/*!
* 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 :host {\n display: grid;\n gap: 4px;\n /* Spacing between grid items */\n /* Remove this comment at will */\n}\n\n.currency-custom-amount-container {\n background-color: var(--classy-custom-secondary-color, #e8ebf9);\n border: 2px solid var(--classy-custom-secondary-color, #e8ebf9);\n border-radius: var(--classy-custom-grid-radius, 8px);\n box-sizing: border-box;\n /* Apply grid border radius */\n height: 56px;\n display: flex;\n overflow: hidden;\n /* Ensure inner elements do not affect the container\'s border radius */\n}\n\n.currency-select {\n height: 100%;\n display: flex;\n align-items: center;\n border: none;\n width: 85px;\n appearance: none; /* Remove default arrow (for most browsers) */\n -webkit-appearance: none; /* Safari */\n -moz-appearance: none; /* Firefox */\n\n font-family: var(--classy-font__font-family--base);\n font-size: var(--classy-theme-font__paragraph-md--font-size);\n line-height: var(--classy-theme-font__paragraph-md--line-height);\n font-weight: var(--classy-font__paragraph-md--font-weight);\n padding: 16px 12px;\n background-color: var(--classy-custom-secondary-color, #e8ebf9);\n /* Use secondary color */\n\n /* Respect the border radius for the top-left and bottom-left corners */\n border-top-left-radius: var(--classy-custom-grid-radius, 8px);\n border-bottom-left-radius: var(--classy-custom-grid-radius, 8px);\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n /* Always hide the select text in the button area (we\'ll show it via overlay) */\n /* The dropdown options will still show the full text */\n text-indent: -9999px;\n}\n\n/* Make sure dropdown options show the full text */\n.currency-select option {\n text-indent: 0;\n direction: ltr;\n}\n\n.currency-select-wrapper {\n position: relative;\n display: inline-block;\n}\n\n/* Overlay to display only the currency code */\n.currency-code-display {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n font-family: var(--classy-font__font-family--base);\n font-size: var(--classy-theme-font__paragraph-md--font-size);\n line-height: var(--classy-theme-font__paragraph-md--line-height);\n font-weight: var(--classy-font__paragraph-md--font-weight);\n color: var(--classy-color__neutral--10);\n}\n\n/* Custom arrow */\n.currency-select-wrapper::after {\n content: \'▾\';\n font-size: 20px;\n position: absolute;\n right: 0.4rem;\n top: 50%;\n transform: translateY(-55%);\n font-weight: bold;\n pointer-events: none;\n background: var(--classy-custom-secondary-color, #e8ebf9);\n padding: 1px 4px 1px 4px;\n font-family: \'Domine\';\n}\n\n.currency-input-container {\n border-left: 1px solid white;\n flex-grow: 1;\n width: 100%;\n color: var(--classy-color__neutral--10);\n background-color: var(--classy-custom-secondary-color, #e8ebf9);\n /* Use secondary color */\n gap: 4px;\n padding: 0;\n font-family: var(--classy-font__font-family--base);\n font-size: var(--classy-font__paragraph-lg-bold--font-size);\n line-height: var(--classy-font__paragraph-lg-bold--line-height);\n font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n padding-left: 12px;\n display: flex;\n align-items: center;\n}\n\n.currency-custom-amount-container.active {\n border-color: var(--classy-custom-primary-color, #425cc7);\n /* Use primary color */\n margin-left: 0px;\n}\n\n.currency-custom-amount-container.active .currency-label {\n background-color: var(--classy-custom-primary-color, #425cc7);\n /* Use primary color */\n color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.currency-custom-amount-container.error {\n border: 2px solid var(--classy-color__status--error-base);\n margin-left: 0px;\n}\n\n.currency-custom-amount-container.error .currency-label {\n background-color: var(--classy-color__status--error-base);\n color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.error-message {\n font-family: var(--classy-font__font-family--base);\n font-size: var(--classy-font__label--font-size);\n line-height: var(--classy-font__label--line-height);\n font-weight: var(--classy-font__label--font-weight);\n color: var(--classy-color__status--error-base);\n}\n\ncl-custom-input {\n flex-grow: 1;\n}\n\ncl-custom-input::part(classy-input-textfield) {\n width: 100%;\n color: rgba(0, 0, 0, 0.9);\n background: transparent;\n border: unset;\n font-family: var(--classy-font__font-family--base, sans-serif);\n font-size: var(--classy-font__paragraph-lg-bold--font-size, 20px);\n line-height: var(--classy-font__paragraph-lg-bold--line-height, 1.5);\n font-weight: var(--classy-font__paragraph-lg-bold--font-weight, 700);\n}\n\ncl-custom-input::part(classy-input-textfield):focus-visible {\n outline: none;\n}\n\ncl-custom-input::part(classy-input-textfield)::placeholder {\n color: var(--classy-color__neutral--10);\n}\n\nfieldset {\n display: grid;\n gap: 4px;\n border: none;\n padding: 0;\n margin: 0;\n}\n\nfieldset.buttons-6 {\n grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-5 {\n grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-4 {\n grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-3 {\n grid-template-columns: repeat(3, 1fr);\n}\n\nfieldset.buttons-2 {\n grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-1 {\n grid-template-columns: 1fr;\n}\n\ncl-custom-button::part(button),\ncl-custom-button {\n font-family: var(--classy-font__font-family--base, \'Arial\', sans-serif);\n font-size: var(--classy-font__paragraph-lg-bold--font-size, \'20px\');\n line-height: var(--classy-font__paragraph-lg-bold--line-height, \'30px\');\n font-weight: var(--classy-font__paragraph-lg-bold--font-weight, \'700\');\n\n text-decoration-skip-ink: none;\n text-underline-position: from-font;\n\n border-radius: var(--classy-custom-grid-radius, 8px);\n /* Apply frequency border radius */\n border: unset;\n max-height: 56px;\n /* Set the max height for each button */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n /* Remove any extra padding to ensure the button size reflects its content */\n height: 56px;\n /* Ensure each button has a consistent height */\n overflow: hidden;\n /* Ensure content doesn\'t overflow the button */\n box-sizing: border-box;\n /* Include padding and border in the element\'s width and height */\n}\n\ncl-custom-button:focus-visible {\n border-radius: var(--classy-custom-grid-radius, 8px);\n /* Apply frequency border radius */\n}\n\ncl-custom-button[active] {\n background-color: var(--classy-custom-primary-color, #425cc7);\n /* Use primary color */\n color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\ncl-custom-button:not([active]) {\n background-color: var(--classy-custom-secondary-color, #e8ebf9);\n /* Use secondary color */\n color: var(--classy-color__neutral--10);\n}\n\ncl-custom-button.full-width {\n grid-column: 1 / span 2;\n}\n\n \n\n \n\n\n
\n \n \n
\n
\n \n \n \n
\n\n\n\n ',this.updateActiveStates(),this.applyDynamicConfiguration(),this.updateCurrencyLabel(),this.updateCurrencySymbol("USD"),this.updateAmountPlaceholder(),this.updateCurrencySelectLabel()}});const me=JSON.parse('{"higher-impact-title":"Higher Impact"}'),ye=JSON.parse('{"higher-impact-title":"Mayor impacto"}');function ve(e){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ve(e)}customElements.get("cl-toggle-group")||customElements.define("cl-toggle-group",class extends de{#o={showRecurringTag:!1};#a;constructor(){super(),this.loadI18nResources("ToggleGroup",{en:me,es:ye}),this.#a="one-time",this.render()}get config(){return this.#o}set config(e){this.#o=e,this.applyDynamicConfiguration()}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("cl-tag");if(e){const t=this.shadowRoot.querySelector("#higherImpact");t&&(t.textContent=` ${this.t("higher-impact-title","Higher Impact")} `),e.setAttribute("class",this.#o.showRecurringTag?"":"hidden")}}connectedCallback(){this.shadowRoot.addEventListener("click",this.handleToggleClick),this.updateButtonStates()}disconnectedCallback(){this.shadowRoot.removeEventListener("click",this.handleToggleClick)}handleToggleClick=e=>{const t=e.composedPath().find((e=>"cl-custom-button"===e?.tagName?.toLowerCase()));if(t){const e=t.getAttribute("value");e&&(this.selected=e)}};static get observedAttributes(){return["selected"]}attributeChangedCallback(e,t,n){"selected"===e&&t!==n&&(this.#a=n,this.updateButtonStates())}get selected(){return this.#a}set selected(e){this.#a!==e&&(this.#a=e,this.setAttribute("selected",e),this.updateButtonStates(),this.dispatchEvent(new CustomEvent("selection-change",{detail:{selected:e},bubbles:!0,composed:!0})))}updateButtonStates(){const e=this.shadowRoot.querySelectorAll("cl-custom-button");setTimeout((()=>{e.forEach((e=>{const t=e.getAttribute("value")===this.#a;e.toggleAttribute("active",t);const n=e.shadowRoot?.querySelector("button");n&&(t?(n.style.display="flex",n.style.gap="6px"):(n.style.display="",n.style.gap=""),n?.setAttribute("aria-pressed",t.toString()));const s=e.querySelector("svg");if(t){if(!s){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("viewBox","6 7 13 10"),t.setAttribute("width","12"),t.setAttribute("height","12");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M10.5 16.5c-.1 0-.2-.02-.4-.07-.12-.05-.23-.12-.34-.23L6.27 12.7c-.19-.19-.28-.43-.27-.72.01-.28.1-.51.3-.7.19-.19.43-.28.72-.28s.53.09.72.28l2.83 2.83L17.35 7.3c.19-.19.42-.28.72-.28.28-.01.52.09.74.3.19.19.28.42.28.7 0 .28-.09.52-.28.71l-7.54 7.54c-.11.11-.23.18-.34.23-.13.05-.25.07-.39.07z"),n.setAttribute("fill","var(--computed-color__brand-primary--contrast, #ffffff)"),t.appendChild(n),e.prepend(t)}}else s&&s.remove()}))}),5)}render(){this.shadowRoot.innerHTML='\n \n\n \n\n ',this.updateButtonStates()}}),customElements.get("cl-tag")||customElements.define("cl-tag",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["text","position"]}attributeChangedCallback(e,t,n){if("text"===e){const e=this.shadowRoot?.querySelector(".tag-content");e&&(e.textContent=n)}if("position"===e){const e=this.shadowRoot?.querySelector(".tag");e&&e.setAttribute("data-position",n)}}render(){this.shadowRoot.innerHTML="\n \n \n \n\n\n "}});var be=/^\s+/,_e=/\s+$/;function Ae(e,t){if(t=t||{},(e=e||"")instanceof Ae)return e;if(!(this instanceof Ae))return new Ae(e,t);var n=function(e){var t,n,s,i={r:0,g:0,b:0},o=1,a=null,r=null,l=null,c=!1,d=!1;return"string"==typeof e&&(e=function(e){e=e.replace(be,"").replace(_e,"").toLowerCase();var t,n=!1;if(qe[e])e=qe[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Je.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Je.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Je.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Je.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Je.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Je.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Je.hex8.exec(e))?{r:Ve(t[1]),g:Ve(t[2]),b:Ve(t[3]),a:Ye(t[4]),format:n?"name":"hex8"}:(t=Je.hex6.exec(e))?{r:Ve(t[1]),g:Ve(t[2]),b:Ve(t[3]),format:n?"name":"hex"}:(t=Je.hex4.exec(e))?{r:Ve(t[1]+""+t[1]),g:Ve(t[2]+""+t[2]),b:Ve(t[3]+""+t[3]),a:Ye(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=Je.hex3.exec(e))&&{r:Ve(t[1]+""+t[1]),g:Ve(t[2]+""+t[2]),b:Ve(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==ve(e)&&(Ze(e.r)&&Ze(e.g)&&Ze(e.b)?(t=e.r,n=e.g,s=e.b,i={r:255*$e(t,255),g:255*$e(n,255),b:255*$e(s,255)},c=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):Ze(e.h)&&Ze(e.s)&&Ze(e.v)?(a=ze(e.s),r=ze(e.v),i=function(e,t,n){e=6*$e(e,360),t=$e(t,100),n=$e(n,100);var s=Math.floor(e),i=e-s,o=n*(1-t),a=n*(1-i*t),r=n*(1-(1-i)*t),l=s%6;return{r:255*[n,a,o,o,r,n][l],g:255*[r,n,n,a,o,o][l],b:255*[o,o,r,n,n,a][l]}}(e.h,a,r),c=!0,d="hsv"):Ze(e.h)&&Ze(e.s)&&Ze(e.l)&&(a=ze(e.s),l=ze(e.l),i=function(e,t,n){var s,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=$e(e,360),t=$e(t,100),n=$e(n,100),0===t)s=i=o=n;else{var r=n<.5?n*(1+t):n+t-n*t,l=2*n-r;s=a(l,r,e+1/3),i=a(l,r,e),o=a(l,r,e-1/3)}return{r:255*s,g:255*i,b:255*o}}(e.h,a,l),c=!0,d="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=Ge(o),{ok:c,format:e.format||d,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Ee(e,t,n){e=$e(e,255),t=$e(t,255),n=$e(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=(o+a)/2;if(o==a)s=i=0;else{var l=o-a;switch(i=r>.5?l/(2-o-a):l/(o+a),o){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+i)%360,o.push(Ae(s));return o}function Fe(e,t){t=t||6;for(var n=Ae(e).toHsv(),s=n.h,i=n.s,o=n.v,a=[],r=1/t;t--;)a.push(Ae({h:s,s:i,v:o})),o=(o+r)%1;return a}Ae.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Ge(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=we(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=we(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=Ee(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Ee(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return Se(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,i){var o=[Ue(Math.round(e).toString(16)),Ue(Math.round(t).toString(16)),Ue(Math.round(n).toString(16)),Ue(Be(s))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*$e(this._r,255))+"%",g:Math.round(100*$e(this._g,255))+"%",b:Math.round(100*$e(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*$e(this._r,255))+"%, "+Math.round(100*$e(this._g,255))+"%, "+Math.round(100*$e(this._b,255))+"%)":"rgba("+Math.round(100*$e(this._r,255))+"%, "+Math.round(100*$e(this._g,255))+"%, "+Math.round(100*$e(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(je[Se(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Ce(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var i=Ae(e);n="#"+Ce(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ae(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Re,arguments)},brighten:function(){return this._applyModification(Oe,arguments)},darken:function(){return this._applyModification(De,arguments)},desaturate:function(){return this._applyModification(xe,arguments)},saturate:function(){return this._applyModification(Ie,arguments)},greyscale:function(){return this._applyModification(ke,arguments)},spin:function(){return this._applyModification(Pe,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Ne,arguments)},complement:function(){return this._applyCombination(Te,arguments)},monochromatic:function(){return this._applyCombination(Fe,arguments)},splitcomplement:function(){return this._applyCombination(Le,arguments)},triad:function(){return this._applyCombination(Me,[3])},tetrad:function(){return this._applyCombination(Me,[4])}},Ae.fromRatio=function(e,t){if("object"==ve(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:ze(e[s]));e=n}return Ae(e,t)},Ae.equals=function(e,t){return!(!e||!t)&&Ae(e).toRgbString()==Ae(t).toRgbString()},Ae.random=function(){return Ae.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ae.mix=function(e,t,n){n=0===n?0:n||50;var s=Ae(e).toRgb(),i=Ae(t).toRgb(),o=n/100;return Ae({r:(i.r-s.r)*o+s.r,g:(i.g-s.g)*o+s.g,b:(i.b-s.b)*o+s.b,a:(i.a-s.a)*o+s.a})},Ae.readability=function(e,t){var n=Ae(e),s=Ae(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Ae.isReadable=function(e,t,n){var s,i,o,a,r,l=Ae.readability(e,t);switch(i=!1,(o=n,"AA"!==(a=((o=o||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(r=(o.size||"small").toLowerCase())&&"large"!==r&&(r="small"),s={level:a,size:r}).level+s.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},Ae.mostReadable=function(e,t,n){var s,i,o,a,r=null,l=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;cl&&(l=s,r=Ae(t[c]));return Ae.isReadable(e,r,{level:o,size:a})||!i?r:(n.includeFallbackColors=!1,Ae.mostReadable(e,["#fff","#000"],n))};var qe=Ae.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},je=Ae.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(qe);function Ge(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function $e(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function He(e){return Math.min(1,Math.max(0,e))}function Ve(e){return parseInt(e,16)}function Ue(e){return 1==e.length?"0"+e:""+e}function ze(e){return e<=1&&(e=100*e+"%"),e}function Be(e){return Math.round(255*parseFloat(e)).toString(16)}function Ye(e){return Ve(e)/255}var Ke,We,Qe,Je=(We="[\\s|\\(]+("+(Ke="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Ke+")[,|\\s]+("+Ke+")\\s*\\)?",Qe="[\\s|\\(]+("+Ke+")[,|\\s]+("+Ke+")[,|\\s]+("+Ke+")[,|\\s]+("+Ke+")\\s*\\)?",{CSS_UNIT:new RegExp(Ke),rgb:new RegExp("rgb"+We),rgba:new RegExp("rgba"+Qe),hsl:new RegExp("hsl"+We),hsla:new RegExp("hsla"+Qe),hsv:new RegExp("hsv"+We),hsva:new RegExp("hsva"+Qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Ze(e){return!!Je.CSS_UNIT.exec(e)}class Xe extends e{#a;#o={options:[],selected:null};constructor(){super(),this.#a=null,this.render()}set config(e){this.#o=e,this.#a=e.selected,this.applyDynamicConfiguration()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}removeEventListeners(){}setupEventListeners(){const e=this.shadowRoot.querySelector("select");e&&e.addEventListener("change",this.handleChange.bind(this))}handleChange(e){const t=e.target;this.#a=t.value,this.dispatchEvent(new CustomEvent("select-change",{detail:{selected:this.#a}}))}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("select");e.innerHTML="",this.#o.options.forEach((t=>{let{value:n,label:s}=t;const i=document.createElement("option");i.value=n,i.innerText=s,this.#a===n&&(i.selected=!0),e.appendChild(i)}))}render(){this.shadowRoot.innerHTML='\n \n\n \n
\n
\n \n \n
\n\n ',this.applyDynamicConfiguration()}}customElements.get("cl-select")||customElements.define("cl-select",Xe);const et=JSON.parse('{"choose-amount":"Choose an amount","continue":"Continue","donate":"Donate","donate-frequency":{"daily":"Donate daily","weekly":"Donate weekly","bi-weekly":"Donate every two weeks","monthly":"Donate monthly","bi-monthly":"Donate bi-monthly","quarterly":"Donate quarterly","semi-annually":"Donate every six months","yearly":"Donate yearly"},"frequency":{"bi-monthly":"Bi-monthly","bi-weekly":"Every two weeks","daily":"Daily","every":"Every","every-six-months":"every six months","every-two-weeks":"every two weeks","monthly":"Monthly","one-time":"One-time","quarterly":"Quarterly","recurring":"Recurring","semi-annually":"Every six months","weekly":"Weekly","yearly":"Yearly"},"frequency-select-label":"Donation Frequency","recurring-end-date-input-label":"End date (optional)","sub-heading-title":"Choose an amount to donate"}'),tt=JSON.parse('{"choose-amount":"Elige una cantidad","continue":"Continuar","donate":"Donar","donate-frequency":{"daily":"Donar diariamente","weekly":"Donar semanalmente","bi-weekly":"Donar quincenalmente","monthly":"Donar mensualmente","bi-monthly":"Donar bimestralmente","quarterly":"Donar trimestralmente","semi-annually":"Donar semestralmente","yearly":"Donar anualmente"},"frequency":{"bi-monthly":"Bimestral","bi-weekly":"Quincenal","daily":"Diaria","every":"Cada","every-six-months":"Cada seis meses","every-two-weeks":"Cada dos semanas","monthly":"Mensual","one-time":"Única","quarterly":"Trimestral","recurring":"Periódica","semi-annually":"Semestral","weekly":"Semanal","yearly":"Anual"},"frequency-select-label":"Frecuencia de donación","recurring-end-date-input-label":"Fecha de finalización (opcional)","sub-heading-title":"Elige una cantidad para donar"}');var nt=function(e){return e.ONE_TIME="one-time",e.DAILY="daily",e.WEEKLY="weekly",e.BI_WEEKLY="bi-weekly",e.MONTHLY="monthly",e.BI_MONTHLY="bi-monthly",e.QUARTERLY="quarterly",e.SEMI_ANNUALLY="semi-annually",e.YEARLY="yearly",e}(nt||{});customElements.get("cl-donation-form")||customElements.define("cl-donation-form",class extends de{#r;#l;#t;#c;#d;#u;#o;#h;#p;#g;#f;constructor(){super(),this.loadI18nResources("DonationForm",{en:et,es:tt}),this.#r=null,this.#t=null,this.#d=null,this.#u=null,this.#o={},this.#p=new Map,this.#g=new Map,this.#f=new Map,this.#h={ONE_TIME:this.t("frequency.one-time","One-time"),DAILY:this.t("frequency.daily","Daily"),WEEKLY:this.t("frequency.weekly","Weekly"),BI_WEEKLY:this.t("frequency.bi-weekly","Every two weeks"),MONTHLY:this.t("frequency.monthly","Monthly"),BI_MONTHLY:this.t("frequency.bi-monthly","Bi-monthly"),QUARTERLY:this.t("frequency.quarterly","Quarterly"),SEMI_ANNUALLY:this.t("frequency.semi-annually","Every six months"),YEARLY:this.t("frequency.yearly","Yearly")},this.#l=[],this.#c="",this.onFrequencySelectionChange=this.onFrequencySelectionChange.bind(this),this.onToggleChange=this.onToggleChange.bind(this),this.onAmountSelectionChange=this.onAmountSelectionChange.bind(this),this.onRecurringEndDateChange=this.onRecurringEndDateChange.bind(this),this.onCurrencyChange=this.onCurrencyChange.bind(this),this.onCustomAmountInput=this.onCustomAmountInput.bind(this),this.onSubmit=this.onSubmit.bind(this),this.render()}connectedCallback(){this.#u=this.getAttribute("campaign-id")||null,null===this.#u&&console.warn("Please provide a non-null value for the campaign ID. PLEASE"),this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}getCustomAmount(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=e?.shadowRoot?.querySelector("cl-custom-input");if(t&&t.value){const e=parseFloat(t.value);if(!Number.isNaN(e)&&e>0)return e}return null}getDefaultFrequency=e=>0===Object.keys(e).length?null:e.donationFrequencies.find((e=>e.isDefault));getTranslatedFrequency=e=>{const t=Object.entries(nt).find((t=>{let[n,s]=t;return s===e}))?.[0];return t?this.#h[t]:e};getCurrentCurrency(){const e=this.#o.currencies?.find((e=>e.selected))?.value;return this.#c||e||""}getFrequencyCurrencyKey(){return`${(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#r)||""}|${this.getCurrentCurrency()}`}initializeWithConfig(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=Ae(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(this.#o.cssBackgroundColor??"transparent",this.#o.cssBackgroundColorOpacity??1);switch(t&&this.style.setProperty("--classy-custom-background-color",t),this.#o.borderRadius){case"sharp":this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0");break;case"rounded":this.style.setProperty("--classy-custom-border-radius","8px"),this.style.setProperty("--classy-custom-frequency-radius","8px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","8px");break;case"pill":this.style.setProperty("--classy-custom-border-radius","20px"),this.style.setProperty("--classy-custom-frequency-radius","20px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","48px");break;default:this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0px")}if(this.style.setProperty("--classy-custom-primary-color",this.#o.primaryColor||"#425cc7"),this.style.setProperty("--classy-custom-primary-color",this.#o.primaryColor||"var(--theme-color__brand-primary)"),this.style.setProperty("--classy-custom-secondary-color",this.#o.secondaryColor||"var(--theme-color__brand-secondary)"),this.style.setProperty("--classy-custom-cta-button-color",this.#o.ctaButtonColor||"#000"),this.style.setProperty("--classy-custom-drop-shadow",this.#o.dropShadow?"0 8px 16px 0 rgba(27,27,27,.1)":"none"),this.#o.primaryColor){const e=Ae(this.#o.primaryColor).isDark()?"#fff":"#000";this.style.setProperty("--computed-color__brand-primary--contrast",e)}else this.style.setProperty("--computed-color__brand-primary--contrast","var(--theme-color__brand-custom-text-color)");if(e){const e=this.getDefaultFrequency(this.#o);this.selectedFrequency=e?e.name:nt.ONE_TIME}const n=(this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts).find((e=>e.isDefault));this.#t=n?n.amount:0;const{visibleFrequencies:s}=this,i=this.shadowRoot.querySelector("cl-toggle-group");0===this.visibleFrequencies.filter((e=>e.name===nt.ONE_TIME&&e.isVisible)).length||0===this.visibleRecurringFrequencies.length?i.style.display="none":i.style.display="block",1===s.length&&(this.selectedFrequency=s[0].name);const o=this.shadowRoot.querySelector("#recurring-end-date-container"),a=this.shadowRoot.querySelector("#recurring-end-date-input-label");a&&(a.textContent=this.t("recurring-end-date-input-label","End date (optional)")),this.shadowRoot.querySelector("cl-custom-input#recurring-end-date").shadowRoot.querySelector("input").setAttribute("min",(new Date).toISOString().split("T")[0]),this.#o.hideRecurringEndDate||this.#r===nt.ONE_TIME?o.style.display="none":o.style.display="block",this.updateDynamicContent()}updateDynamicContent(){this.updateHeading(),this.updateSubHeading(),this.updateSubmitButton(),this.updateAmountSelector(),this.updateRecurringFrequencySelect(),this.updateFaqHyperlink(),this.updateToggleTags()}updateRecurringFrequencySelect(){const e=this.shadowRoot.querySelector("cl-select#recurring-frequency-select"),t=this.visibleRecurringFrequencies.map((e=>{let{name:t}=e;return{value:t,label:(n=this.getTranslatedFrequency(t),n.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())))};var n}));e instanceof Xe&&(e.config={options:t,selected:this.#r});const n=this.shadowRoot.querySelector("#recurring-frequency-container"),s=this.shadowRoot.querySelector("#recurring-frequency-select-label");s&&(s.textContent=this.t("frequency-select-label","Donation Frequency")),this.#r===nt.ONE_TIME||this.visibleRecurringFrequencies.length<2?n.style.display="none":n.style.display="block"}updateToggleTags(){const e=this.shadowRoot?.querySelector("cl-toggle-group");e&&(e.config={showRecurringTag:this.#o.showRecurringUpsell})}updateAmountSelector(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts,n=this.#o.currencies?.map((e=>({...e,selected:this.#c?e.value===this.#c:e.selected})))??[],{minimumDonationAmount:s}=this.#o;this.getCurrentCurrency(),this.getFrequencyCurrencyKey();const i=this.#r||"",o=this.#p.get(i)??null,a=this.#g.get(i)??null,r=this.#f.get(i)??null;let l=null;if(null!==a)l=a;else if(null!==r){const e=t.find((e=>e.name===r&&e.isVisible));e?l=e.amount:null!==o&&(l=o)}else l=null!==o?o:t.find((e=>e.isDefault))?.amount??null;null!==a&&null!==l?(e.setCustomInputValue(a.toString()),e.isCustomAmountActive=!0,e.setSelectedAmountSilently(l)):(e.isCustomAmountActive=!1,null!==l?e.setSelectedAmountSilently(l):e.resetSelectedAmountSilently()),e.config={presetAmounts:t,currencies:n,minimumDonationAmount:s},null!==l&&(e.setCustomInputValue(l.toString()),this.selectedAmount=l)}setupEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.addEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.addEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("currency-selection-change",this.onCurrencyChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("custom-amount-input-change",this.onCustomAmountInput),this.shadowRoot?.querySelector("cl-custom-input#recurring-end-date")?.addEventListener("value-change",this.onRecurringEndDateChange),this.shadowRoot?.querySelector(".submit-button")?.addEventListener("mousedown",this.onSubmit)}removeEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.removeEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.removeEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.removeEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.removeEventListener("custom-amount-input-change",this.onCustomAmountInput),this.shadowRoot?.querySelector(".submit-button")?.removeEventListener("mousedown",this.onSubmit)}attributeChangedCallback(e,t,n){"campaign-id"===e&&(this.#u=n)}onFrequencySelectionChange(e){this.selectedFrequency=e.detail.selected}onToggleChange(e){const{selected:t}=e.detail,n=this.shadowRoot.querySelector("#recurring-end-date-container");if(t===nt.ONE_TIME)this.selectedFrequency=t,n.style.display="none";else{const e=this.visibleRecurringFrequencies.find((e=>e.isDefault))??this.visibleRecurringFrequencies[0];this.selectedFrequency=e.name,n.style.display=this.#o.hideRecurringEndDate?"none":"block"}this.updateRecurringFrequencySelect()}onAmountSelectionChange(e){const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.isCustomAmountActive??!1,s=e.detail.selectedAmount;if(null!==this.#r){const e=this.#r||"",t=this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts;if(n)this.#p.set(e,s),this.#g.set(e,s),this.#f.set(e,"other");else{this.#p.set(e,s),this.#g.set(e,null);const n=t.find((e=>e.amount===s&&"other"!==e.name));this.#f.set(e,n?.name??null)}}this.selectedAmount=s}onRecurringEndDateChange(e){this.recurringEndDate=e.detail.value}onCurrencyChange(e){this.selectedCurrency=e.detail.selectedCurrency}onCustomAmountInput(){this.updateSubmitButton()}onSubmit(e){e.preventDefault();const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.shadowRoot?.querySelector(".error-message");if(n?.textContent?.trim()&&n.offsetParent)return;const s=this.getCustomAmount();if(null!==s&&(s1e7)){const e=t?.shadowRoot?.querySelector("cl-custom-input");e?.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent("classy-donation-submit",{detail:{frequency:this.#r,amount:s??this.#t,recurringEndDate:this.#d,campaignId:this.#u,selectedCurrency:this.#c},bubbles:!0,composed:!0}))}static get observedAttributes(){return["campaign-id"]}set config(e){const t=this.getDefaultFrequency(this.#o),n=e=>(e||[]).map((e=>({...e,amount:"other"===e.name?e.amount:Math.round(e.amount)}))),s=n(e.donationAmounts),i=n(e.recurringAmounts);this.#o={...e,donationAmounts:s,recurringAmounts:i};const o=t!==this.getDefaultFrequency(this.#o);this.initializeWithConfig(o)}set externalCustomAmounts(e){if(!e)return;const t=this.#r;let n=!1;Object.entries(e).forEach((e=>{let[s,i]=e;const o=s,a=o||"";null==i?this.#g.set(a,null):(this.#p.set(a,i),this.#g.set(a,i),this.#f.set(a,"other")),t===o&&(n=!0)})),n&&this.updateAmountSelector()}set externalCustomAmount(e){e&&(this.externalCustomAmounts={[e.frequency]:e.amount})}get campaignId(){return this.#u}set campaignId(e){this.#u=e}get visibleFrequencies(){return this.#o.donationFrequencies.filter((e=>e.isVisible))}get visibleRecurringFrequencies(){return this.visibleFrequencies.filter((e=>e.name!==nt.ONE_TIME))}set selectedFrequency(e){if(this.#r!==e&&Object.keys(nt).map((e=>nt[e])).includes(e)){this.dispatchEvent(new CustomEvent("frequency_change",{detail:{from_frequency:this.#r,to_frequency:e},bubbles:!0,composed:!0})),this.#r=e;const t=this.shadowRoot.querySelector("cl-toggle-group"),n=this.#r===nt.ONE_TIME?"one-time":"recurring";t.setAttribute("selected",n),this.updateDynamicContent()}}set selectedAmount(e){if(this.#t!==e){this.dispatchEvent(new CustomEvent("amount_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#t=e;const t=this.shadowRoot.querySelector("cl-amount-selector"),n=this.#r||"",s=this.#g.get(n)??null;null!==s&&s===e||t.setAttribute("selected-amount",this.#t.toString()),this.updateSubmitButton()}}set recurringEndDate(e){this.#d!==e&&(this.dispatchEvent(new CustomEvent("recurring_end_date_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#d=e)}set selectedCurrency(e){this.#c!==e&&(this.dispatchEvent(new CustomEvent("currency_selected",{detail:{from_currency:this.#c,to_currency:e},bubbles:!0,composed:!0})),this.#c=e)}updateSubHeading(){const e=this.shadowRoot.querySelector(".sub-heading"),t=e?.querySelector("#sub-heading-title");t&&(t.textContent=this.t("sub-heading-title","Choose an amount to donate"));const n=e?.querySelector("#selected-frequency");if(n)switch(this.#r){case nt.ONE_TIME:n.textContent="";break;case nt.BI_WEEKLY:n.textContent=this.t("frequency.every-two-weeks","every two weeks");break;case nt.SEMI_ANNUALLY:n.textContent=this.t("frequency.every-six-months","every six months");break;default:n.textContent=this.getTranslatedFrequency(this.#r).toLowerCase()||""}const s=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="recurring"]'),{visibleRecurringFrequencies:i}=this;if(s&&1===i.length){const e=i[0].name;let t=this.getTranslatedFrequency(e);e!==nt.BI_WEEKLY&&e!==nt.SEMI_ANNUALLY||(t=this.t("frequency.every","Every")),s.innerHTML=`${t}`}else s&&i.length>1&&(s.innerHTML=`${this.t("frequency.recurring","Recurring")}`);const o=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="one-time"]');o&&(o.innerHTML=`${this.getTranslatedFrequency(nt.ONE_TIME)}`)}updateHeading(){const e=this.shadowRoot.querySelector(".heading-logo");if(e&&this.#o.headingLogoUrl){e.style.display="block";const t=e.querySelector("img");t&&(t.src=this.#o.headingLogoUrl)}else e&&(e.style.display="none")}updateSubmitButton(){const e=this.shadowRoot.querySelector(".submit-button");if(!e)return;e.textContent="";const t=this.getCustomAmount(),n=null!==this.#t||null!==t&&t>=this.#o.minimumDonationAmount;e.disabled=!n;const s=document.createElement("span");if(n)if(this.#r&&this.#r!==nt.ONE_TIME){const e=this.#r,t=this.getTranslatedFrequency(e).toLowerCase(),n=`${this.t("donate","Donate")} ${t}`;s.textContent=this.t(`donate-frequency.${e}`,n)}else s.textContent=this.t("donate","Donate");else s.textContent=this.t("choose-amount","Choose an amount");e.appendChild(s)}updateFaqHyperlink(){const e=this.shadowRoot?.querySelector(".faq-hyperlink-container");if(!e)return;if(this.#o.hideFaqSection)return void(e.style.display="none");e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center";const t=e.querySelector("cl-hyperlink");if(t&&e.removeChild(t),this.#o.hyperlink?.isEnabled&&this.#o.hyperlink.url&&this.#o.hyperlink.text){const t=document.createElement("cl-hyperlink");t.setAttribute("href",this.#o.hyperlink.url),t.setAttribute("text",this.#o.hyperlink.text),e.appendChild(t)}}render(){this.shadowRoot.innerHTML='\n \n\n \n\n '}})})()},5049:()=>{(()=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t=/^\s+/,n=/\s+$/;function s(i,o){if(o=o||{},(i=i||"")instanceof s)return i;if(!(this instanceof s))return new s(i,o);var a=function(s){var i,o,a,r={r:0,g:0,b:0},l=1,c=null,d=null,u=null,h=!1,p=!1;return"string"==typeof s&&(s=function(e){e=e.replace(t,"").replace(n,"").toLowerCase();var s,i=!1;if(_[e])e=_[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(s=T.rgb.exec(e))?{r:s[1],g:s[2],b:s[3]}:(s=T.rgba.exec(e))?{r:s[1],g:s[2],b:s[3],a:s[4]}:(s=T.hsl.exec(e))?{h:s[1],s:s[2],l:s[3]}:(s=T.hsla.exec(e))?{h:s[1],s:s[2],l:s[3],a:s[4]}:(s=T.hsv.exec(e))?{h:s[1],s:s[2],v:s[3]}:(s=T.hsva.exec(e))?{h:s[1],s:s[2],v:s[3],a:s[4]}:(s=T.hex8.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),a:R(s[4]),format:i?"name":"hex8"}:(s=T.hex6.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),format:i?"name":"hex"}:(s=T.hex4.exec(e))?{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),a:R(s[4]+""+s[4]),format:i?"name":"hex8"}:!!(s=T.hex3.exec(e))&&{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),format:i?"name":"hex"}}(s)),"object"==e(s)&&(M(s.r)&&M(s.g)&&M(s.b)?(i=s.r,o=s.g,a=s.b,r={r:255*w(i,255),g:255*w(o,255),b:255*w(a,255)},h=!0,p="%"===String(s.r).substr(-1)?"prgb":"rgb"):M(s.h)&&M(s.s)&&M(s.v)?(c=I(s.s),d=I(s.v),r=function(e,t,n){e=6*w(e,360),t=w(t,100),n=w(n,100);var s=Math.floor(e),i=e-s,o=n*(1-t),a=n*(1-i*t),r=n*(1-(1-i)*t),l=s%6;return{r:255*[n,a,o,o,r,n][l],g:255*[r,n,n,a,o,o][l],b:255*[o,o,r,n,n,a][l]}}(s.h,c,d),h=!0,p="hsv"):M(s.h)&&M(s.s)&&M(s.l)&&(c=I(s.s),u=I(s.l),r=function(e,t,n){var s,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=w(e,360),t=w(t,100),n=w(n,100),0===t)s=i=o=n;else{var r=n<.5?n*(1+t):n+t-n*t,l=2*n-r;s=a(l,r,e+1/3),i=a(l,r,e),o=a(l,r,e-1/3)}return{r:255*s,g:255*i,b:255*o}}(s.h,c,u),h=!0,p="hsl"),s.hasOwnProperty("a")&&(l=s.a)),l=E(l),{ok:h,format:s.format||p,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:l}}(i);this._originalInput=i,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=Math.round(100*this._a)/100,this._format=o.format||a.format,this._gradientType=o.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=a.ok}function i(e,t,n){e=w(e,255),t=w(t,255),n=w(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=(o+a)/2;if(o==a)s=i=0;else{var l=o-a;switch(i=r>.5?l/(2-o-a):l/(o+a),o){case e:s=(t-n)/l+(t>1)+720)%360;--t;)i.h=(i.h+o)%360,a.push(s(i));return a}function b(e,t){t=t||6;for(var n=s(e).toHsv(),i=n.h,o=n.s,a=n.v,r=[],l=1/t;t--;)r.push(s({h:i,s:o,v:a})),a=(a+l)%1;return r}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=E(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=o(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=o(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=i(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=i(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return a(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,i){var o=[x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16)),x(k(s))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*w(this._r,255))+"%",g:Math.round(100*w(this._g,255))+"%",b:Math.round(100*w(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%)":"rgba("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+r(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=s(e);n="#"+r(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(u,arguments)},brighten:function(){return this._applyModification(h,arguments)},darken:function(){return this._applyModification(p,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(c,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(f,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(m,[3])},tetrad:function(){return this._applyCombination(m,[4])}},s.fromRatio=function(t,n){if("object"==e(t)){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]="a"===o?t[o]:I(t[o]));t=i}return s(t,n)},s.equals=function(e,t){return!(!e||!t)&&s(e).toRgbString()==s(t).toRgbString()},s.random=function(){return s.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},s.mix=function(e,t,n){n=0===n?0:n||50;var i=s(e).toRgb(),o=s(t).toRgb(),a=n/100;return s({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},s.readability=function(e,t){var n=s(e),i=s(t);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},s.isReadable=function(e,t,n){var i,o,a,r,l,c=s.readability(e,t);switch(o=!1,(a=n,"AA"!==(r=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==r&&(r="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),i={level:r,size:l}).level+i.size){case"AAsmall":case"AAAlarge":o=c>=4.5;break;case"AAlarge":o=c>=3;break;case"AAAsmall":o=c>=7}return o},s.mostReadable=function(e,t,n){var i,o,a,r,l=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,r=n.size;for(var d=0;dc&&(c=i,l=s(t[d]));return s.isReadable(e,l,{level:a,size:r})||!o?l:(n.includeFallbackColors=!1,s.mostReadable(e,["#fff","#000"],n))};var _=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=s.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(_);function E(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function w(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function S(e){return Math.min(1,Math.max(0,e))}function C(e){return parseInt(e,16)}function x(e){return 1==e.length?"0"+e:""+e}function I(e){return e<=1&&(e=100*e+"%"),e}function k(e){return Math.round(255*parseFloat(e)).toString(16)}function R(e){return C(e)/255}var O,D,P,T=(D="[\\s|\\(]+("+(O="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",P="[\\s|\\(]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",{CSS_UNIT:new RegExp(O),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+P),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+P),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+P),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function M(e){return!!T.CSS_UNIT.exec(e)}const L=JSON.parse('{"nudge-tray-content":"Finish your donation to create an impact today.","nudge-tray-cta":"Give Now","nudge-tray-title":"Make a difference!"}'),N=JSON.parse('{"nudge-tray-content":"Finaliza tu donación para crear un impacto hoy.","nudge-tray-cta":"Dona ahora","nudge-tray-title":"¡Haz la diferencia!"}');class F 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(" ")}}const{slice:q,forEach:j}=[],G=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,$={create(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),s&&(i.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(!G.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!G.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),i)},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 U=null;const z=()=>{if(null!==U)return U;try{if(U="undefined"!=typeof window&&null!==window.localStorage,!U)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){U=!1}return U};var B={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&z())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&z()&&window.localStorage.setItem(n,e)}};let Y=null;const K=()=>{if(null!==Y)return Y;try{if(Y="undefined"!=typeof window&&null!==window.sessionStorage,!Y)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Y=!1}return Y};var W={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&K())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&K()&&window.sessionStorage.setItem(n,e)}},Q={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}},J={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}},Z={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("/","")}},X={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 ee=!1;try{document.cookie,ee=!0}catch(e){}const te=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ee||te.splice(1,1);class ne{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]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return j.call(q.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:te,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=n,this.addDetector(H),this.addDetector(V),this.addDetector(B),this.addDetector(W),this.addDetector(Q),this.addDetector(J),this.addDetector(Z),this.addDetector(X)}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)})))}}ne.type="languageDetector";const se=e=>"string"==typeof e,ie=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},oe=e=>null==e?"":""+e,ae=/###/g,re=e=>e&&e.indexOf("###")>-1?e.replace(ae,"."):e,le=e=>!e||se(e),ce=(e,t,n)=>{const s=se(t)?t.split("."):t;let i=0;for(;i{const{obj:s,k:i}=ce(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=ce(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=ce(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=n},ue=(e,t)=>{const{obj:n,k:s}=ce(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},he=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?se(e[s])||e[s]instanceof String||se(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):he(e[s],t[s],n):e[s]=t[s]);return e},pe=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ge={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const fe=e=>se(e)?e.replace(/[&<>"'\/]/g,(e=>ge[e])):e,me=[" ",",","?","!",";"],ye=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),ve=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("_","-"),_e={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 Ae{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||_e,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):se(n)&&i?a.push(...n.split(i)):a.push(n)));const r=ue(this.data,a);return!r&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!r&&o&&se(n)?ve(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),de(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)(se(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=ue(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?he(r,n,i):r={...r,...n},de(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 Ce={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 xe={},Ie=e=>!se(e)&&"boolean"!=typeof e&&"number"!=typeof e;class ke extends we{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=Ee.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=me.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=ye.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:se(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:se(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&&!se(t.count),y=ke.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,A=_&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${v}`]||t[`defaultValue${b}`]||t.defaultValue;let E=u;f&&!u&&y&&(E=A);const w=Ie(E),S=Object.prototype.toString.apply(E);if(!(f&&E&&w&&["[object Number]","[object Function]","[object RegExp]"].indexOf(S)<0)||se(g)&&Array.isArray(E))if(f&&se(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=A),this.isValidLookup(u)||(a=!0,u=o);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,h=y&&A!==u&&this.options.updateMissing;if(a||s||h){if(this.logger.log(h?"updateKey":"missingKey",l,r,o,h?A: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}`]||A)}))})):s(e,o,A))}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,E,{...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(E),n=e?[]:{},s=e?p:h;for(const e in E)if(Object.prototype.hasOwnProperty.call(E,e)){const o=`${s}${i}${e}`;n[e]=y&&!u?this.translate(o,{...t,defaultValue:Ie(A)?A[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=E[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=se(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&&!se(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 se(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&&!se(a.count),u=d&&!a.ordinal&&0===a.count,h=void 0!==a.context&&(se(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,xe[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(xe[`${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&&!se(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 Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ee.create("languageUtils")}getScriptPartFromCode(e){if(!(e=be(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=be(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(se(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)),se(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 se(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))):se(e)&&i(this.formatLanguageCode(e)),n.forEach((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const Oe={zero:0,one:1,two:2,few:3,many:4,other:5},De={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Pe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Ee.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=be("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!"),De;if(!e.match(/-|_/))return De;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)=>Oe[e]-Oe[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 Te=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=ue(e,n);return void 0!==s?s:ue(t,n)})(e,t,n);return!o&&i&&se(n)&&(o=ve(e,n,s),void 0===o&&(o=ve(t,n,s))),o},Me=e=>e.replace(/\$/g,"$$$$");class Le{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ee.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:fe,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?pe(i):o||"{{",this.suffix=a?pe(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?pe(u):h||pe("$t("),this.nestingSuffix=p?pe(p):g||pe(")"),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=Te(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(Te(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=>Me(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Me(this.escape(e)):Me(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=se(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 se(o)||this.useRawValueToEscape||(o=oe(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&&!se(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&&!se(s))return s;se(s)||(s=oe(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 Ne=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(be(s),i),t[a]=r),r(n)}};class Fe{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ee.create("formatter"),this.options=e,this.formats={number:Ne(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Ne(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Ne(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Ne(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Ne(((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()]=Ne(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 qe extends we{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=Ee.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}=ce(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();se(e)&&(e=this.languageUtils.toResolveHierarchy(e)),se(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 je=()=>({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]),se(e[1])&&(t.defaultValue=e[1]),se(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}}),Ge=e=>(se(e.ns)&&(e.ns=[e.ns]),se(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),se(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),$e=()=>{};class He extends we{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=Ge(e),this.services={},this.logger=Ee,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&&(se(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=je();this.options={...s,...this.options,...Ge(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?Ee.init(i(this.modules.logger),this.options):Ee.init(null,this.options),t=this.modules.formatter?this.modules.formatter:Fe;const n=new Re(this.options);this.store=new Se(this.options.resources,this.options);const o=this.services;o.logger=Ee,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new Pe(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 Le(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new qe(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=$e),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=ie(),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]:$e;const n=se(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=ie();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=$e),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&&Ce.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=ie();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=se(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 se(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=ie();return this.options.ns?(se(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=ie();se(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 Re(je());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 He(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]:$e;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new He(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 Se(e,s),i.services.resourceStore=i.store}return i.translator=new ke(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;sVe.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(ne),this.i18n.init({...Ue,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return ze.instance||(ze.instance=new ze),ze.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 Be extends F{loadI18nResources(e,t){this.namespace=e,ze.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 ze.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return ze.getInstance().getLanguage()}}const Ye="title",Ke="content",We="open",Qe="cta-label",Je="brand-color";class Ze extends Be{static observedAttributes=(()=>[Qe,Je,Ye,Ke,We])();constructor(){super(),this.loadI18nResources("NudgeTray",{en:L,es:N})}connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.render(),this.bindEvents()}attributeChangedCallback(e,t,n){switch(e){case Qe:this.updateCtaLabel(n);break;case Je:this.updateCtaBG(n),this.updateIconColor(n);break;case Ye:this.updateTitle(n);break;case Ke:this.updateContent(n);break;case We:this.updateOpen(n)}}render(){this.shadowRoot&&(this.shadowRoot.innerHTML='\n\n\n\n
\n
\n
\n
\n
\n
\n
\n\n ',this.updateOpen(this.getAttribute(We)),this.updateCtaLabel(this.getAttribute(Qe)),this.updateCtaBG(this.getAttribute(Je)),this.updateIconColor(this.getAttribute(Je)),this.updateTitle(this.getAttribute(Ye)),this.updateContent(this.getAttribute(Ke)))}updateOpen(e){const t=this.shadowRoot?.querySelector(".nudge-tray"),n=this.shadowRoot?.querySelector(".nudge-tray--close"),s=this.shadowRoot?.querySelector(".nudge-tray--cta"),i="true"===e;t&&(i?(t.classList.contains("open")||t.classList.add("open"),t.setAttribute("aria-hidden","false"),t.removeAttribute("inert")):(t.classList.remove("open"),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""))),i?(n?.removeAttribute("tabindex"),s?.removeAttribute("tabindex")):(n?.setAttribute("tabindex","-1"),s?.setAttribute("tabindex","-1"))}updateTitle(e){const t=this.shadowRoot?.querySelector(".nudge-tray--title");t&&(t.textContent=e||this.t("nudge-tray-title","Make a difference!"))}updateContent(e){const t=this.shadowRoot?.querySelector(".nudge-tray--content");t&&(t.textContent=e||this.t("nudge-tray-content","Finish your donation to create an impact today."))}updateCtaLabel(e){const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.textContent=e||this.t("nudge-tray-cta","Give Now"))}updateCtaBG(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.style.backgroundColor=e)}updateIconColor(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--icon path.primary"),n=this.shadowRoot?.querySelector(".nudge-tray--icon path.secondary");t&&n&&(t.style.stroke=e,n.style.stroke=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=s(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(e,.5))}bindEvents(){this.bindCtaEvent(),this.bindCloseEvent()}bindCtaEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--cta");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--cta",{bubbles:!0,composed:!0}))}))}bindCloseEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--close");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--close",{bubbles:!0,composed:!0}))}))}}customElements.get("cl-nudge-tray")||customElements.define("cl-nudge-tray",Ze)})()},9727:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(1354),i=n.n(s),o=n(6314),a=n.n(o)()(i());a.push([e.id,"/* @import url('@classy/design-tokens/dist/tokens.css'); */\n\n:root {\n /* Default and Web Safe Fonts */\n --classy-font__font-family--arial: Arial, sans-serif;\n --classy-font__font-family--georgia: Georgia, serif;\n --classy-font__font-family--impact: Impact, sans-serif;\n --classy-font__font-family--tahoma: Tahoma, sans-serif;\n --classy-font__font-family--times-new-roman: 'Times New Roman', serif;\n --classy-font__font-family--verdana: Verdana, sans-serif;\n\n /* Google Fonts */\n --classy-font__font-family--domine: 'Domine', serif;\n --classy-font__font-family--inter: 'Inter', sans-serif;\n --classy-font__font-family--karla: 'Karla', sans-serif;\n --classy-font__font-family--lato: 'Lato', sans-serif;\n --classy-font__font-family--merriweather: 'Merriweather', serif;\n --classy-font__font-family--montserrat: 'Montserrat', sans-serif;\n --classy-font__font-family--open-sans: 'Open Sans', sans-serif;\n --classy-font__font-family--oswald: 'Oswald', sans-serif;\n --classy-font__font-family--poppins: 'Poppins', sans-serif;\n --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;\n --classy-font__font-family--raleway: 'Raleway', sans-serif;\n --classy-font__font-family--roboto: 'Roboto', sans-serif;\n --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;\n --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;\n --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;\n\n /* Theme Colors */\n --classy-theme-color__brand-primary: #425ccd;\n --classy-theme-color__brand-secondary: #e8ebf9;\n --classy-theme-color__brand-tertiary: #303030;\n --classy-theme-color__text-general: #2d2e31;\n --classy-theme-color__background: #ffffff;\n --classy-theme-color__background-accent: #f2f1ef;\n\n /* Base Font Family */\n --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',\n 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n\n /* Typography Variables */\n --classy-font__label--font-size: 12px;\n --classy-font__label--line-height: 1.5;\n --classy-font__label--font-weight: 400;\n --classy-font__label-bold--font-weight: 700;\n\n --classy-font__paragraph-sm--font-size: 14px;\n --classy-font__paragraph-sm--line-height: 1.5;\n --classy-font__paragraph-sm--font-weight: 400;\n --classy-font__paragraph-sm-bold--font-size: 14px;\n --classy-font__paragraph-sm-bold--line-height: 1.5;\n --classy-font__paragraph-sm-bold--font-weight: 700;\n\n --classy-font__paragraph-md--font-size: 16px;\n --classy-font__paragraph-md--line-height: 1.5;\n --classy-font__paragraph-md--font-weight: 400;\n --classy-font__paragraph-md-bold--font-size: 16px;\n --classy-font__paragraph-md-bold--line-height: 1.5;\n --classy-font__paragraph-md-bold--font-weight: 700;\n\n --classy-font__paragraph-lg--font-size: 20px;\n --classy-font__paragraph-lg--line-height: 1.5;\n --classy-font__paragraph-lg--font-weight: 400;\n --classy-font__paragraph-lg-bold--font-size: 20px;\n --classy-font__paragraph-lg-bold--line-height: 1.5;\n --classy-font__paragraph-lg-bold--font-weight: 700;\n\n --classy-font__heading-sm--font-size: 28px;\n --classy-font__heading-sm--line-height: 1.2;\n --classy-font__heading-sm--font-weight: 700;\n\n --classy-font__tag-bold--font-size: 12px;\n --classy-font__tag-bold--line-height: 1;\n --classy-font__tag-bold--font-weight: 700;\n\n /* General and Heading Font Family Aliases */\n --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);\n --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);\n\n --classy-font__heading-xs--font-size: 24px;\n --classy-font__heading-xs--line-height: 1.2;\n --classy-font__heading-xs--font-weight: 700;\n\n --classy-theme-font__paragraph-md--font-size: 16px;\n --classy-theme-font__paragraph-md--line-height: 1.5;\n --classy-theme-font__paragraph-md--font-weight: 400;\n\n /* Border Radius */\n --classy-border__radius-sm: 4px;\n --classy-border__radius-md: 8px;\n --classy-border__radius-lg: 12px;\n --classy-border__radius-xl: 16px;\n --classy-border__radius-xxl: 20px;\n\n /* Shadows */\n --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);\n --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);\n --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);\n --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);\n --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);\n --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,\n 1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;\n --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,\n 1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;\n\n /* Brand Colors */\n --classy-color__brand-primary--base: rgb(54, 81, 201);\n --classy-color__brand-primary--darker: rgb(27, 40, 101);\n --classy-color__brand-primary--dark: rgb(41, 61, 153);\n --classy-color__brand-primary--light: rgb(102, 123, 214);\n --classy-color__brand-primary--lighter: rgb(154, 168, 228);\n --classy-color__brand-primary--lightest: rgb(207, 213, 242);\n --classy-color__brand-secondary: rgb(232, 235, 248);\n --classy-color__brand-secondary-dark: rgb(206, 213, 242);\n --classy-color__brand-tertiary: rgb(26, 25, 24);\n\n /* Neutral Colors */\n --classy-color__neutral--10: rgb(27, 25, 24);\n --classy-color__neutral--20: rgb(49, 47, 45);\n --classy-color__neutral--30: rgb(80, 76, 73);\n --classy-color__neutral--40: rgb(106, 101, 98);\n --classy-color__neutral--45: rgb(120, 114, 110);\n --classy-color__neutral--50: rgb(133, 127, 122);\n --classy-color__neutral--60: rgb(157, 152, 149);\n --classy-color__neutral--70: rgb(181, 178, 176);\n --classy-color__neutral--80: rgb(206, 204, 202);\n --classy-color__neutral--90: rgb(230, 229, 229);\n --classy-color__neutral--95: rgb(243, 242, 242);\n --classy-color__neutral--100: rgb(255, 255, 255);\n\n /* Borders */\n --classy-color__border--input: var(--classy-color__neutral--50);\n --classy-color__border--input-hover: var(--classy-color__neutral--60);\n --classy-color__border--lightest: rgb(235, 234, 234);\n --classy-color__border--placeholder: rgb(248, 247, 247);\n --classy-color__border--focus: rgb(41, 114, 255);\n\n /* Backgrounds */\n --classy-color__background: rgb(255, 255, 255);\n --classy-color__background--accent: rgb(245, 245, 245);\n --classy-color__background--lightest: var(--classy-color__neutral--95);\n --classy-color__background--input: rgb(248, 247, 247);\n --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);\n --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);\n\n /* Status Colors */\n --classy-color__status--error-base: rgb(169, 15, 15);\n --classy-color__status--error-lightest: rgb(254, 246, 246);\n --classy-color__status--success-base: rgb(46, 125, 50);\n\n /*\n * * Component-specific\n * ! FIXME align breakpoint names with design system, CL-27142\n */\n --classy-layout__max-width--tablet: 1280px;\n --classy-section__padding-inline--mobile: 24px;\n --classy-section__padding-block--mobile: 24px;\n --classy-section__padding-inline--tablet: 32px;\n --classy-section__padding-block--tablet: 48px;\n --classy-content__width--wide: 768px;\n}\n\n","",{version:3,sources:["webpack://./node_modules/@classy/embedded-components/dist/common.css"],names:[],mappings:"AAAA,0DAA0D;;AAE1D;EACE,+BAA+B;EAC/B,oDAAoD;EACpD,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,qEAAqE;EACrE,wDAAwD;;EAExD,iBAAiB;EACjB,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,oDAAoD;EACpD,+DAA+D;EAC/D,gEAAgE;EAChE,8DAA8D;EAC9D,wDAAwD;EACxD,0DAA0D;EAC1D,0DAA0D;EAC1D,0DAA0D;EAC1D,wDAAwD;EACxD,2DAA2D;EAC3D,2DAA2D;EAC3D,sEAAsE;;EAEtE,iBAAiB;EACjB,4CAA4C;EAC5C,8CAA8C;EAC9C,6CAA6C;EAC7C,2CAA2C;EAC3C,yCAAyC;EACzC,gDAAgD;;EAEhD,qBAAqB;EACrB;oDACkD;;EAElD,yBAAyB;EACzB,qCAAqC;EACrC,sCAAsC;EACtC,sCAAsC;EACtC,2CAA2C;;EAE3C,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,wCAAwC;EACxC,uCAAuC;EACvC,yCAAyC;;EAEzC,4CAA4C;EAC5C,kFAAkF;EAClF,gFAAgF;;EAEhF,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,kDAAkD;EAClD,mDAAmD;EACnD,mDAAmD;;EAEnD,kBAAkB;EAClB,+BAA+B;EAC/B,+BAA+B;EAC/B,gCAAgC;EAChC,gCAAgC;EAChC,iCAAiC;;EAEjC,YAAY;EACZ,2DAA2D;EAC3D,sDAAsD;EACtD,0DAA0D;EAC1D,4DAA4D;EAC5D,yDAAyD;EACzD;6CAC2C;EAC3C;mDACiD;;EAEjD,iBAAiB;EACjB,qDAAqD;EACrD,uDAAuD;EACvD,qDAAqD;EACrD,wDAAwD;EACxD,0DAA0D;EAC1D,2DAA2D;EAC3D,mDAAmD;EACnD,wDAAwD;EACxD,+CAA+C;;EAE/C,mBAAmB;EACnB,4CAA4C;EAC5C,4CAA4C;EAC5C,4CAA4C;EAC5C,8CAA8C;EAC9C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,gDAAgD;;EAEhD,YAAY;EACZ,+DAA+D;EAC/D,qEAAqE;EACrE,oDAAoD;EACpD,uDAAuD;EACvD,gDAAgD;;EAEhD,gBAAgB;EAChB,8CAA8C;EAC9C,sDAAsD;EACtD,sEAAsE;EACtE,qDAAqD;EACrD,8DAA8D;EAC9D,gEAAgE;;EAEhE,kBAAkB;EAClB,oDAAoD;EACpD,0DAA0D;EAC1D,sDAAsD;;EAEtD;;;IAGE;EACF,0CAA0C;EAC1C,8CAA8C;EAC9C,6CAA6C;EAC7C,8CAA8C;EAC9C,6CAA6C;EAC7C,oCAAoC;AACtC",sourcesContent:["/* @import url('@classy/design-tokens/dist/tokens.css'); */\n\n:root {\n /* Default and Web Safe Fonts */\n --classy-font__font-family--arial: Arial, sans-serif;\n --classy-font__font-family--georgia: Georgia, serif;\n --classy-font__font-family--impact: Impact, sans-serif;\n --classy-font__font-family--tahoma: Tahoma, sans-serif;\n --classy-font__font-family--times-new-roman: 'Times New Roman', serif;\n --classy-font__font-family--verdana: Verdana, sans-serif;\n\n /* Google Fonts */\n --classy-font__font-family--domine: 'Domine', serif;\n --classy-font__font-family--inter: 'Inter', sans-serif;\n --classy-font__font-family--karla: 'Karla', sans-serif;\n --classy-font__font-family--lato: 'Lato', sans-serif;\n --classy-font__font-family--merriweather: 'Merriweather', serif;\n --classy-font__font-family--montserrat: 'Montserrat', sans-serif;\n --classy-font__font-family--open-sans: 'Open Sans', sans-serif;\n --classy-font__font-family--oswald: 'Oswald', sans-serif;\n --classy-font__font-family--poppins: 'Poppins', sans-serif;\n --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;\n --classy-font__font-family--raleway: 'Raleway', sans-serif;\n --classy-font__font-family--roboto: 'Roboto', sans-serif;\n --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;\n --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;\n --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;\n\n /* Theme Colors */\n --classy-theme-color__brand-primary: #425ccd;\n --classy-theme-color__brand-secondary: #e8ebf9;\n --classy-theme-color__brand-tertiary: #303030;\n --classy-theme-color__text-general: #2d2e31;\n --classy-theme-color__background: #ffffff;\n --classy-theme-color__background-accent: #f2f1ef;\n\n /* Base Font Family */\n --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',\n 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n\n /* Typography Variables */\n --classy-font__label--font-size: 12px;\n --classy-font__label--line-height: 1.5;\n --classy-font__label--font-weight: 400;\n --classy-font__label-bold--font-weight: 700;\n\n --classy-font__paragraph-sm--font-size: 14px;\n --classy-font__paragraph-sm--line-height: 1.5;\n --classy-font__paragraph-sm--font-weight: 400;\n --classy-font__paragraph-sm-bold--font-size: 14px;\n --classy-font__paragraph-sm-bold--line-height: 1.5;\n --classy-font__paragraph-sm-bold--font-weight: 700;\n\n --classy-font__paragraph-md--font-size: 16px;\n --classy-font__paragraph-md--line-height: 1.5;\n --classy-font__paragraph-md--font-weight: 400;\n --classy-font__paragraph-md-bold--font-size: 16px;\n --classy-font__paragraph-md-bold--line-height: 1.5;\n --classy-font__paragraph-md-bold--font-weight: 700;\n\n --classy-font__paragraph-lg--font-size: 20px;\n --classy-font__paragraph-lg--line-height: 1.5;\n --classy-font__paragraph-lg--font-weight: 400;\n --classy-font__paragraph-lg-bold--font-size: 20px;\n --classy-font__paragraph-lg-bold--line-height: 1.5;\n --classy-font__paragraph-lg-bold--font-weight: 700;\n\n --classy-font__heading-sm--font-size: 28px;\n --classy-font__heading-sm--line-height: 1.2;\n --classy-font__heading-sm--font-weight: 700;\n\n --classy-font__tag-bold--font-size: 12px;\n --classy-font__tag-bold--line-height: 1;\n --classy-font__tag-bold--font-weight: 700;\n\n /* General and Heading Font Family Aliases */\n --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);\n --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);\n\n --classy-font__heading-xs--font-size: 24px;\n --classy-font__heading-xs--line-height: 1.2;\n --classy-font__heading-xs--font-weight: 700;\n\n --classy-theme-font__paragraph-md--font-size: 16px;\n --classy-theme-font__paragraph-md--line-height: 1.5;\n --classy-theme-font__paragraph-md--font-weight: 400;\n\n /* Border Radius */\n --classy-border__radius-sm: 4px;\n --classy-border__radius-md: 8px;\n --classy-border__radius-lg: 12px;\n --classy-border__radius-xl: 16px;\n --classy-border__radius-xxl: 20px;\n\n /* Shadows */\n --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);\n --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);\n --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);\n --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);\n --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);\n --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,\n 1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;\n --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,\n 1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;\n\n /* Brand Colors */\n --classy-color__brand-primary--base: rgb(54, 81, 201);\n --classy-color__brand-primary--darker: rgb(27, 40, 101);\n --classy-color__brand-primary--dark: rgb(41, 61, 153);\n --classy-color__brand-primary--light: rgb(102, 123, 214);\n --classy-color__brand-primary--lighter: rgb(154, 168, 228);\n --classy-color__brand-primary--lightest: rgb(207, 213, 242);\n --classy-color__brand-secondary: rgb(232, 235, 248);\n --classy-color__brand-secondary-dark: rgb(206, 213, 242);\n --classy-color__brand-tertiary: rgb(26, 25, 24);\n\n /* Neutral Colors */\n --classy-color__neutral--10: rgb(27, 25, 24);\n --classy-color__neutral--20: rgb(49, 47, 45);\n --classy-color__neutral--30: rgb(80, 76, 73);\n --classy-color__neutral--40: rgb(106, 101, 98);\n --classy-color__neutral--45: rgb(120, 114, 110);\n --classy-color__neutral--50: rgb(133, 127, 122);\n --classy-color__neutral--60: rgb(157, 152, 149);\n --classy-color__neutral--70: rgb(181, 178, 176);\n --classy-color__neutral--80: rgb(206, 204, 202);\n --classy-color__neutral--90: rgb(230, 229, 229);\n --classy-color__neutral--95: rgb(243, 242, 242);\n --classy-color__neutral--100: rgb(255, 255, 255);\n\n /* Borders */\n --classy-color__border--input: var(--classy-color__neutral--50);\n --classy-color__border--input-hover: var(--classy-color__neutral--60);\n --classy-color__border--lightest: rgb(235, 234, 234);\n --classy-color__border--placeholder: rgb(248, 247, 247);\n --classy-color__border--focus: rgb(41, 114, 255);\n\n /* Backgrounds */\n --classy-color__background: rgb(255, 255, 255);\n --classy-color__background--accent: rgb(245, 245, 245);\n --classy-color__background--lightest: var(--classy-color__neutral--95);\n --classy-color__background--input: rgb(248, 247, 247);\n --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);\n --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);\n\n /* Status Colors */\n --classy-color__status--error-base: rgb(169, 15, 15);\n --classy-color__status--error-lightest: rgb(254, 246, 246);\n --classy-color__status--success-base: rgb(46, 125, 50);\n\n /*\n * * Component-specific\n * ! FIXME align breakpoint names with design system, CL-27142\n */\n --classy-layout__max-width--tablet: 1280px;\n --classy-section__padding-inline--mobile: 24px;\n --classy-section__padding-block--mobile: 24px;\n --classy-section__padding-inline--tablet: 32px;\n --classy-section__padding-block--tablet: 48px;\n --classy-content__width--wide: 768px;\n}\n\n"],sourceRoot:""}]);const r=a},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var r=0;r0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),o="/*# ".concat(i," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},7910:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var s=n(5072),i=n.n(s),o=n(7825),a=n.n(o),r=n(7659),l=n.n(r),c=n(5056),d=n.n(c),u=n(540),h=n.n(u),p=n(1113),g=n.n(p),f=n(9727),m={};m.styleTagTransform=g(),m.setAttributes=d(),m.insert=l().bind(null,"head"),m.domAPI=a(),m.insertStyleElement=h();i()(f.A,m);const y=f.A&&f.A.locals?f.A.locals:void 0},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,i&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1679:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(2816)),a=i(n(9468)),r=n(3918);t.default=class{constructor(e){this.destroyed=!1,this.init=()=>s(this,void 0,void 0,(function*(){const{modalSDK:e}=this.props;if(this.model=new o.default({win:this.props.win,msg:this.props.msg,configs:yield this.props.configs}),this.view=new a.default({win:this.props.win,onCta:this.subscribeToNudgeTrayCtaEvent,onClose:this.subscribeToNudgeTrayCloseEvent,isOpen:!!(yield this.model.get())&&!e.isOpen()}),e.subscribeToOpenEvent(this.subscribeToModalOpenEvent),e.subscribeToCloseEvent(this.subscribeToModalCloseEvent),e.isOpen()){this.model.markModalOpened();const t=e.getCampaign();t&&this.model.set({campaign:t,params:e.getParams()})}else{const e=yield this.model.get();e&&this.view.open(e)}})),this.subscribeToModalOpenEvent=e=>{this.model.markModalOpened(),this.model.set(e.data),this.view.close()},this.subscribeToModalCloseEvent=()=>s(this,void 0,void 0,(function*(){const e=yield this.model.get();e&&this.view.open(e)})),this.subscribeToNudgeTrayCloseEvent=()=>s(this,void 0,void 0,(function*(){var e;const t=yield this.model.get();(null==t?void 0:t.nav.campaign)&&(null===(e=this.props.hostPageEventInstrumentation)||void 0===e||e.track(r.abandonCartActionEvent,{campaignId:t.nav.campaign,data:{text:"Dismiss",tracking_id:"abandoned cart dismissed"}})),this.model.reset(),this.view.close()})),this.subscribeToNudgeTrayCtaEvent=()=>s(this,void 0,void 0,(function*(){var e;const t=yield this.model.get();(null==t?void 0:t.nav.campaign)&&(null===(e=this.props.hostPageEventInstrumentation)||void 0===e||e.track(r.abandonCartActionEvent,{campaignId:t.nav.campaign,data:{text:"Give Now",tracking_id:"abandoned cart give now"}}),this.props.modalSDK.open(t.nav.campaign,t.nav.params))})),this.props=e,this.init()}destroy(){this.destroyed||(this.destroyed=!0,this.view&&this.view.destroy(),this.model&&this.model.destroy())}}},2816:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i="cl-nudge-tray",o=s(n(8311));t.default=class{constructor(e){this.destroyed=!1,this.hasTrackedModalOpen=!1,this.set=e=>{const t=Object.assign(Object.assign({},e),{hasInteractedWithDonationForm:!0});this.props.win.localStorage.setItem(i,JSON.stringify(t))},this.reset=()=>{this.props.win.localStorage.removeItem(i)},this.markModalOpened=()=>{this.hasTrackedModalOpen=!0},this.get=()=>{try{const e=this.props.win.localStorage.getItem(i);if(!e)return null;const t=JSON.parse(e);if(!this.isValidState(t))return null;const n=t.campaign;if(!n)return null;const s=t,o=this.getConfig(n);return(null==o?void 0:o.enabled)?{nav:s,config:o}:null}catch(e){return null}},this.getConfig=e=>{const t=this.props.configs[e];if(!t)return null;const n=Object.values(t.components).find((e=>"nudge-tray"===e.type));return n?{enabled:n.props.abandonCartNudgeEnabled,theme:t.theme,organizationName:t.organizationName}:null},this.onDonationChanged=e=>{this.hasTrackedModalOpen&&e.data.payload.campaignId&&e.data.payload.params&&this.set({campaign:e.data.payload.campaignId,params:e.data.payload.params})},this.onDonationCompleted=()=>{this.reset()},this.isValidState=e=>this.hasInteractedWithDonationForm(e.hasInteractedWithDonationForm)&&this.isValidStateCampaign(e.campaign)&&this.isValidStateParams(e.params),this.hasInteractedWithDonationForm=e=>!0===e,this.isValidStateCampaign=e=>!!e&&"string"==typeof e,this.isValidStateParams=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,this.props=e,this.dao=new o.default({win:this.props.win}),this.props.msg.onDonationChanged(this.onDonationChanged),this.props.msg.onDonationCompleted(this.onDonationCompleted)}destroy(){this.destroyed||(this.destroyed=!0)}}},9468:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.destroyed=!1,this.open=e=>{this.pendingState=e,e.config.enabled&&this.el&&(this.setCtaBg(e),this.setContent(e),this.setAriaLabel(e),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.init=()=>a(this,void 0,void 0,(function*(){try{yield Promise.resolve().then((()=>o(n(5049)))),this.el=this.props.win.document.createElement("cl-nudge-tray"),this.el.setAttribute("role","complementary"),this.props.win.document.body.appendChild(this.el),this.el.addEventListener("cl-nudge-tray--cta",this.props.onCta),this.el.addEventListener("cl-nudge-tray--close",this.props.onClose),setTimeout((()=>{this.pendingState&&this.pendingState.config.enabled&&(this.setCtaBg(this.pendingState),this.setContent(this.pendingState),this.setAriaLabel(this.pendingState)),this.setOpen(this.props.isOpen)}),0)}catch(e){console.log(e),console.error("unable to init the abandon cart nudge tray view")}})),this.setContent=e=>{if(!this.el)return;const t=Number(e.nav.params.amount);isNaN(t)||!isFinite(t)||t<=0||this.el.setAttribute("content",`Finish your $${t} gift to create an impact today.`)},this.setCtaBg=e=>{this.el&&this.el.setAttribute("brand-color",e.config.theme["--theme-color__brand-primary"])},this.setAriaLabel=e=>{if(!this.el)return;const t=e.config.organizationName?`Donate to ${e.config.organizationName}`:"Donate";this.el.setAttribute("aria-label",t)},this.setOpen=e=>{this.el&&this.el.setAttribute("open",e?"true":"false")},this.props=e,this.init()}destroy(){this.destroyed||(this.destroyed=!0,this.el&&(this.el.removeEventListener("cl-nudge-tray--cta",this.props.onCta),this.el.removeEventListener("cl-nudge-tray--close",this.props.onClose),this.el.remove(),this.el=void 0))}}},1604:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);ie["gtm.start"]));return!!t&&!!t["gtm.uniqueEventId"]}checkGA4InDataLayer(){if(window.dataLayer)for(const e of window.dataLayer)if("config"===e[0]&&e[1]===this.GA4_ID)return!0;return!1}isTealiumAvailable(){var e,t;return"function"==typeof(null===(e=this.props.win.utag)||void 0===e?void 0:e.link)&&"function"==typeof(null===(t=this.props.win.utag)||void 0===t?void 0:t.view)}hasValidTealiumConfig(e){var t,n,s;return Boolean((null===(t=null==e?void 0:e.account)||void 0===t?void 0:t.trim())&&(null===(n=null==e?void 0:e.profile)||void 0===n?void 0:n.trim())&&(null===(s=null==e?void 0:e.environment)||void 0===s?void 0:s.trim()))}initializeTealium(e){if(this.tealiumInitialized||!this.hasValidTealiumConfig(e))return;const t=this.props.win,n=t.document,{account:s,profile:o}=e,a=i(e,["account","profile"]);if(t.utag_cfg_ovrd=t.utag_cfg_ovrd||{},t.utag_cfg_ovrd.noview=!0,t.utag_data=a,!n.getElementById("classy-tealium-sync-script")){const t=n.createElement("script");t.id="classy-tealium-sync-script",t.type="text/javascript",t.src=`https://tags.tiqcdn.com/utag/${s}/${o}/${e.environment}/utag.sync.js`,n.head.prepend(t)}if(!n.getElementById("classy-tealium-script")){const t=n.createElement("script");t.id="classy-tealium-script",t.type="text/javascript",t.async=!0,t.src=`https://tags.tiqcdn.com/utag/${s}/${o}/${e.environment}/utag.js`,t.addEventListener("load",(()=>this.processTealiumEventQueue())),n.body.prepend(t)}this.tealiumInitialized=!0}initializeAnalytics(){return s(this,void 0,void 0,(function*(){try{const e=this.isGA4Available(),t=this.isGTMAvailable();if(e||t)return this.analyticsLoaded=!0,void this.processEventQueue()}catch(e){console.error("Failed to initialize analytics:",e)}}))}queueOrSendEvent(e,t){if(this.analyticsLoaded)this.handleAnalyticsEvent(e,t);else{const n=this.isGA4Available(),s=this.isGTMAvailable();n||s?(this.analyticsLoaded=!0,this.processEventQueue(),this.handleAnalyticsEvent(e,t)):this.eventQueue.push({eventName:e,eventData:t})}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();if(e){const{eventName:t,eventData:n}=e;this.handleAnalyticsEvent(t,n)}}}queueOrSendTealiumEvent(e){if(this.hasValidTealiumConfig(e.config)){if(this.initializeTealium(e.config),this.isTealiumAvailable())return this.processTealiumEventQueue(),void this.sendEventToTealium(e);this.tealiumEventQueue.push(e)}else console.warn("Tealium analytics config is missing account, profile, or environment.")}processTealiumEventQueue(){if(this.isTealiumAvailable())for(;this.tealiumEventQueue.length>0;){const e=this.tealiumEventQueue.shift();e&&this.sendEventToTealium(e)}}sendEventToTealium(e){const{utag:t}=this.props.win;(null==t?void 0:t.link)&&t.view?"page"!==e.eventType?t.link(e.data):t.view(e.data):console.warn("Tealium is not available to handle the event.")}sendEventToGA4(e,t){this.isGA4Available()&&("function"==typeof window.gtag?window.gtag("event",e,t):console.warn("GA4 is not available to handle the event."))}sendEventToGTM(e,t){this.isGTMAvailable()?window.dataLayer.push(Object.assign({event:e},t)):console.warn("GTM is not available to handle the event.")}handleAnalyticsEvent(e,t){this.isGA4Available()?this.sendEventToGA4(e,t):this.isGTMAvailable()?this.sendEventToGTM(e,t):console.warn("Neither GA4 nor GTM are available to handle the event.")}setupEventListener(){this.messenger=new a.default({win:this.props.win}),this.messenger.onAnalyticsEvent((e=>{const{event:t,data:n}=e.data.payload;this.queueOrSendEvent(t,n)})),this.messenger.onTealiumAnalyticsEvent((e=>{this.queueOrSendTealiumEvent(e.data.payload)}))}sendEvent(e,t){this.queueOrSendEvent(e,t)}}},2664:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(8311)),a=n(8392);t.default=class{constructor(e){this.destroyed=!1,this.fetch=()=>s(this,void 0,void 0,(function*(){const e=this.getIds();return(yield this.dao.fetchConfigs(e,this.props.cookiesManager.getPgdidCookie())).reduce(((e,t)=>(e[t.campaignId]=t,e)),{})})),this.getIds=()=>{const e=this.getIdFromActiveUrl(),t=[...this.getIdsFromOrgElements(),...this.getIdsFromClassyElements()];e&&t.push(e);const n=this.getIdFromNudgeTrayState();n&&t.push(n);return[...new Set(t)]},this.getIdFromActiveUrl=()=>{try{return new URLSearchParams(this.props.win.location.search).get(a.CLASSY_HREF)}catch(e){return null}},this.getIdFromNudgeTrayState=()=>{try{const e=this.props.win.localStorage.getItem("cl-nudge-tray");if(!e)return null;const t=JSON.parse(e);return"string"==typeof t.campaign?t.campaign:null}catch(e){return null}},this.getIdsFromOrgElements=()=>{const e=document.querySelectorAll(`a[href*=${a.CLASSY_HREF}]`),t=[];return e.forEach((e=>{const n=e.getAttribute("href");if(!n)return;const s=this._extractCampaignId(n);s&&t.push(s)})),t},this.getIdsFromClassyElements=()=>{const e=document.querySelectorAll(`[${a.CLASSY_ATTR}]`),t=[];return e.length?(e.forEach((e=>{const n=e.getAttribute(a.CLASSY_ATTR);n&&t.push(n)})),t):t},this._extractCampaignId=e=>{if(e.startsWith(`${a.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(a.CLASSY_HREF)}catch(e){return null}},this.props=e,this.dao=new o.default({win:e.win})}destroy(){this.destroyed||(this.destroyed=!0,this.dao.destroy())}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getComponentSectionByType=void 0;t.getComponentSectionByType=(e,t,n)=>{const s=Object.values(n.components).find((t=>t.type===e));if(!(null==s?void 0:s.sections))return;const i=Object.values(s.sections).find((e=>e.type===t));return i||void 0}},8672:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.destroyed=!1,this.pgdid=this.getOrCreatePgdid()}destroy(){this.destroyed||(this.destroyed=!0)}generateUUID(){return(null===crypto||void 0===crypto?void 0:crypto.randomUUID)?crypto.randomUUID():this.fallbackUUID()}fallbackUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}setCookie(e,t,n={}){const s=`${e}=${t}; Path=/; SameSite=Lax;${n.maxAge?` Max-Age=${n.maxAge};`:""}`;document.cookie=s+" Secure;"}setPgdidCookie(e){this.setCookie("pgdid",e,{maxAge:3456e4})}getPgdidCookie(){return this.getCookie("pgdid")}clearCookie(e){document.cookie=`${e}=; Max-Age=0; Path=/;`}getOrCreatePgdid(){const e=this.getPgdidCookie();if(e)return e;const t=this.generateUUID();return this.setPgdidCookie(t),t}getCookie(e){const t=document.cookie.split("; ");for(const n of t){const[t,s]=n.split("=");if(t===e)return s}return null}}},8392:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLASSY_HREF=t.CLASSY_ATTR=void 0,t.CLASSY_ATTR="classy",t.CLASSY_HREF="campaign"},2758:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.strategyHandlers=void 0;const r=n(5318),l=n(3386),c=n(3918),d=n(8869),u="other",h="Custom",p={0:"one-time",1:"yearly",2:"semi-annually",4:"quarterly",12:"monthly",26:"bi-weekly",52:"weekly",365:"daily"};t.strategyHandlers={donationForm:e=>a(void 0,void 0,void 0,(function*(){var t;try{yield Promise.resolve().then((()=>o(n(1724))));const s=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{selected:e.value===t}))),i=(e,t)=>a(void 0,void 0,void 0,(function*(){const n=new URL((0,d.getBaseUri)()).origin,s=yield fetch(`${n}/api/checkout/currency?fromCurrency=${e}&toCurrency=${t}`);if(!s)throw new Error("Failed to fetch config");return yield s.json()})),l=document.createElement("cl-donation-form");l.setAttribute("campaign-id",e.campaignId);const g=()=>Boolean(l.__egHostPageEventSyncDepth);let f,m=[],y=[],v="";const b={},_={};let A=null,E=null,w=null;if(e.config){const{options:t,default:n}=e.config.props.currencies;let i=!1;e.config.props.orgTags&&(i=e.config.props.orgTags.some((e=>"disable-multi-currency"===e.name)));const o=i?t.filter((e=>e.value===n)):t;v=n,E=n,m=JSON.parse(JSON.stringify(e.config.props.donationAmounts)),y=JSON.parse(JSON.stringify(e.config.props.recurringAmounts)),f=e.config.props.minimumDonationAmount;const a=e.config.props.donationFrequencies||[],r=a.find((e=>e.isDefault))||a[0];A=(null==r?void 0:r.name)?r.name:"one-time",e.config.props.currencies=s(o,n)}const S=(e,t,n)=>e.map((e=>Object.assign(Object.assign({},e),{amount:(e.amount*t).toFixed((0,r.getCurrencyDecimalPlaces)(n))}))),C=(t,n)=>{var s,i;return{frequency:t||A||"one-time",currency:n||E||(null===(i=null===(s=e.config)||void 0===s?void 0:s.props.currencies)||void 0===i?void 0:i.default)||"USD"}},x=t=>a(void 0,void 0,void 0,(function*(){if(!e.config)return;const n=v||"USD",o=yield i(n,t);if(e.config.props.donationAmounts=S(m,o.rate,t),e.config.props.recurringAmounts=S(y,o.rate,t),e.config.props.currencies=s(e.config.props.currencies,t),"number"==typeof f){const n=(0,r.getCurrencyDecimalPlaces)(t),s=Number((f*o.rate).toFixed(n));e.config.props.minimumDonationAmount=s}})),I=(e,t)=>a(void 0,void 0,void 0,(function*(){const n={},s=yield i(e,t),o=(0,r.getCurrencyDecimalPlaces)(t);if(Object.entries(b).forEach((([i,a])=>{if(a!==u)return;const r=_[i],l=null==r?void 0:r[e];if("number"!=typeof l)return;const c=Number((l*s.rate).toFixed(o));_[i]||(_[i]={}),_[i][t]=c,n[i]=c})),Object.keys(n).length>0){l.externalCustomAmounts=n}})),k=e.modalSDK.getParams(),R=k.frequency||k.recurring&&p[k.recurring]||k.recurring,O=k.preset1||k.preset2||k.preset3||k.preset4,D=k.currency||R||k.amount||O;if(e.config&&D){if(O){const t=e=>{for(const t of["preset1","preset2","preset3","preset4"]){const n=k[t];if(!n)continue;const s=Number(n);if(isNaN(s)||s<=0)continue;const i=e.find((e=>e.name===t));i&&(i.amount=s)}};t(e.config.props.donationAmounts),t(m),t(e.config.props.recurringAmounts),t(y)}if(k.currency&&k.currency!==E&&(yield x(k.currency),E=k.currency),R){const t=e.config.props.donationFrequencies,n=null==t?void 0:t.some((e=>e.name===R&&e.isVisible));let s=null;if(n)s=R;else if("one-time"!==R){const e=null==t?void 0:t.find((e=>e.isVisible&&"one-time"!==e.name));e&&(s=e.name)}s&&t&&(t.forEach((e=>{e.isDefault=e.name===s})),A=s)}if(k.amount){const t=Number(k.amount);if(!isNaN(t)&&t>0){const n="one-time"===(A||"one-time")?e.config.props.donationAmounts:e.config.props.recurringAmounts;if(n){const e=n.find((e=>Math.round(Number(e.amount))===Math.round(t)));e&&n.forEach((t=>{t.isDefault=t===e}))}}}}if(l.config=e.config.props,e.el.replaceWith(l),e.setReplacement(l),e.config&&k.amount){const t=Number(k.amount);if(!isNaN(t)&&t>0){const n=A||"one-time",s="one-time"===n?e.config.props.donationAmounts:e.config.props.recurringAmounts;if(!(null==s?void 0:s.some((e=>Math.round(Number(e.amount))===Math.round(t))))){const e=E||v||"USD";b[n]=u,_[n]||(_[n]={}),_[n][e]=t,l.externalCustomAmounts={[n]:t}}}}const P=e.config.props,T=A||"one-time",M="one-time"===T?P.donationAmounts||[]:P.recurringAmounts||[],L=M.filter((e=>e.isVisible&&"other"!==e.name)).map((e=>String(e.amount))).join(","),N=(P.donationFrequencies||[]).filter((e=>e.isVisible)).map((e=>e.name)).join(","),F=(Array.isArray(P.currencies)?P.currencies:[]).map((e=>e.value)).join(","),q=M.find((e=>e.isDefault)),j=q?Number(q.amount):0;null===(t=e.hostPageEventInstrumentation)||void 0===t||t.track(c.hostedDonationGridViewedEvent,{campaignId:e.campaignId,data:{donation_amount_default:j,donation_amount_options:L,donation_currency_default:v||"USD",donation_currency_options:F,donation_frequency_default:T,donation_frequency_options:N}}),l.addEventListener("classy-donation-submit",(t=>{var n;t.preventDefault(),t.stopPropagation();const s=t.detail,i=s.frequency||A||"one-time",o="monthly"===i?"Donate monthly":"Donate one time";null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.donateCTAClickedEvent,{campaignId:e.campaignId,data:{donation_amount:parseFloat(s.amount)||0,donation_currency:s.selectedCurrency||E||"USD",donation_frequency:i,link_url:window.location.href,text:o}});const a={};s.frequency&&(a.frequency=s.frequency),s.amount&&(a.amount=s.amount),s.recurringEndDate&&(a.recurringEndDate=s.recurringEndDate),s.selectedCurrency&&(a.currency=s.selectedCurrency),e.modalSDK.open(e.campaignId,a)})),l.addEventListener("frequency_change",(t=>{var n;const s=g(),{from_frequency:i,to_frequency:o}=t.detail;o&&(A=o),!s&&i&&o&&i!==o&&(null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.studioGridFrequencyToggleEvent,{campaignId:e.campaignId,data:{from_frequency:i,to_frequency:o}}))})),l.addEventListener("amount_selected",(t=>{var n;const s=g(),{from_amount:i,to_amount:o,preset_name:a,frequency:r,currency:l}=t.detail||{},{frequency:d,currency:p}=C(r,l);if(!d||null==o)return;let f=a;if(!f&&e.config){const t="string"==typeof o?Number(o):o,n="one-time"===d?e.config.props.donationAmounts:e.config.props.recurringAmounts,s=Math.round(t),i=null==n?void 0:n.find((e=>Math.round(Number(e.amount))===s));f=null==i?void 0:i.name}f||(f=u),b[d]=f;const m=(e=>{if(void 0===e)return null;const t="string"==typeof e?Number(e):e;return Number.isNaN(t)?null:t})(o),y=f===u,v=null!==m;y&&v&&(_[d]||(_[d]={}),_[d][p]=m);const A=y?h:v?((e,t)=>new Intl.NumberFormat("en-US",{currency:t,maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(Math.round(e)))(m,p):null,E=y?h:v?`${p}:${Math.round(m)}`:null;A&&E&&!s&&E!==w&&(w=E,null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.studioGridAmountSelectionEvent,{campaignId:e.campaignId,data:Object.assign(Object.assign({},!y&&v?{donation_amount:m}:{}),{from_amount:i,to_amount:o,value:A})}))})),l.addEventListener("currency_selected",(t=>a(void 0,void 0,void 0,(function*(){var n,s;const i=g();if(!e.config)return;const{from_currency:o,to_currency:a}=t.detail,r=a,d=o||E||v||"USD";if(r&&d!==r){E=r,yield x(r),l.config=(null===(n=e.config)||void 0===n?void 0:n.props)||{},i||null===(s=e.hostPageEventInstrumentation)||void 0===s||s.track(c.studioGridCurrencySelectionEvent,{campaignId:e.campaignId,data:{from_currency:o,to_currency:r}});try{yield I(d,r)}catch(e){}}}))))}catch(e){console.error("Error replacing element with donation form:",e)}})),classyHref:e=>{e.el.addEventListener("click",(t=>{t.preventDefault();const n=e.el.getAttribute("href");if(n){const t=(0,l.extractClassyParamsFromHref)(n);e.modalSDK.open(e.campaignId,t)}}))},default:()=>{console.log("Default strategy: no specific action taken.")}}},1989:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(8392),i=n(2758),o=n(3458);t.default=class{constructor(e){this.destroyed=!1,this.originalElement=null,this.replacementElement=null,this.cleanupCallbacks=new Set,this.resolvedInlineGridDecision=o.DEFAULT_INLINE_GRID_DECISION,this.getInlineGridRenderer=()=>{var e,t;const n=this.props.inlineGridDecision||o.DEFAULT_INLINE_GRID_DECISION,s=null===(e=this.props.inlineGridRenderers)||void 0===e?void 0:e[n.path];return s?(this.resolvedInlineGridDecision=n,s):"legacy"===n.path?(this.resolvedInlineGridDecision=n,i.strategyHandlers.donationForm):(this.resolvedInlineGridDecision=(0,o.makeInlineGridDecision)("legacy","renderer_unavailable"),(null===(t=this.props.inlineGridRenderers)||void 0===t?void 0:t.legacy)||i.strategyHandlers.donationForm)},this.isClassyHref=()=>{const e=this.props.el.getAttribute("href");return!(!e||-1===e.indexOf(s.CLASSY_HREF))},this.props=e,this.applyStrategy()}destroy(){this.destroyed||(this.destroyed=!0,this.cleanupCallbacks.forEach((e=>{try{e()}catch(e){console.warn("[SDK] Renderer cleanup failed:",e)}})),this.cleanupCallbacks.clear(),this.restoreReplacement())}setReplacement(e){this.originalElement=this.props.el,this.replacementElement=e}restoreReplacement(){var e;return!(!this.originalElement||!(null===(e=this.replacementElement)||void 0===e?void 0:e.parentNode))&&(this.replacementElement.parentNode.replaceChild(this.originalElement,this.replacementElement),this.replacementElement=null,!0)}addCleanup(e){this.destroyed?e():this.cleanupCallbacks.add(e)}get campaignId(){return this.props.campaignId}get config(){return this.props.config}get el(){return this.props.el}get modalSDK(){return this.props.modalSDK}get organizationName(){return this.props.organizationName}get pgdid(){return this.props.pgdid}get win(){return this.props.win}get hostPageEventInstrumentation(){return this.props.hostPageEventInstrumentation}get inlineGridDecision(){return this.resolvedInlineGridDecision}get inlineGridProfile(){return this.props.inlineGridProfile}applyStrategy(){var e;return this.isClassyHref()?i.strategyHandlers.classyHref(this):"inline-donation-grid"===(null===(e=this.props.config)||void 0===e?void 0:e.type)?this.getInlineGridRenderer()(this):i.strategyHandlers.default(this)}}},179:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(8392),a=i(n(1989)),r=n(862),l=n(3458);t.default=class{constructor(e){this.elements=[],this.destroyed=!1,this._initOrgElements=()=>{document.querySelectorAll(`a[href*=${o.CLASSY_HREF}]`).forEach((e=>{const t=e.getAttribute("href");if(!t)return;const n=this._extractCampaignId(t);n&&this.elements.push(new a.default({el:e,campaignId:n,config:null,hostPageEventInstrumentation:this.props.hostPageEventInstrumentation,inlineGridDecision:l.DEFAULT_INLINE_GRID_DECISION,inlineGridRenderers:this.props.inlineGridRenderers,win:this.props.win,modalSDK:this.props.modalSDK}))}))},this._extractCampaignId=e=>{if(e.startsWith(`${o.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(o.CLASSY_HREF)}catch(e){return null}},this._initClassyElements=()=>s(this,void 0,void 0,(function*(){const e=document.querySelectorAll(`[${o.CLASSY_ATTR}]`);if(!e.length)return;const t=yield this.props.configs,n=[];e.forEach((e=>{const s=e.getAttribute("id"),i=e.getAttribute(o.CLASSY_ATTR);if(!s||!i)return;const a=t[i];if(!a)return;const r=this.getElementConfig(s,a);n.push({el:e,campaignId:i,campaignConfig:a,config:r,featureFlags:a.featureFlags})}));const s=this.props.inlineGridDecision||(0,l.resolveInlineGridDecision)({featureFlagSets:n.filter((({config:e})=>"inline-donation-grid"===(null==e?void 0:e.type))).map((({featureFlags:e})=>e))});n.forEach((({el:e,campaignId:t,campaignConfig:n,config:i})=>{this.props.modalSDK.setConfig(n),i&&this.elements.push(new a.default({el:e,config:i,campaignId:t,hostPageEventInstrumentation:this.props.hostPageEventInstrumentation,inlineGridDecision:s,inlineGridRenderers:this.props.inlineGridRenderers,inlineGridProfile:n.inlineGridProfile,organizationName:n.organizationName,pgdid:this.props.pgdid,win:this.props.win,modalSDK:this.props.modalSDK}))}))})),this.getElementConfig=(e,t)=>{var n,s;const i=t.components[e];if("inline-donation-grid"===(null==i?void 0:i.type)){const e=(0,r.getComponentSectionByType)("checkout","donation-form",t);if(e)return Object.assign(Object.assign({},i),{props:Object.assign(Object.assign({},i.props),{minimumDonationAmount:t.minimum_donation_amount,donationAmounts:e.props.donationAmounts,donationFrequencies:e.props.donationFrequencies,hideRecurringEndDate:!!(null===(n=t.intelligentAsksConfig)||void 0===n?void 0:n.is_enabled)||e.props.hideRecurringEndDate,recurringAmounts:e.props.recurringAmounts,currencies:t.currency,orgTags:t.orgTags,showRecurringUpsell:!(!(null===(s=t.intelligentAsksConfig)||void 0===s?void 0:s.is_enabled)||200!==t.iaa.status||!t.iaa.data.showRecurringUpsell)})})}return i},this.props=e,this._initElements()}destroy(){this.destroyed||(this.destroyed=!0,this.elements.forEach((e=>{"function"==typeof e.destroy&&e.destroy()})),this.elements=[])}_initElements(){return s(this,void 0,void 0,(function*(){this._initOrgElements(),this._initClassyElements()}))}}},8311:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8369),o=n(8869);t.default=class{constructor(e){this.cache={config:{}},this.destroyed=!1,this.fetchConfigs=(e,t)=>s(this,void 0,void 0,(function*(){const n=e.map((e=>this.fetchConfig(e,t)));return Promise.allSettled(n).then((t=>(t.filter((e=>"rejected"===e.status)).forEach(((t,n)=>{console.error(`Failed to fetch campaign ${e[n]} failed:`,t.reason)})),t.filter((e=>"fulfilled"===e.status)).map((e=>e.value)))))})),this._adjustConfigTheme=e=>{const t=e.theme["--theme-color__brand-primary"],n=t?(0,i.isHexColor)(t)?(0,i.convertRgbToRGBA)((0,i.convertHexToRGB)(t),.1):(0,i.convertRgbToRGBA)(t,.1):"";for(const s in e.components){const o=e.components[s];if("inline-donation-grid"===o.type){const e=o.props;e&&!e.primaryColor&&(e.primaryColor=t),e&&!e.secondaryColor&&(e.secondaryColor=(0,i.convertRgbOrRgbaToHex)(n))}}return e},this._getIAATiles=(e,t)=>{const n=[];for(let t=0;t{e.forEach((e=>{"one-time"===e.name&&(e.isDefault=!t),"one-time"!==e.name&&e.isVisible&&(e.isDefault=null!=t&&t)}))},this._adjustConfigWithIAA=e=>{var t,n,s,i,o,a,r,l;const c=e.iaa;if(200!==c.status)return e;if(!0===e.iaaConfig.useIntelligentAskOnetime||(null===(t=e.intelligentAsksConfig)||void 0===t?void 0:t.is_enabled))for(const t in e.components){const a=e.components[t];if("inline-donation-grid"===a.type){const t=a.props;t.donationAmounts=this._getIAATiles(null!==(n=c.data.suggestedOnetimeAmounts)&&void 0!==n?n:[],Boolean(t.donationAmounts.find((e=>"other"===e.name)))),(null===(s=e.intelligentAsksConfig)||void 0===s?void 0:s.is_enabled)&&this._adjustDefaultFrequency(t.donationFrequencies,c.data.isDefaultRecurring)}if("checkout"===a.type&&a.sections)for(const t in a.sections)if("donation-form"===a.sections[t].type){const n=a.sections[t].props;n.donationAmounts=this._getIAATiles(null!==(i=c.data.suggestedOnetimeAmounts)&&void 0!==i?i:[],Boolean(n.donationAmounts.find((e=>"other"===e.name)))),(null===(o=e.intelligentAsksConfig)||void 0===o?void 0:o.is_enabled)&&this._adjustDefaultFrequency(n.donationFrequencies,c.data.isDefaultRecurring)}}if(!0===e.iaaConfig.useIntelligentAskRecurring||(null===(a=e.intelligentAsksConfig)||void 0===a?void 0:a.is_enabled))for(const t in e.components){const n=e.components[t];if("inline-donation-grid"===n.type){const e=n.props;e.recurringAmounts=this._getIAATiles(null!==(r=c.data.suggestedRecurringAmounts)&&void 0!==r?r:[],Boolean(e.recurringAmounts.find((e=>"other"===e.name))))}if("checkout"===n.type&&n.sections)for(const e in n.sections)if("donation-form"===n.sections[e].type){const t=n.sections[e].props;t.recurringAmounts=this._getIAATiles(null!==(l=c.data.suggestedRecurringAmounts)&&void 0!==l?l:[],Boolean(t.recurringAmounts.find((e=>"other"===e.name))))}}return e},this._setCampaignLocale=e=>{document.cookie=`i18next=${e}`},this.props=e}destroy(){this.destroyed||(this.destroyed=!0,this.cache.config={})}fetchConfig(e,t){var n,i,a;return s(this,void 0,void 0,(function*(){if(this.cache.config[e])return this.cache.config[e];const s=(null===(n=null===window||void 0===window?void 0:window.screen)||void 0===n?void 0:n.height)||0,r=(null===(i=null===window||void 0===window?void 0:window.screen)||void 0===i?void 0:i.width)||0,l=navigator.language,c=new URLSearchParams({published:"1",clickSource:null===(a=null===window||void 0===window?void 0:window.location)||void 0===a?void 0:a.origin,screenHeight:String(s),screenWidth:String(r),locale:l,currency:"USD"});t&&c.append("pgdid",t);const d=new URLSearchParams(this.props.win.location.search);for(const e of["utm_medium","utm_source"]){const t=d.get(e);t&&Array.from(t).length<=255&&c.set(e,t)}const u=new URL((0,o.getBaseUri)()).origin,h=yield this.props.win.fetch(`${u}/api/checkout/sdk-config/campaigns/${e}?${c}`);if(!h.ok)throw new Error("Failed to fetch config");const p=yield h.json();this._setCampaignLocale(p.data.locale||"en");let g=this._adjustConfigTheme(p.data);return g=this._adjustConfigWithIAA(g),this.cache.config[e]=g,g}))}}},5835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKFeatureDecision=t.SDK_FEATURES=void 0,t.SDK_FEATURES={inlineGridIframe:{key:"npo_donate_embedded_cpb_grid",variations:["off","on"]}};t.getSDKFeatureDecision=(e,t)=>{if(null==e)return null;if("object"!=typeof e||Array.isArray(e))return"invalid";const n=e[t.key];return null==n?null:"string"==typeof n&&t.variations.includes(n)?n:"invalid"}},3918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.studioGridCurrencySelectionEvent=t.studioGridAmountSelectionEvent=t.studioGridFrequencyToggleEvent=t.eg3SDKLoadEvent=t.hostedDonationGridViewedEvent=t.studioGridValueSelectedEvent=t.studioGridButtonClickedEvent=t.abandonCartActionEvent=t.donateCTAClickedEvent=void 0;const s=n(1126),i=n(9481);t.donateCTAClickedEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({donation_amount:e.donation_amount,donation_currency:e.donation_currency,donation_frequency:e.donation_frequency,link_url:e.link_url,outbound:!1,text:e.text,tracking_id:"donation grid cta"}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_PRIMARY_CTA_CLICK,mparticleEventName:"Donate CTA Clicked",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.abandonCartActionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({placement:"hosted page",text:e.text,tracking_id:e.tracking_id}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.ABANDON_CART_NUDGE,mparticleEventName:"Button Clicked",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"abandon-cart-nudge"});const o=e=>(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({tracking_id:e.tracking_id}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_INTERACTION,mparticleEventName:e,mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"});t.studioGridButtonClickedEvent=o("Button Clicked"),t.studioGridValueSelectedEvent=o("Value Selected"),t.hostedDonationGridViewedEvent=(0,s.defineHostPageFunnelEvent)({buildMParticleEventInfo:({data:e})=>Object.assign({donation_amount_default:e.donation_amount_default,donation_amount_options:e.donation_amount_options,donation_currency_default:e.donation_currency_default,donation_currency_options:e.donation_currency_options,donation_frequency_default:e.donation_frequency_default,donation_frequency_options:e.donation_frequency_options},e.donation_amount_options_set_id?{donation_amount_options_set_id:e.donation_amount_options_set_id}:{}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_VIEWED,mparticleEventName:"Hosted Donation Grid Viewed",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.eg3SDKLoadEvent=(0,s.defineHostPageFunnelEvent)({flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.EG3_SDK_LOAD,mparticleEventName:"EG3 SDK Loaded",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid",buildMParticleEventInfo:()=>({entry_source:"hosted_checkout"})});t.studioGridFrequencyToggleEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>{return{value:(t=e.to_frequency,"monthly"===t.toLowerCase()?"Monthly":"One-time")};var t},flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_FREQUENCY_CHANGE,mparticleEventName:"Frequency Toggle",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.studioGridAmountSelectionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>Object.assign(Object.assign({},"number"==typeof e.donation_amount?{donation_amount:e.donation_amount}:{}),{tracking_id:"donation amount",value:e.value}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_AMOUNT_CHANGE,mparticleEventName:"Value Selected",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.studioGridCurrencySelectionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({tracking_id:"donation currency",value:e.to_currency}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_CURRENCY_CHANGE,mparticleEventName:"Value Selected",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"})},1126:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createHostPageEventInstrumentation=t.defineHostPageUIElementEvent=t.defineHostPageFunnelEvent=t.defineHostPageEvent=t.HOST_PAGE_EVENT_FLUSH_MODES=void 0;const i=s(n(4060));t.HOST_PAGE_EVENT_FLUSH_MODES={IMMEDIATE:"immediate",MANUAL:"manual"};t.defineHostPageEvent=e=>Object.assign(Object.assign({},e),{tracker:"event"});t.defineHostPageFunnelEvent=e=>Object.assign(Object.assign({},e),{tracker:"funnel"});t.defineHostPageUIElementEvent=e=>Object.assign(Object.assign({},e),{tracker:"ui-element"});class o{constructor(e){this.track=(e,n)=>{var s;const i=e.flushMode===t.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE;return this.getTracker(e.tracker)({campaignId:n.campaignId,componentId:n.componentId,data:n.data,mparticleEventInfo:null===(s=e.buildMParticleEventInfo)||void 0===s?void 0:s.call(e,n),mparticleEventName:e.mparticleEventName,mparticleEventType:e.mparticleEventType,name:e.hostPageEventName,source:e.source},{flush:i})},this.getTracker=e=>"ui-element"===e?this.tracker.trackUIElement:"funnel"===e?this.tracker.trackFunnelEvent:this.tracker.trackEvent,this.tracker=e}}t.default=o;t.createHostPageEventInstrumentation=e=>new o(new i.default(e))},4283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e={}){this.eventsByCampaign={},this.sequence=0,this.record=e=>{const t=this.now(),n=++this.sequence,s=Object.assign(Object.assign({},e),{capturedAt:t,id:`${e.campaignId}:${n}:${t}`,sequence:n});return this.eventsByCampaign[e.campaignId]||(this.eventsByCampaign[e.campaignId]=[]),this.eventsByCampaign[e.campaignId].push(s),s},this.drain=e=>{const t=this.peek(e);return 0===t.length?[]:(delete this.eventsByCampaign[e],t)},this.peek=e=>{const t=this.eventsByCampaign[e];return t?[...t]:[]},this.reset=()=>{this.eventsByCampaign={},this.sequence=0},this.now=e.now||(()=>Date.now())}}},4060:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i{var n;const s=this.queue.record(e);return null===(n=this.sendAnalyticsEvent)||void 0===n||n.call(this,e.name,e.data),t.flush&&this.flush(e.campaignId),s},this.trackEvent=(e,t={})=>this.trackWithMParticleTracker("event",e,t),this.trackFunnelEvent=(e,t={})=>this.trackWithMParticleTracker("funnel",e,t),this.trackUIElement=(e,t={})=>this.trackWithMParticleTracker("ui-element",e,t),this.flush=e=>{const t=this.queue.drain(e);0!==t.length&&this.sendMessage({type:o.HOST_PAGE_EVENTS_MSG_TO_APP,payload:{campaignId:e,events:t}})},this.peek=e=>this.queue.peek(e),this.reset=()=>{this.queue.reset()},this.trackWithMParticleTracker=(e,t,n)=>{const{mparticleEventInfo:i,mparticleEventName:o,mparticleEventType:a=r.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER}=t,l=s(t,["mparticleEventInfo","mparticleEventName","mparticleEventType"]);return this.track(Object.assign(Object.assign({},l),{mparticle:{eventInfo:Object.assign(Object.assign({},i),{surface:r.HOST_PAGE_MPARTICLE_SURFACE}),eventName:o,eventType:a,tracker:e}}),n)},this.queue=e.queue||new a.default,this.sendAnalyticsEvent=e.sendAnalyticsEvent,this.sendMessage=e.sendMessage}}},9481:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HOST_PAGE_MPARTICLE_SURFACE=t.HOST_PAGE_MPARTICLE_EVENT_TYPES=t.HOST_PAGE_EVENT_NAMES=void 0,t.HOST_PAGE_EVENT_NAMES={ABANDON_CART_NUDGE:"abandon_cart_nudge",EG3_SDK_LOAD:"eg3_sdk_load",STUDIO_GRID_AMOUNT_CHANGE:"studio_grid_amount_change",STUDIO_GRID_CURRENCY_CHANGE:"studio_grid_currency_change",STUDIO_GRID_FREQUENCY_CHANGE:"studio_grid_frequency_change",STUDIO_GRID_INTERACTION:"studio_grid_interaction",STUDIO_GRID_PRIMARY_CTA_CLICK:"studio_grid_primary_cta_click",STUDIO_GRID_VIEWED:"studio_grid_viewed"},t.HOST_PAGE_MPARTICLE_EVENT_TYPES={LOCATION:"Location",MEDIA:"Media",NAVIGATION:"Navigation",OTHER:"Other",SEARCH:"Search",SOCIAL:"Social",TRANSACTION:"Transaction",UNKNOWN:"Unknown",USER_CONTENT:"UserContent",USER_PREFERENCE:"UserPreference"},t.HOST_PAGE_MPARTICLE_SURFACE="embedded-sdk"},3458:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveInlineGridDecision=t.DEFAULT_INLINE_GRID_DECISION=t.makeInlineGridDecision=void 0;const s=n(5835);t.makeInlineGridDecision=(e,t)=>Object.freeze({path:e,source:t}),t.DEFAULT_INLINE_GRID_DECISION=(0,t.makeInlineGridDecision)("legacy","no_inline_grid");t.resolveInlineGridDecision=({featureFlagSets:e})=>{const n=(e=>e.map((e=>(0,s.getSDKFeatureDecision)(e,s.SDK_FEATURES.inlineGridIframe))))(e);let i;if(n.length)if(n.some((e=>"invalid"===e)))i=(0,t.makeInlineGridDecision)("legacy","invalid_response");else if(n.some((e=>null===e)))i=(0,t.makeInlineGridDecision)("legacy","provider_fallback");else{const e=n.every((e=>"on"===e));i=(0,t.makeInlineGridDecision)(e?"iframe":"legacy","remote_flag")}else i=t.DEFAULT_INLINE_GRID_DECISION;return i}},3280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeInlineGridIframeRenderer=t.buildInlineGridIframeUrl=void 0;const s=n(8869),i=new Set(["amount","c_src","c_src2","currency","designation","frequency","preset1","preset2","preset3","preset4","recurring","recurringEndDate"]),o="16px",a=(e,t,n)=>{"string"==typeof n&&n.length>0&&e.set(t,n)};t.buildInlineGridIframeUrl=({baseUri:e,campaignId:t,componentId:n,hostSearch:o="",inlineGridProfile:r,params:l,pgdid:c,sdkBuild:d="d01e1d1d",sdkOrigin:u=(0,s.getSdkScriptOrigin)(),sdkRoute:h=(0,s.getIframeRouteReason)(),sdkInstanceId:p})=>{const g=new URL(e),f=g.pathname.replace(/\/$/,"");if(!f.endsWith("/donate/embedded"))throw new Error("Inline grid requires the canonical Whammy embedded route");if(g.pathname=`${f}/grid`,g.hash="",g.search="",g.searchParams.set("cid",t),g.searchParams.set("component_id",n),a(g.searchParams,"pgdid",c),null==r)throw new Error("Inline grid requires a profile");const m=JSON.stringify(r);if(!m)throw new Error("Inline grid profile could not be serialized");g.searchParams.set("grid_profile",m),Object.entries(l).forEach((([e,t])=>{(i.has(e)||e.startsWith("utm_"))&&a(g.searchParams,e,t)})),new URLSearchParams(o).forEach(((e,t)=>{t.startsWith("ff_")&&a(g.searchParams,t,e)})),g.searchParams.set("sdk_build",d),g.searchParams.set("sdk_origin",u),g.searchParams.set("sdk_route",h),g.searchParams.set("sdk_surface","inline-grid"),g.searchParams.set("sdk_instance_id",p);const y=g.toString();if(new Blob([y]).size>8192)throw new Error("Inline grid iframe URL exceeds the 8 KiB limit");return y};t.makeInlineGridIframeRenderer=({fallback:e,getBaseUri:n=s.getIframeBaseUri,getSdkBuild:i=(()=>"d01e1d1d"),getSdkOrigin:a=s.getSdkScriptOrigin,getSdkRoute:r=s.getIframeRouteReason,protocol:l})=>s=>{var c,d;let u;try{const h=s.el.parentNode;if(!h)throw new Error("Inline grid placeholder is detached");const p=l.createInstanceId(s.campaignId,s.el.id),g=(0,t.buildInlineGridIframeUrl)({baseUri:n(),campaignId:s.campaignId,componentId:s.el.id,hostSearch:s.win.location.search,inlineGridProfile:s.inlineGridProfile,params:s.modalSDK.getParams(),pgdid:s.pgdid,sdkBuild:i(),sdkOrigin:a(),sdkRoute:r(),sdkInstanceId:p}),f=s.win.document.createElement("iframe");f.id=s.el.id,f.className=s.el.className,f.setAttribute("loading","eager"),f.name=`eg-inline-grid-iframe--${s.campaignId}--${s.el.id}`,f.referrerPolicy="strict-origin-when-cross-origin",f.src=g,f.title=s.organizationName?`Donate to ${s.organizationName}`:"Donate",f.style.border="0",f.style.borderRadius=o,f.style.display="block",f.style.width="100%",f.style.minWidth="345px",f.style.height="0px";const m=s.win.document.createElement("div");m.style.width="100%",m.style.minWidth="0",m.style.overflowX="auto",m.tabIndex=0,m.setAttribute("role","region"),m.setAttribute("aria-label",f.title),!0===(null===(d=null===(c=s.config)||void 0===c?void 0:c.props)||void 0===d?void 0:d.dropShadow)&&(m.style.borderRadius=o,m.style.boxShadow="0 8px 16px rgb(0 0 0 / 10%)"),m.appendChild(f);let y=!1;const v=()=>{y||(y=!0,null==u||u(),s.restoreReplacement()&&(console.warn("[SDK] Standalone inline grid unavailable; using legacy renderer"),e(s)))};u=l.register({campaignId:s.campaignId,componentId:s.el.id,iframe:f,instanceId:p,onUnavailable:v,targetOrigin:new URL(g).origin}),h.replaceChild(m,s.el),s.setReplacement(m),s.addCleanup(u)}catch(t){null==u||u("grid_error"),console.error("[SDK] Failed to render the standalone inline grid; using legacy:",t),e(s)}}},6244:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i{if(this.destroyed||!(0,o.isInlineGridMessageFromGrid)(e.data))return;const t=e.data,n=this.sessions.get(t.instanceId);n&&e.source===n.iframe.contentWindow&&e.origin===n.targetOrigin&&this.handleTrustedMessage(n,t)},this.handleVisibilityChange=()=>{this.sessions.forEach((e=>this.updateReadyTimeout(e)))},this.hostPageEventInstrumentation=e,this.modalSDK=t,this.readyTimeoutMs=n,this.recordTelemetry=s,this.win=i,this.win.addEventListener("message",this.handleMessage),this.win.document.addEventListener("visibilitychange",this.handleVisibilityChange)}createInstanceId(e,t){this.instanceSequence+=1;return`${e.replace(/[^A-Za-z0-9._:-]/g,"-")}:${t.replace(/[^A-Za-z0-9._:-]/g,"-")}:${this.instanceSequence}`}register(e){if(this.destroyed)return()=>{};this.unregister(e.instanceId);const t=()=>{const t=this.sessions.get(e.instanceId);t&&void 0===t.loadedAt&&(t.loadedAt=this.win.performance.now()),this.sendInitialize(e.instanceId)};e.iframe.addEventListener("load",t);const n=Object.assign(Object.assign({},e),{attemptId:`${this.attemptPrefix}-${++this.attemptSequence}`,startedAt:this.win.performance.now(),wasDeferred:!1,amountByFrequency:{},cleanupLoadListener:()=>e.iframe.removeEventListener("load",t),hasMeasuredHeight:!1,isReady:!1,viewedTracked:!1});this.sessions.set(e.instanceId,n),this.recordGridAttempt(n),this.startReadyTimeout(e.instanceId);const s=this.win.ResizeObserver;if("function"==typeof s){n.resizeObserver=new s((()=>this.updateReadyTimeout(n))),n.resizeObserver.observe(n.iframe);const e=e=>{const t=e.target;"DETAILS"===(null==t?void 0:t.tagName)&&t.contains(n.iframe)&&this.updateReadyTimeout(n)};this.win.document.addEventListener("toggle",e,!0),n.cleanupToggleListener=()=>this.win.document.removeEventListener("toggle",e,!0),this.updateReadyTimeout(n)}return t=>{this.sessions.get(e.instanceId)===n&&(t&&this.recordGridAttempt(n,"fallback",t),this.unregister(e.instanceId))}}syncSelection(e,t){if(this.destroyed)return;const n=(0,o.toInlineGridSelectionUpdate)(t);n&&this.sessions.forEach((t=>{if(!t.isReady||t.campaignId!==e)return;const s=this.normalizeSelectionUpdate(t,n);s&&this.postToGrid(t,(0,o.makeInlineGridMessage)(o.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE,t.instanceId,s))}))}getSelectionParams(e){const t=Array.from(this.sessions.values()).filter((t=>t.campaignId===e&&t.iframe.isConnected));if(this.destroyed||1!==t.length||!t[0].isReady)return;const n=t[0].liveSelection;return n&&null!==n.amount?{amount:String(n.amount),currency:n.currency,frequency:n.frequency}:void 0}destroy(){this.destroyed||(this.destroyed=!0,this.win.removeEventListener("message",this.handleMessage),this.win.document.removeEventListener("visibilitychange",this.handleVisibilityChange),Array.from(this.sessions.keys()).forEach((e=>this.unregister(e))))}handleTrustedMessage(e,t){var n;switch(t.type){case o.INLINE_GRID_MESSAGE_TYPE.ANALYTICS:if(t.payload.campaignId!==e.campaignId)return;return void this.handleAnalytics(e,t.payload);case o.INLINE_GRID_MESSAGE_TYPE.HELLO:return void(t.payload.campaignId===e.campaignId&&(null!==(n=e.helloAt)&&void 0!==n||(e.helloAt=this.win.performance.now()),this.sendInitialize(e.instanceId)));case o.INLINE_GRID_MESSAGE_TYPE.READY:if(t.payload.campaignId!==e.campaignId||e.isReady)return;return e.isReady=!0,e.readyAt=this.win.performance.now(),void this.updateReadyTimeout(e);case o.INLINE_GRID_MESSAGE_TYPE.RESIZE:if(!e.isReady)return;return this.applyHeight(e.iframe,t.payload.height),void(e.hasMeasuredHeight||(this.recordGridAttempt(e,"ready"),e.hasMeasuredHeight=!0,this.stopHeightWatchdog(e),this.trackViewedIfReady(e)));case o.INLINE_GRID_MESSAGE_TYPE.SUBMIT:if(!e.isReady||t.payload.campaignId!==e.campaignId)return;return void this.handleSubmit(e,t.payload);case o.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE:return e.liveSelection=t.payload,void(null!==t.payload.amount?(e.currentSelection=Object.assign(Object.assign(Object.assign({},e.currentSelection),t.payload),{amount:t.payload.amount}),e.amountByFrequency[t.payload.frequency]=t.payload.amount):e.currentSelection=void 0);case o.INLINE_GRID_MESSAGE_TYPE.ERROR:return console.warn("[SDK Inline Grid] Whammy reported a grid error:",{code:t.payload.code,instanceId:e.instanceId,phase:t.payload.phase,reason:t.payload.reason}),void(("initialize"===t.payload.phase||"render"===t.payload.phase||"GRID_SUBMIT_FAILED"===t.payload.code&&"submit"===t.payload.phase&&"selection_invalid"===t.payload.reason)&&this.failSession(e.instanceId));default:return}}handleSubmit(e,t){var n,s;e.currentSelection=t,e.amountByFrequency[t.frequency]=t.amount;const o=Object.assign(Object.assign(Object.assign({amount:String(t.amount),currency:t.currency,frequency:t.frequency,dedication:null!==(s=null===(n=t.dedication)||void 0===n?void 0:n.text)&&void 0!==s?s:""},void 0!==t.dedication&&{dedicationType:t.dedication.type}),void 0!==t.designation&&{designation:String(t.designation)}),void 0!==t.recurringEndDate&&{recurringEndDate:t.recurringEndDate});this.trackBestEffort((()=>{this.hostPageEventInstrumentation.track(i.donateCTAClickedEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{donation_amount:t.amount,donation_currency:t.currency,donation_frequency:t.frequency,link_url:this.win.location.href,text:"monthly"===t.frequency?"Donate monthly":"Donate one time"}})})),this.modalSDK.open(e.campaignId,o)}handleAnalytics(e,t){this.trackBestEffort((()=>{switch(t.action){case"amount_change":{const o="custom"===t.donationType;return void this.hostPageEventInstrumentation.track(i.studioGridAmountSelectionEvent,{campaignId:e.campaignId,componentId:e.componentId,data:Object.assign(Object.assign({},!o&&{donation_amount:t.toAmount}),{from_amount:t.fromAmount,to_amount:t.toAmount,value:o?"Custom":(n=t.toAmount,s=t.currency,new Intl.NumberFormat("en-US",{currency:s,maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(Math.round(n)))})})}case"currency_change":return void this.hostPageEventInstrumentation.track(i.studioGridCurrencySelectionEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{from_currency:t.fromCurrency,to_currency:t.toCurrency}});case"frequency_change":return void this.hostPageEventInstrumentation.track(i.studioGridFrequencyToggleEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{from_frequency:t.fromFrequency,to_frequency:t.toFrequency}});case"interaction":{const n="Button Clicked"===o.INLINE_GRID_INTERACTIONS[t.trackingId]?i.studioGridButtonClickedEvent:i.studioGridValueSelectedEvent;return void this.hostPageEventInstrumentation.track(n,{campaignId:e.campaignId,componentId:e.componentId,data:{tracking_id:t.trackingId}})}case"viewed":return e.viewedEventData={donation_amount_default:t.donation_amount_default,donation_amount_options:t.donation_amount_options,donation_currency_default:t.donation_currency_default,donation_currency_options:t.donation_currency_options,donation_frequency_default:t.donation_frequency_default,donation_frequency_options:t.donation_frequency_options},void this.trackViewedIfReady(e)}var n,s}))}trackViewedIfReady(e){const t=e.viewedEventData;e.isReady&&e.hasMeasuredHeight&&t&&!e.viewedTracked&&(e.viewedTracked=!0,this.trackBestEffort((()=>{this.hostPageEventInstrumentation.track(i.hostedDonationGridViewedEvent,{campaignId:e.campaignId,componentId:e.componentId,data:t})})))}trackBestEffort(e){try{e()}catch(e){}}normalizeSelectionUpdate(e,t){const n=e.currentSelection;if(!n)return e.currentSelection=(0,o.toInlineGridSelection)(t),t;const i=Object.assign({},t),a=n.frequency,r=t.frequency||a;if(t.frequency&&t.frequency!==a){void 0!==t.amount&&(e.amountByFrequency[a]=t.amount);const n=e.amountByFrequency[r];void 0!==n?i.amount=n:delete i.amount}else void 0!==t.amount&&(e.amountByFrequency[r]=t.amount);if(Object.keys(i).forEach((e=>{(0,o.isUnchangedSelectionField)(e,i,n)&&delete i[e]})),0===Object.keys(i).length)return null;const{dedication:l}=i,c=s(i,["dedication"]),d=Object.assign(Object.assign(Object.assign({},n),c),{frequency:r});return null===l?delete d.dedication:void 0!==l&&(d.dedication=l),e.currentSelection=d,i}applyHeight(e,t){const n=`${Math.ceil(t)}px`;e.style.height!==n&&(e.style.height=n)}sendInitialize(e){const t=this.sessions.get(e);t&&!t.isReady&&this.postToGrid(t,(0,o.makeInlineGridMessage)(o.INLINE_GRID_MESSAGE_TYPE.INITIALIZE,e,{campaignId:t.campaignId}))}startReadyTimeout(e){const t=this.sessions.get(e);!t||t.hasMeasuredHeight||t.readyTimeout||(t.readyTimeout=setTimeout((()=>{var t,n;const s=this.sessions.get(e);if(s&&!s.hasMeasuredHeight){if(s.readyTimeout=void 0,this.isHeightWaitSuspended(s))return s.wasDeferred=!0,null===(t=s.resizeObserver)||void 0===t||t.unobserve(s.iframe),void(null===(n=s.resizeObserver)||void 0===n||n.observe(s.iframe));console.warn("[SDK Inline Grid] Grid did not become ready with a measured height before timeout:",{code:"GRID_INITIALIZATION_FAILED",instanceId:e,phase:"initialize"}),this.failSession(e,"timeout")}}),this.readyTimeoutMs))}isHeightWaitSuspended(e){if(!e.resizeObserver)return!1;if("hidden"===this.win.document.visibilityState)return!0;if(!e.isReady)return!1;const t=e.iframe;return!t.isConnected||t.getBoundingClientRect().width<=0||"function"==typeof t.checkVisibility&&!t.checkVisibility()}updateReadyTimeout(e){this.sessions.get(e.instanceId)!==e||e.hasMeasuredHeight||(this.isHeightWaitSuspended(e)?((e.iframe.isConnected||"hidden"===this.win.document.visibilityState)&&(e.wasDeferred=!0),clearTimeout(e.readyTimeout),e.readyTimeout=void 0):this.startReadyTimeout(e.instanceId))}stopHeightWatchdog(e){var t,n;clearTimeout(e.readyTimeout),e.readyTimeout=void 0,null===(t=e.resizeObserver)||void 0===t||t.disconnect(),e.resizeObserver=void 0,null===(n=e.cleanupToggleListener)||void 0===n||n.call(e),e.cleanupToggleListener=void 0}recordGridAttempt(e,t,n){if(!e.hasMeasuredHeight&&this.recordTelemetry)try{const s=t?this.win.performance.now()-e.startedAt:0,i=t?this.getGridDiagnostics(e):void 0;this.recordTelemetry(Object.assign(Object.assign(Object.assign({attemptId:e.attemptId,campaignId:e.campaignId,sdkBuild:"d01e1d1d",phase:t?"result":"start",durationMs:s,wasDeferred:e.wasDeferred},t&&{outcome:t}),n&&{reason:n}),i&&{diagnostics:i}))}catch(e){}}getGridDiagnostics(e){try{const t=e.iframe,n=t.getBoundingClientRect(),s=t=>void 0===t?null:t-e.startedAt;let i="none";return e.isReady?i="ready":void 0!==e.helloAt&&(i="hello"),{handshakeStage:i,loadMs:s(e.loadedAt),helloMs:s(e.helloAt),readyMs:s(e.readyAt),iframeWidth:Math.round(n.width),iframeHeight:Math.round(n.height),iframeConnected:t.isConnected,tabVisible:"visible"===this.win.document.visibilityState,layoutVisible:"function"==typeof t.checkVisibility?t.checkVisibility():null,timeoutMs:this.readyTimeoutMs}}catch(e){return}}failSession(e,t="grid_error"){const n=this.sessions.get(e);if(!n)return;const{onUnavailable:s}=n;this.recordGridAttempt(n,"fallback",t),this.unregister(e),s()}postToGrid(e,t){var n;null===(n=e.iframe.contentWindow)||void 0===n||n.postMessage(t,e.targetOrigin)}unregister(e){const t=this.sessions.get(e);t&&(t.cleanupLoadListener(),this.stopHeightWatchdog(t),this.sessions.delete(e))}}},1791:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUnchangedSelectionField=t.toInlineGridSelection=t.toInlineGridSelectionUpdate=t.makeInlineGridMessage=t.isInlineGridMessageFromGrid=t.INLINE_GRID_INTERACTIONS=t.INLINE_GRID_MESSAGE_TYPE=t.INLINE_GRID_PROTOCOL=void 0,t.INLINE_GRID_PROTOCOL="classy-inline-grid",t.INLINE_GRID_MESSAGE_TYPE={ANALYTICS:"CLASSY_INLINE_GRID_ANALYTICS",ERROR:"CLASSY_INLINE_GRID_ERROR",HELLO:"CLASSY_INLINE_GRID_HELLO",INITIALIZE:"CLASSY_INLINE_GRID_INITIALIZE",READY:"CLASSY_INLINE_GRID_READY",RESIZE:"CLASSY_INLINE_GRID_RESIZE",SELECTION_UPDATE:"CLASSY_INLINE_GRID_SELECTION_UPDATE",SUBMIT:"CLASSY_INLINE_GRID_SUBMIT"},t.INLINE_GRID_INTERACTIONS={"dedication start":"Value Selected","donation: dedication hidden":"Value Selected","donation: dedication start":"Value Selected","donation: ticker dismissed":"Button Clicked","donation ticker dismissed":"Button Clicked"};const n=new Set(["one-time","daily","weekly","bi-weekly","monthly","quarterly","semi-annually","yearly"]),s=new Set(["GRID_INITIALIZATION_FAILED","GRID_NOT_INITIALIZED","GRID_RENDER_FAILED","GRID_RESIZE_FAILED","GRID_SUBMIT_FAILED"]),i=new Set(["initialize","render","resize","submit"]),o=new Set(["campaign_unavailable","configuration_unavailable","height_unavailable","protocol_not_initialized","render_unavailable","selection_invalid","status_failed","unknown"]),a=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),r=(e,t)=>"string"==typeof e&&e.length>0&&e.length<=t,l=e=>r(e,100),c=e=>"string"==typeof e&&/^[A-Z]{3}$/.test(e),d=e=>"number"==typeof e&&Number.isFinite(e)&&e>0,u=e=>"number"==typeof e&&Number.isSafeInteger(e)&&e>0,h=e=>a(e)&&f(e,["text","type"])&&"string"==typeof e.text&&e.text.length>0&&e.text.length<=100&&("honor"===e.type||"memory"===e.type),p=e=>{if("string"!=typeof e)return!1;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return!1;const n=Number(t[1]),s=Number(t[2]),i=Number(t[3]);if(0===n||s<1||s>12)return!1;return i>=1&&i<=[31,n%4==0&&(n%100!=0||n%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][s-1]},g=e=>"string"==typeof e&&n.has(e);function f(e,t){return Object.keys(e).every((e=>t.includes(e)))}const m=e=>!!a(e)&&(e.protocol===t.INLINE_GRID_PROTOCOL&&(e=>r(e,200)&&/^[A-Za-z0-9._:-]+$/.test(e))(e.instanceId)&&"string"==typeof e.type&&a(e.payload)),y=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0;t.isInlineGridMessageFromGrid=e=>{if(!m(e))return!1;const n=e.payload;switch(e.type){case t.INLINE_GRID_MESSAGE_TYPE.ANALYTICS:return(e=>{if(!l(e.campaignId)||"string"!=typeof e.action)return!1;switch(e.action){case"amount_change":return f(e,["action","campaignId","currency","donationType","fromAmount","toAmount"])&&c(e.currency)&&("custom"===e.donationType||"preset"===e.donationType)&&y(e.fromAmount)&&y(e.toAmount);case"currency_change":return f(e,["action","campaignId","fromCurrency","toCurrency"])&&c(e.fromCurrency)&&c(e.toCurrency);case"frequency_change":return f(e,["action","campaignId","fromFrequency","toFrequency"])&&g(e.fromFrequency)&&g(e.toFrequency);case"interaction":return f(e,["action","campaignId","trackingId"])&&"string"==typeof e.trackingId&&Object.prototype.hasOwnProperty.call(t.INLINE_GRID_INTERACTIONS,e.trackingId);case"viewed":return f(e,["action","campaignId","donation_amount_default","donation_amount_options","donation_currency_default","donation_currency_options","donation_frequency_default","donation_frequency_options"])&&y(e.donation_amount_default)&&"string"==typeof e.donation_amount_options&&e.donation_amount_options.length<=2e3&&c(e.donation_currency_default)&&"string"==typeof e.donation_currency_options&&e.donation_currency_options.length<=2e3&&g(e.donation_frequency_default)&&"string"==typeof e.donation_frequency_options&&e.donation_frequency_options.length<=500;default:return!1}})(n);case t.INLINE_GRID_MESSAGE_TYPE.HELLO:case t.INLINE_GRID_MESSAGE_TYPE.READY:return f(n,["campaignId"])&&l(n.campaignId);case t.INLINE_GRID_MESSAGE_TYPE.RESIZE:return f(n,["height"])&&"number"==typeof n.height&&Number.isFinite(n.height)&&n.height>0&&n.height<=2e4;case t.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE:return f(n,["amount","currency","frequency"])&&(null===n.amount||d(n.amount))&&c(n.currency)&&g(n.frequency);case t.INLINE_GRID_MESSAGE_TYPE.SUBMIT:return f(n,["amount","campaignId","currency","dedication","designation","frequency","recurringEndDate"])&&l(n.campaignId)&&(e=>d(e.amount)&&c(e.currency)&&g(e.frequency)&&(void 0===e.dedication||h(e.dedication))&&(void 0===e.designation||u(e.designation))&&(void 0===e.recurringEndDate||"one-time"!==e.frequency&&p(e.recurringEndDate)))(n);case t.INLINE_GRID_MESSAGE_TYPE.ERROR:return f(n,["code","phase","reason"])&&"string"==typeof n.code&&s.has(n.code)&&"string"==typeof n.phase&&i.has(n.phase)&&(void 0===n.reason||"string"==typeof n.reason&&o.has(n.reason));default:return!1}};t.makeInlineGridMessage=(e,n,s)=>({instanceId:n,payload:s,protocol:t.INLINE_GRID_PROTOCOL,type:e});const v=e=>{if("string"!=typeof e&&"number"!=typeof e)return;const t=Number(e);return Number.isFinite(t)&&t>0?t:void 0};t.toInlineGridSelectionUpdate=e=>{const t={},n=v(e.amount),s=v(e.designation);if(void 0!==n&&(t.amount=n),"string"==typeof e.currency&&c(e.currency)&&(t.currency=e.currency),""===e.dedication)t.dedication=null;else if("string"==typeof e.dedication){const n={text:e.dedication,type:"memory"===e.dedicationType?"memory":"honor"};h(n)&&(t.dedication=n)}var i;return void 0!==s&&u(s)&&(t.designation=s),g(e.frequency)&&(t.frequency=e.frequency),"string"==typeof e.recurringEndDate&&(""===(i=e.recurringEndDate)||p(i))&&(t.recurringEndDate=e.recurringEndDate),Object.keys(t).length>0?t:null};t.toInlineGridSelection=e=>{if(void 0!==e.amount&&void 0!==e.currency&&e.frequency)return Object.assign(Object.assign(Object.assign({amount:e.amount,currency:e.currency,frequency:e.frequency},void 0!==e.designation&&{designation:e.designation}),e.dedication?{dedication:e.dedication}:{}),e.recurringEndDate?{recurringEndDate:e.recurringEndDate}:{})};t.isUnchangedSelectionField=(e,t,n)=>{if("dedication"===e){const e=t.dedication,s=n.dedication;return null==e?void 0===s:void 0!==s&&s.text===e.text&&s.type===e.type}return"recurringEndDate"===e?(t.recurringEndDate||void 0)===(n.recurringEndDate||void 0):t[e]===n[e]}},6745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInlineGridTelemetry=void 0;const n=["attemptId","campaignId","sdkBuild","phase","durationMs","wasDeferred","outcome","reason","diagnostics"];t.isInlineGridTelemetry=e=>{var t;if(!e||"object"!=typeof e||Array.isArray(e))return!1;const s=e;return!(!(Object.keys(s).every((e=>n.includes(e)))&&"string"==typeof s.attemptId&&/^[A-Za-z0-9_-]{1,128}$/.test(s.attemptId)&&"string"==typeof s.campaignId&&/^[0-9]{1,32}$/.test(s.campaignId)&&"string"==typeof s.sdkBuild&&/^[A-Za-z0-9._-]{1,128}$/.test(s.sdkBuild)&&"number"==typeof s.durationMs&&Number.isFinite(s.durationMs))||s.durationMs<0||"boolean"!=typeof s.wasDeferred)&&(!!(void 0===s.diagnostics||"result"===s.phase&&((e,t)=>{if(!e||"object"!=typeof e||Array.isArray(e))return!1;const n=e,s=["handshakeStage","loadMs","helloMs","readyMs","iframeWidth","iframeHeight","iframeConnected","tabVisible","layoutVisible","timeoutMs"];if(!Object.keys(n).every((e=>s.includes(e))))return!1;const i=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0;return!(!(["loadMs","helloMs","readyMs"].every((e=>null===n[e]||i(n[e])&&n[e]<=t))&&i(n.iframeWidth)&&i(n.iframeHeight)&&i(n.timeoutMs)&&0!==n.timeoutMs&&"boolean"==typeof n.iframeConnected&&"boolean"==typeof n.tabVisible)||null!==n.layoutVisible&&"boolean"!=typeof n.layoutVisible)&&(null!==n.readyMs?"ready"===n.handshakeStage:null!==n.helloMs?"hello"===n.handshakeStage:"none"===n.handshakeStage)})(s.diagnostics,s.durationMs))&&("start"===s.phase?0===s.durationMs&&void 0===s.outcome&&void 0===s.reason:"result"===s.phase&&("ready"===s.outcome?void 0===s.reason&&(void 0===s.diagnostics||"ready"===(null===(t=s.diagnostics)||void 0===t?void 0:t.handshakeStage)):"fallback"===s.outcome&&["timeout","grid_error"].includes(s.reason))))}},4439:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LifecycleManager=void 0;const r=n(9816),l=n(2048),c=n(8869);t.LifecycleManager=new class{constructor(){this.state="uninitialized",this.currentInstance=null,this.pendingInit=null,this.config={},this.modules={},this.queue=new r.OperationQueue,this.targetWindow=null}init(e={}){return a(this,void 0,void 0,(function*(){return this.pendingInit?this.pendingInit:"initialized"===this.state&&this.currentInstance?(e.onError&&e.onError((0,l.createSDKError)("ALREADY_INITIALIZED","SDK is already initialized")),this.currentInstance):(this.config=e,this.targetWindow=e.win||window,(0,c.setBaseUri)(e.baseUri),this.pendingInit=this.queue.enqueue((()=>a(this,void 0,void 0,(function*(){try{this.state="initializing";const t=yield this.initializeModules();return this.state="initialized",this.currentInstance=t,e.onReady&&e.onReady(),t}catch(t){this.state="uninitialized";const n=t instanceof Error?(0,l.createSDKError)("INIT_FAILED",t.message):(0,l.createSDKError)("INIT_FAILED","Unknown initialization error");throw e.onError&&e.onError(n),n}finally{this.pendingInit=null}})))),this.pendingInit)}))}destroy(){var e;if("uninitialized"!==this.state&&"destroying"!==this.state){this.state="destroying";try{this.cleanupModules(),(null===(e=this.targetWindow)||void 0===e?void 0:e.eg)&&(delete this.targetWindow.eg.modal,delete this.targetWindow.eg.sendAnalyticsEvent),this.currentInstance=null,this.modules={},this.state="uninitialized"}catch(e){this.state="uninitialized"}}}isInitialized(){return"initialized"===this.state}getState(){return this.state}initializeModules(){var e;return a(this,void 0,void 0,(function*(){const t=this.targetWindow,{default:s}=yield Promise.resolve().then((()=>o(n(963)))),{default:i}=yield Promise.resolve().then((()=>o(n(8672)))),{default:a}=yield Promise.resolve().then((()=>o(n(2664)))),{default:r}=yield Promise.resolve().then((()=>o(n(4016)))),{default:l}=yield Promise.resolve().then((()=>o(n(1679)))),{default:c}=yield Promise.resolve().then((()=>o(n(179)))),{default:d}=yield Promise.resolve().then((()=>o(n(1604)))),{createHostPageEventInstrumentation:u}=yield Promise.resolve().then((()=>o(n(1126)))),{makeInlineGridIframeRenderer:h}=yield Promise.resolve().then((()=>o(n(3280)))),{default:p}=yield Promise.resolve().then((()=>o(n(6244)))),{strategyHandlers:g}=yield Promise.resolve().then((()=>o(n(2758)))),f=new s({win:t});this.modules.messenger=f;const m=new i;this.modules.cookiesManager=m;const y=null!==(e=m.getPgdidCookie())&&void 0!==e?e:void 0,v=new a({win:t,cookiesManager:m}),b=v.fetch();this.modules.configService=v;const _=new d({win:t});_.initialize(),_.setupEventListener(),this.modules.analytics=_;const A=new r({getInlineGridParams:e=>{var t;return null===(t=this.modules.inlineGridProtocol)||void 0===t?void 0:t.getSelectionParams(e)},win:t,msg:f,configs:b,pgdid:y,sendAnalyticsEvent:(e,t)=>_.sendEvent(e,t)});this.modules.modalCtrl=A;const E=A.sdk(),w=new p({hostPageEventInstrumentation:A.getHostPageEventInstrumentation(),recordTelemetry:A.recordInlineGridTelemetry,modalSDK:E,win:t});this.modules.inlineGridProtocol=w;const S={iframe:h({fallback:g.donationForm,protocol:w})},C={},x={};f.onDonationChanged((e=>{var t;if(!E.isOpen())return;const{campaignId:n,params:s}=e.data.payload;if(!n)return;if(E.getCampaign()!==n)return;w.syncSelection(n,s);const i=document.querySelector(`cl-donation-form[campaign-id="${n}"]`);if(!i)return;const o=i;(e=>{e.__egHostPageEventSyncDepth=(e.__egHostPageEventSyncDepth||0)+1})(i);try{if(s.currency){const e=("function"==typeof o.getCurrentCurrency?o.getCurrentCurrency():null)||"USD";s.currency!==e&&(o.selectedCurrency=s.currency)}const e=x[n]||o.selectedFrequency||"one-time",i=s.frequency||e,a=s.frequency&&s.frequency!==e;let r=null;if(void 0!==s.amount&&null!==s.amount){const e="string"==typeof s.amount?Number(s.amount):s.amount;!isNaN(e)&&e>0&&(r=e)}if(a){r&&(C[`${n}:${e}`]=r),x[n]=s.frequency,o.selectedFrequency=s.frequency;const t=C[`${n}:${s.frequency}`];t&&(o.selectedAmount=0,o.selectedAmount=t)}else{if(r){C[`${n}:${i}`]=r;const e=null===(t=o.shadowRoot)||void 0===t?void 0:t.querySelector("cl-amount-selector");let s=!1;if(null==e?void 0:e.shadowRoot){e.shadowRoot.querySelectorAll("cl-custom-button").forEach((e=>{const t=e.getAttribute("value");null!==t&&Math.round(Number(t))===Math.round(r)&&(s=!0)}))}o.selectedAmount=0,o.selectedAmount=r,e&&(e.isCustomAmountActive=!s,e.selectedAmount=r),s||(o.externalCustomAmount={frequency:i,amount:r})}s.frequency&&(x[n]=s.frequency,o.selectedFrequency=s.frequency)}}finally{(e=>{Promise.resolve().then((()=>{const t=(e.__egHostPageEventSyncDepth||1)-1;t>0?e.__egHostPageEventSyncDepth=t:delete e.__egHostPageEventSyncDepth}))})(i)}}));const I=u({sendAnalyticsEvent:(e,t)=>_.sendEvent(e,t),sendMessage:f.iframe.sendMessage}),k=new l({win:t,msg:f,modalSDK:E,configs:b,hostPageEventInstrumentation:I});this.modules.abandonCartNudgeTray=k;const R=new c({win:t,modalSDK:E,configs:b,hostPageEventInstrumentation:I,inlineGridRenderers:S,pgdid:y});this.modules.crawler=R;const O=this.createSDKInstance(E,_),D=t.eg;return D&&(D.modal=this.createProxiedModal(E),D.sendAnalyticsEvent=this.createProxiedAnalytics(_)),O}))}createSDKInstance(e,t){return{modal:e,sendAnalyticsEvent:(e,n)=>{if(!this.isInitialized())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");t.sendEvent(e,n)},destroy:()=>this.destroy(),reinit:e=>(this.destroy(),this.initSync(e||this.config)),isInitialized:()=>this.isInitialized()}}initSync(e){return this.init(e),this.currentInstance}createProxiedModal(e){const t=()=>this.isInitialized();return new Proxy(e,{get(e,n){if(!t())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");return e[n]}})}createProxiedAnalytics(e){return(t,n)=>{if(!this.isInitialized())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");e.sendEvent(t,n)}}cleanupModules(){const e=["abandonCartNudgeTray","crawler","inlineGridProtocol","analytics","modalCtrl","configService","cookiesManager","messenger"];for(const t of e){const e=this.modules[t];if(e&&"function"==typeof e.destroy)try{e.destroy()}catch(e){console.error(`[eg] Failed to destroy ${t}:`,e)}}}}},9816:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationQueue=void 0;t.OperationQueue=class{constructor(){this.queue=[],this.processing=!1,this.lastOperationTime=0,this.RAPID_CYCLE_THRESHOLD_MS=100}enqueue(e){return n(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const s={operation:e,resolve:t,reject:n,cancelled:!1};this.queue.push(s),this.trackTiming(),this.processQueue()}))}))}cancelPending(){this.queue.forEach((e=>{e.cancelled=!0,e.reject(new Error("Operation cancelled"))})),this.queue=[]}isRapidCycle(){return Date.now()-this.lastOperationTime0;){const e=this.queue.shift();if(e&&!e.cancelled)try{const t=yield e.operation();e.cancelled||e.resolve(t)}catch(t){e.cancelled||e.reject(t)}}this.processing=!1}}))}}},2048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSDKError=t.createSDKError=void 0;const n=["IFRAME_LOAD_TIMEOUT","INIT_FAILED","ALREADY_INITIALIZED"];class s extends Error{constructor(e,t,n,i){super(t),this.name="SDKError",this.code=e,this.recoverable=n,this.context=i,Object.setPrototypeOf(this,s.prototype)}}t.createSDKError=function(e,t,i){const o=n.includes(e),a=new s(e,t,o,i);return console.error(`[eg] ${e}: ${t}`,i||""),a},t.isSDKError=function(e){return e instanceof s}},9205:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(2681);t.default=class{constructor(){this.isAppReady=!1,this.eventQueue=[],this.register=e=>{this.iframe=e,this.isAppReady&&this._flushQueue()},this.reset=()=>{this.iframe=void 0,this.isAppReady=!1,this.eventQueue=[]},this.sendMessage=e=>{var t;this.isAppReady&&(null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)?this._postMessage(e):this._queueMessage(e)},this._queueMessage=e=>{this.eventQueue.push(e)},this._flushQueue=()=>{var e;if(this.isAppReady&&(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow))for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this._postMessage(e)}},this._postMessage=e=>{var t;(null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)&&this.iframe.contentWindow.postMessage(e,"*")},this.setAppReady=()=>{this.isAppReady=!0},this.sendSDKInitMessage=(e,t)=>{this._postMessage({type:s.SDK_INIT,payload:{safeguardToken:"insectsdofly",iaa:e.iaa,hostUrl:t}}),this._flushQueue()}}}},2681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DONATION_CLOSE_REQUESTED_MSG_TO_APP=t.INLINE_GRID_TELEMETRY_MSG_TO_APP=t.HOST_PAGE_EVENTS_MSG_TO_APP=t.DONATION_PARAMS_UPDATE=t.SDK_INIT=t.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP=t.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP=t.EMBEDDED_APP_VISIBLE=t.DONATION_COMPLETED_MSG_FROM_APP=t.DONATION_CHANGED_MSG_FROM_APP=t.DONATION_READY_MSG_FROM_APP=t.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP=t.ANALYTICS_EVENT_MSG_FROM_APP=t.GA4_INIT_MSG_FROM_APP=void 0,t.GA4_INIT_MSG_FROM_APP="GA4_INIT_MSG_FROM_APP",t.ANALYTICS_EVENT_MSG_FROM_APP="ANALYTICS_EVENT_MSG_FROM_APP",t.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP="TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP",t.DONATION_READY_MSG_FROM_APP="DONATION_READY_MSG_FROM_APP",t.DONATION_CHANGED_MSG_FROM_APP="DONATION_CHANGED_MSG_FROM_APP",t.DONATION_COMPLETED_MSG_FROM_APP="DONATION_COMPLETED_MSG_FROM_APP",t.EMBEDDED_APP_VISIBLE="EMBEDDED_APP_VISIBLE",t.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP="DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP",t.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP="DONATION_CLOSE_CONFIRMED_MSG_FROM_APP",t.SDK_INIT="SDK_INIT",t.DONATION_PARAMS_UPDATE="DONATION_PARAMS_UPDATE",t.HOST_PAGE_EVENTS_MSG_TO_APP="HOST_PAGE_EVENTS_MSG_TO_APP",t.INLINE_GRID_TELEMETRY_MSG_TO_APP="INLINE_GRID_TELEMETRY_MSG_TO_APP",t.DONATION_CLOSE_REQUESTED_MSG_TO_APP="DONATION_CLOSE_REQUESTED_MSG_TO_APP"},963:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=s(n(2179)),o=s(n(9205)),a=n(2681);t.default=class{constructor(e){this.messageListener=null,this.destroyed=!1,this._subscribe=()=>{this.messageListener=e=>{const t=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded","https://giving.classy.org/embedded"].filter((e=>Boolean(e)));if(!(e.origin===this.props.win.location.origin||t.some((t=>t.startsWith(e.origin)))))return void console.warn("Untrusted origin:",e.origin);if(!e.data)return;const{type:n,payload:s}=e.data;n&&s&&this.pubsub.publish({name:n,data:{type:n,payload:s,source:e.source}})},this.props.win.addEventListener("message",this.messageListener)},this.onGA4Init=e=>{this.pubsub.subscribe(a.GA4_INIT_MSG_FROM_APP,e)},this.onAnalyticsEvent=e=>{this.pubsub.subscribe(a.ANALYTICS_EVENT_MSG_FROM_APP,e)},this.onTealiumAnalyticsEvent=e=>{this.pubsub.subscribe(a.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP,e)},this.onDonationReady=e=>{this.pubsub.subscribe(a.DONATION_READY_MSG_FROM_APP,e)},this.onDonationChanged=e=>{this.pubsub.subscribe(a.DONATION_CHANGED_MSG_FROM_APP,e)},this.onDonationCompleted=e=>{this.pubsub.subscribe(a.DONATION_COMPLETED_MSG_FROM_APP,e)},this.onDonationCloseInterceptReady=e=>{this.pubsub.subscribe(a.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP,e)},this.onDonationCloseConfirmed=e=>{this.pubsub.subscribe(a.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP,e)},this.props=e,this.pubsub=new i.default,this.iframe=new o.default,this._subscribe()}destroy(){this.destroyed||(this.destroyed=!0,this.messageListener&&(this.props.win.removeEventListener("message",this.messageListener),this.messageListener=null),this.pubsub.unsubscribeAll(),this.iframe.reset())}}},4016:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(5864)),a=i(n(1127)),r=n(2681),l=n(8392),c=n(1126),d=n(3918),u=n(6745);t.default=class{constructor(e){this.destroyed=!1,this.cachedViews=new Map,this.unopenedPreloads=new Set,this.pendingHostPageEventMessages=new Map,this.pendingInlineGridTelemetry=[],this.eg3SDKLoadTrackedCampaigns=new Set,this.readyCampaigns=new Set,this.closeInterceptReadyCampaigns=new Set,this.reinitializingCampaigns=new Set,this.completedCampaigns=new Set,this.loadedViews=new WeakSet,this.sdk=()=>this.modal.sdk(),this.getHostPageEventInstrumentation=()=>this.hostPageEventInstrumentation,this.recordInlineGridTelemetry=e=>{!this.destroyed&&(0,u.isInlineGridTelemetry)(e)&&(this._flushInlineGridTelemetry(),this.pendingInlineGridTelemetry.length>=100||(this.pendingInlineGridTelemetry.push(e),this._flushInlineGridTelemetry()))},this._flushInlineGridTelemetry=()=>{if(this.pendingInlineGridTelemetry.length&&!this.destroyed)for(const[e,t]of this.cachedViews){const n=t.getIframe();if(!this.readyCampaigns.has(e)||!n.isConnected||!n.contentWindow)continue;const s=this.pendingInlineGridTelemetry.splice(0);try{const e=new URL(n.src).origin;s.forEach((t=>{var s;return null===(s=n.contentWindow)||void 0===s?void 0:s.postMessage({type:r.INLINE_GRID_TELEMETRY_MSG_TO_APP,payload:t},e)}))}catch(e){}return}},this._onLoad=e=>{e.data.campaign&&(this._subscribeToOpenEvent(e),this.modal.open(e.data.campaign,e.data.params))},this._subscribeToOpenEvent=({data:{campaign:e,params:t}})=>s(this,void 0,void 0,(function*(){var n,s;if(!e)return;this.pendingParams=t;const i=void 0!==t.amount||void 0!==t.frequency||void 0!==t.recurring||void 0!==t.currency;this.pendingInlineGridParams=i||null===(s=(n=this.props).getInlineGridParams)||void 0===s?void 0:s.call(n,e),this.view&&this.view.getCampaign()===e?(this._showView(this.view),this._sendDonationParamsUpdate(t)):this.view?(this._deactivateCurrentView(),yield this._activateCampaign(e,t,!0)):yield this._activateCampaign(e,t),this._sendEmbeddedAppVisibleEvent()})),this._activateCampaign=(e,t,n=!1)=>s(this,void 0,void 0,(function*(){yield this.props.configs;const s=this.cachedViews.get(e);s?(this.view=s,this.unopenedPreloads.delete(e),this._showView(this.view),this._registerCachedView(e,this.view,n),this._sendDonationParamsUpdate(t),0===this.unopenedPreloads.size&&this._removePreloadListener()):yield this._appendView(e,t,"visible")})),this._setViewVisibility=(e,t)=>{e.style.display="block",e.style.visibility=t,"visible"===t?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true")},this._showView=e=>{const{body:t}=this.props.win.document;t.style.overflow="hidden",this._setViewVisibility(e,"visible")},this._hideViewOnly=e=>{this._setViewVisibility(e,"hidden")},this._deactivateCurrentView=()=>{if(!this.view)return;const e=this.view.getCampaign();!this.readyCampaigns.has(e)||this.completedCampaigns.has(e)?this._removeView():this._hideViewOnly(this.view)},this._registerCachedView=(e,t,n)=>{n&&this.props.msg.iframe.reset(),this.readyCampaigns.has(e)&&this.props.msg.iframe.setAppReady(),this.props.msg.iframe.register(t.getIframe())},this._handleIframeLoad=e=>s(this,void 0,void 0,(function*(){const t=this.cachedViews.get(e);if(t)if(this.loadedViews.has(t)){if(!this.unopenedPreloads.has(e))if(this.completedCampaigns.delete(e),this.readyCampaigns.delete(e),this.view===t){this.reinitializingCampaigns.add(e);try{this.props.msg.iframe.reset(),this.props.msg.iframe.register(t.getIframe());const n=(yield this.props.configs)[e];if(!n||this.view!==t)return;this.props.msg.iframe.setAppReady(),this.props.msg.iframe.sendSDKInitMessage(n,this.props.win.location.href),this.readyCampaigns.add(e),this._flushHostPageEventMessages(e),this._flushInlineGridTelemetry(),this.pendingParams&&this._sendDonationParamsUpdate(this.pendingParams),this.modal.getIsOpen()&&this._sendEmbeddedAppVisibleEvent()}catch(e){console.warn("[SDK] Failed to reinitialize reloaded iframe:",e)}finally{this.reinitializingCampaigns.delete(e)}}else yield this._initializeInactiveIframe(e,!1)}else this.loadedViews.add(t)})),this._initializeInactiveIframe=(e,t)=>s(this,void 0,void 0,(function*(){try{const n=(yield this.props.configs)[e],s=this.cachedViews.get(e);if(!n||!s||s===this.view||!s.getIframe().contentWindow)return;this._postSDKInitMessage(s,n),t&&(this.readyCampaigns.add(e),this._flushHostPageEventMessages(e),this._flushInlineGridTelemetry())}catch(e){console.warn("[SDK] Failed to initialize inactive iframe:",e)}})),this._postSDKInitMessage=(e,t)=>{var n;null===(n=e.getIframe().contentWindow)||void 0===n||n.postMessage({type:r.SDK_INIT,payload:{safeguardToken:"insectsdofly",iaa:t.iaa,hostUrl:this.props.win.location.href}},"*")},this._handleDonationCompleted=e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source);n&&this.completedCampaigns.add(n)},this._sendHostPageEventMessage=e=>{const t=e.payload.campaignId,n=this.cachedViews.get(t),s=null==n?void 0:n.getIframe();(null==s?void 0:s.contentWindow)&&this.readyCampaigns.has(t)?s.contentWindow.postMessage(e,"*"):this._queueHostPageEventMessage(e)},this._queueHostPageEventMessage=e=>{const t=e.payload.campaignId,n=this.pendingHostPageEventMessages.get(t)||[];n.push(e),this.pendingHostPageEventMessages.set(t,n)},this._flushHostPageEventMessages=e=>{const t=this.cachedViews.get(e),n=null==t?void 0:t.getIframe(),s=this.pendingHostPageEventMessages.get(e);(null==n?void 0:n.contentWindow)&&(null==s?void 0:s.length)&&this.readyCampaigns.has(e)&&(s.forEach((e=>{var t;return null===(t=n.contentWindow)||void 0===t?void 0:t.postMessage(e,"*")})),this.pendingHostPageEventMessages.delete(e))},this._subscribeToHoverEvent=({data:{campaign:e,params:t}})=>s(this,void 0,void 0,(function*(){var n,s;e&&(0===this.cachedViews.size&&(yield this._appendView(e,t,"hidden")),null===(s=null===(n=window.eg)||void 0===n?void 0:n.sendAnalyticsEvent)||void 0===s||s.call(n,"studio_checkout_cta_hover",{campaign:e,params:t}))})),this._subscribeToCloseEvent=({data:{campaign:e}})=>{var t,n;this._hideView(),null===(n=null===(t=window.eg)||void 0===t?void 0:t.sendAnalyticsEvent)||void 0===n||n.call(t,"studio_checkout_close",{campaign:e})},this._hideView=()=>{const{body:e}=this.props.win.document;e.style.overflow="inherit",this.view&&this._hideViewOnly(this.view)},this._removeView=()=>{var e,t;const{body:n}=this.props.win.document;n.style.overflow="inherit";const s=null===(e=this.view)||void 0===e?void 0:e.getCampaign();null===(t=this.view)||void 0===t||t.remove(),s&&(this.cachedViews.delete(s),this.unopenedPreloads.delete(s),this.readyCampaigns.delete(s),this.reinitializingCampaigns.delete(s),this.completedCampaigns.delete(s),this.pendingHostPageEventMessages.delete(s),this.closeInterceptReadyCampaigns.delete(s),this.view&&this.loadedViews.delete(this.view)),this.view=void 0},this._removeAllPreloadedViews=()=>{this.unopenedPreloads.forEach((e=>{const t=this.cachedViews.get(e);null==t||t.remove(),this.cachedViews.delete(e),this.readyCampaigns.delete(e),this.reinitializingCampaigns.delete(e),this.completedCampaigns.delete(e),this.pendingHostPageEventMessages.delete(e),t&&this.loadedViews.delete(t)})),this.unopenedPreloads.clear()},this._removeAllViews=()=>{const e=new Set(this.cachedViews.values());this.view&&e.add(this.view),e.forEach((e=>e.remove())),e.forEach((e=>this.loadedViews.delete(e))),this.cachedViews.clear(),this.unopenedPreloads.clear(),this.readyCampaigns.clear(),this.reinitializingCampaigns.clear(),this.completedCampaigns.clear(),this.pendingHostPageEventMessages.clear(),this.pendingInlineGridTelemetry=[],this.closeInterceptReadyCampaigns.clear(),this.view=void 0},this._removePreloadListener=()=>{this.preloadListener&&(this.props.win.removeEventListener("message",this.preloadListener),this.preloadListener=void 0)},this._getActiveCampaign=()=>{var e;return null===(e=this.view)||void 0===e?void 0:e.getCampaign()},this._getCampaignBySource=e=>{if(e)for(const[t,n]of this.cachedViews)if(n.getIframe().contentWindow===e)return t},this._appendView=(e,t,n)=>s(this,void 0,void 0,(function*(){const{body:s}=this.props.win.document;"visible"===n&&(s.style.overflow="hidden");const i=(yield this.props.configs)[e];this.cachedViews.has(e)?"visible"===n&&(yield this._activateCampaign(e,t)):(this.props.msg.iframe.reset(),this.view=new o.default({campaign:e,params:t,subscribeToCloseEvent:this.modal.close,onIframeLoad:this._handleIframeLoad,config:i,pgdid:this.props.pgdid}),this._setViewVisibility(this.view,n),s.appendChild(this.view),this.cachedViews.set(e,this.view),this.props.msg.iframe.register(this.view.getIframe()))})),this._getPreloadCampaignId=e=>{const t=this.modal.getCampaign();if(t&&e[t])return t;const n=this._getCampaignIdsInDomOrder();for(const t of n)if(e[t])return t;return Object.keys(e)[0]},this._getCampaignIdsInDomOrder=()=>{const e=new Set;return this.props.win.document.querySelectorAll(`[${l.CLASSY_ATTR}], a[href*=${l.CLASSY_HREF}]`).forEach((t=>{const n=t.getAttribute(l.CLASSY_ATTR);if(n)return void e.add(n);if(!(t instanceof HTMLAnchorElement))return;const s=t.getAttribute("href");if(!s)return;const i=this._extractCampaignIdFromHref(s);i&&e.add(i)})),[...e]},this._extractCampaignIdFromHref=e=>{if(e.startsWith(`${l.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(l.CLASSY_HREF)}catch(e){return null}},this._preloadIframes=()=>s(this,void 0,void 0,(function*(){const e=yield this.props.configs,t=this._getPreloadCampaignId(e);if(!t||this.destroyed)return;if(this.view)return;const n=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded","https://giving.classy.org/embedded"].filter((e=>Boolean(e)));this.preloadListener=t=>{var s;if((t.origin===location.origin||n.some((e=>e.startsWith(t.origin))))&&(null===(s=t.data)||void 0===s?void 0:s.type)===r.DONATION_READY_MSG_FROM_APP)for(const n of this.unopenedPreloads){const s=this.cachedViews.get(n);if(!s)continue;const i=s.getIframe();if(i.contentWindow===t.source){const t=e[n];if(t&&i.contentWindow){this._postSDKInitMessage(s,t),this.readyCampaigns.add(n),this._flushHostPageEventMessages(n),this._flushInlineGridTelemetry();const e=this._getActiveCampaign();e&&e!==n||(this.props.msg.iframe.setAppReady(),this.props.msg.iframe.register(i)),this.eg3SDKLoadTrackedCampaigns.has(n)||(this.eg3SDKLoadTrackedCampaigns.add(n),this.hostPageEventInstrumentation.track(d.eg3SDKLoadEvent,{campaignId:n,data:{entry_source:"hosted_checkout"}}))}break}}},this.props.win.addEventListener("message",this.preloadListener);const{body:s}=this.props.win.document;if(this.destroyed||this.view)return;const i=e[t],a=new o.default({campaign:t,params:this.modal.getParams(),subscribeToCloseEvent:this.modal.close,onIframeLoad:this._handleIframeLoad,config:i,pgdid:this.props.pgdid});this._setViewVisibility(a,"hidden"),s.appendChild(a),this.cachedViews.set(t,a),this.unopenedPreloads.add(t)})),this._shouldInterceptClose=()=>{const e=this.modal.getCampaign()||this._getActiveCampaign();return!!e&&this.closeInterceptReadyCampaigns.has(e)},this._sendDonationCloseRequestedEvent=()=>{const e=this.modal.getCampaign()||this._getActiveCampaign(),t=e?this.cachedViews.get(e):this.view,n=null==t?void 0:t.getIframe();e&&(null==n?void 0:n.contentWindow)&&this.readyCampaigns.has(e)?n.contentWindow.postMessage({type:r.DONATION_CLOSE_REQUESTED_MSG_TO_APP,payload:{}},"*"):this.modal.forceClose()},this._sendEmbeddedAppVisibleEvent=()=>{this.props.msg.iframe.sendMessage({type:r.EMBEDDED_APP_VISIBLE,payload:{}})},this._sendDonationParamsUpdate=e=>{this.props.msg.iframe.sendMessage({type:r.DONATION_PARAMS_UPDATE,payload:this.pendingInlineGridParams?{params:Object.assign(Object.assign({},e),this.pendingInlineGridParams),submit:!1}:{params:e}})},this.props=e,this.hostPageEventInstrumentation=(0,c.createHostPageEventInstrumentation)({sendAnalyticsEvent:e.sendAnalyticsEvent,sendMessage:this._sendHostPageEventMessage}),this.modal=new a.default({win:e.win,shouldInterceptClose:this._shouldInterceptClose,onCloseRequested:this._sendDonationCloseRequestedEvent}),this.modal.onLoad(this._onLoad),this.modal.subscribeToOpenEvent(this._subscribeToOpenEvent),this.modal.subscribeToCloseEvent(this._subscribeToCloseEvent),this.modal.subscribeToHoverEvent(this._subscribeToHoverEvent),this.props.msg.onDonationCloseInterceptReady((e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source);n&&this.closeInterceptReadyCampaigns.add(n)})),this.props.msg.onDonationCloseConfirmed((e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source),s=this.modal.getCampaign()||this._getActiveCampaign();n&&s&&n!==s||this.modal.forceClose()})),this.props.msg.onDonationReady((e=>s(this,void 0,void 0,(function*(){var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source),s=this.modal.getCampaign()||this._getActiveCampaign();if(n&&this.unopenedPreloads.has(n))return;if(n&&s&&n!==s)return void(this.cachedViews.get(n)!==this.view&&(yield this._initializeInactiveIframe(n,!0)));const i=n||s;if(!i)return;if(this.reinitializingCampaigns.has(i))return;this.props.msg.iframe.setAppReady();const o=(yield this.props.configs)[i];o&&(this.props.msg.iframe.sendSDKInitMessage(o,this.props.win.location.href),this.readyCampaigns.add(i),this._flushHostPageEventMessages(i),this._flushInlineGridTelemetry(),this.eg3SDKLoadTrackedCampaigns.has(i)||(this.eg3SDKLoadTrackedCampaigns.add(i),this.hostPageEventInstrumentation.track(d.eg3SDKLoadEvent,{campaignId:i,data:{entry_source:"hosted_checkout"}})),this.pendingParams&&this._sendDonationParamsUpdate(this.pendingParams))})))),this.props.msg.onDonationCompleted(this._handleDonationCompleted),this._preloadIframes().catch((e=>{console.warn("[SDK Preload] failed:",e)}))}destroy(){this.destroyed||(this.destroyed=!0,this.modal.getIsOpen()&&this.modal.forceClose(),this._removeAllViews(),this._removePreloadListener(),this.modal.destroy())}}},1127:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MODAL_CLOSE_EVENT=t.MODAL_HOVER_EVENT=t.MODAL_OPEN_EVENT=t.MODAL_LOAD_EVENT=void 0;const i=s(n(2979)),o=s(n(2179));t.MODAL_LOAD_EVENT="load",t.MODAL_OPEN_EVENT="open",t.MODAL_HOVER_EVENT="hover",t.MODAL_CLOSE_EVENT="close";t.default=class{constructor(e){this.destroyed=!1,this.prev=null,this._onNavPopstate=e=>{const{campaign:n}=e.data;n?(this._isOpen=!0,this.pubsub.publish({name:t.MODAL_OPEN_EVENT,data:this.nav.get()})):(this._isOpen=!1,this.pubsub.publish({name:t.MODAL_CLOSE_EVENT,data:this.nav.get()}))},this.open=(e,n)=>{if(this.lockBodyScroll(),this._isOpen)return;this.nav.setClassyParams(e,n);const s=this.nav.get();this.pubsub.publish({name:t.MODAL_OPEN_EVENT,data:Object.assign(Object.assign({},s),{params:Object.assign(Object.assign({},s.params),""===n.dedication&&{dedication:""})})}),this._isOpen=!0},this.subscribeToOpenEvent=e=>this.pubsub.subscribe(t.MODAL_OPEN_EVENT,e),this.close=()=>{var e,t,n,s;this._isOpen&&(null===(t=(e=this.props).shouldInterceptClose)||void 0===t?void 0:t.call(e))?null===(s=(n=this.props).onCloseRequested)||void 0===s||s.call(n):this._close()},this.forceClose=()=>{this._close()},this._close=()=>{this.unlockBodyScroll(),this._isOpen&&(this.nav.removeClassyParams(),this.pubsub.publish({name:t.MODAL_CLOSE_EVENT,data:this.nav.get()}),this._isOpen=!1)},this.subscribeToCloseEvent=e=>this.pubsub.subscribe(t.MODAL_CLOSE_EVENT,e),this.hover=(e,n)=>{this.pubsub.publish({name:t.MODAL_HOVER_EVENT,data:{campaign:e,params:n}})},this.subscribeToHoverEvent=e=>this.pubsub.subscribe(t.MODAL_HOVER_EVENT,e),this.unsubscribe=e=>{this.pubsub.unsubscribe(e)},this.onLoad=e=>{e({name:t.MODAL_LOAD_EVENT,data:this.nav.get()})},this.getParams=()=>this.nav.get().params,this.getCampaign=()=>this.nav.get().campaign,this.__handleKeydown=e=>{"Escape"!==e.key&&27!==e.keyCode||this.close()},this.setConfig=e=>{this.config=e},this.getConfig=()=>this.config,this.getIsOpen=()=>this._isOpen,this.sdk=()=>({open:this.open,close:this.close,hover:this.hover,isOpen:this.getIsOpen,getCampaign:this.getCampaign,getParams:this.getParams,getConfig:this.getConfig,setConfig:this.setConfig,subscribeToOpenEvent:this.subscribeToOpenEvent,subscribeToCloseEvent:this.subscribeToCloseEvent,subscribeToHoverEvent:this.subscribeToHoverEvent,unsubscribe:this.unsubscribe}),this.lockCount=0,this.scrollY=0,this.prev=null,this.props=e,this.nav=new i.default({win:this.props.win}),this.nav.onPopstate(this._onNavPopstate),this.pubsub=new o.default,this._isOpen=!!this.nav.get().campaign,this.props.win.addEventListener("keydown",this.__handleKeydown),document.addEventListener("keydown",this.__handleKeydown)}destroy(){this.destroyed||(this.destroyed=!0,this.nav.destroy(),this.props.win.removeEventListener("keydown",this.__handleKeydown),document.removeEventListener("keydown",this.__handleKeydown),this.pubsub.unsubscribeAll(),this._isOpen=!1)}lockBodyScroll(){this.lockCount+=1,this.lockCount>1||(this.scrollY=window.scrollY||window.pageYOffset||0,this.prev={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,right:document.body.style.right,width:document.body.style.width,overflow:document.body.style.overflow,touchAction:document.body.style.touchAction,overscrollBehavior:document.body.style.overscrollBehavior},document.body.style.position="fixed",document.body.style.top=`-${this.scrollY}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",document.body.style.overflow="hidden",document.body.style.touchAction="none",document.body.style.overscrollBehavior="none")}unlockBodyScroll(){0!==this.lockCount&&(this.lockCount-=1,this.lockCount>0||(this.prev?(document.body.style.position=this.prev.position,document.body.style.top=this.prev.top,document.body.style.left=this.prev.left,document.body.style.right=this.prev.right,document.body.style.width=this.prev.width,document.body.style.overflow=this.prev.overflow,document.body.style.touchAction=this.prev.touchAction,document.body.style.overscrollBehavior=this.prev.overscrollBehavior,this.prev=null):(document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",document.body.style.overflow="",document.body.style.touchAction="",document.body.style.overscrollBehavior=""),window.scrollTo(0,this.scrollY)))}}},5864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(862),i=n(8869);class o extends HTMLElement{constructor(e){super(),this.syncNarrowViewportScale=()=>this._syncNarrowViewportScale(),this.getIframe=()=>this.iframe,this.getCampaign=()=>this.props.campaign,this.getParams=()=>this.props.params,this._bindViewportEvents=()=>{var e;const t=this.ownerDocument.defaultView;null==t||t.addEventListener("resize",this.syncNarrowViewportScale),null===(e=null==t?void 0:t.visualViewport)||void 0===e||e.addEventListener("resize",this.syncNarrowViewportScale)},this._isContentPanelEnabled=()=>{if(!this.props.config)return!1;const e=(0,s.getComponentSectionByType)("checkout","content-pane",this.props.config);return!0===(null==e?void 0:e.props.enabled)},this._unbindEvents=()=>{var e;this.closeBtn.removeEventListener("click",this.props.subscribeToCloseEvent);const t=this.ownerDocument.defaultView;null==t||t.removeEventListener("resize",this.syncNarrowViewportScale),null===(e=null==t?void 0:t.visualViewport)||void 0===e||e.removeEventListener("resize",this.syncNarrowViewportScale)},this._syncNarrowViewportScale=()=>{const e=this.ownerDocument.defaultView,t=this.ownerDocument.documentElement.clientWidth||(null==e?void 0:e.innerWidth)||376;if(t>=376)return this.removeAttribute("data-eg-narrow-viewport"),this.style.removeProperty("--eg-modal-iframe-scale"),this.style.removeProperty("--eg-modal-iframe-layout-width"),void this.style.removeProperty("--eg-modal-iframe-layout-height");const n=t/400;this.setAttribute("data-eg-narrow-viewport",""),this.style.setProperty("--eg-modal-iframe-scale",String(n)),this.style.setProperty("--eg-modal-iframe-layout-width","400px"),this.style.setProperty("--eg-modal-iframe-layout-height",100/n+"%")},this._makeCSS=()=>{const e=document.createElement("style");return e.textContent="\n .eg-modal {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: calc(100dvh - 45px);\n background: rgba(26, 25, 25, 0.8);\n z-index: 2147483645;\n display: flex;\n align-items: center;\n justify-content: center;\n pointer-events: auto;\n padding-top: 45px;\n }\n\n .eg-modal--window {\n position: relative;\n height: 100%;\n min-width: 0;\n max-width: 100vw;\n border-radius: 20px;\n max-height: 680px;\n pointer-events: auto;\n display: flex;\n flex-direction: column;\n }\n\n .eg-modal--close {\n position: absolute;\n top: -36px;\n right: 0px;\n cursor: pointer;\n z-index: 2;\n border: none;\n background: transparent;\n height: 24px;\n color: var(--neutral-100, #FFF);;\n text-align: center;\n font-family: sans-serif;\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color 0.2s ease;\n }\n\n .eg-modal--close:hover {\n opacity: 0.8;\n }\n .eg-modal--close-x {\n font-size: 20px;\n margin-left: 3px;\n margin-bottom: 2px;\n }\n\n .eg-modal--iframe {\n flex: 1;\n width: var(--eg-modal-iframe-layout-width, 100%);\n border: none;\n border-radius: 20px;\n z-index: 1;\n }\n\n :host([data-eg-narrow-viewport]) .eg-modal--iframe {\n align-self: center;\n flex: 0 0 var(--eg-modal-iframe-layout-height, 100%);\n height: var(--eg-modal-iframe-layout-height, 100%);\n max-width: none;\n transform: scale(var(--eg-modal-iframe-scale, 1));\n transform-origin: top center;\n }\n\n .eg-modal--loader {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: zoom-in 0.25s ease;\n background: white;\n border-radius: 20px;\n }\n\n .eg-modal--loader--inner {\n padding: 48px;\n background: white;\n border-radius: 20px;\n text-align: center;\n color: #1B1918;\n }\n\n .eg-modal--loader--title {\n font-size: 1.125em;\n \n }\n\n .eg-modal--loader--body {\n font-size: .85em;\n }\n\n @keyframes zoom-in {\n 0% {\n transform: scale(0.5, 0.5);\n }\n 100% {\n transform: scale(1, 1);\n }\n }\n\n @media (max-width: 783px) {\n .eg-modal--window {\n width: min(440px, 100vw) !important;\n }\n }\n ",e},this._makeHTML=()=>{const e=document.createElement("div");e.setAttribute("class","eg-modal");const t=document.createElement("div");t.setAttribute("class","eg-modal--window");const n=this._isContentPanelEnabled()?"992px":"440px";return t.style.width=n,t.appendChild(this.closeBtn),t.appendChild(this.iframe),t.appendChild(this.loader),e.appendChild(t),e},this._makeIframe=()=>{var e;const t=document.createElement("iframe"),n=(null===(e=this.props.config)||void 0===e?void 0:e.organizationName)?`Donate to ${this.props.config.organizationName}`:"Donate";return t.setAttribute("frameborder","0"),t.setAttribute("allow","payment; clipboard-write; clipboard-read;"),t.setAttribute("allowfullscreen","true"),t.setAttribute("allowpaymentrequest","true"),t.setAttribute("class","eg-modal--iframe"),t.setAttribute("name",`eg-modal-iframe--${this.props.campaign}`),t.setAttribute("src",this._makeIframeSrc()),t.setAttribute("title",n),t},this._makeLoader=()=>{const e=document.createElement("div");return e.setAttribute("class","eg-modal--loader"),e.innerHTML='\n \n
\n
One moment, please
\n
\n ',e},this._makeCloseBtn=()=>{const e=document.createElement("button");return e.innerHTML='Close ×',e.setAttribute("label","Close"),e.setAttribute("class","eg-modal--close"),e.addEventListener("click",this.props.subscribeToCloseEvent),e},this._makeIframeSrc=()=>`${(0,i.getIframeBaseUri)()}/?${new URLSearchParams(Object.assign(Object.assign(Object.assign({cid:this.props.campaign},this.props.params),this.props.pgdid&&{pgdid:this.props.pgdid}),{sdk_build:"d01e1d1d",sdk_origin:(0,i.getSdkScriptOrigin)(),sdk_route:(0,i.getIframeRouteReason)()})).toString()}`,this.props=e;const t=this.attachShadow({mode:"open"});this.loader=this._makeLoader(),this.iframe=this._makeIframe(),this.closeBtn=this._makeCloseBtn(),t.append(this._makeCSS()),t.append(this._makeHTML()),this._syncNarrowViewportScale(),this._bindViewportEvents(),this.iframe.addEventListener("load",(()=>{var e,t;this.loader.remove(),null===(t=(e=this.props).onIframeLoad)||void 0===t||t.call(e,this.props.campaign)}))}disconnectedCallback(){this._unbindEvents()}}t.default=o,customElements.get("eg-modal")||customElements.define("eg-modal",o)},2979:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);ithis.state,this.destroy=()=>{this.props.win.removeEventListener(r,this._onPopstate),this.pubsub.unsubscribeAll()},this.setClassyParams=(e,t)=>{const n=this._getAllParams();delete n.campaign;const i=Object.assign(Object.assign({campaign:e},n),t),{recovery_token:o,cart_recovery_action:a}=i,r=s(i,["recovery_token","cart_recovery_action"]);this._pushState(r),this.state=this._getState(),o&&(this.state.params.recovery_token=o),a&&(this.state.params.cart_recovery_action=a)},this.removeClassyParams=()=>{this._pushState(this.preserveParamsFromMount),this.state=this._getState()},this.onPopstate=e=>{this.pubsub.subscribe(r,e)},this._onPopstate=()=>{this.state=this._getState(),this._removeRecoveryParamsFromParentUrl(),this.pubsub.publish({name:r,data:this.state})},this._getState=()=>({campaign:this._getCampaign(),params:this._getClassyParams()}),this._getCampaign=()=>this._getAllParams()[a.CAMPAIGN_PARAM]||void 0,this._getClassyParams=()=>{const e=this._getAllParams(),t=a.CLASSY_PARAMS.reduce(((t,n)=>{const s=e[n];return s&&(t[n]=s),t}),{}),n=Object.keys(e).filter((e=>e.startsWith("utm_"))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{});return Object.assign(Object.assign({},t),n)},this._collectPreserveEligibleParamsFromUrl=()=>{const e=this._getAllParams(),t=new Set([a.C_SRC_PARAM,a.C_SRC2_PARAM,a.DEDICATION_PARAM,a.DESIGNATION_PARAM,a.RECURRING_END_DATE_PARAM]),n={};for(const s of Object.keys(e)){const i=e[s];if(!i)continue;const o=t.has(s),r=s.startsWith("utm_"),l=a.CLASSY_PARAMS.includes(s);(o||r||!l&&s!==a.CAMPAIGN_PARAM)&&(n[s]=i)}return n},this._getAllParams=()=>{const e=new URLSearchParams(this.props.win.location.search);return Object.fromEntries(e.entries())},this._removeRecoveryParamsFromParentUrl=()=>{const e=new URLSearchParams(this.props.win.location.search);if(!e.has(a.RECOVERY_TOKEN_PARAM)&&!e.has(a.CART_RECOVERY_ACTION_PARAM))return;e.delete(a.RECOVERY_TOKEN_PARAM),e.delete(a.CART_RECOVERY_ACTION_PARAM);const t=e.toString(),{pathname:n,hash:s}=this.props.win.location,i=`${n}${t?`?${t}`:""}${s||""}`;this.props.win.history.replaceState(void 0,"",i)},this._pushState=e=>{const t=this._toQueryStr(e);this.props.win.history.pushState(void 0,"",t)},this._toQueryStr=e=>{const t=Object.keys(e),{pathname:n,hash:s}=this.props.win.location,i=s||"";if(0===t.length)return`${n}${i}`;return`${n}?${t.filter((t=>!!e[t])).map((t=>`${t}=${encodeURIComponent(e[t])}`)).join("&")}${i}`},this.props=e,this.preserveParamsFromMount=this._collectPreserveEligibleParamsFromUrl(),this.state=this._getState(),this._removeRecoveryParamsFromParentUrl(),this.pubsub=new o.default,this.props.win.addEventListener(r,this._onPopstate)}}},1118:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLASSY_PARAMS=t.CART_RECOVERY_ACTION_PARAM=t.RECOVERY_TOKEN_PARAM=t.RECURRING_END_DATE_PARAM=t.DEDICATION_TYPE_PARAM=t.DEDICATION_PARAM=t.DESIGNATION_PARAM=t.C_SRC2_PARAM=t.C_SRC_PARAM=t.UTM_PARAM=t.DONOR_PARAMS=t.COUNTRY=t.ZIP=t.STATE=t.CITY=t.STREET=t.PHONE=t.EMAIL=t.LAST=t.FIRST=t.CURRENCY_PARAM=t.PRESET4_PARAM=t.PRESET3_PARAM=t.PRESET2_PARAM=t.PRESET1_PARAM=t.AMOUNT_PARAM=t.FREQUENCY_PARAM=t.RECURRING_PARAM=t.CAMPAIGN_PARAM=void 0,t.CAMPAIGN_PARAM="campaign",t.RECURRING_PARAM="recurring",t.FREQUENCY_PARAM="frequency",t.AMOUNT_PARAM="amount",t.PRESET1_PARAM="preset1",t.PRESET2_PARAM="preset2",t.PRESET3_PARAM="preset3",t.PRESET4_PARAM="preset4",t.CURRENCY_PARAM="currency",t.FIRST="first",t.LAST="last",t.EMAIL="email",t.PHONE="phone",t.STREET="street",t.CITY="city",t.STATE="state",t.ZIP="zip",t.COUNTRY="country",t.DONOR_PARAMS=[t.FIRST,t.LAST,t.EMAIL,t.PHONE,t.STREET,t.CITY,t.STATE,t.ZIP,t.COUNTRY],t.UTM_PARAM="utm_*",t.C_SRC_PARAM="c_src",t.C_SRC2_PARAM="c_src2",t.DESIGNATION_PARAM="designation",t.DEDICATION_PARAM="dedication",t.DEDICATION_TYPE_PARAM="dedicationType",t.RECURRING_END_DATE_PARAM="recurringEndDate",t.RECOVERY_TOKEN_PARAM="recovery_token",t.CART_RECOVERY_ACTION_PARAM="cart_recovery_action",t.CLASSY_PARAMS=[t.RECURRING_PARAM,t.FREQUENCY_PARAM,t.RECURRING_END_DATE_PARAM,t.AMOUNT_PARAM,t.PRESET1_PARAM,t.PRESET2_PARAM,t.PRESET3_PARAM,t.PRESET4_PARAM,t.CURRENCY_PARAM,t.UTM_PARAM,t.C_SRC_PARAM,t.C_SRC2_PARAM,t.DESIGNATION_PARAM,t.DEDICATION_PARAM,t.RECOVERY_TOKEN_PARAM,t.CART_RECOVERY_ACTION_PARAM,t.DEDICATION_TYPE_PARAM,...t.DONOR_PARAMS]},3386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractClassyParamsFromHref=void 0;const s=n(1118);t.extractClassyParamsFromHref=e=>{const t=new URLSearchParams(e),n={};for(const[e,i]of t.entries())-1!==s.CLASSY_PARAMS.indexOf(e)&&(n[e]=i);return n}},2179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.publish=e=>{const t=this.subscriptions[e.name];t&&Object.keys(t).forEach((n=>{t[n](e)}))},this.subscribe=(e,t)=>{this.subscriptions[e]||(this.subscriptions[e]={});const n=this.generateNextKey();return this.subscriptions[e][n]=t,`${e}.${n}`},this.generateNextKey=()=>{const e=this.currentKey+1;return this.currentKey=e,e},this.currentKey=0,this.subscriptions={}}unsubscribe(e){const[t,n]=e.split(".");return!(!this.subscriptions[t]||!this.subscriptions[t][n])&&(delete this.subscriptions[t][n],!0)}unsubscribeAll(){this.subscriptions={},this.currentKey=0}}},8369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertRgbOrRgbaToHex=t.convertRgbToHex=t.isHexColor=t.convertHexToRGB=t.convertRgbToRGBA=void 0;t.convertRgbToRGBA=(e,t=.1)=>{const n=e.match(/rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/);if(n){return`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})`}return e};t.convertHexToRGB=e=>{let t,n,s;return 3===(e=e.replace(/^#/,"")).length?(t=parseInt(e[0]+e[0],16),n=parseInt(e[1]+e[1],16),s=parseInt(e[2]+e[2],16)):(t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16)),`rgb(${t}, ${n}, ${s})`};t.isHexColor=e=>/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(e);t.convertRgbToHex=e=>{const t=e.match(/rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/);if(!t)throw new Error("Invalid RGB or RGBA string");const n=parseInt(t[1],10),s=parseInt(t[2],10),i=parseInt(t[3],10),o=e=>{const t=e.toString(16);return 1===t.length?"0"+t:t};return`#${o(n)}${o(s)}${o(i)}`};t.convertRgbOrRgbaToHex=(e,t="#FFFFFF")=>{if(!e)return"";const n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!n)throw new Error("Invalid RGB or RGBA format. Expected format: rgb(R, G, B) or rgba(R, G, B, A)");const s=parseInt(n[1],10),i=parseInt(n[2],10),o=parseInt(n[3],10),a=void 0!==n[4]?parseFloat(n[4]):1;if(a<0||a>1)throw new Error("Alpha must be between 0 and 1");const r=e=>{const t=e.toString(16).toUpperCase();return 1===t.length?`0${t}`:t};if(1===a)return`#${r(s)}${r(i)}${r(o)}`;const l=parseInt(t.substring(1,3),16),c=parseInt(t.substring(3,5),16),d=parseInt(t.substring(5,7),16),u=Math.round((1-a)*l+a*s),h=Math.round((1-a)*c+a*i),p=Math.round((1-a)*d+a*o);return`#${r(u)}${r(h)}${r(p)}`}},5318:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrencyDecimalPlaces=t.currencyDecimalMap=void 0,t.currencyDecimalMap=Object.freeze({BIF:0,CLP:0,COP:0,DJF:0,GNF:0,IDR:0,ISK:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0});t.getCurrencyDecimalPlaces=e=>{var n;return null!==(n=t.currencyDecimalMap[e.toUpperCase()])&&void 0!==n?n:2}},8869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSkipAutoInit=t.getSdkScriptOrigin=t.getIframeRouteReason=t.getIframeBaseUri=t.getBaseUri=t.setBaseUri=t.captureBaseUri=t.parseManualInitParam=void 0;let n=null,s=null;const i="/api/checkout/sdk/js/",o="https://giving.classy.org/embedded";function a(e){if(!e)return null;try{const t=new URL(e),n=t.pathname.replace(/\/$/,"");return`${t.origin}${n}`}catch(e){return null}}function r(e){const t=a(e);if(!t)return null;const n=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded",o].filter((e=>Boolean(e))).find((e=>a(e)===t));return n||null}function l(e){if(!e)return!1;try{const t=new URL(e).searchParams.get("manual-init");return"true"===t||"1"===t||""===t}catch(e){return!1}}t.parseManualInitParam=l,t.captureBaseUri=function(e){const t="string"==typeof e?e:"undefined"!=typeof document&&document.currentScript?document.currentScript.src:"";return n=function(e){if(!e)return null;try{const t=new URL(e),n=t.pathname.indexOf(i);if(-1===n)return null;const s=t.pathname.slice(0,n);return r(`${t.origin}${s}`)}catch(e){return null}}(t),n},t.setBaseUri=function(e){s=r(e)},t.getBaseUri=function(){return s||n||"https://giving.gofundme.com/donate/embedded"},t.getIframeBaseUri=function(){return s||"https://giving.gofundme.com/donate/embedded"},t.getIframeRouteReason=function(){return s?"override":"default"},t.getSdkScriptOrigin=function(){return n?n===o?"legacy":"https://giving.gofundme.com/donate/embedded"===n?"monolith":"https://giving.gofundme.com/embedded"===n?"gfm":"none":"none"},t.shouldSkipAutoInit=function(){if("undefined"!=typeof document&&document.currentScript){return l(document.currentScript.src)}return!1}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={id:s,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;(()=>{"use strict";const e=n(4439);const t=n(8869);n(7910),"undefined"!=typeof window&&(0,t.captureBaseUri)();const s="undefined"!=typeof window&&(0,t.shouldSkipAutoInit)();if("undefined"!=typeof window&&(window.eg={init:t=>e.LifecycleManager.init(t),destroy:()=>e.LifecycleManager.destroy(),isInitialized:()=>e.LifecycleManager.isInitialized()},!s)){const t=()=>e.LifecycleManager.init({win:window});"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}})()})();
//# sourceMappingURL=classy-embedded-sdk.js.map