/*! * GoFundMe Embedded SDK * Build: 2026-10-15T18:19:02.860Z * Commit: d01e1d1dd5d09765047d579686c0da8c6deaff8c */(()=>{var e={1724:()=>{(()=>{"use strict";class e extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"})}updateStyles(e){return Object.keys(e).map((t=>{const{cssVar:n,defaultValue:s}=e[t];return`${n}: ${this.getAttribute(t)||s};`})).join(" ")}}customElements.get("cl-custom-button")||customElements.define("cl-custom-button",class extends e{boundHandleClick=this.handleClick.bind(this);constructor(){super(),this.render()}static get observedAttributes(){return["disabled"]}attributeChangedCallback(e,t,n){"disabled"===e&&this.updateDisabledState()}get disabled(){const e=this.shadowRoot?.querySelector("button");return e?.hasAttribute("disabled")}set disabled(e){const t=this.shadowRoot?.querySelector("button");e?t?.setAttribute("disabled",""):t?.removeAttribute("disabled")}updateDisabledState(){const e=this.shadowRoot?.querySelector("button");this.hasAttribute("disabled")?e?.setAttribute("disabled",""):e?.removeAttribute("disabled")}handleClick(e){this.disabled?e.preventDefault():this.dispatchEvent(new CustomEvent("custom-button-click",{bubbles:!0,composed:!0}))}render(){this.shadowRoot.innerHTML='\n \n\n \n\n ';const e=this.shadowRoot.querySelector("button");e.removeEventListener("click",this.boundHandleClick),e.addEventListener("click",this.boundHandleClick)}}),customElements.get("cl-hyperlink")||customElements.define("cl-hyperlink",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["href","text"]}href="";text="";attributeChangedCallback(e,t,n){"href"===e&&(this.href=n,this.updateLink()),"text"===e&&(this.text=n,this.updateLink())}updateLink(){const e=this.shadowRoot?.querySelector("a.link");e&&(e.setAttribute("href",this.href),e.textContent=this.text)}render(){this.shadowRoot.innerHTML='\n \n \n\n ',this.updateLink()}});class t extends e{#e="";constructor(){super(),this.render()}static get observedAttributes(){return["value","placeholder","aria-label","data-id","disabled","type","step","min","max"]}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case"value":this.#e=n,this.updateInputValue();break;case"placeholder":case"aria-label":case"data-id":case"type":case"step":case"min":case"max":case"disabled":this.updateInputAttributes(e,n)}}get value(){return this.#e}set value(e){this.#e=e,this.updateInputValue()}handleInput(e){const t=e.target;this.#e=t.value,this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.#e}}))}updateInputValue(){const e=this.shadowRoot.querySelector("input");e&&(e.value=this.#e)}updateInputAttributes(e,t){const n=this.shadowRoot.querySelector("input");n&&(null===t?n.removeAttribute(e):n.setAttribute(e,t))}initializeAttributesAndListeners(){this.updateInputValue(),t.observedAttributes.forEach((e=>{this.updateInputAttributes(e,this.getAttribute(e))})),this.initializeEventListeners()}initializeEventListeners(){const e=this.shadowRoot.querySelector("input");e&&e.addEventListener("input",this.handleInput.bind(this))}render(){this.shadowRoot.innerHTML='\n \n\n \n\n ',this.initializeAttributesAndListeners()}}customElements.get("cl-custom-input")||customElements.define("cl-custom-input",t);const{slice:n,forEach:s}=[],i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,o={create(e,t,n,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),s&&(o.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!i.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!i.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const s=e.substring(1).split("&");for(let e=0;e0&&s[e].substring(0,i)===n&&(t=s[e].substring(i+1))}}return t}};let l=null;const c=()=>{if(null!==l)return l;try{if(l="undefined"!=typeof window&&null!==window.localStorage,!l)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){l=!1}return l};var d={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&c())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&c()&&window.localStorage.setItem(n,e)}};let u=null;const h=()=>{if(null!==u)return u;try{if(u="undefined"!=typeof window&&null!==window.sessionStorage,!u)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){u=!1}return u};var p={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&h())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&h()&&window.sessionStorage.setItem(n,e)}},g={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n0?t:void 0}},f={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},m={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const s="number"==typeof t?t:0;return n[s]?.replace("/","")}},y={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let v=!1;try{document.cookie,v=!0}catch(e){}const b=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];v||b.splice(1,1);class _{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return s.call(n.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:b,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(a),this.addDetector(r),this.addDetector(d),this.addDetector(p),this.addDetector(g),this.addDetector(f),this.addDetector(m),this.addDetector(y)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}_.type="languageDetector";const A=e=>"string"==typeof e,E=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},w=e=>null==e?"":""+e,S=/###/g,C=e=>e&&e.indexOf("###")>-1?e.replace(S,"."):e,x=e=>!e||A(e),I=(e,t,n)=>{const s=A(t)?t.split("."):t;let i=0;for(;i{const{obj:s,k:i}=I(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),r=I(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=I(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=n},R=(e,t)=>{const{obj:n,k:s}=I(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},O=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?A(e[s])||e[s]instanceof String||A(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):O(e[s],t[s],n):e[s]=t[s]);return e},D=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var P={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const T=e=>A(e)?e.replace(/[&<>"'\/]/g,(e=>P[e])):e,M=[" ",",","?","!",";"],L=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),N=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;e-1&&ae?.replace("_","-"),q={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class j{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||q,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s{let[t,s]=e;for(let e=0;e{let[s,i]=t;for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):A(n)&&i?a.push(...n.split(i)):a.push(n)));const r=R(this.data,a);return!r&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!r&&o&&A(n)?N(this.data?.[e]?.[t],n,i):r}addResource(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),k(this.data,a,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(A(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let r=R(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?O(r,n,i):r={...r,...n},k(this.data,a,r),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var V={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const U={},z=e=>!A(e)&&"boolean"!=typeof e&&"number"!=typeof e;class B extends ${constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{n[e]&&(s[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=G.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=M.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=L.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,s));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A(i)?[i]:i};const o=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(s)}return{key:e,namespaces:A(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),r=a[a.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${r}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:`${r}${e}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let u=d?.res;const h=d?.usedKey||o,p=d?.exactUsedKey||o,g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!A(t.count),y=B.hasDefaultValue(t),v=m?this.pluralResolver.getSuffix(l,t.count,t):"",b=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",_=m&&!t.ordinal&&0===t.count,E=_&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${v}`]||t[`defaultValue${b}`]||t.defaultValue;let w=u;f&&!u&&y&&(w=E);const S=z(w),C=Object.prototype.toString.apply(w);if(!(f&&w&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||A(g)&&Array.isArray(w))if(f&&A(g)&&Array.isArray(u))u=u.join(g),u&&(u=this.extendTranslation(u,e,t,n));else{let s=!1,a=!1;!this.isValidLookup(u)&&y&&(s=!0,u=E),this.isValidLookup(u)||(a=!0,u=o);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,h=y&&E!==u&&this.options.updateMissing;if(a||s||h){if(this.logger.log(h?"updateKey":"missingKey",l,r,o,h?E:u),i){const e=this.resolve(o,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{const i=y&&s!==u?s:c;this.options.missingKeyHandler?this.options.missingKeyHandler(e,r,n,i,h,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,r,n,i,h,t),this.emit("missingKey",e,r,n,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);_&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{s([e],o+n,t[`defaultValue${n}`]||E)}))})):s(e,o,E))}u=this.extendTranslation(u,e,t,d,n),a&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${r}:${o}`),(a||s)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${r}:${o}`:o,s?u:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,w,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(i){const e=Array.isArray(w),n=e?[]:{},s=e?p:h;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const o=`${s}${i}${e}`;n[e]=y&&!u?this.translate(o,{...t,defaultValue:z(E)?E[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=w[e])}u=n}}return s?(d.res=u,d.usedParams=this.getUsedParamsDetails(t),d):u}extendTranslation(e,t,n,s,i){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=A(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(a){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=n.replace&&!A(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,s=new Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return A(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const r=this.extractFromKey(e,a),l=r.key;n=l;let c=r.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==a.count&&!A(a.count),u=d&&!a.ordinal&&0===a.count,h=void 0!==a.context&&(A(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(o=e,U[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(U[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;i=n;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,n,e,a);else{let e;d&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(l+e),a.ordinal&&0===e.indexOf(s)&&o.push(l+e.replace(s,this.options.pluralSeparator)),u&&o.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${a.context}`;o.push(n),d&&(o.push(n+e),a.ordinal&&0===e.indexOf(s)&&o.push(n+e.replace(s,this.options.pluralSeparator)),u&&o.push(n+t))}}let r;for(;r=o.pop();)this.isValidLookup(t)||(s=r,t=this.getResource(n,e,r,a))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!A(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Y{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=G.create("languageUtils")}getScriptPartFromCode(e){if(!(e=F(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=F(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),A(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return A(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):A(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const K={zero:0,one:1,two:2,few:3,many:4,other:5},W={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=G.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=F("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:s})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),W;if(!e.match(/-|_/))return W;const s=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(s,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>K[e]-K[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const J=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,n)=>{const s=R(e,n);return void 0!==s?s:R(t,n)})(e,t,n);return!o&&i&&A(n)&&(o=N(e,n,s),void 0===o&&(o=N(t,n,s))),o},Z=e=>e.replace(/\$/g,"$$$$");class X{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=G.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:T,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?D(i):o||"{{",this.suffix=a?D(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?D(u):h||D("$t("),this.nestingSuffix=p?D(p):g||D(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,o,a;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=J(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(J(t,r,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...s,...t,interpolationkey:o})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Z(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Z(this.escape(e)):Z(e)}].forEach((t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,s);o=A(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))o="";else{if(d){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else A(o)||this.useRawValueToEscape||(o=w(o));const r=t.safeValue(o);if(e=e.replace(i[0],r),d?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,s,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let o=`{${s[1]}`;e=s[0],o=this.interpolate(o,i);const a=o.match(/'/g),r=o.match(/"/g);((a?.length??0)%2==0&&!r||r.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let r=[];i={...o},i=i.replace&&!A(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),r=e,l=!0}if(s=t(a.call(this,n[1].trim(),i),i),s&&n[0]===e&&!A(s))return s;A(s)||(s=w(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=r.reduce(((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const ee=e=>{const t={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=s+JSON.stringify(o);let r=t[a];return r||(r=e(F(s),i),t[a]=r),r(n)}};class te{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=G.create("formatter"),this.options=e,this.formats={number:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:ee(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:ee(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:ee(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ee(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=s?.formatParams?.[s.interpolationkey]||{},r=a.locale||a.lng||s.locale||s.lng||n;t=this.formats[i](e,r,{...o,...s,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class ne extends ${constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=G.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},o={},a={},r={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,s=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===r[t]&&(r[t]=!0)))})),s||(a[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,n){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=I(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:o});this.readingCalls++;const a=(a,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&r&&s{this.read.call(this,e,t,n,s+1,2*i,o)}),i):o(a,r)},r=this.backend[n].bind(this.backend);if(2!==r.length)return r(e,t,a);try{const n=r(e,t);n&&"function"==typeof n.then?n.then((e=>a(null,e))).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();A(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const r={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,r):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>a(null,e))).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,s,a,r)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const se=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),A(e[1])&&(t.defaultValue=e[1]),A(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ie=e=>(A(e.ns)&&(e.ns=[e.ns]),A(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),oe=()=>{};class ae extends ${constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=ie(e),this.services={},this.logger=G,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(A(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=se();this.options={...s,...this.options,...ie(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?G.init(i(this.modules.logger),this.options):G.init(null,this.options),t=this.modules.formatter?this.modules.formatter:te;const n=new Y(this.options);this.store=new H(this.options.resources,this.options);const o=this.services;o.logger=G,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new Q(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new X(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new ne(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=oe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const o=E(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oe;const n=A(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e))),this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=E();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=oe),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&V.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=E();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=A(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{o(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const i=function(e,t){let o;if("object"!=typeof t){for(var a=arguments.length,r=new Array(a>2?a-2:0),l=2;l`${o.keyPrefix}${c}${e}`)):o.keyPrefix?`${o.keyPrefix}${c}${e}`:e,s.t(d,o)};return A(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,e)||s&&!o(i,e)))}loadNamespaces(e,t){const n=E();return this.options.ns?(A(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=E();A(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Y(se());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new ae(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oe;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new ae(s);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});i.store=new H(e,s),i.services.resourceStore=i.store}return i.translator=new B(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;sre.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(_),this.i18n.init({...le,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return ce.instance||(ce.instance=new ce),ce.instance}addNamespaceResources(e,t){this.loadedNamespaces.has(e)||(Object.keys(t).forEach((n=>{this.i18n.addResourceBundle(n,e,t[n],!0,!0)})),this.loadedNamespaces.add(e))}translate(e,t){return this.i18n.t(e,t)}getLanguage(){return this.i18n.language}}class de extends e{loadI18nResources(e,t){this.namespace=e,ce.getInstance().addNamespaceResources(e,t)}t(e,t,n){if(!this.namespace&&!n?.ns)throw new Error("Namespace is not set. Call `this.loadI18nResources()` with a namespace first, or provide a namespace in the options parameter.");return ce.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return ce.getInstance().getLanguage()}}const ue=JSON.parse('{"custom-amount-placeholder":"Other","donation-amount":"Donation amount {{amountString}}","greater-amount-error-message":"Amount must be smaller than or equal to {{maxValue}}","less-amount-error-message":"Amount cannot be less than {{minValue}}","select-donation-currency":"Select Donation Currency"}'),he=JSON.parse('{"custom-amount-placeholder":"Otro","donation-amount":"Cantidad de la donación {{amountString}}","greater-amount-error-message":"La cantidad debe ser menor o igual a {{maxValue}}","less-amount-error-message":"La cantidad no puede ser menor que {{minValue}}","select-donation-currency":"Seleccionar moneda de donación"}'),pe={USD:"$",EUR:"€",GBP:"£",JPY:"¥",AUD:"A$",CAD:"CA$",CHF:"CHF",CNY:"¥",HKD:"HK$",NZD:"NZ$",SEK:"kr",KRW:"₩",SGD:"S$",NOK:"kr",MXN:"$",INR:"₹",RUB:"₽",ZAR:"R",TRY:"₺",BRL:"R$",TWD:"NT$",DKK:"kr",PLN:"zł",THB:"฿",IDR:"Rp",HUF:"Ft",CZK:"Kč",ILS:"₪",PHP:"₱",AED:"د.إ",COP:"$",SAR:"﷼",MYR:"RM"},ge=e=>pe[e]||e,fe=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"USD",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en";if(!e)return null;try{if(Number.isNaN(Number(e)))return`$${e}`;const i=ge(n),o=t?.maximumFractionDigits??2,a=t?.minimumFractionDigits??o;return`${i}${i!==n?"":" "}${new Intl.NumberFormat(s,{...t,style:"decimal",minimumFractionDigits:a,maximumFractionDigits:o}).format(Number(e))}`}catch(e){return console.error("Error formatting currency: ",e),"Curr. format err"}};customElements.get("cl-amount-selector")||customElements.define("cl-amount-selector",class extends de{#t;#n;#s;#i;#o={presetAmounts:[],showCustomAmountsInput:!1,minimumDonationAmount:1};constructor(){super(),this.loadI18nResources("AmountSelector",{en:ue,es:he}),this.#t=null,this.#s=!1,this.#i=!1,this.#n="USD",this.handleAmountClick=this.handleAmountClick.bind(this),this.handleCustomAmountChange=this.handleCustomAmountChange.bind(this),this.handleCustomAmountInput=this.handleCustomAmountInput.bind(this),this.updateActiveStates=this.updateActiveStates.bind(this),this.render()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}handleCurrencyChange=e=>{const t=e.target;this.updateCurrencySymbol(t.value),this.updateCurrencyCodeDisplay(t.value),this.dispatchEvent(new CustomEvent("currency-selection-change",{detail:{selectedCurrency:t.value},bubbles:!0,composed:!0}))};updateCurrencyCodeDisplay(e){const t=this.shadowRoot.querySelector(".currency-code-display");t&&(t.textContent=e)}updateCurrencySymbol(e){const t=ge(e),n=this.shadowRoot.querySelector(".currency-symbol");n&&(n.textContent=t);const s=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]');s.innerHTML="",s.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const i=this.#o.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let o=0;i.forEach((t=>{let{amount:n,isVisible:i}=t;if(i){const t=document.createElement("cl-custom-button"),i=n.toString();t.setAttribute("value",i),t.textContent=fe(i,{maximumFractionDigits:0},e,this.getLanguage());const a=t.shadowRoot?.querySelector("button");a?.setAttribute("aria-label",this.t("donation-amount","Donation amount {{amountString}}",{amountString:i})),o+=1,s.appendChild(t)}})),s.classList.add(`buttons-${o}`),this.updateActiveStates()}removeEventListeners(){const e=this.shadowRoot?.querySelector("cl-custom-input");e&&(e.removeEventListener("value-change",this.handleCustomAmountInput),e.removeEventListener("blur",this.handleCustomAmountChange));const t=this.shadowRoot?.querySelector(".currency-select");t&&t.removeEventListener("change",this.handleCurrencyChange)}setupEventListeners(){this.shadowRoot?.addEventListener("custom-button-click",this.handleAmountClick);const e=this.shadowRoot?.querySelector("cl-custom-input");e&&(e.addEventListener("blur",this.handleCustomAmountChange),e.addEventListener("value-change",this.handleCustomAmountInput));const t=this.shadowRoot?.querySelector(".currency-select");t&&t.addEventListener("change",this.handleCurrencyChange)}handleAmountClick(e){const t=e.target,n=Number(t.getAttribute("value")),s=this.#o.minimumDonationAmount;if(n){if(ns?(this.selectedAmount=null,this.displayErrorMessage(this.t("greater-amount-error-message","Amount must be smaller than or equal to {{maxValue}}",{maxValue:s})),o?.classList.add("error"),this.#t=null):n{const t=e.getAttribute("value"),n=null!==t?Number(t):Number.NaN,i=Number.isNaN(n)||n>=s,o=!this.#s&&i&&n===this.#t,a=e.shadowRoot?.querySelector("button");a?.setAttribute("aria-pressed",o.toString()),e.toggleAttribute("active",o)})),this.#s?(n?.classList.add("active"),t?.setAttribute("active","")):(n?.classList.remove("active"),t?.removeAttribute("active"))}applyDynamicConfiguration(){this.clearErrorMessage();const e=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]'),t=this.#i;let n;this.#i=!1,this.#o.currencies&&(n=this.#o.currencies?.find((e=>e.selected)),this.#n=ge(n?.value||"USD")),e.innerHTML="",e.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const s=this.#o.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let i=0;s.forEach(((o,a)=>{let{amount:r,isVisible:l,isDefault:c}=o;if(l){const o=document.createElement("cl-custom-button"),l=r.toString();if(o.setAttribute("value",l),o.textContent=fe(l,{maximumFractionDigits:0},n?.value||"USD",this.getLanguage()),c){const e=Number(l);t||null!==this.#t&&0!==this.#t?this.#t===e&&o.setAttribute("active",""):(this.selectedAmount=e,o.setAttribute("active",""))}const d=o.shadowRoot?.querySelector("button");d?.setAttribute("aria-label",this.t("donation-amount","Donation amount {{amountString}}",{amountString:l})),4===i&&4===a&&5===s.length&&o.classList.add("full-width"),i+=1,e.appendChild(o)}})),e.classList.add(`buttons-${i}`);const o=this.#o.presetAmounts.find((e=>{let{name:t}=e;return"other"===t})),a=this.shadowRoot.querySelector(".currency-custom-amount-container"),r=this.shadowRoot.querySelector("cl-custom-input");a.style.visibility=o?.isVisible?"":"hidden",o?.isDefault?(this.#s=!0,r.setAttribute("active",""),r.value=null,o.amount>0?this.selectedAmount=o.amount:this.#t=null):this.#s||(r.removeAttribute("active"),r.value="",a.style.visibility=o?.isVisible?"":"hidden");const l=this.shadowRoot.querySelector(".currency-select");this.#o.currencies&&l&&(l.innerHTML="",this.#o.currencies.forEach((e=>{let{label:t,value:n,selected:s}=e;const i=document.createElement("option");i.value=n,i.textContent=t,i.selected=s,l.appendChild(i),s&&this.updateCurrencyCodeDisplay(n)})));const c=this.#o.minimumDonationAmount,d=this.#o.presetAmounts.find((e=>e.isDefault)),u=null!==this.#t&&this.#t\n\n
\n\n
\n
\n \n \n
\n \n \n \n \n
\n\n