stripe-pwa-elements 3.2.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
- package/dist/cjs/error-FFC4kSs5.js +0 -3
- package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
- package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
- package/dist/cjs/index-Dkb0SxZc.js +4694 -0
- package/dist/cjs/index.cjs.js +0 -1
- package/dist/cjs/ion-icon.cjs.entry.js +22 -13
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/stripe-address-element.cjs.entry.js +41 -26
- package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
- package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
- package/dist/cjs/stripe-elements.cjs.js +31 -5
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
- package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -21
- package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +62 -68
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
- package/dist/collection/components/stripe-modal/stripe-modal.js +18 -7
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +162 -162
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces.js +0 -1
- package/dist/collection/services/address-element-manager.js +3 -4
- package/dist/collection/services/card-element-manager.js +3 -4
- package/dist/collection/services/currency-selector-element-manager.js +3 -4
- package/dist/collection/services/express-checkout-element-manager.js +9 -10
- package/dist/collection/services/factory.js +0 -1
- package/dist/collection/services/interfaces.js +0 -1
- package/dist/collection/services/link-authentication-element-manager.js +3 -4
- package/dist/collection/services/payment-element-manager.js +4 -5
- package/dist/collection/services/stripe-service.js +27 -10
- package/dist/collection/utils/element-finder.js +2 -3
- package/dist/collection/utils/error.js +0 -1
- package/dist/collection/utils/i18n.js +0 -1
- package/dist/collection/utils/platform.js +0 -1
- package/dist/collection/utils/test-setup.js +0 -1
- package/dist/collection/utils/utils.js +2 -3
- package/dist/components/error.js +1 -16
- package/dist/components/factory.js +1 -3736
- package/dist/components/icon.js +1 -459
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -4
- package/dist/components/index2.js +1 -192
- package/dist/components/ion-icon.js +1 -9
- package/dist/components/stripe-address-element.js +1 -327
- package/dist/components/stripe-card-element-modal.js +1 -174
- package/dist/components/stripe-card-element.js +1 -9
- package/dist/components/stripe-card-element2.js +1 -440
- package/dist/components/stripe-currency-selector.js +1 -218
- package/dist/components/stripe-express-checkout-element.js +1 -332
- package/dist/components/stripe-link-authentication-element.js +1 -256
- package/dist/components/stripe-modal.js +1 -9
- package/dist/components/stripe-modal2.js +1 -112
- package/dist/components/stripe-payment-element.js +1 -510
- package/dist/components/stripe-payment-request-button.js +1 -9
- package/dist/components/stripe-payment-request-button2.js +1 -224
- package/dist/components/utils.js +1 -89
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/error-XRfh5Wrs.js +0 -3
- package/dist/esm/{factory-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
- package/dist/esm/index-C6bbmyga.js +4677 -0
- package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
- package/dist/esm/index.js +0 -1
- package/dist/esm/ion-icon.entry.js +22 -13
- package/dist/esm/loader.js +3 -4
- package/dist/esm/stripe-address-element.entry.js +41 -26
- package/dist/esm/stripe-card-element-modal.entry.js +6 -7
- package/dist/esm/stripe-card-element_2.entry.js +129 -72
- package/dist/esm/stripe-currency-selector.entry.js +20 -10
- package/dist/esm/stripe-elements.js +32 -6
- package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
- package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
- package/dist/esm/stripe-payment-element.entry.js +283 -167
- package/dist/esm/stripe-payment-request-button.entry.js +27 -15
- package/dist/stripe-elements/index.esm.js +0 -2
- package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
- package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
- package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
- package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
- package/dist/stripe-elements/p-74de1556.entry.js +1 -0
- package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
- package/dist/stripe-elements/p-840d499f.entry.js +1 -0
- package/dist/stripe-elements/p-C6bbmyga.js +2 -0
- package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
- package/dist/stripe-elements/p-CrjrbGJ3.js +1 -0
- package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
- package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
- package/dist/stripe-elements/p-ae0c336e.entry.js +1 -0
- package/dist/stripe-elements/p-cfd8e081.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -2
- package/dist/stripe-elements/svg/.gitignore +4 -0
- package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -1
- package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
- package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
- package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
- package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
- package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -2
- package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
- package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +14 -1
- package/dist/types/components.d.ts +139 -29
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/interfaces.d.ts +4 -3
- package/dist/types/services/stripe-service.d.ts +8 -4
- package/dist/types/stencil-public-runtime.d.ts +110 -5
- package/package.json +50 -30
- package/readme.md +386 -133
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/error-FFC4kSs5.js.map +0 -1
- package/dist/cjs/factory-CbbbSvkg.js.map +0 -1
- package/dist/cjs/index-BXVW_rzh.js +0 -1932
- package/dist/cjs/index-BXVW_rzh.js.map +0 -1
- package/dist/cjs/index-Ba1pBePA.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-elements.cjs.js.map +0 -1
- package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
- package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces.js.map +0 -1
- package/dist/collection/services/address-element-manager.js.map +0 -1
- package/dist/collection/services/card-element-manager.js.map +0 -1
- package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
- package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
- package/dist/collection/services/factory.js.map +0 -1
- package/dist/collection/services/interfaces.js.map +0 -1
- package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
- package/dist/collection/services/payment-element-manager.js.map +0 -1
- package/dist/collection/services/stripe-service.js.map +0 -1
- package/dist/collection/utils/element-finder.js.map +0 -1
- package/dist/collection/utils/error.js.map +0 -1
- package/dist/collection/utils/i18n.js.map +0 -1
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/collection/utils/test-setup.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/error.js.map +0 -1
- package/dist/components/factory.js.map +0 -1
- package/dist/components/icon.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index2.js.map +0 -1
- package/dist/components/ion-icon.js.map +0 -1
- package/dist/components/stripe-address-element.js.map +0 -1
- package/dist/components/stripe-card-element-modal.js.map +0 -1
- package/dist/components/stripe-card-element.js.map +0 -1
- package/dist/components/stripe-card-element2.js.map +0 -1
- package/dist/components/stripe-currency-selector.js.map +0 -1
- package/dist/components/stripe-express-checkout-element.js.map +0 -1
- package/dist/components/stripe-link-authentication-element.js.map +0 -1
- package/dist/components/stripe-modal.js.map +0 -1
- package/dist/components/stripe-modal2.js.map +0 -1
- package/dist/components/stripe-payment-element.js.map +0 -1
- package/dist/components/stripe-payment-request-button.js.map +0 -1
- package/dist/components/stripe-payment-request-button2.js.map +0 -1
- package/dist/components/utils.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/error-XRfh5Wrs.js.map +0 -1
- package/dist/esm/factory-Drde6-y7.js.map +0 -1
- package/dist/esm/index-BHDCxQOb.js.map +0 -1
- package/dist/esm/index-DJwTOfxZ.js +0 -1920
- package/dist/esm/index-DJwTOfxZ.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/ion-icon.entry.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/stripe-address-element.entry.js.map +0 -1
- package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
- package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
- package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
- package/dist/esm/stripe-elements.js.map +0 -1
- package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
- package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
- package/dist/stripe-elements/index.esm.js.map +0 -1
- package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
- package/dist/stripe-elements/loader.esm.js.map +0 -1
- package/dist/stripe-elements/p-02f6e421.entry.js +0 -2
- package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
- package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
- package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
- package/dist/stripe-elements/p-4d505729.entry.js +0 -2
- package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
- package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
- package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
- package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
- package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
- package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
- package/dist/stripe-elements/p-9aee2b6b.entry.js.map +0 -1
- package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
- package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
- package/dist/stripe-elements/p-DI2vmGaI.js +0 -2
- package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
- package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
- package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
- package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
- package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
- package/dist/stripe-elements/p-ba251393.entry.js +0 -2
- package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
- package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
- package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
- package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
- package/dist/stripe-elements/p-e8bb43ae.entry.js.map +0 -1
- package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as t}from"./p-C6bbmyga.js";import{l as e}from"./p-CBXaOfXU.js";const i=t=>Object.keys(u).filter((e=>u[e](t))),s=t=>!!l(t,/iPad/i)||!(!l(t,/Macintosh/i)||!r(t)),n=t=>l(t,/android|sink/i),r=t=>c(t,"(any-pointer:coarse)"),o=t=>a(t)||h(t),a=t=>!!(t.cordova||t.phonegap||t.PhoneGap),h=t=>{const e=t.Capacitor;return!(!e||!e.isNative)},l=(t,e)=>e.test(t.navigator.userAgent),c=(t,e)=>t.matchMedia(e).matches,u={ipad:s,iphone:t=>l(t,/iPhone/i),ios:t=>l(t,/iPhone|iPod/i)||s(t),android:n,phablet:t=>{const e=t.innerWidth,i=t.innerHeight,s=Math.min(e,i),n=Math.max(e,i);return s>390&&s<520&&n>620&&n<800},tablet:t=>{const e=t.innerWidth,i=t.innerHeight,r=Math.min(e,i),o=Math.max(e,i);return s(t)||(t=>n(t)&&!l(t,/mobile/i))(t)||r>460&&r<820&&o>780&&o<1400},cordova:a,capacitor:h,electron:t=>l(t,/electron/i),pwa:t=>!(!t.matchMedia("(display-mode: standalone)").matches&&!t.navigator.standalone),mobile:r,mobileweb:t=>r(t)&&!o(t),desktop:t=>!r(t),hybrid:o},d=()=>{const t=((t=window)=>{if(void 0===t)return[];t.Ionic=t.Ionic||{};let e=t.Ionic.platforms;return null==e&&(e=t.Ionic.platforms=i(t),e.forEach((e=>t.document.documentElement.classList.add(`plt-${e}`)))),e})(undefined);return t.includes("ios")?"ios":t.includes("android")?"android":void 0},f=t=>"string"==typeof t,p=()=>{let t,e;const i=new Promise(((i,s)=>{t=i,e=s}));return i.resolve=t,i.reject=e,i},g=t=>null==t?"":""+t,m=/###/g,y=t=>t&&t.indexOf("###")>-1?t.replace(m,"."):t,v=t=>!t||f(t),w=(t,e,i)=>{const s=f(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(v(t))return{};const e=y(s[n]);!t[e]&&i&&(t[e]=new i),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++n}return v(t)?{}:{obj:t,k:y(s[n])}},b=(t,e,i)=>{const{obj:s,k:n}=w(t,e,Object);if(void 0!==s||1===e.length)return void(s[n]=i);let r=e[e.length-1],o=e.slice(0,e.length-1),a=w(t,o,Object);for(;void 0===a.obj&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=w(t,o,Object),a?.obj&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=i},S=(t,e)=>{const{obj:i,k:s}=w(t,e);if(i&&Object.prototype.hasOwnProperty.call(i,s))return i[s]},$=(t,e,i)=>{for(const s in e)"__proto__"!==s&&"constructor"!==s&&(s in t?f(t[s])||t[s]instanceof String||f(e[s])||e[s]instanceof String?i&&(t[s]=e[s]):$(t[s],e[s],i):t[s]=e[s]);return t},k=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var x={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const C=t=>f(t)?t.replace(/[&<>"'\/]/g,(t=>x[t])):t,j=[" ",",","?","!",";"],O=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}(20),E=(t,e,i=".")=>{if(!t)return;if(t[e]){if(!Object.prototype.hasOwnProperty.call(t,e))return;return t[e]}const s=e.split(i);let n=t;for(let t=0;t<s.length;){if(!n||"object"!=typeof n)return;let e,r="";for(let o=t;o<s.length;++o)if(o!==t&&(r+=i),r+=s[o],e=n[r],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&o<s.length-1)continue;t+=o-t+1;break}n=e}return n},N=t=>t?.replace(/_/g,"-"),M={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class L{constructor(t,e={}){this.init(t,e)}init(t,e={}){this.prefix=e.prefix||"i18next:",this.logger=t||M,this.options=e,this.debug=e.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,i,s){return s&&!this.debug?null:(f(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new L(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new L(this.logger,t)}}var P=new L;class z{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const i=this.observers[t].get(e)||0;this.observers[t].set(e,i+1)})),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t,...e){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,i])=>{for(let s=0;s<i;s++)t(...e)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([i,s])=>{for(let n=0;n<s;n++)i.apply(i,[t,...e])}))}}class A extends z{constructor(t,e={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,i,s={}){const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,r=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;t.indexOf(".")>-1?o=t.split("."):(o=[t,e],i&&(Array.isArray(i)?o.push(...i):f(i)&&n?o.push(...i.split(n)):o.push(i)));const a=S(this.data,o);return!a&&!e&&!i&&t.indexOf(".")>-1&&(t=o[0],e=o[1],i=o.slice(2).join(".")),!a&&r&&f(i)?E(this.data?.[t]?.[e],i,n):a}addResource(t,e,i,s,n={silent:!1}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let o=[t,e];i&&(o=o.concat(r?i.split(r):i)),t.indexOf(".")>-1&&(o=t.split("."),s=e,e=o[1]),this.addNamespaces(e),b(this.data,o,s),n.silent||this.emit("added",t,e,i,s)}addResources(t,e,i,s={silent:!1}){for(const s in i)(f(i[s])||Array.isArray(i[s]))&&this.addResource(t,e,s,i[s],{silent:!0});s.silent||this.emit("added",t,e,i)}addResourceBundle(t,e,i,s,n,r={silent:!1,skipCopy:!1}){let o=[t,e];t.indexOf(".")>-1&&(o=t.split("."),s=i,i=e,e=o[1]),this.addNamespaces(e);let a=S(this.data,o)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?$(a,i,n):a={...a,...i},b(this.data,o,a),r.silent||this.emit("added",t,e,i)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var R={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,i,s,n){return t.forEach((t=>{e=this.processors[t]?.process(e,i,s,n)??e})),e}};const T=Symbol("i18next/PATH_KEY");function I(t,e){const{[T]:i}=t(function(){const t=[],e=Object.create(null);let i;return e.get=(s,n)=>(i?.revoke?.(),n===T?t:(t.push(n),i=Proxy.revocable(s,e),i.proxy)),Proxy.revocable(Object.create(null),e).proxy}()),s=e?.keySeparator??".",n=e?.nsSeparator??":";if(i.length>1&&n){const t=e?.ns,r=Array.isArray(t)?t:null;if(r&&r.length>1&&r.slice(1).includes(i[0]))return`${i[0]}${n}${i.slice(1).join(s)}`}return i.join(s)}const F={},V=t=>!f(t)&&"boolean"!=typeof t&&"number"!=typeof t;class D extends z{constructor(t,e={}){var i,s;super(),i=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{i[t]&&(s[t]=i[t])})),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,e={interpolation:{}}){const i={...e};if(null==t)return!1;const s=this.resolve(t,i);if(void 0===s?.res)return!1;const n=V(s.res);return!1!==i.returnObjects||!n}extractFromKey(t,e){let i=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const s=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let n=e.ns||this.options.defaultNS||[];const r=i&&t.indexOf(i)>-1,o=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,i)=>{e=e||"",i=i||"";const s=j.filter((t=>e.indexOf(t)<0&&i.indexOf(t)<0));if(0===s.length)return!0;const n=O.getRegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let r=!n.test(t);if(!r){const e=t.indexOf(i);e>0&&!n.test(t.substring(0,e))&&(r=!0)}return r})(t,i,s));if(r&&!o){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:f(n)?[n]:n};const r=t.split(i);(i!==s||i===s&&this.options.ns.indexOf(r[0])>-1)&&(n=r.shift()),t=r.join(s)}return{key:t,namespaces:f(n)?[n]:n}}translate(t,e,i){let s="object"==typeof e?{...e}:e;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";"function"==typeof t&&(t=I(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?I(t,{...this.options,...s}):String(t)));const n=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],s),h=a[a.length-1];let l=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const c=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return u?n?{res:`${h}${l}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:`${h}${l}${o}`:n?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:o;const d=this.resolve(t,s);let p=d?.res;const g=d?.usedKey||o,m=d?.exactUsedKey||o,y=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=void 0!==s.count&&!f(s.count),b=D.hasDefaultValue(s),S=w?this.pluralResolver.getSuffix(c,s.count,s):"",$=s.ordinal&&w?this.pluralResolver.getSuffix(c,s.count,{ordinal:!1}):"",k=w&&!s.ordinal&&0===s.count,x=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${S}`]||s[`defaultValue${$}`]||s.defaultValue;let C=p;v&&!p&&b&&(C=x);const j=V(C),O=Object.prototype.toString.apply(C);if(!(v&&C&&j&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||f(y)&&Array.isArray(C))if(v&&f(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,s,i));else{let e=!1,n=!1;!this.isValidLookup(p)&&b&&(e=!0,p=x),this.isValidLookup(p)||(n=!0,p=o);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:p,u=b&&x!==p&&this.options.updateMissing;if(n||e||u){if(this.logger.log(u?"updateKey":"missingKey",c,h,o,u?x:p),r){const t=this.resolve(o,{...s,keySeparator:!1});t&&t.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 t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let i=0;i<e.length;i++)t.push(e[i]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const i=(t,e,i)=>{const n=b&&i!==p?i:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,e,n,u,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,e,n,u,s),this.emit("missingKey",t,h,e,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?t.forEach((t=>{const e=this.pluralResolver.getSuffixes(t,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&e.indexOf(`${this.options.pluralSeparator}zero`)<0&&e.push(`${this.options.pluralSeparator}zero`),e.forEach((e=>{i([t],o+e,s[`defaultValue${e}`]||x)}))})):i(t,o,x))}p=this.extendTranslation(p,t,s,d,i),n&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${h}${l}${o}`),(n||e)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${l}${o}`:o,e?p:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,C,{...s,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return n?(d.res=t,d.usedParams=this.getUsedParamsDetails(s),d):t}if(r){const t=Array.isArray(C),e=t?[]:{},i=t?m:g;for(const t in C)if(Object.prototype.hasOwnProperty.call(C,t)){const n=`${i}${r}${t}`;e[t]=this.translate(n,b&&!p?{...s,defaultValue:V(x)?x[t]:void 0,joinArrays:!1,ns:a}:{...s,joinArrays:!1,ns:a}),e[t]===n&&(e[t]=C[t])}p=e}}return n?(d.res=p,d.usedParams=this.getUsedParamsDetails(s),d):p}extendTranslation(t,e,i,s,n){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const r=f(t)&&(void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let o;if(r){const e=t.match(this.interpolator.nestingRegexp);o=e&&e.length}let a=i.replace&&!f(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,i.lng||this.language||s.usedLng,i),r){const e=t.match(this.interpolator.nestingRegexp);o<(e&&e.length)&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),!1!==i.nest&&(t=this.interpolator.nest(t,((...t)=>n?.[0]!==t[0]||i.context?this.translate(...t,e):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${e[0]}`),null)),i)),i.interpolation&&this.interpolator.reset()}const r=i.postProcess||this.options.postProcess,o=f(r)?[r]:r;return null!=t&&o?.length&&!1!==i.applyPostProcessor&&(t=R.handle(o,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,e={}){let i,s,n,r,o;return f(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?I(t,{...this.options,...e}):t))),t.forEach((t=>{if(this.isValidLookup(i))return;const a=this.extractFromKey(t,e),h=a.key;s=h;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==e.count&&!f(e.count),u=c&&!e.ordinal&&0===e.count,d=void 0!==e.context&&(f(e.context)||"number"==typeof e.context)&&""!==e.context,p=e.lngs?e.lngs:this.languageUtils.toResolveHierarchy(e.lng||this.language,e.fallbackLng);l.forEach((t=>{this.isValidLookup(i)||(o=t,F[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(F[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${s}" 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((s=>{if(this.isValidLookup(i))return;r=s;const o=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,h,s,t,e);else{let t;c&&(t=this.pluralResolver.getSuffix(s,e.count,e));const i=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(e.ordinal&&0===t.indexOf(n)&&o.push(h+t.replace(n,this.options.pluralSeparator)),o.push(h+t),u&&o.push(h+i)),d){const s=`${h}${this.options.contextSeparator||"_"}${e.context}`;o.push(s),c&&(e.ordinal&&0===t.indexOf(n)&&o.push(s+t.replace(n,this.options.pluralSeparator)),o.push(s+t),u&&o.push(s+i))}}let a;for(;a=o.pop();)this.isValidLookup(i)||(n=a,i=this.getResource(s,t,a,e))})))}))})),{res:i,usedKey:s,exactUsedKey:n,usedLng:r,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,i,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,e,i,s):this.resourceStore.getResource(t,e,i,s)}getUsedParamsDetails(t={}){const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!f(t.replace);let s=i?t.replace:t;if(i&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const t of e)delete s[t]}return s}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}class B{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(t){if(!(t=N(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=N(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(f(t)&&t.indexOf("-")>-1){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(t){}return e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const i=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(i)||(e=i)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const i=this.getScriptPartFromCode(t);if(this.isSupportedCode(i))return e=i;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return e=s;e=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:t.indexOf("-")>0&&s.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===s||0===t.indexOf(s)&&s.length>1?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),f(t)&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let i=t[e];return i||(i=t[this.getScriptPartFromCode(e)]),i||(i=t[this.formatLanguageCode(e)]),i||(i=t[this.getLanguagePartFromCode(e)]),i||(i=t.default),i||[]}toResolveHierarchy(t,e){const i=this.getFallbackCodes((!1===e?[]:e)||this.options.fallbackLng||[],t),s=[],n=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return f(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(t))):f(t)&&n(this.formatLanguageCode(t)),i.forEach((t=>{s.indexOf(t)<0&&n(this.formatLanguageCode(t))})),s}}const K={zero:0,one:1,two:2,few:3,many:4,other:5},U={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _{constructor(t,e={}){this.languageUtils=t,this.options=e,this.logger=P.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,e={}){const i=N("dev"===t?"en":t),s=e.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:i,type:s});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let r;try{r=new Intl.PluralRules(i,{type:s})}catch(i){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),U;if(!t.match(/-|_/))return U;const s=this.languageUtils.getLanguagePartFromCode(t);r=this.getRule(s,e)}return this.pluralRulesCache[n]=r,r}needsPlural(t,e={}){let i=this.getRule(t,e);return i||(i=this.getRule("dev",e)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,e,i={}){return this.getSuffixes(t,i).map((t=>`${e}${t}`))}getSuffixes(t,e={}){let i=this.getRule(t,e);return i||(i=this.getRule("dev",e)),i?i.resolvedOptions().pluralCategories.sort(((t,e)=>K[t]-K[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,e,i={}){const s=this.getRule(t,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(e)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",e,i))}}const H=(t,e,i,s=".",n=!0)=>{let r=((t,e,i)=>{const s=S(t,i);return void 0!==s?s:S(e,i)})(t,e,i);return!r&&n&&f(i)&&(r=E(t,i,s),void 0===r&&(r=E(e,i,s))),r},Y=t=>t.replace(/\$/g,"$$$$");class W{constructor(t={}){this.logger=P.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:i,useRawValueToEscape:s,prefix:n,prefixEscaped:r,suffix:o,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=t.interpolation;this.escape=void 0!==e?e:C,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?k(n):r||"{{",this.suffix=o?k(o):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=u?k(u):d||k("$t("),this.nestingSuffix=f?k(f):p||k(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t?.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,e,i,s){let n,r,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const n=H(e,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,i,{...s,...e,interpolationkey:t}):n}const n=t.split(this.formatSeparator),r=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(H(e,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,i,{...s,...e,interpolationkey:r})};this.resetRegExp();const l=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>Y(t)},{regex:this.regexp,safeValue:t=>Y(this.escapeValue?this.escape(t):t)}].forEach((e=>{for(o=0;n=e.regex.exec(t);){const i=n[1].trim();if(r=h(i),void 0===r)if("function"==typeof l){const e=l(t,n,s);r=f(e)?e:""}else if(s&&Object.prototype.hasOwnProperty.call(s,i))r="";else{if(c){r=n[0];continue}this.logger.warn(`missed to pass in variable ${i} for interpolating ${t}`),r=""}else f(r)||this.useRawValueToEscape||(r=g(r));const a=e.safeValue(r);if(t=t.replace(n[0],a),c?(e.regex.lastIndex+=r.length,e.regex.lastIndex-=n[0].length):e.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),t}nest(t,e,i={}){let s,n,r;const o=(t,e)=>{const i=this.nestingOptionsSeparator;if(t.indexOf(i)<0)return t;const s=t.split(new RegExp(`${k(i)}[ ]*{`));let n=`{${s[1]}`;t=s[0],n=this.interpolate(n,r);const o=n.match(/'/g),a=n.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(n=n.replace(/'/g,'"'));try{r=JSON.parse(n),e&&(r={...e,...r})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${i}${n}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,t};for(;s=this.nestingRegexp.exec(t);){let a=[];r={...i},r=r.replace&&!f(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const h=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==h&&(a=s[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),s[1]=s[1].slice(0,h)),n=e(o.call(this,s[1].trim(),r),r),n&&s[0]===t&&!f(n))return n;f(n)||(n=g(n)),n||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),n=""),a.length&&(n=a.reduce(((t,e)=>this.format(t,e,i.lng,{...i,interpolationkey:s[1].trim()})),n.trim())),t=t.replace(s[0],n),this.regexp.lastIndex=0}return t}}const J=t=>{const e={};return(i,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=e[o];return a||(a=t(N(s),n),e[o]=a),a(i)}},q=t=>(e,i,s)=>t(N(i),s)(e);class G{constructor(t={}){this.logger=P.create("formatter"),this.options=t,this.init(t)}init(t,e={interpolation:{}}){this.formatSeparator=e.interpolation.formatSeparator||",";const i=e.cacheInBuiltFormats?J:q;this.formats={number:i(((t,e)=>{const i=new Intl.NumberFormat(t,{...e});return t=>i.format(t)})),currency:i(((t,e)=>{const i=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>i.format(t)})),datetime:i(((t,e)=>{const i=new Intl.DateTimeFormat(t,{...e});return t=>i.format(t)})),relativetime:i(((t,e)=>{const i=new Intl.RelativeTimeFormat(t,{...e});return t=>i.format(t,e.range||"day")})),list:i(((t,e)=>{const i=new Intl.ListFormat(t,{...e});return t=>i.format(t)}))}}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=J(e)}format(t,e,i,s={}){const n=e.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find((t=>t.indexOf(")")>-1))){const t=n.findIndex((t=>t.indexOf(")")>-1));n[0]=[n[0],...n.splice(1,t)].join(this.formatSeparator)}return n.reduce(((t,e)=>{const{formatName:n,formatOptions:r}=(t=>{let e=t.toLowerCase().trim();const i={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===e&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):"relativetime"===e&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach((t=>{if(t){const[e,...s]=t.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),r=e.trim();i[r]||(i[r]=n),"false"===n&&(i[r]=!1),"true"===n&&(i[r]=!0),isNaN(n)||(i[r]=parseInt(n,10))}}))}return{formatName:e,formatOptions:i}})(e);if(this.formats[n]){let e=t;try{const o=s?.formatParams?.[s.interpolationkey]||{};e=this.formats[n](t,o.locale||o.lng||s.locale||s.lng||i,{...r,...s,...o})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class Q extends z{constructor(t,e,i,s={}){super(),this.backend=t,this.store=e,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=P.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?.(i,s.backend,s)}queueLoad(t,e,i,s){const n={},r={},o={},a={};return t.forEach((t=>{let s=!0;e.forEach((e=>{const o=`${t}|${e}`;!i.reload&&this.store.hasResourceBundle(t,e)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,s=!1,void 0===r[o]&&(r[o]=!0),void 0===n[o]&&(n[o]=!0),void 0===a[e]&&(a[e]=!0)))})),s||(o[t]=!0)})),(Object.keys(n).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(t,e,i){const s=t.split("|"),n=s[0],r=s[1];e&&this.emit("failedLoading",n,r,e),!e&&i&&this.store.addResourceBundle(n,r,i,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&i&&(this.state[t]=0);const o={};this.queue.forEach((i=>{((t,e,i)=>{const{obj:s,k:n}=w(t,e,Object);s[n]=s[n]||[],s[n].push(i)})(i.loaded,[n],r),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(i,t),e&&i.errors.push(e),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((t=>{o[t]||(o[t]={});const e=i.loaded[t];e.length&&e.forEach((e=>{void 0===o[t][e]&&(o[t][e]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((t=>!t.done))}read(t,e,i,s=0,n=this.retryTimeout,r){if(!t.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:i,tried:s,wait:n,callback:r});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}o&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,i,s+1,2*n,r)}),n):r(o,a)},a=this.backend[i].bind(this.backend);if(2!==a.length)return a(t,e,o);try{const i=a(t,e);i&&"function"==typeof i.then?i.then((t=>o(null,t))).catch(o):o(null,i)}catch(t){o(t)}}prepareLoading(t,e,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();f(t)&&(t=this.languageUtils.toResolveHierarchy(t)),f(e)&&(e=[e]);const n=this.queueLoad(t,e,i,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,i){this.prepareLoading(t,e,{},i)}reload(t,e,i){this.prepareLoading(t,e,{reload:!0},i)}loadOne(t,e=""){const i=t.split("|"),s=i[0],n=i[1];this.read(s,n,"read",void 0,void 0,((i,r)=>{i&&this.logger.warn(`${e}loading namespace ${n} for language ${s} failed`,i),!i&&r&&this.logger.log(`${e}loaded namespace ${n} for language ${s}`,r),this.loaded(t,i,r)}))}saveMissing(t,e,i,s,n,r={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(e)){if(null!=i&&""!==i){if(this.backend?.create){const a={...r,isUpdate:n},h=this.backend.create.bind(this.backend);if(h.length<6)try{let n;n=5===h.length?h(t,e,i,s,a):h(t,e,i,s),n&&"function"==typeof n.then?n.then((t=>o(null,t))).catch(o):o(null,n)}catch(t){o(t)}else h(t,e,i,s,o,a)}t&&t[0]&&this.store.addResource(t[0],e,i,s)}}else this.logger.warn(`did not save key "${i}" as the namespace "${e}" 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 X=()=>({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:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),f(t[1])&&(e.defaultValue=t[1]),f(t[2])&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const i=t[3]||t[2];Object.keys(i).forEach((t=>{e[t]=i[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Z=t=>(f(t.ns)&&(t.ns=[t.ns]),f(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),f(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),tt=()=>{},et="__i18next_supportNoticeShown";class it extends z{constructor(t={},e){var i;if(super(),this.options=Z(t),this.services={},this.logger=P,this.modules={external:[]},i=this,Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t=>{"function"==typeof i[t]&&(i[t]=i[t].bind(i))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(t={},e){this.isInitializing=!0,"function"==typeof t&&(e=t,t={}),null==t.defaultNS&&t.ns&&(f(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=X();var s;this.options={...i,...this.options,...Z(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(s=this,s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[et]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[et]=!0));const n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;P.init(this.modules.logger?n(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:G;const e=new B(this.options);this.store=new A(this.options.resources,this.options);const s=this.services;s.logger=P,s.resourceStore=this.store,s.languageUtils=e,s.pluralResolver=new _(e,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(s.formatter=n(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new W(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Q(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",((t,...e)=>{this.emit(t,...e)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,e||(e=tt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[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]=(...e)=>this.store[t](...e)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...e)=>(this.store[t](...e),this)}));const r=p(),o=()=>{const t=(t,i)=>{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),r.resolve(i),e(t,i)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),r}loadResources(t,e=tt){let i=e;const s=f(t)?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return i();const t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};s?e(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>e(t))),this.options.preload?.forEach?.((t=>e(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),i(t)}))}else i(null)}reloadResources(t,e,i){const s=p();return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),i||(i=tt),this.services.backendConnector.reload(t,e,(t=>{s.resolve(),i(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&R.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,e){this.isLanguageChangingTo=t;const i=p();this.emit("languageChanging",t);const s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},n=(n,r)=>{r?this.isLanguageChangingTo===t&&(s(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,i.resolve(((...t)=>this.t(...t))),e&&e(n,((...t)=>this.t(...t)))},r=e=>{t||e||!this.services.languageDetector||(e=[]);const i=f(e)?e:e&&e[0],r=this.store.hasLanguageSomeTranslations(i)?i:this.services.languageUtils.getBestMatchFromCodes(f(e)?[e]:e);r&&(this.language||s(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,(t=>{n(t,r)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(t):r(this.services.languageDetector.detect()),i}getFixedT(t,e,i){const s=(t,e,...n)=>{let r;r="object"!=typeof e?this.options.overloadTranslationOptionHandler([t,e].concat(n)):{...e},r.lng=r.lng||s.lng,r.lngs=r.lngs||s.lngs,r.ns=r.ns||s.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||i||s.keyPrefix);const o={...this.options,...r};"function"==typeof r.keyPrefix&&(r.keyPrefix=I(r.keyPrefix,o));const a=this.options.keySeparator||".";let h;return r.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=I(t,o)),`${r.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=I(t,o)),h=r.keyPrefix?`${r.keyPrefix}${a}${t}`:t),this.t(h,r)};return f(t)?s.lng=t:s.lngs=t,s.ns=e,s.keyPrefix=i,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,e={}){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 i=e.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const r=(t,e)=>{const i=this.services.backendConnector.state[`${t}|${e}`];return-1===i||0===i||2===i};if(e.precheck){const t=e.precheck(this,r);if(void 0!==t)return t}return!(!this.hasResourceBundle(i,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(i,t)||s&&!r(n,t)))}loadNamespaces(t,e){const i=p();return this.options.ns?(f(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}loadLanguages(t,e){const i=p();f(t)&&(t=[t]);const s=this.options.preload||[],n=t.filter((t=>s.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return n.length?(this.options.preload=s.concat(n),this.loadResources((t=>{i.resolve(),e&&e(t)})),i):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const e=new Intl.Locale(t);if(e&&e.getTextInfo){const t=e.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const e=this.services?.languageUtils||new B(X());return t.toLowerCase().indexOf("-latn")>1?"ltr":["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(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},e){const i=new it(t,e);return i.createInstance=it.createInstance,i}cloneInstance(t={},e=tt){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},n=new it(s);if(void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},i){const t=Object.keys(this.store.data).reduce(((t,e)=>(t[e]={...this.store.data[e]},t[e]=Object.keys(t[e]).reduce(((i,s)=>(i[s]={...t[e][s]},i)),t[e]),t)),{});n.store=new A(t,s),n.services.resourceStore=n.store}if(t.interpolation){const e={...X().interpolation,...this.options.interpolation,...t.interpolation},i={...s,interpolation:e};n.services.interpolator=new W(i)}return n.translator=new D(n.services,s),n.translator.on("*",((t,...e)=>{n.emit(t,...e)})),n.init(s,e),n.translator.options=s,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const st=it.createInstance(),{slice:nt,forEach:rt}=[],ot=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,at={create(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*i*1e3)),s&&(n.domain=s),document.cookie=function(t,e){const i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${t}=${encodeURIComponent(e)}`;if(i.maxAge>0){const t=i.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(t)}`}if(i.domain){if(!ot.test(i.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${i.domain}`}if(i.path){if(!ot.test(i.path))throw new TypeError("option path is invalid");s+=`; Path=${i.path}`}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.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 i.partitioned&&(s+="; Partitioned"),s}(t,e,n)},read(t){const e=`${t}=`,i=document.cookie.split(";");for(let t=0;t<i.length;t++){let s=i[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var ht={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&"undefined"!=typeof document)return at.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:i,cookieMinutes:s,cookieDomain:n,cookieOptions:r}=e;i&&"undefined"!=typeof document&&at.create(i,t,s,n,r)}},lt={name:"querystring",lookup(t){let e,{lookupQuerystring:i}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const s=t.substring(1).split("&");for(let t=0;t<s.length;t++){const n=s[t].indexOf("=");n>0&&s[t].substring(0,n)===i&&(e=s[t].substring(n+1))}}return e}},ct={name:"hash",lookup(t){let e,{lookupHash:i,lookupFromHashIndex:s}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const n=t.substring(1);if(i){const t=n.split("&");for(let s=0;s<t.length;s++){const n=t[s].indexOf("=");n>0&&t[s].substring(0,n)===i&&(e=t[s].substring(n+1))}}if(e)return e;if(!e&&s>-1){const e=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const i="number"==typeof s?s:0;return e[i]?.replace("/","")}}}return e}};let ut=null;const dt=()=>{if(null!==ut)return ut;try{if(ut="undefined"!=typeof window&&null!==window.localStorage,!ut)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){ut=!1}return ut};var ft={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&dt())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:i}=e;i&&dt()&&window.localStorage.setItem(i,t)}};let pt=null;const gt=()=>{if(null!==pt)return pt;try{if(pt="undefined"!=typeof window&&null!==window.sessionStorage,!pt)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){pt=!1}return pt};var mt={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&>())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:i}=e;i&>()&&window.sessionStorage.setItem(i,t)}},yt={name:"navigator",lookup(t){const e=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:i,language:s}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);i&&e.push(i),s&&e.push(s)}return e.length>0?e:void 0}},vt={name:"htmlTag",lookup(t){let e,{htmlTag:i}=t;const s=i||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(e=s.getAttribute("lang")),e}},wt={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if("undefined"==typeof window)return;const i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const s="number"==typeof e?e:0;return i[s]?.replace("/","")}},bt={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const i="number"==typeof e?e+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[i]}};let St=!1;try{St=!0}catch(t){}const $t=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];St||$t.splice(1,1);class kt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,e)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return rt.call(nt.call(arguments,1),(e=>{if(e)for(const i in e)void 0===t[i]&&(t[i]=e[i])})),t}(t,this.options||{},{order:$t,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=e,this.addDetector(ht),this.addDetector(lt),this.addDetector(ft),this.addDetector(mt),this.addDetector(yt),this.addDetector(vt),this.addDetector(wt),this.addDetector(bt),this.addDetector(ct)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((e=>{if(this.detectors[e]){let i=this.detectors[e].lookup(this.options);i&&"string"==typeof i&&(i=[i]),i&&(t=t.concat(i))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(e=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(e))));var e})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach((e=>{this.detectors[e]&&this.detectors[e].cacheUserLanguage(t,this.options)})))}}kt.type="languageDetector",st.use(kt).init({fallbackLng:"en",debug:!1,resources:{en:{translation:{}},ja:{translation:{Pay:"支払う","Failed to load Stripe":"ライブラリの読み込みに失敗しました。","Add your payment information":"支払情報を追加","Add card":"カードを追加","Add a card":"カードを追加",Add:"追加","Card information":"カード情報","Card Number":"カード番号","MM / YY":"月 / 年",CVC:"セキュリティコード(CVC)","Country or region":"地域","Postal Code":"郵便番号"}},"pt-BR":{translation:{Pay:"Pagar","Failed to load Stripe":"Falha ao ler Stripe","Add your payment information":"Informações do seu Pagamento","Add card":"Adicionar Cartão","Add a card":"Adicionar um Cartão",Add:"Adicionar","Card information":"Informações do Cartão","Card Number":"Número do Cartão","MM / YY":"MM / AA",CVC:"Número de Segurança(CVC)","Country or region":"País ou região","Postal Code":"Cep"}}}});const xt=st,Ct=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys()){const i=t.get(e).filter((t=>{const e=t.deref();return e&&(!("isConnected"in(i=e))||i.isConnected);var i}));t.set(e,i)}})(...e)}),2e3)}})(),jt=t.forceUpdate,Ot=t.getRenderingRef,Et=(t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)},Nt=(t,e)=>{const i=((t,e=(t,e)=>t!==e)=>{const i=()=>{return("function"==typeof(e=t)?e():e)??{};var e},s=i();let n=new Map(Object.entries(s));const r="undefined"!=typeof Proxy,o=r?null:{},a={dispose:[],get:[],set:[],reset:[]},h=new Map,l=()=>{n=new Map(Object.entries(i())),r||g(),a.reset.forEach((t=>t()))},c=t=>(a.get.forEach((e=>e(t))),n.get(t)),u=(t,i)=>{const s=n.get(t);e(i,s,t)&&(n.set(t,i),r||p(t),a.set.forEach((e=>e(t,i,s))))},d=r?new Proxy(s,{get:(t,e)=>c(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,i)=>(u(e,i),!0)}):(g(),o),f=(t,e)=>(a[t].push(e),()=>{Et(a[t],e)});function p(t){!r&&o&&(Object.prototype.hasOwnProperty.call(o,t)||Object.defineProperty(o,t,{configurable:!0,enumerable:!0,get:()=>c(t),set(e){u(t,e)}}))}function g(){if(r||!o)return;const t=new Set(n.keys());for(const e of Object.keys(o))t.has(e)||delete o[e];for(const e of t)p(e)}return{state:d,get:c,set:u,on:f,onChange:(t,e)=>{const s=(i,s)=>{i===t&&e(s)},n=()=>{const s=i();e(s[t])},r=f("set",s),o=f("reset",n);return h.set(e,{setHandler:s,resetHandler:n,propName:t}),()=>{r(),o(),h.delete(e)}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(f("set",e.set)),e.get&&t.push(f("get",e.get)),e.reset&&t.push(f("reset",e.reset)),e.dispose&&t.push(f("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),l()},reset:l,forceUpdate:t=>{const e=n.get(t);a.set.forEach((i=>i(t,e,e)))},removeListener:(t,e)=>{const i=h.get(e);i&&i.propName===t&&(Et(a.set,i.setHandler),Et(a.reset,i.resetHandler),h.delete(e))}}})(t,e);return i.use((()=>{if("function"!=typeof Ot||"function"!=typeof jt)return{};const t=jt,e=Ot,i=new Map;return{dispose:()=>i.clear(),get:t=>{const s=e();s&&((t,e,i)=>{let s=t.get(e);s||(s=[],t.set(e,s)),s.some((t=>t.deref()===i))||s.push(new WeakRef(i))})(i,t,s)},set:e=>{const s=i.get(e);if(s){const n=s.filter((e=>{const i=e.deref();return!!i&&t(i)}));i.set(e,n)}Ct(i)},reset:()=>{i.forEach((e=>{e.forEach((e=>{const i=e.deref();i&&t(i)}))})),Ct(i)}}})()),i};class Mt{constructor(){this.store=Nt({loadStripeStatus:"",applicationName:"stripe-pwa-elements",isCheckoutSession:!1}),this.initGeneration=0,this.changeListeners=new Map}get state(){return this.store.state}onChange(t,e){const i=this.store.onChange(t,e);return this.changeListeners.has(t)||this.changeListeners.set(t,[]),this.changeListeners.get(t).push(i),i}async initialize(t,i){const s=++this.initGeneration,n=null!=this.store.state.stripe&&!this.store.state.isCheckoutSession&&this.store.state.publishableKey===t&&this.store.state.stripeAccount===(null==i?void 0:i.stripeAccount)&&this.intentClientSecret===(null==i?void 0:i.clientSecret);if(this.store.state.publishableKey=t,this.store.state.isCheckoutSession=!1,this.intentClientSecret=null==i?void 0:i.clientSecret,null!=(null==i?void 0:i.stripeAccount)&&""!==(null==i?void 0:i.stripeAccount)&&(this.store.state.stripeAccount=i.stripeAccount),null!=(null==i?void 0:i.applicationName)&&""!==(null==i?void 0:i.applicationName)&&(this.store.state.applicationName=i.applicationName),!n){this.store.state.loadStripeStatus="loading";try{const n=await e(t,{stripeAccount:null==i?void 0:i.stripeAccount});if(s!==this.initGeneration)return;n.registerAppInfo({name:this.store.state.applicationName}),this.store.state.stripe=n,this.store.state.elements=null!=(null==i?void 0:i.clientSecret)&&""!==i.clientSecret?n.elements({clientSecret:i.clientSecret}):n.elements(),this.store.state.checkout=void 0,this.store.state.loadStripeStatus="success"}catch(t){console.error("Failed to load Stripe.js:",t),this.store.state.loadStripeStatus="failure"}}}async initializeWithCheckoutSession(t,i,s){const n=++this.initGeneration;this.store.state.publishableKey=t,this.store.state.isCheckoutSession=!0,null!=(null==s?void 0:s.stripeAccount)&&""!==(null==s?void 0:s.stripeAccount)&&(this.store.state.stripeAccount=s.stripeAccount),null!=(null==s?void 0:s.applicationName)&&""!==(null==s?void 0:s.applicationName)&&(this.store.state.applicationName=s.applicationName),this.store.state.loadStripeStatus="loading";try{const r=await e(t,{stripeAccount:null==s?void 0:s.stripeAccount});if(n!==this.initGeneration)return;r.registerAppInfo({name:this.store.state.applicationName}),this.store.state.stripe=r;const o=r.initCheckoutElementsSdk({clientSecret:i,elementsOptions:null==s?void 0:s.elementsOptions});this.store.state.checkout=o,this.store.state.elements=void 0,this.store.state.loadStripeStatus="success"}catch(t){console.error("Failed to initialize Stripe Checkout:",t),this.store.state.loadStripeStatus="failure"}}getStripe(){return this.store.state.stripe}getElements(){return this.store.state.elements}getCheckout(){return this.store.state.checkout}reset(){this.store.reset()}dispose(){this.changeListeners.forEach((t=>{t.forEach((t=>t()))})),this.changeListeners.clear(),this.store.dispose()}}function Lt(t,e,i=5e3){return new Promise(((s,n)=>{const r=t.querySelector(e);if(null!=r)return s(r);const o=setTimeout((()=>{a.disconnect(),n(new Error(`Element "${e}" not found within ${i}ms`))}),i),a=new MutationObserver((()=>{const i=t.querySelector(e);null!=i&&(clearTimeout(o),a.disconnect(),s(i))}));a.observe(t,{childList:!0,subtree:!0})}))}new Mt;class Pt{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:"",errorSource:void 0})}getState(){return this.store.state}async initialize(t){const e=this.stripeService.getElements();if(null==e)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");null!=this.cardElements&&this.unmount();const i=e.create("cardNumber",{placeholder:xt.t("Card Number")}),s=await Lt(t,"#card-number");i.mount(s),i.on("change",this.handleCardError("cardNumber"));const n=e.create("cardExpiry"),r=await Lt(t,"#card-expiry");n.mount(r),n.on("change",this.handleCardError("cardExpiry"));const o=e.create("cardCvc"),a=await Lt(t,"#card-cvc");return o.mount(a),o.on("change",this.handleCardError("cardCvc")),this.cardElements={cardNumber:i,cardExpiry:n,cardCVC:o},this.cardElements}getElements(){return this.cardElements}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage",""),this.store.set("errorSource",void 0)}unmount(){var t,e,i;null!=this.cardElements&&(null===(t=this.cardElements.cardNumber)||void 0===t||t.unmount(),null===(e=this.cardElements.cardExpiry)||void 0===e||e.unmount(),null===(i=this.cardElements.cardCVC)||void 0===i||i.unmount(),this.cardElements=void 0)}handleCardError(t){return({error:e})=>{if(e)return this.store.set("errorMessage",e.message),void this.store.set("errorSource",t);this.store.state.errorSource===t&&(this.store.set("errorMessage",""),this.store.set("errorSource",void 0))}}}class zt{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:""})}getState(){return this.store.state}async initialize(t,e){const i=this.stripeService.state.isCheckoutSession;if(null!=this.paymentElement&&this.unmount(),i){const t=this.stripeService.getCheckout();if(null==t)throw new Error("StripeService not initialized with Checkout Session. Call StripeService.initializeWithCheckoutSession() first.");this.paymentElement=t.createPaymentElement(e)}else{const t=this.stripeService.getElements();if(null==t)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");this.paymentElement=t.create("payment",e||{})}const s=await Lt(t,"#payment-element");return this.paymentElement.mount(s),this.paymentElement}getElement(){return this.paymentElement}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage","")}unmount(){null!=this.paymentElement&&(this.paymentElement.unmount(),this.paymentElement=void 0)}}class At{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:"",isComplete:!1})}getState(){return this.store.state}async initialize(t,e){const i=this.stripeService.getElements();if(null==i)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");null!=this.addressElement&&this.unmount(),this.addressElement=i.create("address",e||{mode:"billing"});const s=await Lt(t,"#address-element");return this.addressElement.mount(s),this.addressElement.on("change",(t=>{this.store.set("errorMessage",""),this.store.set("isComplete",t.complete)})),this.addressElement}getElement(){return this.addressElement}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage","")}unmount(){null!=this.addressElement&&(this.addressElement.unmount(),this.addressElement=void 0)}}class Rt{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:"",email:void 0})}getState(){return this.store.state}onChange(t,e){return this.store.onChange(t,e)}async initialize(t,e){const i=this.stripeService.getElements();if(null==i)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");null!=this.linkAuthenticationElement&&this.unmount();const s=i.create("linkAuthentication",e),n=await Lt(t,"#link-authentication-element");return s.mount(n),s.on("change",(t=>{var e;this.store.set("email",null===(e=t.value)||void 0===e?void 0:e.email)})),this.linkAuthenticationElement=s,this.linkAuthenticationElement}getElement(){return this.linkAuthenticationElement}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage","")}unmount(){null!=this.linkAuthenticationElement&&(this.linkAuthenticationElement.unmount(),this.linkAuthenticationElement=void 0)}}class Tt{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:"",selectedCurrency:void 0})}getState(){return this.store.state}async initialize(t,e){const i=this.stripeService.getElements();if(null==i)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");null!=this.currencySelectorElement&&this.unmount();const s=await Lt(t,"#currency-selector");return this.currencySelectorElement=i.create("currencySelector",e||{}),this.currencySelectorElement.mount(s),this.currencySelectorElement.on("change",(t=>{var e;this.store.set("errorMessage",""),(null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.currency)&&this.store.set("selectedCurrency",t.value.currency)})),this.currencySelectorElement}getElement(){return this.currencySelectorElement}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage","")}unmount(){null!=this.currencySelectorElement&&(this.currencySelectorElement.unmount(),this.currencySelectorElement=void 0)}}class It{constructor(t){this.stripeService=t,this.store=Nt({errorMessage:"",isReady:!1})}getState(){return this.store.state}async initialize(t,e,i){const s=this.stripeService.getElements();if(null==s)throw new Error("StripeService not initialized. Call StripeService.initialize() first.");null!=this.expressCheckoutElement&&this.unmount();const n=Object.assign({},e);if(n.buttonHeight&&"string"==typeof n.buttonHeight){const t=parseInt(n.buttonHeight.replace("px",""),10);isNaN(t)||(n.buttonHeight=t)}const r=s.create("expressCheckout",n),o=await Lt(t,"#express-checkout-element");return null!=(null==i?void 0:i.onConfirm)&&r.on("confirm",i.onConfirm),null!=(null==i?void 0:i.onClick)&&r.on("click",i.onClick),null!=(null==i?void 0:i.onCancel)&&r.on("cancel",i.onCancel),null!=(null==i?void 0:i.onShippingAddressChange)&&r.on("shippingaddresschange",i.onShippingAddressChange),null!=(null==i?void 0:i.onShippingRateChange)&&r.on("shippingratechange",i.onShippingRateChange),r.on("ready",(()=>{this.store.set("isReady",!0)})),r.mount(o),this.expressCheckoutElement=r,this.expressCheckoutElement}getElement(){return this.expressCheckoutElement}update(t){if(null==this.expressCheckoutElement)return void console.warn("Express Checkout Element not initialized. Cannot update options.");const e=Object.assign({},t);if(e.buttonHeight&&"string"==typeof e.buttonHeight){const t=parseInt(e.buttonHeight.replace("px",""),10);isNaN(t)||(e.buttonHeight=t)}this.expressCheckoutElement.update(e)}setError(t){this.store.set("errorMessage",t)}clearError(){this.store.set("errorMessage","")}unmount(){null!=this.expressCheckoutElement&&(this.expressCheckoutElement.unmount(),this.expressCheckoutElement=void 0,this.store.set("isReady",!1))}}const Ft=new class{createStripeService(){return new Mt}createCardElementManager(t){return new Pt(t)}createPaymentElementManager(t){return new zt(t)}createAddressElementManager(t){return new At(t)}createLinkAuthenticationElementManager(t){return new Rt(t)}createCurrencySelectorElementManager(t){return new Tt(t)}createExpressCheckoutElementManager(t){return new It(t)}};export{d as c,xt as i,Ft as s}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
const o=()=>{};export{o as g}
|
|
2
|
-
//# sourceMappingURL=p-DQuL1Twl.js.map
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
class s extends Error{constructor(s){super(s.message)
|
|
2
|
-
//# sourceMappingURL=p-XRfh5Wrs.js.map
|
|
1
|
+
class s extends Error{constructor(s){super(s.message),this.code=s.code,this.docUrl=s.doc_url,this.message=s.message,this.param=s.param,this.requestLogUrl=s.request_log_url,this.type=s.type}}export{s as S}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,a as e,h as s,g as i}from"./p-C6bbmyga.js";const r=class{constructor(s){t(this,s),this.closed=e(this,"closed",7),this.showLabel=!1,this.shouldUseDefaultFormSubmitAction=!0,this.intentType="payment",this.showCloseButton=!0,this.zip=!0,this.open=!1}componentDidLoad(){this.el.querySelector("stripe-modal").addEventListener("close",(()=>{this.closed.emit()}))}async getStripeCardElementElement(){return this.el.querySelector("stripe-card-element")}async present(){return this.open=!0,new Promise(((t,e)=>{this.el.querySelector("stripe-card-element").addEventListener("formSubmit",(async e=>{t(e)})),this.el.addEventListener("closed",(()=>e()))}))}async updateProgress(t){return this.el.querySelector("stripe-card-element").updateProgress(t)}async destroy(){this.el.querySelector("stripe-card-element").remove(),this.el.remove()}async setPaymentRequestButton(t){const e=this.el.getElementsByTagName("stripe-card-element");if(e.length<1)return;const s=e[0];s&&(s.setAttribute("show-payment-request-button","true"),this.applicationName&&s.setAttribute("application-name",this.applicationName),s.setPaymentRequestOption(t))}render(){return s("stripe-modal",{key:"a0229c55472e3c6f417086fa08d79e1ec8a8c485",open:this.open,showCloseButton:this.showCloseButton},s("stripe-card-element",{key:"799f08c781bad089cec8b1338e9a714d080abd51",showLabel:this.showLabel,publishableKey:this.publishableKey,intentClientSecret:this.intentClientSecret,shouldUseDefaultFormSubmitAction:this.shouldUseDefaultFormSubmitAction,handleSubmit:this.handleSubmit,stripeDidLoaded:this.stripeDidLoaded,intentType:this.intentType,zip:this.zip,buttonLabel:this.buttonLabel,sheetTitle:this.sheetTitle,applicationName:this.applicationName}))}get el(){return i(this)}};r.style="stripe-card-element-modal{display:block}";export{r as stripe_card_element_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,a as i,h as e,g as n}from"./p-C6bbmyga.js";import{s,c as a,i as r}from"./p-CrjrbGJ3.js";import"./p-CBXaOfXU.js";const o=class{updatePublishableKey(t){const i={};this.stripeAccount&&(i.stripeAccount=this.stripeAccount),this.initStripe(t,Object.keys(i).length?i:void 0)}updateStripeAccountId(t){const i=this.stripeService.state.publishableKey||this.publishableKey;i&&this.initStripe(i,{stripeAccount:t})}async initStripe(t,i){if(await this.stripeService.initialize(t,{stripeAccount:null==i?void 0:i.stripeAccount,applicationName:this.applicationName}),"success"===this.stripeService.state.loadStripeStatus)await this.initElement(),this.stripeLoadedEventHandler();else{const t=this.stripeService.onChange("loadStripeStatus",(async i=>{"success"===i&&(await this.initElement(),this.stripeLoadedEventHandler(),t())}))}}async updateProgress(t){return this.progress=t,this}async setErrorMessage(t){return this.linkAuthenticationElementManager.setError(t),this}async getEmail(){return this.linkAuthenticationElementManager.getState().email}stripeLoadedEventHandler(){const t=this.stripeService.getStripe();if(!t)return void console.error("Stripe instance is not available");const i={stripe:t};this.stripeDidLoaded&&this.stripeDidLoaded(i),this.stripeLoaded.emit(i)}linkAuthenticationChangeEventHandler(t){const i=this.linkAuthenticationElementManager.getElement(),e=this.stripeService.getStripe();if(!i||!e)return void console.error("Link Authentication Element not initialized");const n={stripe:e,linkAuthenticationElement:i,email:t};this.handleChange&&this.handleChange(n),this.linkAuthenticationChange.emit(n)}componentWillRender(){this.stripeService.state.publishableKey&&(["success","loading"].includes(this.stripeService.state.loadStripeStatus)||this.initStripe(this.stripeService.state.publishableKey,{stripeAccount:this.stripeService.state.stripeAccount}))}constructor(e){t(this,e),this.stripeLoaded=i(this,"stripeLoaded",7),this.linkAuthenticationChange=i(this,"linkAuthenticationChange",7),this.applicationName="stripe-pwa-elements",this.progress="",this.stripeService=s.createStripeService(),this.linkAuthenticationElementManager=s.createLinkAuthenticationElementManager(this.stripeService)}componentWillLoad(){this.publishableKey&&this.initStripe(this.publishableKey,{stripeAccount:this.stripeAccount})}async initElement(){const t={};this.defaultEmail&&(t.defaultValues={email:this.defaultEmail}),await this.linkAuthenticationElementManager.initialize(this.el,Object.keys(t).length?t:void 0),this.linkAuthenticationElementManager.onChange("email",(t=>{this.linkAuthenticationChangeEventHandler(t)}))}componentDidLoad(){const t=a();t&&this.el.classList.add(t)}disconnectedCallback(){this.linkAuthenticationElementManager.unmount()}render(){const{loadStripeStatus:t}=this.stripeService.state,{errorMessage:i}=this.linkAuthenticationElementManager.getState();return"failure"===t?e("p",null,r.t("Failed to load Stripe")):e("div",{class:"stripe-link-authentication-wrap"},e("div",{class:"stripe-link-authentication-container"},e("div",{id:"link-authentication-element"}),e("div",{id:"link-authentication-errors",class:"stripe-element-errors"},i)))}get el(){return n(this)}static get watchers(){return{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}}};o.style=':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}';export{o as stripe_link_authentication_element}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
2
|
-
//# sourceMappingURL=stripe-elements.esm.js.map
|
|
1
|
+
import{p as e,B as t,c as i,w as n,N as a,H as l,b as o}from"./p-C6bbmyga.js";export{s as setNonce}from"./p-C6bbmyga.js";import{g as p}from"./p-DQuL1Twl.js";var r=e=>{const t=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return t.call(this,e);const i=t.call(this,!1),n=this.childNodes;if(e)for(let e=0;e<n.length;e++)2!==n[e].nodeType&&i.appendChild(n[e].cloneNode(!0));return i}};(()=>{t.isDev&&!t.isTesting&&i("Running in development mode."),t.cloneNodeFix&&r(l.prototype);const s=t.scriptDataOpts?n.document&&Array.from(n.document.querySelectorAll("script")).find((e=>new RegExp(`/${a}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===a)):null,o=import.meta.url,p=t.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==o&&(p.resourcesUrl=new URL(".",o).href),e(p)})().then((async e=>(await p(),o([["p-ae0c336e",[[0,"stripe-card-element-modal",{publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],showLabel:[4,"show-label"],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],intentClientSecret:[1,"intent-client-secret"],shouldUseDefaultFormSubmitAction:[4,"should-use-default-form-submit-action"],intentType:[1,"intent-type"],handleSubmit:[1040],stripeDidLoaded:[1040],showCloseButton:[4,"show-close-button"],zip:[4],open:[4],getStripeCardElementElement:[64],present:[64],updateProgress:[64],destroy:[64],setPaymentRequestButton:[64]}]]],["p-3f42ca0c",[[0,"stripe-address-element",{mode:[1],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],showLabel:[4,"show-label"],defaultCountry:[1,"default-country"],allowedCountries:[16],handleSubmit:[1040],stripeDidLoaded:[1040],progress:[32],initStripe:[64],updateProgress:[64],setErrorMessage:[64],getValue:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}]]],["p-840d499f",[[0,"stripe-currency-selector",{publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],clientSecret:[1,"client-secret"],handleCurrencyChange:[1040],stripeDidLoaded:[1040],initStripe:[64],setErrorMessage:[64],getSelectedCurrency:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}]]],["p-1bd46766",[[0,"stripe-express-checkout-element",{intentType:[1,"intent-type"],publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],clientSecret:[1,"client-secret"],amount:[2],currency:[1],buttonHeight:[1,"button-height"],shouldUseDefaultConfirmAction:[4,"should-use-default-confirm-action"],stripeDidLoaded:[1040],progress:[32],updateProgress:[64],setErrorMessage:[64],initStripe:[64],updateElementOptions:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}]]],["p-cfd8e081",[[0,"stripe-link-authentication-element",{publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],defaultEmail:[1,"default-email"],handleChange:[1040],stripeDidLoaded:[1040],progress:[32],initStripe:[64],updateProgress:[64],setErrorMessage:[64],getEmail:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}]]],["p-1c6e0a45",[[0,"stripe-payment-element",{intentType:[1,"intent-type"],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],intentClientSecret:[1,"intent-client-secret"],checkoutSessionClientSecret:[1,"checkout-session-client-secret"],shouldUseDefaultFormSubmitAction:[4,"should-use-default-form-submit-action"],handleSubmit:[1040],stripeDidLoaded:[1040],progress:[32],initStripe:[64],initStripeWithCheckoutSession:[64],updateProgress:[64],setErrorMessage:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}],intentClientSecret:[{updateIntentClientSecret:0}],checkoutSessionClientSecret:[{updateCheckoutSessionClientSecret:0}]}]]],["p-5cf62945",[[1,"ion-icon",{mode:[1025],color:[1],ios:[1],md:[1],flipRtl:[4,"flip-rtl"],name:[513],src:[1],icon:[8],size:[1],lazy:[4],sanitize:[4],svgContent:[32],isVisible:[32]},null,{name:[{loadIcon:0}],src:[{loadIcon:0}],icon:[{loadIcon:0}],ios:[{loadIcon:0}],md:[{loadIcon:0}]}]]],["p-76e57d78",[[260,"stripe-payment-request-button",{paymentMethodEventHandler:[16],shippingOptionEventHandler:[16],shippingAddressEventHandler:[16],publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],stripeDidLoaded:[1040],loadStripeStatus:[32],stripe:[32],paymentRequestOption:[32],isAvailable:[64],setPaymentMethodEventHandler:[64],setPaymentRequestShippingOptionEventHandler:[64],setPaymentRequestShippingAddressEventHandler:[64],setPaymentRequestOption:[64],initStripe:[64]}]]],["p-74de1556",[[0,"stripe-card-element",{intentType:[1,"intent-type"],zip:[4],sheetTitle:[1,"sheet-title"],buttonLabel:[1,"button-label"],publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],showLabel:[4,"show-label"],intentClientSecret:[1,"intent-client-secret"],shouldUseDefaultFormSubmitAction:[4,"should-use-default-form-submit-action"],showPaymentRequestButton:[4,"show-payment-request-button"],handleSubmit:[1040],stripeDidLoaded:[1040],progress:[32],zipCode:[32],paymentRequestOption:[32],initStripe:[64],updateProgress:[64],setErrorMessage:[64],setPaymentRequestOption:[64]},null,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}],[257,"stripe-modal",{showCloseButton:[4,"show-close-button"],open:[1028],renderedOpen:[32],toggleModal:[64],openModal:[64],closeModal:[64]},null,{open:[{onOpenChange:0}]}]]]],e))));
|
|
@@ -185,6 +185,12 @@ export declare class StripeAddressElement {
|
|
|
185
185
|
private formSubmitEventHandler;
|
|
186
186
|
componentWillRender(): void;
|
|
187
187
|
constructor();
|
|
188
|
+
/**
|
|
189
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
190
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
191
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
192
|
+
*/
|
|
193
|
+
componentWillLoad(): void;
|
|
188
194
|
/**
|
|
189
195
|
* Initialize Component using Stripe Address Element
|
|
190
196
|
*/
|
|
@@ -43,7 +43,7 @@ export declare class StripeCardElement {
|
|
|
43
43
|
* customElements
|
|
44
44
|
* .whenDefined('stripe-card-element')
|
|
45
45
|
* .then(() => {
|
|
46
|
-
*
|
|
46
|
+
* stripeElement.initStripe('pk_test_XXXXXXXXX')
|
|
47
47
|
* })
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
@@ -76,6 +76,7 @@ export declare class StripeCardElement {
|
|
|
76
76
|
* stripeElement.updateProgress('success')
|
|
77
77
|
* });
|
|
78
78
|
* })
|
|
79
|
+
* ```
|
|
79
80
|
*/
|
|
80
81
|
updateProgress(progress: ProgressStatus): Promise<this>;
|
|
81
82
|
/**
|
|
@@ -103,6 +104,7 @@ export declare class StripeCardElement {
|
|
|
103
104
|
* }
|
|
104
105
|
* });
|
|
105
106
|
* })
|
|
107
|
+
* ```
|
|
106
108
|
*/
|
|
107
109
|
setErrorMessage(errorMessage: string): Promise<this>;
|
|
108
110
|
/**
|
|
@@ -219,6 +221,7 @@ export declare class StripeCardElement {
|
|
|
219
221
|
* console.log(result);
|
|
220
222
|
* })
|
|
221
223
|
* })
|
|
224
|
+
* ```
|
|
222
225
|
*/
|
|
223
226
|
formSubmit: EventEmitter<FormSubmitEvent>;
|
|
224
227
|
private formSubmitEventHandler;
|
|
@@ -238,6 +241,7 @@ export declare class StripeCardElement {
|
|
|
238
241
|
* }
|
|
239
242
|
* })
|
|
240
243
|
* })
|
|
244
|
+
* ```
|
|
241
245
|
*/
|
|
242
246
|
defaultFormSubmitResult: EventEmitter<DefaultFormSubmitResult>;
|
|
243
247
|
private defaultFormSubmitResultHandler;
|
|
@@ -250,6 +254,12 @@ export declare class StripeCardElement {
|
|
|
250
254
|
*/
|
|
251
255
|
private defaultFormSubmitAction;
|
|
252
256
|
constructor();
|
|
257
|
+
/**
|
|
258
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
259
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
260
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
261
|
+
*/
|
|
262
|
+
componentWillLoad(): void;
|
|
253
263
|
/**
|
|
254
264
|
* Initialize Component using Stripe Element
|
|
255
265
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Stripe, StripeCardNumberElement, PaymentIntentResult, SetupIntentResult } from '@stripe/stripe-js';
|
|
2
|
+
import { IntentType, InitStripeOptions, PaymentRequestButtonOption } from '../../interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Build the `InitStripeOptions` object from an optional connected-account id.
|
|
5
|
+
* Returns `undefined` when no account is provided, mirroring the behavior
|
|
6
|
+
* expected by `initStripe` (so the second argument can be omitted entirely).
|
|
7
|
+
* @param stripeAccount Optional connected-account id
|
|
8
|
+
* @returns InitStripeOptions when an account id exists, otherwise undefined
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildInitStripeOptionsFromAccount: (stripeAccount?: string) => InitStripeOptions | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Confirm a Stripe card intent, dispatching to `confirmCardPayment` or
|
|
13
|
+
* `confirmCardSetup` based on the configured intent type.
|
|
14
|
+
* @param stripe The loaded Stripe.js instance
|
|
15
|
+
* @param intentType Whether this is a payment or setup intent
|
|
16
|
+
* @param intentClientSecret The client secret of the intent to confirm
|
|
17
|
+
* @param cardNumberElement The Stripe card number element to confirm with
|
|
18
|
+
* @returns The PaymentIntent or SetupIntent confirmation result
|
|
19
|
+
*/
|
|
20
|
+
export declare const confirmCardIntent: (stripe: Stripe, intentType: IntentType, intentClientSecret: string, cardNumberElement: StripeCardNumberElement) => Promise<PaymentIntentResult | SetupIntentResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Wire up the optional payment-request handlers onto a freshly created
|
|
23
|
+
* `<stripe-payment-request-button>` element. Only handlers that are provided
|
|
24
|
+
* on the option object are attached, preserving the original behavior.
|
|
25
|
+
* @param element The payment-request-button custom element instance
|
|
26
|
+
* @param option The payment request button option (handlers + config)
|
|
27
|
+
* @returns void
|
|
28
|
+
*/
|
|
29
|
+
export declare const attachPaymentRequestHandlers: (element: HTMLStripePaymentRequestButtonElement, option: PaymentRequestButtonOption) => void;
|
|
@@ -44,9 +44,9 @@ export declare class StripeCardElementModal {
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```
|
|
47
|
-
* const stripeElement = document.createElement('stripe-card-element');
|
|
47
|
+
* const stripeElement = document.createElement('stripe-card-element-modal');
|
|
48
48
|
* customElements
|
|
49
|
-
* .whenDefined('stripe-card-element')
|
|
49
|
+
* .whenDefined('stripe-card-element-modal')
|
|
50
50
|
* .then(() => {
|
|
51
51
|
* stripeElement.setAttribute('intent-client-secret', 'dummy')
|
|
52
52
|
* })
|
|
@@ -54,7 +54,7 @@ export declare class StripeCardElementModal {
|
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```
|
|
57
|
-
* <stripe-card-element intent-client-secret="dummy" />
|
|
57
|
+
* <stripe-card-element-modal intent-client-secret="dummy" />
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
intentClientSecret?: string;
|
|
@@ -69,7 +69,7 @@ export declare class StripeCardElementModal {
|
|
|
69
69
|
* If you want to use `setupIntent`, should update this attribute.
|
|
70
70
|
* @example
|
|
71
71
|
* ```
|
|
72
|
-
* <stripe-card-element intent-type="setup" />
|
|
72
|
+
* <stripe-card-element-modal intent-type="setup" />
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
75
|
intentType: IntentType;
|
|
@@ -117,6 +117,12 @@ export declare class StripeCurrencySelector {
|
|
|
117
117
|
private currencyChangeEventHandler;
|
|
118
118
|
componentWillRender(): void;
|
|
119
119
|
constructor();
|
|
120
|
+
/**
|
|
121
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
122
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
123
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
124
|
+
*/
|
|
125
|
+
componentWillLoad(): void;
|
|
120
126
|
/**
|
|
121
127
|
* Initialize Component using Stripe Currency Selector Element
|
|
122
128
|
*/
|
package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts
CHANGED
|
@@ -215,6 +215,12 @@ export declare class StripeExpressCheckoutElement {
|
|
|
215
215
|
defaultConfirmResult: EventEmitter<DefaultFormSubmitResult>;
|
|
216
216
|
private defaultConfirmResultHandler;
|
|
217
217
|
constructor();
|
|
218
|
+
/**
|
|
219
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
220
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
221
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
222
|
+
*/
|
|
223
|
+
componentWillLoad(): void;
|
|
218
224
|
componentWillUpdate(): void;
|
|
219
225
|
/**
|
|
220
226
|
* Default confirm action
|
|
@@ -133,6 +133,12 @@ export declare class StripeLinkAuthenticationElement {
|
|
|
133
133
|
private linkAuthenticationChangeEventHandler;
|
|
134
134
|
componentWillRender(): void;
|
|
135
135
|
constructor();
|
|
136
|
+
/**
|
|
137
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
138
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
139
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
140
|
+
*/
|
|
141
|
+
componentWillLoad(): void;
|
|
136
142
|
/**
|
|
137
143
|
* Initialize Component using Stripe Element
|
|
138
144
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { StripeDidLoadedHandler, StripeLoadedEvent, ProgressStatus, IntentType, DefaultFormSubmitResult, InitStripeOptions } from '../../interfaces';
|
|
3
3
|
import type { CheckoutSessionOptions } from '../../services/interfaces';
|
|
4
|
-
import type { Stripe, StripeElements,
|
|
4
|
+
import type { Stripe, StripeElements, StripeCheckoutElementsSdk, StripeCheckoutConfirmResult } from '@stripe/stripe-js';
|
|
5
5
|
/**
|
|
6
6
|
* Payment Element submit event
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export type PaymentElementSubmitEvent = {
|
|
|
9
9
|
stripe: Stripe;
|
|
10
10
|
elements?: StripeElements;
|
|
11
11
|
intentClientSecret?: string;
|
|
12
|
-
checkout?:
|
|
12
|
+
checkout?: StripeCheckoutElementsSdk;
|
|
13
13
|
checkoutSessionClientSecret?: string;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
@@ -29,6 +29,7 @@ export declare class StripePaymentElement {
|
|
|
29
29
|
private stripeService;
|
|
30
30
|
private paymentElementManager;
|
|
31
31
|
private _submitHandler;
|
|
32
|
+
private initGeneration;
|
|
32
33
|
/**
|
|
33
34
|
* Default submit handle type.
|
|
34
35
|
* If you want to use `setupIntent`, should update this attribute.
|
|
@@ -285,6 +286,23 @@ export declare class StripePaymentElement {
|
|
|
285
286
|
*/
|
|
286
287
|
private checkoutSessionFormSubmitAction;
|
|
287
288
|
constructor();
|
|
289
|
+
/**
|
|
290
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
291
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
292
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
293
|
+
*/
|
|
294
|
+
componentWillLoad(): void;
|
|
295
|
+
/**
|
|
296
|
+
* Mount the element once Stripe.js has loaded, unless a newer init call (of either mode) has superseded this one.
|
|
297
|
+
* @param generation - The value of `initGeneration` taken when the init call started
|
|
298
|
+
*/
|
|
299
|
+
private mountWhenLoaded;
|
|
300
|
+
private hasCheckoutSessionClientSecret;
|
|
301
|
+
/**
|
|
302
|
+
* Start Stripe.js in the mode that matches the given props.
|
|
303
|
+
* Checkout Session mode when `checkoutSessionClientSecret` is set, PaymentIntent / SetupIntent mode otherwise.
|
|
304
|
+
*/
|
|
305
|
+
private startStripe;
|
|
288
306
|
/**
|
|
289
307
|
* Initialize Component using Stripe Element
|
|
290
308
|
*/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Stripe, StripeElements, StripeCheckoutElementsSdk, StripeCheckoutConfirmResult } from '@stripe/stripe-js';
|
|
2
|
+
import type { IntentType, ProgressStatus } from '../../interfaces';
|
|
3
|
+
import type { PaymentElementSubmitEvent } from './stripe-payment-element';
|
|
4
|
+
/**
|
|
5
|
+
* Determine whether the submit button should be disabled.
|
|
6
|
+
* For Checkout Session mode: the checkout is ready once Stripe finished loading.
|
|
7
|
+
* For Payment Intent / Setup Intent mode: an intent client secret must be present.
|
|
8
|
+
* @param params progress / loading state and the current mode information
|
|
9
|
+
* @returns true when the submit button should be disabled
|
|
10
|
+
*/
|
|
11
|
+
export declare const isSubmitButtonDisabled: (params: {
|
|
12
|
+
progress: ProgressStatus;
|
|
13
|
+
isCheckoutSession: boolean;
|
|
14
|
+
loadStripeStatus: ProgressStatus;
|
|
15
|
+
intentClientSecret?: string;
|
|
16
|
+
}) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Run the default Stripe confirmation flow for Payment Intent / Setup Intent mode.
|
|
19
|
+
* Calls `confirmPayment` or `confirmSetup` depending on the intent type.
|
|
20
|
+
* @param stripe the loaded Stripe.js instance
|
|
21
|
+
* @param elements the Stripe Elements instance bound to the payment element
|
|
22
|
+
* @param intentType the configured intent type
|
|
23
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
24
|
+
* @returns the confirmation result
|
|
25
|
+
* @throws StripeAPIError when Stripe returns an error
|
|
26
|
+
*/
|
|
27
|
+
export declare const confirmPaymentOrSetup: (stripe: Stripe, elements: StripeElements, intentType: IntentType, returnUrl: string) => Promise<import("@stripe/stripe-js").PaymentIntentResult | import("@stripe/stripe-js").SetupIntentResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Confirm a Checkout Session payment using the checkout actions.
|
|
30
|
+
* @param checkout the Stripe Checkout instance
|
|
31
|
+
* @param returnUrl the URL Stripe should redirect back to when required
|
|
32
|
+
* @returns the confirmation result
|
|
33
|
+
* @throws StripeAPIError when loading actions or confirming fails
|
|
34
|
+
*/
|
|
35
|
+
export declare const confirmCheckoutSession: (checkout: StripeCheckoutElementsSdk, returnUrl: string) => Promise<StripeCheckoutConfirmResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the mode-specific properties for a submit event.
|
|
38
|
+
* Picks the Checkout or Elements payload depending on the active mode and
|
|
39
|
+
* reports a descriptive error string when the required instance is missing.
|
|
40
|
+
* @param params the resolved Stripe instances and client secrets for the current mode
|
|
41
|
+
* @returns the submit event props, or an error message when an instance is missing
|
|
42
|
+
*/
|
|
43
|
+
export declare const buildSubmitEventProps: (params: {
|
|
44
|
+
stripe: Stripe;
|
|
45
|
+
isCheckoutSession: boolean;
|
|
46
|
+
checkout?: StripeCheckoutElementsSdk;
|
|
47
|
+
checkoutSessionClientSecret?: string;
|
|
48
|
+
elements?: StripeElements;
|
|
49
|
+
intentClientSecret?: string;
|
|
50
|
+
}) => {
|
|
51
|
+
props: PaymentElementSubmitEvent;
|
|
52
|
+
} | {
|
|
53
|
+
error: string;
|
|
54
|
+
};
|
package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { Stripe, PaymentRequestOptions } from '@stripe/stripe-js';
|
|
3
3
|
import { StripeDidLoadedHandler, StripeLoadedEvent, PaymentRequestShippingAddressEventHandler, PaymentRequestPaymentMethodEventHandler, PaymentRequestShippingOptionEventHandler } from '../../interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated `stripe-payment-request-button` is deprecated and will be removed in a future release.
|
|
6
|
+
* `stripe.paymentRequest()` is being removed in Stripe.js 9.x (deprecated as of 2025-09-30 / 2026-03-25).
|
|
7
|
+
* Please migrate to `<stripe-express-checkout-element>` which supports Apple Pay, Google Pay, Link, PayPal,
|
|
8
|
+
* and more via the modern Express Checkout Element API.
|
|
9
|
+
* Migration guide: https://hideokamoto.github.io/stripe-pwa-elements/guides/migrate-payment-request-button-to-express-checkout/
|
|
10
|
+
*/
|
|
4
11
|
export declare class StripePaymentRequestButton {
|
|
5
12
|
el: HTMLStripePaymentRequestButtonElement;
|
|
6
13
|
loadStripeStatus: '' | 'loading' | 'success' | 'failure';
|
|
@@ -122,7 +129,13 @@ export declare class StripePaymentRequestButton {
|
|
|
122
129
|
*/
|
|
123
130
|
stripeLoaded: EventEmitter<StripeLoadedEvent>;
|
|
124
131
|
private stripeLoadedEventHandler;
|
|
125
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Props are not yet populated inside the constructor when the component is registered via
|
|
134
|
+
* the custom-elements build (`dist/components/*`), so initialization that depends on them
|
|
135
|
+
* must run in `componentWillLoad`, where both the lazy and custom-elements builds have them set.
|
|
136
|
+
*/
|
|
137
|
+
componentWillLoad(): void;
|
|
138
|
+
connectedCallback(): void;
|
|
126
139
|
/**
|
|
127
140
|
* @param option
|
|
128
141
|
* @private
|