@paynext/sdk 0.0.134 → 0.0.136
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/index.d.ts +2 -1
- package/dist/index.es.js +19 -13
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(de,ge){typeof exports=="object"&&typeof module!="undefined"?ge(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ge):(de=typeof globalThis!="undefined"?globalThis:de||self,ge(de["PayNext SDK"]={},de.React))})(this,function(de,ge){"use strict";var o5=Object.defineProperty,a5=Object.defineProperties;var c5=Object.getOwnPropertyDescriptors;var ua=Object.getOwnPropertySymbols;var Pb=Object.prototype.hasOwnProperty,Mb=Object.prototype.propertyIsEnumerable;var Yl=(de,ge)=>(ge=Symbol[de])?ge:Symbol.for("Symbol."+de);var Xl=(de,ge,Se)=>ge in de?o5(de,ge,{enumerable:!0,configurable:!0,writable:!0,value:Se}):de[ge]=Se,y=(de,ge)=>{for(var Se in ge||(ge={}))Pb.call(ge,Se)&&Xl(de,Se,ge[Se]);if(ua)for(var Se of ua(ge))Mb.call(ge,Se)&&Xl(de,Se,ge[Se]);return de},$=(de,ge)=>a5(de,c5(ge));var at=(de,ge)=>{var Se={};for(var Be in de)Pb.call(de,Be)&&ge.indexOf(Be)<0&&(Se[Be]=de[Be]);if(de!=null&&ua)for(var Be of ua(de))ge.indexOf(Be)<0&&Mb.call(de,Be)&&(Se[Be]=de[Be]);return Se};var N=(de,ge,Se)=>Xl(de,typeof ge!="symbol"?ge+"":ge,Se);var j=(de,ge,Se)=>new Promise((Be,Lt)=>{var J=Ge=>{try{rt(Se.next(Ge))}catch(yt){Lt(yt)}},pt=Ge=>{try{rt(Se.throw(Ge))}catch(yt){Lt(yt)}},rt=Ge=>Ge.done?Be(Ge.value):Promise.resolve(Ge.value).then(J,pt);rt((Se=Se.apply(de,ge)).next())}),Fn=function(de,ge){this[0]=de,this[1]=ge},la=(de,ge,Se)=>{var Be=(pt,rt,Ge,yt)=>{try{var fs=Se[pt](rt),ps=(rt=fs.value)instanceof Fn,fa=fs.done;Promise.resolve(ps?rt[0]:rt).then(Gt=>ps?Be(pt==="return"?pt:"next",rt[1]?{done:Gt.done,value:Gt.value}:Gt,Ge,yt):Ge({value:Gt,done:fa})).catch(Gt=>Be("throw",Gt,Ge,yt))}catch(Gt){yt(Gt)}},Lt=pt=>J[pt]=rt=>new Promise((Ge,yt)=>Be(pt,rt,Ge,yt)),J={};return Se=Se.apply(de,ge),J[Yl("asyncIterator")]=()=>J,Lt("next"),Lt("throw"),Lt("return"),J};var da=(de,ge,Se)=>(ge=de[Yl("asyncIterator")])?ge.call(de):(de=de[Yl("iterator")](),ge={},Se=(Be,Lt)=>(Lt=de[Be])&&(ge[Be]=J=>new Promise((pt,rt,Ge)=>(J=Lt.call(de,J),Ge=J.done,Promise.resolve(J.value).then(yt=>pt({value:yt,done:Ge}),rt)))),Se("next"),Se("return"),ge);var Rb,Nb,Ob;var Se=document.createElement("style");Se.textContent=`._spinner_1lif3_1{height:100%;width:100%}@keyframes _spin_1lif3_1{to{transform:rotate(360deg)}}._spinner_1lif3_1{animation:_spin_1lif3_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}._spinner_1lif3_1:is(._dark_1lif3_1 *){fill:#d1d5db;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._spinnerContainer_1lif3_5{height:40px;width:40px}._success_1lif3_9{position:absolute;top:50%;left:50%;height:3.5rem;width:3.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#0d776e;z-index:3}._successContainer_1lif3_14{position:relative;display:grid;height:5rem;width:5rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._successContainer_1lif3_14:is(._dark_1lif3_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._successContainer_1lif3_14{z-index:0;animation:_containerPulse_1lif3_1 3s ease-in-out infinite}._successContainer_1lif3_14:before,._successContainer_1lif3_14:after{content:"";position:absolute;inset:0;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._successContainer_1lif3_14:is(._dark_1lif3_1 *):before,._successContainer_1lif3_14:is(._dark_1lif3_1 *):after{--tw-bg-opacity: 1;background-color:rgb(167 233 193 / var(--tw-bg-opacity, 1))}._successContainer_1lif3_14:before,._successContainer_1lif3_14:after{animation:_ripplePulse_1lif3_1 3s cubic-bezier(.4,0,.6,1) infinite;opacity:0;z-index:1}._successContainer_1lif3_14:after{animation-delay:.5s}@keyframes _containerPulse_1lif3_1{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes _ripplePulse_1lif3_1{0%{transform:scale(1);opacity:0}10%{transform:scale(1);opacity:.7}to{transform:scale(1.3);opacity:0}}._container_1lif3_57{width:30px;height:20px;display:flex;margin:0 1px;align-items:center;justify-content:center}._card_1lif3_66{width:28px;height:19px;display:flex;margin:0 1px;align-items:center;justify-content:center}._warning_1lif3_75{width:16px;height:16px;display:flex;align-items:center;justify-content:center}._svg_1lif3_83{width:100%;height:100%}._srOnly_1lif3_88{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._backButton_1lif3_92{width:30px;height:30px;display:flex;margin:0 1px;align-items:center;justify-content:center;background-color:#f4f4f5;border-radius:8px}._loader_nwq3e_1{position:absolute;height:100%;top:0;left:0;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:1000;display:flex;width:100%;align-items:center;justify-content:center;border-radius:10px}._checkout_15zm1_1{padding:0 4px;overflow:hidden;z-index:0;position:relative;height:auto;min-height:60px;width:100%;max-width:640px}._hidden_15zm1_8{display:none!important}._formInitial_15zm1_12{opacity:0;transform:translateY(100px)}._cardForm_15zm1_17{opacity:1}._btnsInitial_15zm1_21{opacity:0;transform:translateY(-100px)}._buttons_qc8am_1{display:flex;flex-direction:column;gap:8px;opacity:1}._hidden_qc8am_8{display:none!important}._skeleton_qc8am_12{overflow:hidden;width:100%;height:40px;border-radius:12px;background:linear-gradient(90deg,#f0f0f0,#e0e0e0 20%,#f0f0f0 40% 100%);background-size:200% 100%;animation:_shimmer_qc8am_1 2s infinite}@keyframes _shimmer_qc8am_1{0%{background-position:-200% 0}to{background-position:200% 0}}._applePay_1wlwu_1{display:flex;flex-direction:column;gap:8px}@media (hover: hover){._applePay_1wlwu_1:hover{filter:contrast(.575) brightness(1.2)}}._hidden_1wlwu_13{display:none!important}._googlePay_17y0j_1{position:relative;display:flex;overflow:hidden;height:40px;border-radius:12px}._googlePay_17y0j_1 iframe{position:absolute;top:-1px;left:-1px;width:calc(100% + 2px)!important;height:calc(100% + 2px)!important;border:none;display:block}._hidden_17y0j_19{display:none!important}._paypal_iyh6g_1{display:flex;flex-direction:column;gap:8px}._hidden_iyh6g_7{display:none}._button_1trim_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:1.5rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1trim_1{transition-property:none}}._button_1trim_1 span{margin-left:.25rem}@media (hover: hover){._button_1trim_1:hover{opacity:.7}}._container_10ziz_2{display:flex;flex-direction:column;gap:.5rem}._venmo_10ziz_8{display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:12px;height:40px;background-color:#0088f7;width:100%;color:#fff;font-size:16px;text-align:center;cursor:pointer;transition:background-color .3s ease;svg{height:40%}@media (hover: hover){&:hover{background-color:#5683c1}}}._hidden_10ziz_35{display:none}._button_125my_1{cursor:pointer}._button_1d7ly_1{margin-top:8px;transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-radius:.75rem;border-style:none;--tw-bg-opacity: 1;background-color:rgb(13 118 110 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_1d7ly_1{transition-property:none}}._button_1d7ly_1 span{margin-left:.25rem}._disabled_1d7ly_18{opacity:.7}@media (hover: hover){._button_1d7ly_1:hover{opacity:.7}}._hidden_1d7ly_28{display:none!important}._spinner_1d7ly_32{width:24px;height:24px}._cardForm_1uc4x_1{position:relative;display:grid;min-height:250px;gap:.75rem;padding-top:0;opacity:1}._hidden_1uc4x_6{display:none!important}._topOffset_1uc4x_10{margin-top:.5rem}._wrapper_1xw0g_1{position:relative}._inputContainer_1xw0g_5{background-color:transparent;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;padding-left:.75rem;padding-right:.75rem}._inputContainer_1xw0g_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xw0g_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1xw0g_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_1xw0g_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_1xw0g_12{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._inputContainer_1xw0g_5:focus-within:not(._disabled_1xw0g_23){box-shadow:0 0 0 1px #0d766eb3,0 1px 1px #00000012,0 0 0 4px #0d766e4d}._input_1xw0g_5{display:block;width:100%;height:100%;border:none;font-size:1rem;font-weight:400;outline:none;background-color:transparent;color:#1a1a1ae6}._endContent_1xw0g_39{display:flex}._errorInput_1xw0g_18{box-shadow:0 0 0 1px #dc2727,0 2px 4px #00000012,0 1px 1.5px #0000000d}._error_1xw0g_18{margin-top:4px;margin-bottom:0;padding-left:4px;font-size:12px;font-weight:400;color:#ef4444}._label_1xw0g_56{margin-bottom:3px;display:flex;justify-content:space-between;padding-left:1px;padding-right:2px;font-size:12px;font-weight:500;color:#1a1a1ab2}._labelError_1xw0g_67{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_1xw0g_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_1xw0g_75{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_1xw0g_82{display:none!important}._wrapper_41zd2_1{position:relative}._inputContainer_41zd2_5{background-color:transparent;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;transition:box-shadow .2s ease-in-out;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;padding-left:.75rem;padding-right:.75rem}._inputContainer_41zd2_5::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_41zd2_5:-ms-input-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_41zd2_5::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}@media (min-width: 640px){._inputContainer_41zd2_5{font-size:.875rem;line-height:1.25rem}}._inputFocus_41zd2_12{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._inputContainer_41zd2_5:focus-within:not(._disabled_41zd2_23){box-shadow:0 0 0 1px #0d766eb3,0 1px 1px #00000012,0 0 0 4px #0d766e4d}._input_41zd2_5{display:block;width:100%;height:100%;border:none;font-size:1rem;font-weight:400;outline:none;background-color:transparent;color:#1a1a1ae6}._endContent_41zd2_39{display:flex}._errorInput_41zd2_18{box-shadow:0 0 0 1px #dc2727,0 2px 4px #00000012,0 1px 1.5px #0000000d}._error_41zd2_18{margin-top:4px;margin-bottom:0;padding-left:4px;font-size:12px;font-weight:400;color:#ef4444}._label_41zd2_56{margin-bottom:3px;display:flex;justify-content:space-between;padding-left:1px;padding-right:2px;font-size:12px;font-weight:500;color:#1a1a1ab2}._labelError_41zd2_67{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._disabled_41zd2_23{border-style:none;--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}._disabledInput_41zd2_75{opacity:1;-webkit-appearance:none!important;-webkit-text-fill-color:#9ca3af!important;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._hidden_41zd2_82{display:none!important}._securityContent_41zd2_86{display:grid;grid-column-gap:6px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,auto))}._container_79xkl_1{display:flex;min-height:292px;width:100%;flex-direction:column;align-items:center;justify-content:center}._title_79xkl_5{margin-top:.5rem;font-weight:300}._container_g3abj_1{border-radius:12px;margin-top:.5rem;display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:flex-start;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_g3abj_1:is(._dark_g3abj_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._container_g3abj_1 svg{margin-top:2px;width:16px;height:16px}._title_g3abj_12{padding:0;padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}._title_g3abj_12:is(._dark_g3abj_1 *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(Se);function Be(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}class Lt{constructor(){N(this,"core")}mount(e,n){return j(this,null,function*(){var s,o,a,c,u,d,l,f,p,h,m;const r=document.getElementById(e);if(!r){console.error(`Element with id "${e}" not found`);return}if(!this.core){const _=(yield Promise.resolve().then(()=>$D)).Core;this.core=new _}n.styles&&((a=(o=(s=this.core)==null?void 0:s.state)==null?void 0:o.styles)==null||a.setState(n.styles)),(d=(u=(c=this.core)==null?void 0:c.state)==null?void 0:u.checkout)==null||d.setState({clientToken:n.clientToken,environment:n.environment,apiVersion:n.apiVersion,errorMessageText:n.errorMessageText});const i=yield(f=(l=this.core)==null?void 0:l.checkout)==null?void 0:f.mount();r.innerHTML="",r.appendChild(i),(m=(h=(p=this.core)==null?void 0:p.state)==null?void 0:h.checkout)==null||m.setState(n)})}unmount(e){return j(this,null,function*(){var r;const n=document.getElementById(e);!n||!this.core||(n.innerHTML="",(r=this.core)==null||r.clearState())})}}var J=(t=>(t.PAYPAL="PAYPAL",t.APPLE_PAY="APPLEPAY",t.GOOGLE_PAY="GPAY",t.CARD="CARD",t.VENMO="VENMO",t))(J||{}),pt=(t=>(t.PENDING="PENDING",t.FAILED="FAILED",t.AUTHORIZED="AUTHORIZED",t.SETTLING="SETTLING",t.SETTLED="SETTLED",t.DECLINED="DECLINED",t.CANCELLED="CANCELLED",t))(pt||{});const rt={appIds:{develop:"app_00b96c0c3011",staging:"app_00396c84ac2b",sandbox:"app_03b1ea2b6dfa",production:"app_409cf462b6cc"},teamId:"team_f20c9e679d47"},Ge=(t="sandbox")=>({develop:"https://dev-api.paynext.com",staging:"https://staging-api.paynext.com",sandbox:"https://sandbox-api.paynext.com",production:"https://api.paynext.com"})[t],yt=[{type:J.PAYPAL,order:1,is_active:!0},{type:J.APPLE_PAY,order:2,is_active:!0},{type:J.GOOGLE_PAY,order:3,is_active:!0},{type:J.CARD,order:4,is_active:!0}],fs=t=>t.googlePay?J.GOOGLE_PAY:t.applePay?J.APPLE_PAY:t.paypal?J.PAYPAL:t.braintree?J.VENMO:J.CARD,ps=t=>{const e=t.card;if(e)return{bin:e.firstSixDigits,bin_data:{brand:e.cardBrand,country:e.country,currency_code:e.currency,funding:e.funding,issuer:e.issuer,type:e.type},cvc:e.cvc,exp_month:Number(e.expMonth),exp_year:Number(e.expYear),last4:e.lastFourDigits,number:e.number}},fa=t=>{var n;const e=t.paypal;if((n=e==null?void 0:e.billing_agreement_token)!=null&&n.paypalId)return{billing_agreement_token:e.billing_agreement_token.paypalId}},Gt=t=>{var n,r,i,s,o,a,c,u,d,l,f,p,h,m,g,_,b,C;const e=t.googlePay;if(e!=null&&e.token)return{cryptogram:e.cryptogram,eci:e.eci,exp_month:(r=(n=e.card)==null?void 0:n.expiry)!=null&&r.month||(s=(i=e.token)==null?void 0:i.expiry)!=null&&s.month?Number(((a=(o=e.card)==null?void 0:o.expiry)==null?void 0:a.month)||((u=(c=e.token)==null?void 0:c.expiry)==null?void 0:u.month)):void 0,exp_year:(l=(d=e.card)==null?void 0:d.expiry)!=null&&l.year||(p=(f=e.token)==null?void 0:f.expiry)!=null&&p.year?Number(((m=(h=e.card)==null?void 0:h.expiry)==null?void 0:m.year)||((_=(g=e.token)==null?void 0:g.expiry)==null?void 0:_.year)):void 0,token:(b=e.token)==null?void 0:b.number,token_service_provider:(C=e.token)==null?void 0:C.tokenServiceProvider}},Lb=t=>{var n,r,i,s,o,a;const e=t.applePay;if(e)return{cryptogram:e.cryptogram,eci:e.eci,exp_month:(r=(n=e.networkToken)==null?void 0:n.expiry)!=null&&r.month?Number(e.networkToken.expiry.month):void 0,exp_year:(s=(i=e.networkToken)==null?void 0:i.expiry)!=null&&s.year?Number(e.networkToken.expiry.year):void 0,token:(o=e.networkToken)==null?void 0:o.number,token_service_provider:(a=e.networkToken)==null?void 0:a.tokenServiceProvider}},Db=t=>{const e=t.braintree;if(e)return{payment_method_nonce:e.nonce}},Ql=t=>{var r,i,s,o,a,c,u,d,l,f,p,h,m,g;const{applePay:e,googlePay:n}=t;if(!(!e&&!n))return{city:((r=e==null?void 0:e.billingContact)==null?void 0:r.locality)||((i=n==null?void 0:n.billingAddress)==null?void 0:i.locality)||void 0,country:((s=e==null?void 0:e.billingContact)==null?void 0:s.countryCode)||((o=n==null?void 0:n.billingAddress)==null?void 0:o.countryCode)||void 0,line1:((c=(a=e==null?void 0:e.billingContact)==null?void 0:a.addressLines)==null?void 0:c.at(0))||((u=n==null?void 0:n.billingAddress)==null?void 0:u.address1)||void 0,line2:((l=(d=e==null?void 0:e.billingContact)==null?void 0:d.addressLines)==null?void 0:l.at(1))||((f=n==null?void 0:n.billingAddress)==null?void 0:f.address2)||void 0,postal_code:((p=e==null?void 0:e.billingContact)==null?void 0:p.postalCode)||((h=n==null?void 0:n.billingAddress)==null?void 0:h.postalCode)||void 0,state:((m=e==null?void 0:e.billingContact)==null?void 0:m.administrativeArea)||((g=n==null?void 0:n.billingAddress)==null?void 0:g.administrativeArea)||void 0}},Jl=t=>{var i,s,o,a,c,u,d,l,f,p,h,m,g,_,b,C,A,I,k,w,O,M,V;const{card:e,googlePay:n,applePay:r}=t;if(!(!e&&!(n!=null&&n.card)&&!(r!=null&&r.card)))return{bin:e==null?void 0:e.firstSixDigits,bin_data:{brand:(e==null?void 0:e.cardBrand)||((i=n==null?void 0:n.card)==null?void 0:i.brand)||((s=r==null?void 0:r.card)==null?void 0:s.brand),country:(e==null?void 0:e.country)||((o=n==null?void 0:n.card)==null?void 0:o.country)||((a=r==null?void 0:r.card)==null?void 0:a.country),currency_code:(e==null?void 0:e.currency)||((c=n==null?void 0:n.card)==null?void 0:c.currency)||((u=r==null?void 0:r.card)==null?void 0:u.currency),funding:(e==null?void 0:e.funding)||((d=n==null?void 0:n.card)==null?void 0:d.funding)||((l=r==null?void 0:r.card)==null?void 0:l.funding),issuer:(e==null?void 0:e.issuer)||((f=n==null?void 0:n.card)==null?void 0:f.issuer)||((p=r==null?void 0:r.card)==null?void 0:p.issuer),type:(e==null?void 0:e.type)||((h=n==null?void 0:n.card)==null?void 0:h.segment)||((m=r==null?void 0:r.card)==null?void 0:m.segment)},cvc:e==null?void 0:e.cvc,exp_month:e!=null&&e.expMonth||(_=(g=n==null?void 0:n.card)==null?void 0:g.expiry)!=null&&_.month?Number((e==null?void 0:e.expMonth)||((C=(b=n==null?void 0:n.card)==null?void 0:b.expiry)==null?void 0:C.month)):void 0,exp_year:e!=null&&e.expYear||(I=(A=n==null?void 0:n.card)==null?void 0:A.expiry)!=null&&I.year?Number((e==null?void 0:e.expYear)||((w=(k=n==null?void 0:n.card)==null?void 0:k.expiry)==null?void 0:w.year)):void 0,last4:(e==null?void 0:e.lastFourDigits)||((O=n==null?void 0:n.card)==null?void 0:O.lastFour)||((M=r==null?void 0:r.card)==null?void 0:M.lastFour),number:(e==null?void 0:e.number)||((V=n==null?void 0:n.card)==null?void 0:V.number)}},Zl=t=>{var r,i;const{applePay:e,card:n}=t;return(r=e==null?void 0:e.billingContact)!=null&&r.givenName?`${e.billingContact.givenName} ${e.billingContact.familyName||""}`.trim():(i=n==null?void 0:n.metadata)==null?void 0:i.name},Fb=t=>{var r,i,s,o,a,c,u,d;const e=fs(t),n={client_session:t.clientSession,three_ds_session_id:t.threeDsSessionId,type:e};switch(e){case J.CARD:return $(y({},n),{name:Zl(t),card:ps(t)});case J.PAYPAL:return $(y({},n),{paypal:fa(t)});case J.GOOGLE_PAY:return $(y({},n),{name:(i=(r=t.googlePay)==null?void 0:r.billingAddress)==null?void 0:i.name,phone:(c=(a=(o=(s=t.googlePay)==null?void 0:s.billingAddress)==null?void 0:o.phoneNumber)==null?void 0:a.replace(/ /g,""))==null?void 0:c.replace(/-/g,""),card:Jl(t),google_pay:Gt(t),billing_address:Ql(t)});case J.APPLE_PAY:return $(y({},n),{name:Zl(t),card:Jl(t),apple_pay:Lb(t),phone:(d=(u=t.applePay)==null?void 0:u.shippingContact)==null?void 0:d.phoneNumber,billing_address:Ql(t)});case J.VENMO:return $(y({},n),{venmo:Db(t)});default:throw new Error(`Unsupported payment method: ${e}`)}},Ub=(t,e,n)=>j(this,null,function*(){const r=`${Ge(e)}/payments/create`,i=new Headers;i.append("Content-Type","application/json"),i.append("X-API-Version",n);const s=Fb(t);try{return yield(yield fetch(r,{method:"POST",headers:i,body:JSON.stringify(s)})).json()}catch(o){throw new Error("Failed to create payment: "+(o==null?void 0:o.message))}}),Bb=(t,e,n)=>j(this,null,function*(){const r=`${Ge(e)}/payments/create/billing/agreement`,i=new Headers;return i.append("Content-Type","application/json"),i.append("X-API-Version",n),(yield(yield fetch(r,{method:"POST",headers:i,body:JSON.stringify({client_session:t})})).json()).paypal_agreement_token_response.token_id||""}),Vb=(t,e,n)=>j(this,null,function*(){const r=new Headers;r.append("X-API-Version",n);const i=`${Ge(e)}/payments/config?client_session_id=${t}`;try{const o=yield(yield fetch(i,{headers:r})).json();return o.checkout_config||(o.checkout_config=yt),o}catch(s){console.error("Failed to get transaction config:",s);const o=new Error("INVALID_SESSION");throw o.name="INVALID_SESSION",o}});let $b=class{constructor(e){N(this,"apple",null);N(this,"isAvailable",!0);N(this,"onReady");this.ev=e}init(u,d){return j(this,arguments,function*({transaction:e,locale:n,onReady:r,onError:i,onSuccess:s,onCancel:o,onPaymentAttempt:a},c){const l=this.ev.transactions.create(e);this.apple=this.ev.ui.applePay(l,$(y({locale:n,borderRadius:12,size:{width:"100%",height:"40px"}},c==null?void 0:c.styles),{allowedCardNetworks:["visa","masterCard"],requestBillingAddress:!0,requestPayerDetails:["name","email","phone"],process:(h,m)=>j(this,[h,m],function*(f,{fail:p}){a==null||a({paymentMethod:J.APPLE_PAY});try{s==null||s(f)}catch(g){console.error(g),p({message:"Cannot pay with payment credentials"})}})})),i&&this.apple.on("error",f=>i({e:f,paymentMethod:J.APPLE_PAY})),o&&this.apple.on("cancel",o),this.onReady=r})}render(e){return j(this,null,function*(){var n;if(!(!this.apple||!this.isAvailable)){e.innerHTML="";try{yield this.apple.mount(e),(n=this.onReady)==null||n.call(this)}catch(r){throw console.error(r),new Error(r instanceof Error?r.message:"Failed to render Apple Pay button")}}})}},zb=class{constructor(e){N(this,"google",null);this.ev=e}init(u,d){return j(this,arguments,function*({transaction:e,locale:n,onReady:r,onError:i,onSuccess:s,onCancel:o,onPaymentAttempt:a},c){const l=this.ev.transactions.create(e);this.google=this.ev.ui.googlePay(l,$(y({locale:n,size:{width:"100%",height:40},borderRadius:12,billingAddress:{phoneNumber:!0}},c==null?void 0:c.styles),{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"],process:(h,m)=>j(this,[h,m],function*(f,{fail:p}){a==null||a({paymentMethod:J.GOOGLE_PAY});try{s==null||s(f)}catch(g){console.error(g),p({message:"Cannot pay with payment credentials"})}})})),o&&this.google.on("cancel",o),r&&this.google.on("ready",r),i&&this.google.on("error",f=>i({e:f,paymentMethod:J.GOOGLE_PAY}))})}render(e){return j(this,null,function*(){this.google&&(e.innerHTML="",this.google.mount(e))})}};class qe{constructor(){N(this,"listeners",[])}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}addListener(e){return this.listeners.push(e),()=>this.removeListener(e)}emit(e){for(const n of this.listeners)n(e)}clear(){this.listeners=[]}}class jb{constructor(e){N(this,"threeDs",null);this.ev=e}init(s){return j(this,arguments,function*({threeDsId:e,onReady:n,onSuccess:r,onError:i}){this.threeDs=this.ev.ui.threeDSecure(e),this.threeDs.on("ready",()=>n==null?void 0:n()),this.threeDs.on("success",()=>r==null?void 0:r()),this.threeDs.on("failure",()=>i==null?void 0:i()),this.threeDs.on("error",()=>i==null?void 0:i())})}render(e){return j(this,null,function*(){this.threeDs&&this.threeDs.mount(e)})}}class Hb{constructor(){N(this,"isReady",!1);N(this,"ev",null);N(this,"apple",null);N(this,"google",null);N(this,"threeDs",null);N(this,"events",{ready:new qe})}isShouldLoad({teamId:e,appId:n}){var r,i;return((r=this.ev)==null?void 0:r.config.appId)!==n||((i=this.ev)==null?void 0:i.config.teamId)!==e}preloadEvervault(e){return j(this,null,function*(){if(!this.isShouldLoad(e))return;if(typeof window=="undefined")throw new Error("Evervault can only be initialized in browser environment");this.isReady=!1;const{loadEvervault:n}=yield Promise.resolve().then(()=>HD);this.ev=yield n(e.teamId,e.appId)})}initEv(e){return j(this,null,function*(){this.ev||(yield this.preloadEvervault(e)),this.apple=new $b(this.ev),this.google=new zb(this.ev),this.events.ready.emit(),this.isReady=!0})}initThreeDs(e){return j(this,null,function*(){if(!this.ev)throw new Error("Evervault should be init before using Three DS Secure");this.threeDs=new jb(this.ev),yield this.threeDs.init(e),yield this.threeDs.render()})}initApple(e,n){return j(this,null,function*(){if(!this.apple)throw new Error("Evervault should be init before using Apple Pay");yield this.apple.init(e,n)})}initGoogle(e,n){return j(this,null,function*(){if(!this.google)throw new Error("Evervault should be init before using Google Pay");yield this.google.init(e,n)})}isAppleAvailable(){var e;return!!((e=this.apple)!=null&&e.isAvailable)}addEventListener(e,n){return this.events[e].addListener(n)}renderApple(e){return j(this,null,function*(){var n;return(n=this.apple)==null?void 0:n.render(e)})}renderGoogle(e){return j(this,null,function*(){var n;return(n=this.google)==null?void 0:n.render(e)})}getEv(){if(!this.ev)throw new Error("Evervault should be init before getting instance");return this.ev}}function pa(t){return typeof t=="object"&&!Array.isArray(t)}function Wb(t,e,n){var r;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const s=(r=n==null?void 0:n[t])!=null?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function ed(t,e,n,r){return typeof t=="string"&&pa(e)?Wb(t,n,r):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Gb(t,e,n){return t*(e+1)}function td(t,e,n,r){var i;return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:(i=r.get(e))!=null?i:t}const ui=(t,e,n)=>t+(e-t)*n,qb=(t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t},nd=t=>Array.isArray(t)&&typeof t[0]!="number";function rd(t,e){return nd(t)?t[qb(0,t.length,e)]:t}function Kb(t,e){t.indexOf(e)===-1&&t.push(e)}function id(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function Yb(t,e,n){for(let r=0;r<t.length;r++){const i=t[r];i.at>e&&i.at<n&&(id(t,i),r--)}}function Xb(t,e,n,r,i,s){Yb(t,i,s);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ui(i,s,r[o]),easing:rd(n,o)})}function Qb(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Jb(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const ct=t=>!!(t&&t.getVelocity),ha=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};function sd(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=ha(0,e,r);t.push(ui(n,1,i))}}function od(t){const e=[0];return sd(e,t.length-1),e}function ma(t){return typeof t=="function"&&"applyToOptions"in t}const hs=2e4;function ga(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<hs;)e+=n,r=t.next(e);return e>=hs?1/0:e}const Dt=t=>t*1e3,en=t=>t/1e3;function ad(t,e=100,n){const r=n($(y({},t),{keyframes:[0,e]})),i=Math.min(ga(r),hs);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:en(i)}}let li=()=>{},tn=()=>{};process.env.NODE_ENV!=="production"&&(li=(t,e)=>{!t&&typeof console!="undefined"&&console.warn(e)},tn=(t,e)=>{if(!t)throw new Error(e)});const Zb="easeInOut",ev=20;function tv(t,s={},r,i){var o=s,{defaultTransition:e={}}=o,n=at(o,["defaultTransition"]);const a=e.duration||.3,c=new Map,u=new Map,d={},l=new Map;let f=0,p=0,h=0;for(let m=0;m<t.length;m++){const g=t[m];if(typeof g=="string"){l.set(g,p);continue}else if(!Array.isArray(g)){l.set(g.name,td(p,g.at,f,l));continue}let[_,b,C={}]=g;C.at!==void 0&&(p=td(p,C.at,f,l));let A=0;const I=(k,w,O,M=0,V=0)=>{const Y=nv(k),G=w,{delay:L=0,times:U=od(Y),type:z="keyframes",repeat:Q,repeatType:B,repeatDelay:K=0}=G,H=at(G,["delay","times","type","repeat","repeatType","repeatDelay"]);let{ease:E=e.ease||"easeOut",duration:v}=w;const P=typeof L=="function"?L(M,V):L,W=Y.length,S=ma(z)?z:i==null?void 0:i[z];if(W<=2&&S){let x=100;if(W===2&&sv(Y)){const Ce=Y[1]-Y[0];x=Math.abs(Ce)}const X=y({},H);v!==void 0&&(X.duration=Dt(v));const ne=ad(X,x,S);E=ne.ease,v=ne.duration}v!=null||(v=a);const R=p+P;U.length===1&&U[0]===0&&(U[1]=1);const T=U.length-Y.length;if(T>0&&sd(U,T),Y.length===1&&Y.unshift(null),Q){tn(Q<ev,"Repeat count too high, must be less than 20"),v=Gb(v,Q);const x=[...Y],X=[...U];E=Array.isArray(E)?[...E]:[E];const ne=[...E];for(let Ce=0;Ce<Q;Ce++){Y.push(...x);for(let q=0;q<x.length;q++)U.push(X[q]+(Ce+1)),E.push(q===0?"linear":rd(ne,q-1))}Qb(U,Q)}const F=R+v;Xb(O,Y,E,U,R,F),A=Math.max(P+v,A),h=Math.max(F,h)};if(ct(_)){const k=cd(_,u);I(b,C,ud("default",k))}else{const k=ed(_,b,r,d),w=k.length;for(let O=0;O<w;O++){b=b,C=C;const M=k[O],V=cd(M,u);for(const Y in b)I(b[Y],rv(C,Y),ud(Y,V),O,w)}}f=p,p+=A}return u.forEach((m,g)=>{for(const _ in m){const b=m[_];b.sort(Jb);const C=[],A=[],I=[];for(let w=0;w<b.length;w++){const{at:O,value:M,easing:V}=b[w];C.push(M),A.push(ha(0,h,O)),I.push(V||"easeOut")}A[0]!==0&&(A.unshift(0),C.unshift(C[0]),I.unshift(Zb)),A[A.length-1]!==1&&(A.push(1),C.push(null)),c.has(g)||c.set(g,{keyframes:{},transition:{}});const k=c.get(g);k.keyframes[_]=C,k.transition[_]=y($(y({},e),{duration:h,ease:I,times:A}),n)}}),c}function cd(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ud(t,e){return e[t]||(e[t]=[]),e[t]}function nv(t){return Array.isArray(t)?t:[t]}function rv(t,e){return t&&t[e]?y(y({},t),t[e]):y({},t)}const iv=t=>typeof t=="number",sv=t=>t.every(iv),di=new WeakMap,ov=t=>Array.isArray(t);function ld(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function dd(t,e,n,r){if(typeof e=="function"){const[i,s]=ld(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=ld(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function av(t,e,n){const r=t.getProps();return dd(r,e,r.custom,t)}const ms=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function cv(t,e){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,l=!1,f=!1)=>{const h=f&&i?n:r;return l&&o.add(d),h.has(d)||h.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),n.clear(),i=!1,s&&(s=!1,u.process(d))}};return u}const nn={},uv=40;function lv(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=ms.reduce((C,A)=>(C[A]=cv(s),C),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:l,preRender:f,render:p,postRender:h}=o,m=()=>{const C=nn.useManualTiming?i.timestamp:performance.now();n=!1,nn.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(C-i.timestamp,uv),1)),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),d.process(i),l.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(m))},g=()=>{n=!0,r=!0,i.isProcessing||t(m)};return{schedule:ms.reduce((C,A)=>{const I=o[A];return C[A]=(k,w=!1,O=!1)=>(n||g(),I.schedule(k,w,O)),C},{}),cancel:C=>{for(let A=0;A<ms.length;A++)o[ms[A]].cancel(C)},state:i,steps:o}}const gr=t=>t,{schedule:rn,cancel:_a,state:gs}=lv(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:gr,!0);let _s;function dv(){_s=void 0}const Ct={now:()=>(_s===void 0&&Ct.set(gs.isProcessing||nn.useManualTiming?gs.timestamp:performance.now()),_s),set:t=>{_s=t,queueMicrotask(dv)}},fd=new Set;function pd(t,e,n){t||fd.has(e)||(console.warn(e),fd.add(e))}class hd{constructor(){this.subscriptions=[]}add(e){return Kb(this.subscriptions,e),()=>id(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function md(t,e){return e?t*(1e3/e):0}const gd=30,fv=t=>!isNaN(parseFloat(t));class pv{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{var o,a;const s=Ct.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty();i&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ct.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fv(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&pd(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new hd);const r=this.events[e].add(n);return e==="change"?()=>{r(),rn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gd)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gd);return md(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fi(t,e){return new pv(t,e)}function hv(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,fi(n))}function mv(t){return ov(t)?t[t.length-1]||0:t}function gv(t,e){let o=av(t,e)||{},{transitionEnd:r={},transition:i={}}=o,s=at(o,["transitionEnd","transition"]);s=y(y({},s),r);for(const a in s){const c=mv(s[a]);hv(t,a,c)}}function _v(t){return!!(ct(t)&&t.add)}function yv(t,e){const n=t.getValue("willChange");if(_v(n))return n.add(e);if(!n&&nn.WillChange){const r=new nn.WillChange("auto");t.addValue("willChange",r),r.add(e)}}const ya=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bv="data-"+ya("framerAppearId");function vv(t){return t.props[bv]}const Ev=t=>t!==null;function Sv(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(Ev),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[s]}const _r=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yr=new Set(_r),wv={type:"spring",stiffness:500,damping:25,restSpeed:10},Cv=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Tv={type:"keyframes",duration:.8},Iv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Av=(t,{keyframes:e})=>e.length>2?Tv:yr.has(t)?t.startsWith("scale")?Cv(e[1]):wv:Iv;function kv(l){var f=l,{when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:u}=f,d=at(f,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}function _d(t,e){var n,r;return(r=(n=t==null?void 0:t[e])!=null?n:t==null?void 0:t.default)!=null?r:t}const yd=t=>e=>typeof e=="string"&&e.startsWith(t),bd=yd("--"),xv=yd("var(--"),ba=t=>xv(t)?Rv.test(t.split("/*")[0].trim()):!1,Rv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Un=(t,e,n)=>n>e?e:n<t?t:n,br={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},pi=$(y({},br),{transform:t=>Un(0,1,t)}),ys=$(y({},br),{default:1}),hi=t=>Math.round(t*1e5)/1e5,va=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Nv(t){return t==null}const Ov=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ea=(t,e)=>n=>!!(typeof n=="string"&&Ov.test(n)&&n.startsWith(t)||e&&!Nv(n)&&Object.prototype.hasOwnProperty.call(n,e)),vd=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(va);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Pv=t=>Un(0,255,t),Sa=$(y({},br),{transform:t=>Math.round(Pv(t))}),Bn={test:Ea("rgb","red"),parse:vd("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Sa.transform(t)+", "+Sa.transform(e)+", "+Sa.transform(n)+", "+hi(pi.transform(r))+")"};function Mv(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const wa={test:Ea("#"),parse:Mv,transform:Bn.transform},mi=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),En=mi("deg"),vr=mi("%"),ce=mi("px"),Lv=mi("vh"),Dv=mi("vw"),Ed=$(y({},vr),{parse:t=>vr.parse(t)/100,transform:t=>vr.transform(t*100)}),Er={test:Ea("hsl","hue"),parse:vd("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+vr.transform(hi(e))+", "+vr.transform(hi(n))+", "+hi(pi.transform(r))+")"},it={test:t=>Bn.test(t)||wa.test(t)||Er.test(t),parse:t=>Bn.test(t)?Bn.parse(t):Er.test(t)?Er.parse(t):wa.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Bn.transform(t):Er.transform(t)},Fv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Uv(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(va))==null?void 0:e.length)||0)+(((n=t.match(Fv))==null?void 0:n.length)||0)>0}const Sd="number",wd="color",Bv="var",Vv="var(",Cd="${}",$v=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function gi(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace($v,c=>(it.test(c)?(r.color.push(s),i.push(wd),n.push(it.parse(c))):c.startsWith(Vv)?(r.var.push(s),i.push(Bv),n.push(c)):(r.number.push(s),i.push(Sd),n.push(parseFloat(c))),++s,Cd)).split(Cd);return{values:n,split:a,indexes:r,types:i}}function Td(t){return gi(t).values}function Id(t){const{split:e,types:n}=gi(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Sd?s+=hi(i[o]):a===wd?s+=it.transform(i[o]):s+=i[o]}return s}}const zv=t=>typeof t=="number"?0:t;function jv(t){const e=Td(t);return Id(t)(e.map(zv))}const Sr={test:Uv,parse:Td,createTransformer:Id,getAnimatableNone:jv};function Ca(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Hv({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Ca(c,a,t+1/3),s=Ca(c,a,t),o=Ca(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function bs(t,e){return n=>n>0?e:t}const Ta=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Wv=[wa,Bn,Er],Gv=t=>Wv.find(e=>e.test(t));function Ad(t){const e=Gv(t);if(li(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Er&&(n=Hv(n)),n}const kd=(t,e)=>{const n=Ad(t),r=Ad(e);if(!n||!r)return bs(t,e);const i=y({},n);return s=>(i.red=Ta(n.red,r.red,s),i.green=Ta(n.green,r.green,s),i.blue=Ta(n.blue,r.blue,s),i.alpha=ui(n.alpha,r.alpha,s),Bn.transform(i))},Ia=new Set(["none","hidden"]);function qv(t,e){return Ia.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const Kv=(t,e)=>n=>e(t(n)),Aa=(...t)=>t.reduce(Kv);function Yv(t,e){return n=>ui(t,e,n)}function ka(t){return typeof t=="number"?Yv:typeof t=="string"?ba(t)?bs:it.test(t)?kd:Jv:Array.isArray(t)?xd:typeof t=="object"?it.test(t)?kd:Xv:bs}function xd(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>ka(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function Xv(t,e){const n=y(y({},t),e),r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=ka(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function Qv(t,e){var i;const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][r[o]],c=(i=t.values[a])!=null?i:0;n[s]=c,r[o]++}return n}const Jv=(t,e)=>{const n=Sr.createTransformer(e),r=gi(t),i=gi(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ia.has(t)&&!i.values.length||Ia.has(e)&&!r.values.length?qv(t,e):Aa(xd(Qv(r,i),i.values),n):(li(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),bs(t,e))};function Rd(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ui(t,e,n):ka(t)(t,e)}const Zv=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>rn.update(e,n),stop:()=>_a(e),now:()=>gs.isProcessing?gs.timestamp:Ct.now()}},Nd=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},eE=5;function Od(t,e,n){const r=Math.max(e-eE,0);return md(n-t(r),e-r)}const Le={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},xa=.001;function tE({duration:t=Le.duration,bounce:e=Le.bounce,velocity:n=Le.velocity,mass:r=Le.mass}){let i,s;li(t<=Dt(Le.maxDuration),"Spring duration must be 10 seconds or less");let o=1-e;o=Un(Le.minDamping,Le.maxDamping,o),t=Un(Le.minDuration,Le.maxDuration,en(t)),o<1?(i=u=>{const d=u*o,l=d*t,f=d-n,p=Ra(u,o),h=Math.exp(-l);return xa-f/p*h},s=u=>{const l=u*o*t,f=l*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,h=Math.exp(-l),m=Ra(Math.pow(u,2),o);return(-i(u)+xa>0?-1:1)*((f-p)*h)/m}):(i=u=>{const d=Math.exp(-u*t),l=(u-n)*t+1;return-xa+d*l},s=u=>{const d=Math.exp(-u*t),l=(n-u)*(t*t);return d*l});const a=5/t,c=rE(i,s,a);if(t=Dt(t),isNaN(c))return{stiffness:Le.stiffness,damping:Le.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const nE=12;function rE(t,e,n){let r=n;for(let i=1;i<nE;i++)r=r-t(r)/e(r);return r}function Ra(t,e){return t*Math.sqrt(1-e*e)}const iE=["duration","bounce"],sE=["stiffness","damping","mass"];function Pd(t,e){return e.some(n=>t[n]!==void 0)}function oE(t){let e=y({velocity:Le.velocity,stiffness:Le.stiffness,damping:Le.damping,mass:Le.mass,isResolvedFromDuration:!1},t);if(!Pd(t,sE)&&Pd(t,iE))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Un(.05,1,1-(t.bounce||0))*Math.sqrt(i);e=$(y({},e),{mass:Le.mass,stiffness:i,damping:s})}else{const n=tE(t);e=$(y(y({},e),n),{mass:Le.mass}),e.isResolvedFromDuration=!0}return e}function _i(t=Le.visualDuration,e=Le.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:l,velocity:f,isResolvedFromDuration:p}=oE($(y({},n),{velocity:-en(n.velocity||0)})),h=f||0,m=u/(2*Math.sqrt(c*d)),g=o-s,_=en(Math.sqrt(c/d)),b=Math.abs(g)<5;r||(r=b?Le.restSpeed.granular:Le.restSpeed.default),i||(i=b?Le.restDelta.granular:Le.restDelta.default);let C;if(m<1){const I=Ra(_,m);C=k=>{const w=Math.exp(-m*_*k);return o-w*((h+m*_*g)/I*Math.sin(I*k)+g*Math.cos(I*k))}}else if(m===1)C=I=>o-Math.exp(-_*I)*(g+(h+_*g)*I);else{const I=_*Math.sqrt(m*m-1);C=k=>{const w=Math.exp(-m*_*k),O=Math.min(I*k,300);return o-w*((h+m*_*g)*Math.sinh(O)+I*g*Math.cosh(O))/I}}const A={calculatedDuration:p&&l||null,next:I=>{const k=C(I);if(p)a.done=I>=l;else{let w=I===0?h:0;m<1&&(w=I===0?Dt(h):Od(C,I,k));const O=Math.abs(w)<=r,M=Math.abs(o-k)<=i;a.done=O&&M}return a.value=a.done?o:k,a},toString:()=>{const I=Math.min(ga(A),hs),k=Nd(w=>A.next(I*w).value,I,30);return I+"ms "+k},toTransition:()=>{}};return A}_i.applyToOptions=t=>{const e=ad(t,100,_i);return t.ease=e.ease,t.duration=Dt(e.duration),t.type="keyframes",t};function Na({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:d}){const l=t[0],f={done:!1,value:l},p=O=>a!==void 0&&O<a||c!==void 0&&O>c,h=O=>a===void 0?c:c===void 0||Math.abs(a-O)<Math.abs(c-O)?a:c;let m=n*e;const g=l+m,_=o===void 0?g:o(g);_!==g&&(m=_-l);const b=O=>-m*Math.exp(-O/r),C=O=>_+b(O),A=O=>{const M=b(O),V=C(O);f.done=Math.abs(M)<=u,f.value=f.done?_:V};let I,k;const w=O=>{p(f.value)&&(I=O,k=_i({keyframes:[f.value,h(f.value)],velocity:Od(C,O,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return w(0),{calculatedDuration:null,next:O=>{let M=!1;return!k&&I===void 0&&(M=!0,A(O),w(O)),I!==void 0&&O>=I?k.next(O-I):(!M&&A(O),f)}}}function aE(t,e,n){const r=[],i=n||nn.mix||Rd,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||gr:e;a=Aa(c,a)}r.push(a)}return r}function cE(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(tn(s===e.length,"Both input and output ranges must be the same length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=aE(e,r,i),c=a.length,u=d=>{if(o&&d<t[0])return e[0];let l=0;if(c>1)for(;l<t.length-2&&!(d<t[l+1]);l++);const f=ha(t[l],t[l+1],d);return a[l](f)};return n?d=>u(Un(t[0],t[s-1],d)):u}function uE(t,e){return t.map(n=>n*e)}const Md=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,lE=1e-7,dE=12;function fE(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=Md(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>lE&&++a<dE);return o}function yi(t,e,n,r){if(t===e&&n===r)return gr;const i=s=>fE(s,0,1,t,n);return s=>s===0||s===1?s:Md(i(s),e,r)}const pE=yi(.42,0,1,1),hE=yi(0,0,.58,1),Ld=yi(.42,0,.58,1),Dd=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fd=t=>e=>1-t(1-e),Ud=yi(.33,1.53,.69,.99),Oa=Fd(Ud),Bd=Dd(Oa),Vd=t=>(t*=2)<1?.5*Oa(t):.5*(2-Math.pow(2,-10*(t-1))),Pa=t=>1-Math.sin(Math.acos(t)),mE=Fd(Pa),$d=Dd(Pa),zd=t=>Array.isArray(t)&&typeof t[0]=="number",jd={linear:gr,easeIn:pE,easeInOut:Ld,easeOut:hE,circIn:Pa,circInOut:$d,circOut:mE,backIn:Oa,backInOut:Bd,backOut:Ud,anticipate:Vd},gE=t=>typeof t=="string",Hd=t=>{if(zd(t)){tn(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return yi(e,n,r,i)}else if(gE(t))return tn(jd[t]!==void 0,`Invalid easing type '${t}'`),jd[t];return t};function _E(t,e){return t.map(()=>e||Ld).splice(0,t.length-1)}function wr({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=nd(r)?r.map(Hd):Hd(r),s={done:!1,value:e[0]},o=uE(n&&n.length===e.length?n:od(e),t),a=cE(o,e,{ease:Array.isArray(i)?i:_E(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const yE=t=>t!==null;function Ma(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(yE),a=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const bE={decay:Na,inertia:Na,tween:wr,keyframes:wr,spring:_i};function Wd(t){typeof t.type=="string"&&(t.type=bE[t.type])}class La{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const vE=t=>t/100;class Da extends La{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ct.now()&&this.tick(Ct.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Wd(e);const{type:n=wr,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const c=n||wr;process.env.NODE_ENV!=="production"&&c!==wr&&tn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==wr&&typeof a[0]!="number"&&(this.mixKeyframes=Aa(vE,Rd(a[0],a[1])),a=[0,100]);const u=c($(y({},e),{keyframes:a}));s==="mirror"&&(this.mirroredGenerator=c($(y({},e),{keyframes:[...a].reverse(),velocity:-o}))),u.calculatedDuration===null&&(u.calculatedDuration=ga(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:l,repeatType:f,repeatDelay:p,type:h,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const _=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let C=this.currentTime,A=r;if(l){const O=Math.min(this.currentTime,i)/a;let M=Math.floor(O),V=O%1;!V&&O>=1&&(V=1),V===1&&M--,M=Math.min(M,l+1),!!(M%2)&&(f==="reverse"?(V=1-V,p&&(V-=p/a)):f==="mirror"&&(A=o)),C=Un(0,1,V)*a}const I=b?{done:!1,value:d[0]}:A.next(C);s&&(I.value=s(I.value));let{done:k}=I;!b&&c!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const w=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return w&&h!==Na&&(I.value=Ma(d,this.options,g,this.speed)),m&&m(I.value),w&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return en(this.calculatedDuration)}get time(){return en(this.currentTime)}set time(e){var n;e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Ct.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=en(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=Zv,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n!=null?n:r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ct.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function EE(t){var e;for(let n=1;n<t.length;n++)(e=t[n])!=null||(t[n]=t[n-1])}const Vn=t=>t*180/Math.PI,Fa=t=>{const e=Vn(Math.atan2(t[1],t[0]));return Ua(e)},SE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fa,rotateZ:Fa,skewX:t=>Vn(Math.atan(t[1])),skewY:t=>Vn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ua=t=>(t=t%360,t<0&&(t+=360),t),Gd=Fa,qd=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Kd=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),wE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qd,scaleY:Kd,scale:t=>(qd(t)+Kd(t))/2,rotateX:t=>Ua(Vn(Math.atan2(t[6],t[5]))),rotateY:t=>Ua(Vn(Math.atan2(-t[2],t[0]))),rotateZ:Gd,rotate:Gd,skewX:t=>Vn(Math.atan(t[4])),skewY:t=>Vn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ba(t){return t.includes("scale")?1:0}function Va(t,e){if(!t||t==="none")return Ba(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=wE,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=SE,i=a}if(!i)return Ba(e);const s=r[e],o=i[1].split(",").map(TE);return typeof s=="function"?s(o):o[s]}const CE=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Va(n,e)};function TE(t){return parseFloat(t.trim())}const Yd=t=>t===br||t===ce,IE=new Set(["x","y","z"]),AE=_r.filter(t=>!IE.has(t));function kE(t){const e=[];return AE.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const $n={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Va(e,"x"),y:(t,{transform:e})=>Va(e,"y")};$n.translateX=$n.x,$n.translateY=$n.y;const zn=new Set;let $a=!1,za=!1,ja=!1;function Xd(){if(za){const t=Array.from(zn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=kE(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}za=!1,$a=!1,zn.forEach(t=>t.complete(ja)),zn.clear()}function Qd(){zn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(za=!0)})}function xE(){ja=!0,Qd(),Xd(),ja=!1}class Ha{constructor(e,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(zn.add(this),$a||($a=!0,rn.read(Qd),rn.resolveKeyframes(Xd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}EE(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),zn.delete(this)}cancel(){this.state==="scheduled"&&(zn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const RE=t=>t.startsWith("--");function NE(t,e,n){RE(e)?t.style.setProperty(e,n):t.style[e]=n}function Wa(t){let e;return()=>(e===void 0&&(e=t()),e)}const OE=Wa(()=>window.ScrollTimeline!==void 0),PE={};function ME(t,e){const n=Wa(t);return()=>{var r;return(r=PE[e])!=null?r:n()}}const Jd=ME(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),bi=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Zd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bi([0,.65,.55,1]),circOut:bi([.55,0,1,.45]),backIn:bi([.31,.01,.66,-.59]),backOut:bi([.33,1.53,.69,.99])};function ef(t,e){if(t)return typeof t=="function"?Jd()?Nd(t,e):"ease-out":zd(t)?bi(t):Array.isArray(t)?t.map(n=>ef(n,e)||Zd.easeOut):Zd[t]}function LE(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const l=ef(a,i);Array.isArray(l)&&(d.easing=l);const f={delay:r,duration:i,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(d,f)}function DE(n){var r=n,{type:t}=r,e=at(r,["type"]);var i,s;return ma(t)&&Jd()?t.applyToOptions(e):((i=e.duration)!=null||(e.duration=300),(s=e.ease)!=null||(e.ease="easeOut"),e)}class FE extends La{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,tn(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const u=DE(e);this.animation=LE(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Ma(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):NE(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return en(Number(e))}get time(){return en(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&OE()?(this.animation.timeline=e,gr):n(this)}}const tf={anticipate:Vd,backInOut:Bd,circInOut:$d};function UE(t){return t in tf}function BE(t){typeof t.ease=="string"&&UE(t.ease)&&(t.ease=tf[t.ease])}const nf=10;class VE extends FE{constructor(e){BE(e),Wd(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){var d;const u=this.options,{motionValue:n,onUpdate:r,onComplete:i,element:s}=u,o=at(u,["motionValue","onUpdate","onComplete","element"]);if(!n)return;if(e!==void 0){n.set(e);return}const a=new Da($(y({},o),{autoplay:!1})),c=Dt((d=this.finishedTime)!=null?d:this.time);n.setWithVelocity(a.sample(c-nf).value,a.sample(c).value,nf),a.stop()}}const rf=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Sr.test(t)||t==="0")&&!t.startsWith("url("));function $E(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function zE(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=rf(i,e),a=rf(s,e);return li(o===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!o||!a?!1:$E(t)||(n==="spring"||ma(n))&&r}function sf(t){return typeof t=="object"&&t!==null}function jE(t){return sf(t)&&"offsetHeight"in t}const HE=new Set(["opacity","clipPath","filter","transform"]),WE=Wa(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function GE(t){var u;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=t;if(!jE((u=e==null?void 0:e.owner)==null?void 0:u.current))return!1;const{onUpdate:a,transformTemplate:c}=e.owner.getProps();return WE()&&n&&HE.has(n)&&(n!=="transform"||!c)&&!a&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const qE=40;class KE extends La{constructor(f){var p=f,{autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:d}=p,l=at(p,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var g;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Ct.now();const h=y({autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:c,motionValue:u,element:d},l),m=(d==null?void 0:d.KeyframeResolver)||Ha;this.keyframeResolver=new m(a,(_,b,C)=>this.onKeyframesResolved(_,b,h,!C),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Ct.now(),zE(e,s,o,a)||((nn.instantAnimations||!c)&&(d==null||d(Ma(e,r,n))),e[0]=e[e.length-1],r.duration=0,r.repeat=0);const l=i?this.resolvedAt?this.resolvedAt-this.createdAt>qE?this.resolvedAt:this.createdAt:this.createdAt:void 0,f=$(y({startTime:l,finalKeyframe:n},r),{keyframes:e}),p=!u&&GE(f)?new VE($(y({},f),{element:f.motionValue.owner.current})):new Da(f);p.finished.then(()=>this.notifyFinished()).catch(gr),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),xE()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const of=(t,e,n,r={},i,s)=>o=>{const a=_d(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Dt(c);const d=$(y({keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity()},a),{delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i});kv(a)||Object.assign(d,Av(t,d)),d.duration&&(d.duration=Dt(d.duration)),d.repeatDelay&&(d.repeatDelay=Dt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let l=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(l=!0)),(nn.instantAnimations||nn.skipAnimations)&&(l=!0,d.duration=0,d.delay=0),d.allowFlatten=!a.type&&!a.ease,l&&!s&&e.get()!==void 0){const f=Sv(d.keyframes,a);if(f!==void 0){rn.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new Da(d):new KE(d)},af=new Set(["width","height","top","left","right","bottom",..._r]);function YE({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function XE(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var l;let d=e,{transition:s=t.getDefaultTransition(),transitionEnd:o}=d,a=at(d,["transition","transitionEnd"]);r&&(s=r);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const p=t.getValue(f,(l=t.latestValues[f])!=null?l:null),h=a[f];if(h===void 0||u&&YE(u,f))continue;const m=y({delay:n},_d(s||{},f)),g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let _=!1;if(window.MotionHandoffAnimation){const C=vv(t);if(C){const A=window.MotionHandoffAnimation(C,f,rn);A!==null&&(m.startTime=A,_=!0)}}yv(t,f),p.start(of(f,p,h,t.shouldReduceMotion&&af.has(f)?{type:!1}:m,t,_));const b=p.animation;b&&c.push(b)}return o&&Promise.all(c).then(()=>{rn.update(()=>{o&&gv(t,o)})}),c}function QE({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function JE(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ZE(t,e){return QE(JE(t.getBoundingClientRect(),e))}const cf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ga={};for(const t in cf)Ga[t]={isEnabled:e=>cf[t].some(n=>!!e[n])};const uf=()=>({min:0,max:0}),qa=()=>({x:uf(),y:uf()}),e0=typeof window!="undefined",Ka={current:null},lf={current:!1};function t0(){if(lf.current=!0,!!e0)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ka.current=t.matches;t.addListener(e),e()}else Ka.current=!1}function n0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function r0(t){return typeof t=="string"||Array.isArray(t)}const i0=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function df(t){return n0(t.animate)||i0.some(e=>r0(t[e]))}function s0(t){return!!(df(t)||t.variants)}function o0(t,e,n){for(const r in e){const i=e[r],s=n[r];if(ct(i))t.addValue(r,i);else if(ct(s))t.addValue(r,fi(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,fi(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const ff=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),pf=t=>/^0[^.\s]+$/u.test(t),a0={test:t=>t==="auto",parse:t=>t},hf=t=>e=>e.test(t),mf=[br,ce,vr,En,Dv,Lv,a0],gf=t=>mf.find(hf(t)),c0=[...mf,it,Sr],u0=t=>c0.find(hf(t)),l0=new Set(["brightness","contrast","saturate","opacity"]);function d0(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(va)||[];if(!r)return t;const i=n.replace(r,"");let s=l0.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const f0=/\b([a-z-]*)\(.*?\)/gu,Ya=$(y({},Sr),{getAnimatableNone:t=>{const e=t.match(f0);return e?e.map(d0).join(" "):t}}),_f=$(y({},br),{transform:Math.round}),Xa=$(y({borderWidth:ce,borderTopWidth:ce,borderRightWidth:ce,borderBottomWidth:ce,borderLeftWidth:ce,borderRadius:ce,radius:ce,borderTopLeftRadius:ce,borderTopRightRadius:ce,borderBottomRightRadius:ce,borderBottomLeftRadius:ce,width:ce,maxWidth:ce,height:ce,maxHeight:ce,top:ce,right:ce,bottom:ce,left:ce,padding:ce,paddingTop:ce,paddingRight:ce,paddingBottom:ce,paddingLeft:ce,margin:ce,marginTop:ce,marginRight:ce,marginBottom:ce,marginLeft:ce,backgroundPositionX:ce,backgroundPositionY:ce},{rotate:En,rotateX:En,rotateY:En,rotateZ:En,scale:ys,scaleX:ys,scaleY:ys,scaleZ:ys,skew:En,skewX:En,skewY:En,distance:ce,translateX:ce,translateY:ce,translateZ:ce,x:ce,y:ce,z:ce,perspective:ce,transformPerspective:ce,opacity:pi,originX:Ed,originY:Ed,originZ:ce}),{zIndex:_f,fillOpacity:pi,strokeOpacity:pi,numOctaves:_f}),p0=$(y({},Xa),{color:it,backgroundColor:it,outlineColor:it,fill:it,stroke:it,borderColor:it,borderTopColor:it,borderRightColor:it,borderBottomColor:it,borderLeftColor:it,filter:Ya,WebkitFilter:Ya}),yf=t=>p0[t];function bf(t,e){let n=yf(t);return n!==Ya&&(n=Sr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const vf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ef{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ha,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ct.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,rn.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget=y({},c),this.initialValues=n.initial?y({},c):{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=df(n),this.isVariantNode=s0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const f=this.scrapeMotionValuesFromProps(n,{},this),{willChange:d}=f,l=at(f,["willChange"]);for(const p in l){const h=l[p];c[p]!==void 0&&ct(h)&&h.set(c[p],!1)}}mount(e){this.current=e,di.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),lf.current||t0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ka.current,process.env.NODE_ENV!=="production"&&pd(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_a(this.notifyUpdate),_a(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=yr.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&rn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Ga){const n=Ga[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qa()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<vf.length;r++){const i=vf[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=o0(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=fi(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!=null?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ff(r)||pf(r))?r=parseFloat(r):!u0(r)&&Sr.test(n)&&(r=bf(e,n)),this.setBaseTarget(e,ct(r)?r.get():r)),ct(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=dd(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ct(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new hd),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}const h0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function m0(t){const e=h0.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n!=null?n:r}`,i]}const g0=4;function Sf(t,e,n=1){tn(n<=g0,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=m0(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return ff(o)?parseFloat(o):o}return ba(i)?Sf(i,e,n+1):i}function _0(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pf(t):!0}const y0=new Set(["auto","none","0"]);function b0(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!y0.has(s)&&gi(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=bf(n,i)}class v0 extends Ha{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),ba(u))){const d=Sf(u,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!af.has(r)||e.length!==2)return;const[i,s]=e,o=gf(i),a=gf(s);if(o!==a)if(Yd(o)&&Yd(a))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else $n[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||_0(e[i]))&&r.push(i);r.length&&b0(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$n[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=$n[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}class wf extends Ef{constructor(){super(...arguments),this.KeyframeResolver=v0}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ct(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}const Cf=(t,e)=>e&&typeof t=="number"?e.transform(t):t,E0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},S0=_r.length;function w0(t,e,n){let r="",i=!0;for(let s=0;s<S0;s++){const o=_r[s],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const u=Cf(a,Xa[o]);if(!c){i=!1;const d=E0[o]||o;r+=`${d}(${u}) `}n&&(e[o]=u)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Tf(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(yr.has(c)){o=!0;continue}else if(bd(c)){i[c]=u;continue}else{const d=Cf(u,Xa[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(o||n?r.transform=w0(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function If(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const C0={};function T0(t,{layout:e,layoutId:n}){return yr.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!C0[t]||t==="opacity")}function Af(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(ct(r[o])||e.style&&ct(e.style[o])||T0(o,t)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function I0(t){return window.getComputedStyle(t)}class A0 extends wf{constructor(){super(...arguments),this.type="html",this.renderInstance=If}readValueFromInstance(e,n){var r;if(yr.has(n))return(r=this.projection)!=null&&r.isProjecting?Ba(n):CE(e,n);{const i=I0(e),s=(bd(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ZE(e,n)}build(e,n,r){Tf(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Af(e,n,r)}}function k0(t,e){return t in e}class x0 extends Ef{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(k0(n,e)){const r=e[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return qa()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const R0={offset:"stroke-dashoffset",array:"stroke-dasharray"},N0={offset:"strokeDashoffset",array:"strokeDasharray"};function O0(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?R0:N0;t[s.offset]=ce.transform(-r);const o=ce.transform(e),a=ce.transform(n);t[s.array]=`${o} ${a}`}function P0(t,l,c,u,d){var f=l,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0}=f,a=at(f,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var m,g;if(Tf(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:h}=t;p.transform&&(h.transform=p.transform,delete p.transform),(h.transform||p.transformOrigin)&&(h.transformOrigin=(m=p.transformOrigin)!=null?m:"50% 50%",delete p.transformOrigin),h.transform&&(h.transformBox=(g=d==null?void 0:d.transformBox)!=null?g:"fill-box",delete p.transformBox),e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),i!==void 0&&O0(p,i,s,o,!1)}const kf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),M0=t=>typeof t=="string"&&t.toLowerCase()==="svg";function L0(t,e,n,r){If(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(kf.has(i)?i:ya(i),e.attrs[i])}function D0(t,e,n){const r=Af(t,e,n);for(const i in t)if(ct(t[i])||ct(e[i])){const s=_r.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}class F0 extends wf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qa}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(yr.has(n)){const r=yf(n);return r&&r.default||0}return n=kf.has(n)?n:ya(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return D0(e,n,r)}build(e,n,r){P0(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){L0(e,n,r,i)}mount(e){this.isSVGTag=M0(e.tagName),super.mount(e)}}function xf(t){return sf(t)&&"ownerSVGElement"in t}function U0(t){return xf(t)&&t.tagName==="svg"}function B0(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=xf(t)&&!U0(t)?new F0(e):new A0(e);n.mount(t),di.set(t,n)}function V0(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new x0(e);n.mount(t),di.set(t,n)}function $0(t,e,n){const r=ct(t)?t:fi(t);return r.start(of("",r,e,n)),r.animation}function z0(t,e){return ct(t)||typeof t=="number"||typeof t=="string"&&!pa(e)}function Rf(t,e,n,r){const i=[];if(z0(t,e))i.push($0(t,pa(e)&&e.default||e,n&&(n.default||n)));else{const s=ed(t,e,r),o=s.length;tn(!!o,"No valid elements provided.");for(let a=0;a<o;a++){const c=s[a],u=c instanceof Element?B0:V0;di.has(c)||u(c);const d=di.get(c),l=y({},n);"delay"in l&&typeof l.delay=="function"&&(l.delay=l.delay(a,o)),i.push(...XE(d,$(y({},e),{transition:l}),{}))}}return i}function j0(t,e,n){const r=[];return tv(t,e,n,{spring:_i}).forEach(({keyframes:s,transition:o},a)=>{r.push(...Rf(a,s,o))}),r}class H0{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>r.attachTimeline(e));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class W0 extends H0{then(e,n){return this.finished.finally(e).then(()=>{})}}function G0(t){return Array.isArray(t)&&t.some(Array.isArray)}function q0(t){function e(n,r,i){let s=[];return G0(n)?s=j0(n,r,t):s=Rf(n,r,i,t),new W0(s)}return e}const Xe=q0(),xe={spinner:"_spinner_1lif3_1",spinnerContainer:"_spinnerContainer_1lif3_5",success:"_success_1lif3_9",successContainer:"_successContainer_1lif3_14",container:"_container_1lif3_57",card:"_card_1lif3_66",warning:"_warning_1lif3_75",svg:"_svg_1lif3_83",srOnly:"_srOnly_1lif3_88",backButton:"_backButton_1lif3_92"};function Pe(t,e){if(!e)return;const n=e.trim().split(/\s+/).filter(r=>r.length>0);t.classList.add(...n)}class Nf{constructor(){N(this,"template",`
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(Se);function Be(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}class Lt{constructor(){N(this,"core");N(this,"parentId")}mount(e,n){return j(this,null,function*(){var s,o,a,c,u,d,l,f,p,h,m;const r=document.getElementById(e);if(!r){console.error(`Element with id "${e}" not found`);return}if(this.parentId=e,!this.core){const _=(yield Promise.resolve().then(()=>$D)).Core;this.core=new _}n.styles&&((a=(o=(s=this.core)==null?void 0:s.state)==null?void 0:o.styles)==null||a.setState(n.styles)),(d=(u=(c=this.core)==null?void 0:c.state)==null?void 0:u.checkout)==null||d.setState({clientToken:n.clientToken,environment:n.environment,apiVersion:n.apiVersion,errorMessageText:n.errorMessageText});const i=yield(f=(l=this.core)==null?void 0:l.checkout)==null?void 0:f.mount();r.innerHTML="",r.appendChild(i),(m=(h=(p=this.core)==null?void 0:p.state)==null?void 0:h.checkout)==null||m.setState(n)})}unmount(){return j(this,null,function*(){var n;if(!this.parentId)return;const e=document.getElementById(this.parentId);!e||!this.core||(e.innerHTML="",(n=this.core)==null||n.clearState())})}}var J=(t=>(t.PAYPAL="PAYPAL",t.APPLE_PAY="APPLEPAY",t.GOOGLE_PAY="GPAY",t.CARD="CARD",t.VENMO="VENMO",t))(J||{}),pt=(t=>(t.PENDING="PENDING",t.FAILED="FAILED",t.AUTHORIZED="AUTHORIZED",t.SETTLING="SETTLING",t.SETTLED="SETTLED",t.DECLINED="DECLINED",t.CANCELLED="CANCELLED",t))(pt||{});const rt={appIds:{develop:"app_00b96c0c3011",staging:"app_00396c84ac2b",sandbox:"app_03b1ea2b6dfa",production:"app_409cf462b6cc"},teamId:"team_f20c9e679d47"},Ge=(t="sandbox")=>({develop:"https://dev-api.paynext.com",staging:"https://staging-api.paynext.com",sandbox:"https://sandbox-api.paynext.com",production:"https://api.paynext.com"})[t],yt=[{type:J.PAYPAL,order:1,is_active:!0},{type:J.APPLE_PAY,order:2,is_active:!0},{type:J.GOOGLE_PAY,order:3,is_active:!0},{type:J.CARD,order:4,is_active:!0}],fs=t=>t.googlePay?J.GOOGLE_PAY:t.applePay?J.APPLE_PAY:t.paypal?J.PAYPAL:t.braintree?J.VENMO:J.CARD,ps=t=>{const e=t.card;if(e)return{bin:e.firstSixDigits,bin_data:{brand:e.cardBrand,country:e.country,currency_code:e.currency,funding:e.funding,issuer:e.issuer,type:e.type},cvc:e.cvc,exp_month:Number(e.expMonth),exp_year:Number(e.expYear),last4:e.lastFourDigits,number:e.number}},fa=t=>{var n;const e=t.paypal;if((n=e==null?void 0:e.billing_agreement_token)!=null&&n.paypalId)return{billing_agreement_token:e.billing_agreement_token.paypalId}},Gt=t=>{var n,r,i,s,o,a,c,u,d,l,f,p,h,m,g,_,b,C;const e=t.googlePay;if(e!=null&&e.token)return{cryptogram:e.cryptogram,eci:e.eci,exp_month:(r=(n=e.card)==null?void 0:n.expiry)!=null&&r.month||(s=(i=e.token)==null?void 0:i.expiry)!=null&&s.month?Number(((a=(o=e.card)==null?void 0:o.expiry)==null?void 0:a.month)||((u=(c=e.token)==null?void 0:c.expiry)==null?void 0:u.month)):void 0,exp_year:(l=(d=e.card)==null?void 0:d.expiry)!=null&&l.year||(p=(f=e.token)==null?void 0:f.expiry)!=null&&p.year?Number(((m=(h=e.card)==null?void 0:h.expiry)==null?void 0:m.year)||((_=(g=e.token)==null?void 0:g.expiry)==null?void 0:_.year)):void 0,token:(b=e.token)==null?void 0:b.number,token_service_provider:(C=e.token)==null?void 0:C.tokenServiceProvider}},Lb=t=>{var n,r,i,s,o,a;const e=t.applePay;if(e)return{cryptogram:e.cryptogram,eci:e.eci,exp_month:(r=(n=e.networkToken)==null?void 0:n.expiry)!=null&&r.month?Number(e.networkToken.expiry.month):void 0,exp_year:(s=(i=e.networkToken)==null?void 0:i.expiry)!=null&&s.year?Number(e.networkToken.expiry.year):void 0,token:(o=e.networkToken)==null?void 0:o.number,token_service_provider:(a=e.networkToken)==null?void 0:a.tokenServiceProvider}},Db=t=>{const e=t.braintree;if(e)return{payment_method_nonce:e.nonce}},Ql=t=>{var r,i,s,o,a,c,u,d,l,f,p,h,m,g;const{applePay:e,googlePay:n}=t;if(!(!e&&!n))return{city:((r=e==null?void 0:e.billingContact)==null?void 0:r.locality)||((i=n==null?void 0:n.billingAddress)==null?void 0:i.locality)||void 0,country:((s=e==null?void 0:e.billingContact)==null?void 0:s.countryCode)||((o=n==null?void 0:n.billingAddress)==null?void 0:o.countryCode)||void 0,line1:((c=(a=e==null?void 0:e.billingContact)==null?void 0:a.addressLines)==null?void 0:c.at(0))||((u=n==null?void 0:n.billingAddress)==null?void 0:u.address1)||void 0,line2:((l=(d=e==null?void 0:e.billingContact)==null?void 0:d.addressLines)==null?void 0:l.at(1))||((f=n==null?void 0:n.billingAddress)==null?void 0:f.address2)||void 0,postal_code:((p=e==null?void 0:e.billingContact)==null?void 0:p.postalCode)||((h=n==null?void 0:n.billingAddress)==null?void 0:h.postalCode)||void 0,state:((m=e==null?void 0:e.billingContact)==null?void 0:m.administrativeArea)||((g=n==null?void 0:n.billingAddress)==null?void 0:g.administrativeArea)||void 0}},Jl=t=>{var i,s,o,a,c,u,d,l,f,p,h,m,g,_,b,C,A,I,k,w,O,M,V;const{card:e,googlePay:n,applePay:r}=t;if(!(!e&&!(n!=null&&n.card)&&!(r!=null&&r.card)))return{bin:e==null?void 0:e.firstSixDigits,bin_data:{brand:(e==null?void 0:e.cardBrand)||((i=n==null?void 0:n.card)==null?void 0:i.brand)||((s=r==null?void 0:r.card)==null?void 0:s.brand),country:(e==null?void 0:e.country)||((o=n==null?void 0:n.card)==null?void 0:o.country)||((a=r==null?void 0:r.card)==null?void 0:a.country),currency_code:(e==null?void 0:e.currency)||((c=n==null?void 0:n.card)==null?void 0:c.currency)||((u=r==null?void 0:r.card)==null?void 0:u.currency),funding:(e==null?void 0:e.funding)||((d=n==null?void 0:n.card)==null?void 0:d.funding)||((l=r==null?void 0:r.card)==null?void 0:l.funding),issuer:(e==null?void 0:e.issuer)||((f=n==null?void 0:n.card)==null?void 0:f.issuer)||((p=r==null?void 0:r.card)==null?void 0:p.issuer),type:(e==null?void 0:e.type)||((h=n==null?void 0:n.card)==null?void 0:h.segment)||((m=r==null?void 0:r.card)==null?void 0:m.segment)},cvc:e==null?void 0:e.cvc,exp_month:e!=null&&e.expMonth||(_=(g=n==null?void 0:n.card)==null?void 0:g.expiry)!=null&&_.month?Number((e==null?void 0:e.expMonth)||((C=(b=n==null?void 0:n.card)==null?void 0:b.expiry)==null?void 0:C.month)):void 0,exp_year:e!=null&&e.expYear||(I=(A=n==null?void 0:n.card)==null?void 0:A.expiry)!=null&&I.year?Number((e==null?void 0:e.expYear)||((w=(k=n==null?void 0:n.card)==null?void 0:k.expiry)==null?void 0:w.year)):void 0,last4:(e==null?void 0:e.lastFourDigits)||((O=n==null?void 0:n.card)==null?void 0:O.lastFour)||((M=r==null?void 0:r.card)==null?void 0:M.lastFour),number:(e==null?void 0:e.number)||((V=n==null?void 0:n.card)==null?void 0:V.number)}},Zl=t=>{var r,i;const{applePay:e,card:n}=t;return(r=e==null?void 0:e.billingContact)!=null&&r.givenName?`${e.billingContact.givenName} ${e.billingContact.familyName||""}`.trim():(i=n==null?void 0:n.metadata)==null?void 0:i.name},Fb=t=>{var r,i,s,o,a,c,u,d;const e=fs(t),n={client_session:t.clientSession,three_ds_session_id:t.threeDsSessionId,type:e};switch(e){case J.CARD:return $(y({},n),{name:Zl(t),card:ps(t)});case J.PAYPAL:return $(y({},n),{paypal:fa(t)});case J.GOOGLE_PAY:return $(y({},n),{name:(i=(r=t.googlePay)==null?void 0:r.billingAddress)==null?void 0:i.name,phone:(c=(a=(o=(s=t.googlePay)==null?void 0:s.billingAddress)==null?void 0:o.phoneNumber)==null?void 0:a.replace(/ /g,""))==null?void 0:c.replace(/-/g,""),card:Jl(t),google_pay:Gt(t),billing_address:Ql(t)});case J.APPLE_PAY:return $(y({},n),{name:Zl(t),card:Jl(t),apple_pay:Lb(t),phone:(d=(u=t.applePay)==null?void 0:u.shippingContact)==null?void 0:d.phoneNumber,billing_address:Ql(t)});case J.VENMO:return $(y({},n),{venmo:Db(t)});default:throw new Error(`Unsupported payment method: ${e}`)}},Ub=(t,e,n)=>j(this,null,function*(){const r=`${Ge(e)}/payments/create`,i=new Headers;i.append("Content-Type","application/json"),i.append("X-API-Version",n);const s=Fb(t);try{return yield(yield fetch(r,{method:"POST",headers:i,body:JSON.stringify(s)})).json()}catch(o){throw new Error("Failed to create payment: "+(o==null?void 0:o.message))}}),Bb=(t,e,n)=>j(this,null,function*(){const r=`${Ge(e)}/payments/create/billing/agreement`,i=new Headers;return i.append("Content-Type","application/json"),i.append("X-API-Version",n),(yield(yield fetch(r,{method:"POST",headers:i,body:JSON.stringify({client_session:t})})).json()).paypal_agreement_token_response.token_id||""}),Vb=(t,e,n)=>j(this,null,function*(){const r=new Headers;r.append("X-API-Version",n);const i=`${Ge(e)}/payments/config?client_session_id=${t}`;try{const o=yield(yield fetch(i,{headers:r})).json();return o.checkout_config||(o.checkout_config=yt),o}catch(s){console.error("Failed to get transaction config:",s);const o=new Error("INVALID_SESSION");throw o.name="INVALID_SESSION",o}});let $b=class{constructor(e){N(this,"apple",null);N(this,"isAvailable",!0);N(this,"onReady");this.ev=e}init(u,d){return j(this,arguments,function*({transaction:e,locale:n,onReady:r,onError:i,onSuccess:s,onCancel:o,onPaymentAttempt:a},c){const l=this.ev.transactions.create(e);this.apple=this.ev.ui.applePay(l,$(y({locale:n,borderRadius:12,size:{width:"100%",height:"40px"}},c==null?void 0:c.styles),{allowedCardNetworks:["visa","masterCard"],requestBillingAddress:!0,requestPayerDetails:["name","email","phone"],process:(h,m)=>j(this,[h,m],function*(f,{fail:p}){a==null||a({paymentMethod:J.APPLE_PAY});try{s==null||s(f)}catch(g){console.error(g),p({message:"Cannot pay with payment credentials"})}})})),i&&this.apple.on("error",f=>i({e:f,paymentMethod:J.APPLE_PAY})),o&&this.apple.on("cancel",o),this.onReady=r})}render(e){return j(this,null,function*(){var n;if(!(!this.apple||!this.isAvailable)){e.innerHTML="";try{yield this.apple.mount(e),(n=this.onReady)==null||n.call(this)}catch(r){throw console.error(r),new Error(r instanceof Error?r.message:"Failed to render Apple Pay button")}}})}},zb=class{constructor(e){N(this,"google",null);this.ev=e}init(u,d){return j(this,arguments,function*({transaction:e,locale:n,onReady:r,onError:i,onSuccess:s,onCancel:o,onPaymentAttempt:a},c){const l=this.ev.transactions.create(e);this.google=this.ev.ui.googlePay(l,$(y({locale:n,size:{width:"100%",height:40},borderRadius:12,billingAddress:{phoneNumber:!0}},c==null?void 0:c.styles),{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"],process:(h,m)=>j(this,[h,m],function*(f,{fail:p}){a==null||a({paymentMethod:J.GOOGLE_PAY});try{s==null||s(f)}catch(g){console.error(g),p({message:"Cannot pay with payment credentials"})}})})),o&&this.google.on("cancel",o),r&&this.google.on("ready",r),i&&this.google.on("error",f=>i({e:f,paymentMethod:J.GOOGLE_PAY}))})}render(e){return j(this,null,function*(){this.google&&(e.innerHTML="",this.google.mount(e))})}};class qe{constructor(){N(this,"listeners",[])}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}addListener(e){return this.listeners.push(e),()=>this.removeListener(e)}emit(e){for(const n of this.listeners)n(e)}clear(){this.listeners=[]}}class jb{constructor(e){N(this,"threeDs",null);this.ev=e}init(s){return j(this,arguments,function*({threeDsId:e,onReady:n,onSuccess:r,onError:i}){this.threeDs=this.ev.ui.threeDSecure(e),this.threeDs.on("ready",()=>n==null?void 0:n()),this.threeDs.on("success",()=>r==null?void 0:r()),this.threeDs.on("failure",()=>i==null?void 0:i()),this.threeDs.on("error",()=>i==null?void 0:i())})}render(e){return j(this,null,function*(){this.threeDs&&this.threeDs.mount(e)})}}class Hb{constructor(){N(this,"isReady",!1);N(this,"ev",null);N(this,"apple",null);N(this,"google",null);N(this,"threeDs",null);N(this,"events",{ready:new qe})}isShouldLoad({teamId:e,appId:n}){var r,i;return((r=this.ev)==null?void 0:r.config.appId)!==n||((i=this.ev)==null?void 0:i.config.teamId)!==e}preloadEvervault(e){return j(this,null,function*(){if(!this.isShouldLoad(e))return;if(typeof window=="undefined")throw new Error("Evervault can only be initialized in browser environment");this.isReady=!1;const{loadEvervault:n}=yield Promise.resolve().then(()=>HD);this.ev=yield n(e.teamId,e.appId)})}initEv(e){return j(this,null,function*(){this.ev||(yield this.preloadEvervault(e)),this.apple=new $b(this.ev),this.google=new zb(this.ev),this.events.ready.emit(),this.isReady=!0})}initThreeDs(e){return j(this,null,function*(){if(!this.ev)throw new Error("Evervault should be init before using Three DS Secure");this.threeDs=new jb(this.ev),yield this.threeDs.init(e),yield this.threeDs.render()})}initApple(e,n){return j(this,null,function*(){if(!this.apple)throw new Error("Evervault should be init before using Apple Pay");yield this.apple.init(e,n)})}initGoogle(e,n){return j(this,null,function*(){if(!this.google)throw new Error("Evervault should be init before using Google Pay");yield this.google.init(e,n)})}isAppleAvailable(){var e;return!!((e=this.apple)!=null&&e.isAvailable)}addEventListener(e,n){return this.events[e].addListener(n)}renderApple(e){return j(this,null,function*(){var n;return(n=this.apple)==null?void 0:n.render(e)})}renderGoogle(e){return j(this,null,function*(){var n;return(n=this.google)==null?void 0:n.render(e)})}getEv(){if(!this.ev)throw new Error("Evervault should be init before getting instance");return this.ev}}function pa(t){return typeof t=="object"&&!Array.isArray(t)}function Wb(t,e,n){var r;if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const s=(r=n==null?void 0:n[t])!=null?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function ed(t,e,n,r){return typeof t=="string"&&pa(e)?Wb(t,n,r):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Gb(t,e,n){return t*(e+1)}function td(t,e,n,r){var i;return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:(i=r.get(e))!=null?i:t}const ui=(t,e,n)=>t+(e-t)*n,qb=(t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t},nd=t=>Array.isArray(t)&&typeof t[0]!="number";function rd(t,e){return nd(t)?t[qb(0,t.length,e)]:t}function Kb(t,e){t.indexOf(e)===-1&&t.push(e)}function id(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function Yb(t,e,n){for(let r=0;r<t.length;r++){const i=t[r];i.at>e&&i.at<n&&(id(t,i),r--)}}function Xb(t,e,n,r,i,s){Yb(t,i,s);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ui(i,s,r[o]),easing:rd(n,o)})}function Qb(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Jb(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const ct=t=>!!(t&&t.getVelocity),ha=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};function sd(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=ha(0,e,r);t.push(ui(n,1,i))}}function od(t){const e=[0];return sd(e,t.length-1),e}function ma(t){return typeof t=="function"&&"applyToOptions"in t}const hs=2e4;function ga(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<hs;)e+=n,r=t.next(e);return e>=hs?1/0:e}const Dt=t=>t*1e3,en=t=>t/1e3;function ad(t,e=100,n){const r=n($(y({},t),{keyframes:[0,e]})),i=Math.min(ga(r),hs);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:en(i)}}let li=()=>{},tn=()=>{};process.env.NODE_ENV!=="production"&&(li=(t,e)=>{!t&&typeof console!="undefined"&&console.warn(e)},tn=(t,e)=>{if(!t)throw new Error(e)});const Zb="easeInOut",ev=20;function tv(t,s={},r,i){var o=s,{defaultTransition:e={}}=o,n=at(o,["defaultTransition"]);const a=e.duration||.3,c=new Map,u=new Map,d={},l=new Map;let f=0,p=0,h=0;for(let m=0;m<t.length;m++){const g=t[m];if(typeof g=="string"){l.set(g,p);continue}else if(!Array.isArray(g)){l.set(g.name,td(p,g.at,f,l));continue}let[_,b,C={}]=g;C.at!==void 0&&(p=td(p,C.at,f,l));let A=0;const I=(k,w,O,M=0,V=0)=>{const Y=nv(k),G=w,{delay:L=0,times:U=od(Y),type:z="keyframes",repeat:Q,repeatType:B,repeatDelay:K=0}=G,H=at(G,["delay","times","type","repeat","repeatType","repeatDelay"]);let{ease:E=e.ease||"easeOut",duration:v}=w;const P=typeof L=="function"?L(M,V):L,W=Y.length,S=ma(z)?z:i==null?void 0:i[z];if(W<=2&&S){let x=100;if(W===2&&sv(Y)){const Ce=Y[1]-Y[0];x=Math.abs(Ce)}const X=y({},H);v!==void 0&&(X.duration=Dt(v));const ne=ad(X,x,S);E=ne.ease,v=ne.duration}v!=null||(v=a);const R=p+P;U.length===1&&U[0]===0&&(U[1]=1);const T=U.length-Y.length;if(T>0&&sd(U,T),Y.length===1&&Y.unshift(null),Q){tn(Q<ev,"Repeat count too high, must be less than 20"),v=Gb(v,Q);const x=[...Y],X=[...U];E=Array.isArray(E)?[...E]:[E];const ne=[...E];for(let Ce=0;Ce<Q;Ce++){Y.push(...x);for(let q=0;q<x.length;q++)U.push(X[q]+(Ce+1)),E.push(q===0?"linear":rd(ne,q-1))}Qb(U,Q)}const F=R+v;Xb(O,Y,E,U,R,F),A=Math.max(P+v,A),h=Math.max(F,h)};if(ct(_)){const k=cd(_,u);I(b,C,ud("default",k))}else{const k=ed(_,b,r,d),w=k.length;for(let O=0;O<w;O++){b=b,C=C;const M=k[O],V=cd(M,u);for(const Y in b)I(b[Y],rv(C,Y),ud(Y,V),O,w)}}f=p,p+=A}return u.forEach((m,g)=>{for(const _ in m){const b=m[_];b.sort(Jb);const C=[],A=[],I=[];for(let w=0;w<b.length;w++){const{at:O,value:M,easing:V}=b[w];C.push(M),A.push(ha(0,h,O)),I.push(V||"easeOut")}A[0]!==0&&(A.unshift(0),C.unshift(C[0]),I.unshift(Zb)),A[A.length-1]!==1&&(A.push(1),C.push(null)),c.has(g)||c.set(g,{keyframes:{},transition:{}});const k=c.get(g);k.keyframes[_]=C,k.transition[_]=y($(y({},e),{duration:h,ease:I,times:A}),n)}}),c}function cd(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ud(t,e){return e[t]||(e[t]=[]),e[t]}function nv(t){return Array.isArray(t)?t:[t]}function rv(t,e){return t&&t[e]?y(y({},t),t[e]):y({},t)}const iv=t=>typeof t=="number",sv=t=>t.every(iv),di=new WeakMap,ov=t=>Array.isArray(t);function ld(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function dd(t,e,n,r){if(typeof e=="function"){const[i,s]=ld(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=ld(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function av(t,e,n){const r=t.getProps();return dd(r,e,r.custom,t)}const ms=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function cv(t,e){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,l=!1,f=!1)=>{const h=f&&i?n:r;return l&&o.add(d),h.has(d)||h.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),n.clear(),i=!1,s&&(s=!1,u.process(d))}};return u}const nn={},uv=40;function lv(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=ms.reduce((C,A)=>(C[A]=cv(s),C),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:l,preRender:f,render:p,postRender:h}=o,m=()=>{const C=nn.useManualTiming?i.timestamp:performance.now();n=!1,nn.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(C-i.timestamp,uv),1)),i.timestamp=C,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),d.process(i),l.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(m))},g=()=>{n=!0,r=!0,i.isProcessing||t(m)};return{schedule:ms.reduce((C,A)=>{const I=o[A];return C[A]=(k,w=!1,O=!1)=>(n||g(),I.schedule(k,w,O)),C},{}),cancel:C=>{for(let A=0;A<ms.length;A++)o[ms[A]].cancel(C)},state:i,steps:o}}const gr=t=>t,{schedule:rn,cancel:_a,state:gs}=lv(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:gr,!0);let _s;function dv(){_s=void 0}const Ct={now:()=>(_s===void 0&&Ct.set(gs.isProcessing||nn.useManualTiming?gs.timestamp:performance.now()),_s),set:t=>{_s=t,queueMicrotask(dv)}},fd=new Set;function pd(t,e,n){t||fd.has(e)||(console.warn(e),fd.add(e))}class hd{constructor(){this.subscriptions=[]}add(e){return Kb(this.subscriptions,e),()=>id(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function md(t,e){return e?t*(1e3/e):0}const gd=30,fv=t=>!isNaN(parseFloat(t));class pv{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{var o,a;const s=Ct.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty();i&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ct.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fv(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&pd(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new hd);const r=this.events[e].add(n);return e==="change"?()=>{r(),rn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gd)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gd);return md(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fi(t,e){return new pv(t,e)}function hv(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,fi(n))}function mv(t){return ov(t)?t[t.length-1]||0:t}function gv(t,e){let o=av(t,e)||{},{transitionEnd:r={},transition:i={}}=o,s=at(o,["transitionEnd","transition"]);s=y(y({},s),r);for(const a in s){const c=mv(s[a]);hv(t,a,c)}}function _v(t){return!!(ct(t)&&t.add)}function yv(t,e){const n=t.getValue("willChange");if(_v(n))return n.add(e);if(!n&&nn.WillChange){const r=new nn.WillChange("auto");t.addValue("willChange",r),r.add(e)}}const ya=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bv="data-"+ya("framerAppearId");function vv(t){return t.props[bv]}const Ev=t=>t!==null;function Sv(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(Ev),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[s]}const _r=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yr=new Set(_r),wv={type:"spring",stiffness:500,damping:25,restSpeed:10},Cv=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Tv={type:"keyframes",duration:.8},Iv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Av=(t,{keyframes:e})=>e.length>2?Tv:yr.has(t)?t.startsWith("scale")?Cv(e[1]):wv:Iv;function kv(l){var f=l,{when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:u}=f,d=at(f,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}function _d(t,e){var n,r;return(r=(n=t==null?void 0:t[e])!=null?n:t==null?void 0:t.default)!=null?r:t}const yd=t=>e=>typeof e=="string"&&e.startsWith(t),bd=yd("--"),xv=yd("var(--"),ba=t=>xv(t)?Rv.test(t.split("/*")[0].trim()):!1,Rv=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Un=(t,e,n)=>n>e?e:n<t?t:n,br={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},pi=$(y({},br),{transform:t=>Un(0,1,t)}),ys=$(y({},br),{default:1}),hi=t=>Math.round(t*1e5)/1e5,va=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Nv(t){return t==null}const Ov=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ea=(t,e)=>n=>!!(typeof n=="string"&&Ov.test(n)&&n.startsWith(t)||e&&!Nv(n)&&Object.prototype.hasOwnProperty.call(n,e)),vd=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(va);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Pv=t=>Un(0,255,t),Sa=$(y({},br),{transform:t=>Math.round(Pv(t))}),Bn={test:Ea("rgb","red"),parse:vd("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Sa.transform(t)+", "+Sa.transform(e)+", "+Sa.transform(n)+", "+hi(pi.transform(r))+")"};function Mv(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const wa={test:Ea("#"),parse:Mv,transform:Bn.transform},mi=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),En=mi("deg"),vr=mi("%"),ce=mi("px"),Lv=mi("vh"),Dv=mi("vw"),Ed=$(y({},vr),{parse:t=>vr.parse(t)/100,transform:t=>vr.transform(t*100)}),Er={test:Ea("hsl","hue"),parse:vd("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+vr.transform(hi(e))+", "+vr.transform(hi(n))+", "+hi(pi.transform(r))+")"},it={test:t=>Bn.test(t)||wa.test(t)||Er.test(t),parse:t=>Bn.test(t)?Bn.parse(t):Er.test(t)?Er.parse(t):wa.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Bn.transform(t):Er.transform(t)},Fv=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Uv(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(va))==null?void 0:e.length)||0)+(((n=t.match(Fv))==null?void 0:n.length)||0)>0}const Sd="number",wd="color",Bv="var",Vv="var(",Cd="${}",$v=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function gi(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace($v,c=>(it.test(c)?(r.color.push(s),i.push(wd),n.push(it.parse(c))):c.startsWith(Vv)?(r.var.push(s),i.push(Bv),n.push(c)):(r.number.push(s),i.push(Sd),n.push(parseFloat(c))),++s,Cd)).split(Cd);return{values:n,split:a,indexes:r,types:i}}function Td(t){return gi(t).values}function Id(t){const{split:e,types:n}=gi(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Sd?s+=hi(i[o]):a===wd?s+=it.transform(i[o]):s+=i[o]}return s}}const zv=t=>typeof t=="number"?0:t;function jv(t){const e=Td(t);return Id(t)(e.map(zv))}const Sr={test:Uv,parse:Td,createTransformer:Id,getAnimatableNone:jv};function Ca(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Hv({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Ca(c,a,t+1/3),s=Ca(c,a,t),o=Ca(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function bs(t,e){return n=>n>0?e:t}const Ta=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Wv=[wa,Bn,Er],Gv=t=>Wv.find(e=>e.test(t));function Ad(t){const e=Gv(t);if(li(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Er&&(n=Hv(n)),n}const kd=(t,e)=>{const n=Ad(t),r=Ad(e);if(!n||!r)return bs(t,e);const i=y({},n);return s=>(i.red=Ta(n.red,r.red,s),i.green=Ta(n.green,r.green,s),i.blue=Ta(n.blue,r.blue,s),i.alpha=ui(n.alpha,r.alpha,s),Bn.transform(i))},Ia=new Set(["none","hidden"]);function qv(t,e){return Ia.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const Kv=(t,e)=>n=>e(t(n)),Aa=(...t)=>t.reduce(Kv);function Yv(t,e){return n=>ui(t,e,n)}function ka(t){return typeof t=="number"?Yv:typeof t=="string"?ba(t)?bs:it.test(t)?kd:Jv:Array.isArray(t)?xd:typeof t=="object"?it.test(t)?kd:Xv:bs}function xd(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>ka(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function Xv(t,e){const n=y(y({},t),e),r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=ka(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function Qv(t,e){var i;const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][r[o]],c=(i=t.values[a])!=null?i:0;n[s]=c,r[o]++}return n}const Jv=(t,e)=>{const n=Sr.createTransformer(e),r=gi(t),i=gi(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ia.has(t)&&!i.values.length||Ia.has(e)&&!r.values.length?qv(t,e):Aa(xd(Qv(r,i),i.values),n):(li(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),bs(t,e))};function Rd(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ui(t,e,n):ka(t)(t,e)}const Zv=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>rn.update(e,n),stop:()=>_a(e),now:()=>gs.isProcessing?gs.timestamp:Ct.now()}},Nd=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},eE=5;function Od(t,e,n){const r=Math.max(e-eE,0);return md(n-t(r),e-r)}const Le={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},xa=.001;function tE({duration:t=Le.duration,bounce:e=Le.bounce,velocity:n=Le.velocity,mass:r=Le.mass}){let i,s;li(t<=Dt(Le.maxDuration),"Spring duration must be 10 seconds or less");let o=1-e;o=Un(Le.minDamping,Le.maxDamping,o),t=Un(Le.minDuration,Le.maxDuration,en(t)),o<1?(i=u=>{const d=u*o,l=d*t,f=d-n,p=Ra(u,o),h=Math.exp(-l);return xa-f/p*h},s=u=>{const l=u*o*t,f=l*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,h=Math.exp(-l),m=Ra(Math.pow(u,2),o);return(-i(u)+xa>0?-1:1)*((f-p)*h)/m}):(i=u=>{const d=Math.exp(-u*t),l=(u-n)*t+1;return-xa+d*l},s=u=>{const d=Math.exp(-u*t),l=(n-u)*(t*t);return d*l});const a=5/t,c=rE(i,s,a);if(t=Dt(t),isNaN(c))return{stiffness:Le.stiffness,damping:Le.damping,duration:t};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const nE=12;function rE(t,e,n){let r=n;for(let i=1;i<nE;i++)r=r-t(r)/e(r);return r}function Ra(t,e){return t*Math.sqrt(1-e*e)}const iE=["duration","bounce"],sE=["stiffness","damping","mass"];function Pd(t,e){return e.some(n=>t[n]!==void 0)}function oE(t){let e=y({velocity:Le.velocity,stiffness:Le.stiffness,damping:Le.damping,mass:Le.mass,isResolvedFromDuration:!1},t);if(!Pd(t,sE)&&Pd(t,iE))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Un(.05,1,1-(t.bounce||0))*Math.sqrt(i);e=$(y({},e),{mass:Le.mass,stiffness:i,damping:s})}else{const n=tE(t);e=$(y(y({},e),n),{mass:Le.mass}),e.isResolvedFromDuration=!0}return e}function _i(t=Le.visualDuration,e=Le.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:l,velocity:f,isResolvedFromDuration:p}=oE($(y({},n),{velocity:-en(n.velocity||0)})),h=f||0,m=u/(2*Math.sqrt(c*d)),g=o-s,_=en(Math.sqrt(c/d)),b=Math.abs(g)<5;r||(r=b?Le.restSpeed.granular:Le.restSpeed.default),i||(i=b?Le.restDelta.granular:Le.restDelta.default);let C;if(m<1){const I=Ra(_,m);C=k=>{const w=Math.exp(-m*_*k);return o-w*((h+m*_*g)/I*Math.sin(I*k)+g*Math.cos(I*k))}}else if(m===1)C=I=>o-Math.exp(-_*I)*(g+(h+_*g)*I);else{const I=_*Math.sqrt(m*m-1);C=k=>{const w=Math.exp(-m*_*k),O=Math.min(I*k,300);return o-w*((h+m*_*g)*Math.sinh(O)+I*g*Math.cosh(O))/I}}const A={calculatedDuration:p&&l||null,next:I=>{const k=C(I);if(p)a.done=I>=l;else{let w=I===0?h:0;m<1&&(w=I===0?Dt(h):Od(C,I,k));const O=Math.abs(w)<=r,M=Math.abs(o-k)<=i;a.done=O&&M}return a.value=a.done?o:k,a},toString:()=>{const I=Math.min(ga(A),hs),k=Nd(w=>A.next(I*w).value,I,30);return I+"ms "+k},toTransition:()=>{}};return A}_i.applyToOptions=t=>{const e=ad(t,100,_i);return t.ease=e.ease,t.duration=Dt(e.duration),t.type="keyframes",t};function Na({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:d}){const l=t[0],f={done:!1,value:l},p=O=>a!==void 0&&O<a||c!==void 0&&O>c,h=O=>a===void 0?c:c===void 0||Math.abs(a-O)<Math.abs(c-O)?a:c;let m=n*e;const g=l+m,_=o===void 0?g:o(g);_!==g&&(m=_-l);const b=O=>-m*Math.exp(-O/r),C=O=>_+b(O),A=O=>{const M=b(O),V=C(O);f.done=Math.abs(M)<=u,f.value=f.done?_:V};let I,k;const w=O=>{p(f.value)&&(I=O,k=_i({keyframes:[f.value,h(f.value)],velocity:Od(C,O,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return w(0),{calculatedDuration:null,next:O=>{let M=!1;return!k&&I===void 0&&(M=!0,A(O),w(O)),I!==void 0&&O>=I?k.next(O-I):(!M&&A(O),f)}}}function aE(t,e,n){const r=[],i=n||nn.mix||Rd,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||gr:e;a=Aa(c,a)}r.push(a)}return r}function cE(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(tn(s===e.length,"Both input and output ranges must be the same length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=aE(e,r,i),c=a.length,u=d=>{if(o&&d<t[0])return e[0];let l=0;if(c>1)for(;l<t.length-2&&!(d<t[l+1]);l++);const f=ha(t[l],t[l+1],d);return a[l](f)};return n?d=>u(Un(t[0],t[s-1],d)):u}function uE(t,e){return t.map(n=>n*e)}const Md=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,lE=1e-7,dE=12;function fE(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=Md(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>lE&&++a<dE);return o}function yi(t,e,n,r){if(t===e&&n===r)return gr;const i=s=>fE(s,0,1,t,n);return s=>s===0||s===1?s:Md(i(s),e,r)}const pE=yi(.42,0,1,1),hE=yi(0,0,.58,1),Ld=yi(.42,0,.58,1),Dd=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fd=t=>e=>1-t(1-e),Ud=yi(.33,1.53,.69,.99),Oa=Fd(Ud),Bd=Dd(Oa),Vd=t=>(t*=2)<1?.5*Oa(t):.5*(2-Math.pow(2,-10*(t-1))),Pa=t=>1-Math.sin(Math.acos(t)),mE=Fd(Pa),$d=Dd(Pa),zd=t=>Array.isArray(t)&&typeof t[0]=="number",jd={linear:gr,easeIn:pE,easeInOut:Ld,easeOut:hE,circIn:Pa,circInOut:$d,circOut:mE,backIn:Oa,backInOut:Bd,backOut:Ud,anticipate:Vd},gE=t=>typeof t=="string",Hd=t=>{if(zd(t)){tn(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return yi(e,n,r,i)}else if(gE(t))return tn(jd[t]!==void 0,`Invalid easing type '${t}'`),jd[t];return t};function _E(t,e){return t.map(()=>e||Ld).splice(0,t.length-1)}function wr({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=nd(r)?r.map(Hd):Hd(r),s={done:!1,value:e[0]},o=uE(n&&n.length===e.length?n:od(e),t),a=cE(o,e,{ease:Array.isArray(i)?i:_E(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const yE=t=>t!==null;function Ma(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(yE),a=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const bE={decay:Na,inertia:Na,tween:wr,keyframes:wr,spring:_i};function Wd(t){typeof t.type=="string"&&(t.type=bE[t.type])}class La{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const vE=t=>t/100;class Da extends La{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ct.now()&&this.tick(Ct.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Wd(e);const{type:n=wr,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const c=n||wr;process.env.NODE_ENV!=="production"&&c!==wr&&tn(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==wr&&typeof a[0]!="number"&&(this.mixKeyframes=Aa(vE,Rd(a[0],a[1])),a=[0,100]);const u=c($(y({},e),{keyframes:a}));s==="mirror"&&(this.mirroredGenerator=c($(y({},e),{keyframes:[...a].reverse(),velocity:-o}))),u.calculatedDuration===null&&(u.calculatedDuration=ga(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:l,repeatType:f,repeatDelay:p,type:h,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const _=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let C=this.currentTime,A=r;if(l){const O=Math.min(this.currentTime,i)/a;let M=Math.floor(O),V=O%1;!V&&O>=1&&(V=1),V===1&&M--,M=Math.min(M,l+1),!!(M%2)&&(f==="reverse"?(V=1-V,p&&(V-=p/a)):f==="mirror"&&(A=o)),C=Un(0,1,V)*a}const I=b?{done:!1,value:d[0]}:A.next(C);s&&(I.value=s(I.value));let{done:k}=I;!b&&c!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const w=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return w&&h!==Na&&(I.value=Ma(d,this.options,g,this.speed)),m&&m(I.value),w&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return en(this.calculatedDuration)}get time(){return en(this.currentTime)}set time(e){var n;e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Ct.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=en(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=Zv,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n!=null?n:r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ct.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function EE(t){var e;for(let n=1;n<t.length;n++)(e=t[n])!=null||(t[n]=t[n-1])}const Vn=t=>t*180/Math.PI,Fa=t=>{const e=Vn(Math.atan2(t[1],t[0]));return Ua(e)},SE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fa,rotateZ:Fa,skewX:t=>Vn(Math.atan(t[1])),skewY:t=>Vn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ua=t=>(t=t%360,t<0&&(t+=360),t),Gd=Fa,qd=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Kd=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),wE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qd,scaleY:Kd,scale:t=>(qd(t)+Kd(t))/2,rotateX:t=>Ua(Vn(Math.atan2(t[6],t[5]))),rotateY:t=>Ua(Vn(Math.atan2(-t[2],t[0]))),rotateZ:Gd,rotate:Gd,skewX:t=>Vn(Math.atan(t[4])),skewY:t=>Vn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ba(t){return t.includes("scale")?1:0}function Va(t,e){if(!t||t==="none")return Ba(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=wE,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=SE,i=a}if(!i)return Ba(e);const s=r[e],o=i[1].split(",").map(TE);return typeof s=="function"?s(o):o[s]}const CE=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Va(n,e)};function TE(t){return parseFloat(t.trim())}const Yd=t=>t===br||t===ce,IE=new Set(["x","y","z"]),AE=_r.filter(t=>!IE.has(t));function kE(t){const e=[];return AE.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const $n={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Va(e,"x"),y:(t,{transform:e})=>Va(e,"y")};$n.translateX=$n.x,$n.translateY=$n.y;const zn=new Set;let $a=!1,za=!1,ja=!1;function Xd(){if(za){const t=Array.from(zn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=kE(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}za=!1,$a=!1,zn.forEach(t=>t.complete(ja)),zn.clear()}function Qd(){zn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(za=!0)})}function xE(){ja=!0,Qd(),Xd(),ja=!1}class Ha{constructor(e,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(zn.add(this),$a||($a=!0,rn.read(Qd),rn.resolveKeyframes(Xd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}EE(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),zn.delete(this)}cancel(){this.state==="scheduled"&&(zn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const RE=t=>t.startsWith("--");function NE(t,e,n){RE(e)?t.style.setProperty(e,n):t.style[e]=n}function Wa(t){let e;return()=>(e===void 0&&(e=t()),e)}const OE=Wa(()=>window.ScrollTimeline!==void 0),PE={};function ME(t,e){const n=Wa(t);return()=>{var r;return(r=PE[e])!=null?r:n()}}const Jd=ME(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),bi=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Zd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bi([0,.65,.55,1]),circOut:bi([.55,0,1,.45]),backIn:bi([.31,.01,.66,-.59]),backOut:bi([.33,1.53,.69,.99])};function ef(t,e){if(t)return typeof t=="function"?Jd()?Nd(t,e):"ease-out":zd(t)?bi(t):Array.isArray(t)?t.map(n=>ef(n,e)||Zd.easeOut):Zd[t]}function LE(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const l=ef(a,i);Array.isArray(l)&&(d.easing=l);const f={delay:r,duration:i,easing:Array.isArray(l)?"linear":l,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(d,f)}function DE(n){var r=n,{type:t}=r,e=at(r,["type"]);var i,s;return ma(t)&&Jd()?t.applyToOptions(e):((i=e.duration)!=null||(e.duration=300),(s=e.ease)!=null||(e.ease="easeOut"),e)}class FE extends La{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,tn(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const u=DE(e);this.animation=LE(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Ma(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):NE(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return en(Number(e))}get time(){return en(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&OE()?(this.animation.timeline=e,gr):n(this)}}const tf={anticipate:Vd,backInOut:Bd,circInOut:$d};function UE(t){return t in tf}function BE(t){typeof t.ease=="string"&&UE(t.ease)&&(t.ease=tf[t.ease])}const nf=10;class VE extends FE{constructor(e){BE(e),Wd(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){var d;const u=this.options,{motionValue:n,onUpdate:r,onComplete:i,element:s}=u,o=at(u,["motionValue","onUpdate","onComplete","element"]);if(!n)return;if(e!==void 0){n.set(e);return}const a=new Da($(y({},o),{autoplay:!1})),c=Dt((d=this.finishedTime)!=null?d:this.time);n.setWithVelocity(a.sample(c-nf).value,a.sample(c).value,nf),a.stop()}}const rf=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Sr.test(t)||t==="0")&&!t.startsWith("url("));function $E(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function zE(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=rf(i,e),a=rf(s,e);return li(o===a,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!o||!a?!1:$E(t)||(n==="spring"||ma(n))&&r}function sf(t){return typeof t=="object"&&t!==null}function jE(t){return sf(t)&&"offsetHeight"in t}const HE=new Set(["opacity","clipPath","filter","transform"]),WE=Wa(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function GE(t){var u;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=t;if(!jE((u=e==null?void 0:e.owner)==null?void 0:u.current))return!1;const{onUpdate:a,transformTemplate:c}=e.owner.getProps();return WE()&&n&&HE.has(n)&&(n!=="transform"||!c)&&!a&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const qE=40;class KE extends La{constructor(f){var p=f,{autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:d}=p,l=at(p,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var g;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Ct.now();const h=y({autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:c,motionValue:u,element:d},l),m=(d==null?void 0:d.KeyframeResolver)||Ha;this.keyframeResolver=new m(a,(_,b,C)=>this.onKeyframesResolved(_,b,h,!C),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Ct.now(),zE(e,s,o,a)||((nn.instantAnimations||!c)&&(d==null||d(Ma(e,r,n))),e[0]=e[e.length-1],r.duration=0,r.repeat=0);const l=i?this.resolvedAt?this.resolvedAt-this.createdAt>qE?this.resolvedAt:this.createdAt:this.createdAt:void 0,f=$(y({startTime:l,finalKeyframe:n},r),{keyframes:e}),p=!u&&GE(f)?new VE($(y({},f),{element:f.motionValue.owner.current})):new Da(f);p.finished.then(()=>this.notifyFinished()).catch(gr),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),xE()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const of=(t,e,n,r={},i,s)=>o=>{const a=_d(r,t)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Dt(c);const d=$(y({keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity()},a),{delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i});kv(a)||Object.assign(d,Av(t,d)),d.duration&&(d.duration=Dt(d.duration)),d.repeatDelay&&(d.repeatDelay=Dt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let l=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(l=!0)),(nn.instantAnimations||nn.skipAnimations)&&(l=!0,d.duration=0,d.delay=0),d.allowFlatten=!a.type&&!a.ease,l&&!s&&e.get()!==void 0){const f=Sv(d.keyframes,a);if(f!==void 0){rn.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new Da(d):new KE(d)},af=new Set(["width","height","top","left","right","bottom",..._r]);function YE({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function XE(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var l;let d=e,{transition:s=t.getDefaultTransition(),transitionEnd:o}=d,a=at(d,["transition","transitionEnd"]);r&&(s=r);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const p=t.getValue(f,(l=t.latestValues[f])!=null?l:null),h=a[f];if(h===void 0||u&&YE(u,f))continue;const m=y({delay:n},_d(s||{},f)),g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let _=!1;if(window.MotionHandoffAnimation){const C=vv(t);if(C){const A=window.MotionHandoffAnimation(C,f,rn);A!==null&&(m.startTime=A,_=!0)}}yv(t,f),p.start(of(f,p,h,t.shouldReduceMotion&&af.has(f)?{type:!1}:m,t,_));const b=p.animation;b&&c.push(b)}return o&&Promise.all(c).then(()=>{rn.update(()=>{o&&gv(t,o)})}),c}function QE({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function JE(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ZE(t,e){return QE(JE(t.getBoundingClientRect(),e))}const cf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ga={};for(const t in cf)Ga[t]={isEnabled:e=>cf[t].some(n=>!!e[n])};const uf=()=>({min:0,max:0}),qa=()=>({x:uf(),y:uf()}),e0=typeof window!="undefined",Ka={current:null},lf={current:!1};function t0(){if(lf.current=!0,!!e0)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ka.current=t.matches;t.addListener(e),e()}else Ka.current=!1}function n0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function r0(t){return typeof t=="string"||Array.isArray(t)}const i0=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function df(t){return n0(t.animate)||i0.some(e=>r0(t[e]))}function s0(t){return!!(df(t)||t.variants)}function o0(t,e,n){for(const r in e){const i=e[r],s=n[r];if(ct(i))t.addValue(r,i);else if(ct(s))t.addValue(r,fi(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,fi(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const ff=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),pf=t=>/^0[^.\s]+$/u.test(t),a0={test:t=>t==="auto",parse:t=>t},hf=t=>e=>e.test(t),mf=[br,ce,vr,En,Dv,Lv,a0],gf=t=>mf.find(hf(t)),c0=[...mf,it,Sr],u0=t=>c0.find(hf(t)),l0=new Set(["brightness","contrast","saturate","opacity"]);function d0(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(va)||[];if(!r)return t;const i=n.replace(r,"");let s=l0.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const f0=/\b([a-z-]*)\(.*?\)/gu,Ya=$(y({},Sr),{getAnimatableNone:t=>{const e=t.match(f0);return e?e.map(d0).join(" "):t}}),_f=$(y({},br),{transform:Math.round}),Xa=$(y({borderWidth:ce,borderTopWidth:ce,borderRightWidth:ce,borderBottomWidth:ce,borderLeftWidth:ce,borderRadius:ce,radius:ce,borderTopLeftRadius:ce,borderTopRightRadius:ce,borderBottomRightRadius:ce,borderBottomLeftRadius:ce,width:ce,maxWidth:ce,height:ce,maxHeight:ce,top:ce,right:ce,bottom:ce,left:ce,padding:ce,paddingTop:ce,paddingRight:ce,paddingBottom:ce,paddingLeft:ce,margin:ce,marginTop:ce,marginRight:ce,marginBottom:ce,marginLeft:ce,backgroundPositionX:ce,backgroundPositionY:ce},{rotate:En,rotateX:En,rotateY:En,rotateZ:En,scale:ys,scaleX:ys,scaleY:ys,scaleZ:ys,skew:En,skewX:En,skewY:En,distance:ce,translateX:ce,translateY:ce,translateZ:ce,x:ce,y:ce,z:ce,perspective:ce,transformPerspective:ce,opacity:pi,originX:Ed,originY:Ed,originZ:ce}),{zIndex:_f,fillOpacity:pi,strokeOpacity:pi,numOctaves:_f}),p0=$(y({},Xa),{color:it,backgroundColor:it,outlineColor:it,fill:it,stroke:it,borderColor:it,borderTopColor:it,borderRightColor:it,borderBottomColor:it,borderLeftColor:it,filter:Ya,WebkitFilter:Ya}),yf=t=>p0[t];function bf(t,e){let n=yf(t);return n!==Ya&&(n=Sr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const vf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ef{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ha,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ct.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,rn.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget=y({},c),this.initialValues=n.initial?y({},c):{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=df(n),this.isVariantNode=s0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const f=this.scrapeMotionValuesFromProps(n,{},this),{willChange:d}=f,l=at(f,["willChange"]);for(const p in l){const h=l[p];c[p]!==void 0&&ct(h)&&h.set(c[p],!1)}}mount(e){this.current=e,di.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),lf.current||t0(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ka.current,process.env.NODE_ENV!=="production"&&pd(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_a(this.notifyUpdate),_a(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=yr.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&rn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Ga){const n=Ga[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qa()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<vf.length;r++){const i=vf[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=o0(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=fi(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!=null?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ff(r)||pf(r))?r=parseFloat(r):!u0(r)&&Sr.test(n)&&(r=bf(e,n)),this.setBaseTarget(e,ct(r)?r.get():r)),ct(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=dd(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ct(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new hd),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}const h0=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function m0(t){const e=h0.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n!=null?n:r}`,i]}const g0=4;function Sf(t,e,n=1){tn(n<=g0,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=m0(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return ff(o)?parseFloat(o):o}return ba(i)?Sf(i,e,n+1):i}function _0(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pf(t):!0}const y0=new Set(["auto","none","0"]);function b0(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!y0.has(s)&&gi(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=bf(n,i)}class v0 extends Ha{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),ba(u))){const d=Sf(u,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!af.has(r)||e.length!==2)return;const[i,s]=e,o=gf(i),a=gf(s);if(o!==a)if(Yd(o)&&Yd(a))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else $n[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||_0(e[i]))&&r.push(i);r.length&&b0(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$n[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=$n[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}class wf extends Ef{constructor(){super(...arguments),this.KeyframeResolver=v0}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ct(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}const Cf=(t,e)=>e&&typeof t=="number"?e.transform(t):t,E0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},S0=_r.length;function w0(t,e,n){let r="",i=!0;for(let s=0;s<S0;s++){const o=_r[s],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const u=Cf(a,Xa[o]);if(!c){i=!1;const d=E0[o]||o;r+=`${d}(${u}) `}n&&(e[o]=u)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Tf(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(yr.has(c)){o=!0;continue}else if(bd(c)){i[c]=u;continue}else{const d=Cf(u,Xa[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(o||n?r.transform=w0(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function If(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const C0={};function T0(t,{layout:e,layoutId:n}){return yr.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!C0[t]||t==="opacity")}function Af(t,e,n){var s;const{style:r}=t,i={};for(const o in r)(ct(r[o])||e.style&&ct(e.style[o])||T0(o,t)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function I0(t){return window.getComputedStyle(t)}class A0 extends wf{constructor(){super(...arguments),this.type="html",this.renderInstance=If}readValueFromInstance(e,n){var r;if(yr.has(n))return(r=this.projection)!=null&&r.isProjecting?Ba(n):CE(e,n);{const i=I0(e),s=(bd(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ZE(e,n)}build(e,n,r){Tf(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Af(e,n,r)}}function k0(t,e){return t in e}class x0 extends Ef{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(k0(n,e)){const r=e[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return qa()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const R0={offset:"stroke-dashoffset",array:"stroke-dasharray"},N0={offset:"strokeDashoffset",array:"strokeDasharray"};function O0(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?R0:N0;t[s.offset]=ce.transform(-r);const o=ce.transform(e),a=ce.transform(n);t[s.array]=`${o} ${a}`}function P0(t,l,c,u,d){var f=l,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0}=f,a=at(f,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var m,g;if(Tf(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:h}=t;p.transform&&(h.transform=p.transform,delete p.transform),(h.transform||p.transformOrigin)&&(h.transformOrigin=(m=p.transformOrigin)!=null?m:"50% 50%",delete p.transformOrigin),h.transform&&(h.transformBox=(g=d==null?void 0:d.transformBox)!=null?g:"fill-box",delete p.transformBox),e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),i!==void 0&&O0(p,i,s,o,!1)}const kf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),M0=t=>typeof t=="string"&&t.toLowerCase()==="svg";function L0(t,e,n,r){If(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(kf.has(i)?i:ya(i),e.attrs[i])}function D0(t,e,n){const r=Af(t,e,n);for(const i in t)if(ct(t[i])||ct(e[i])){const s=_r.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}class F0 extends wf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qa}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(yr.has(n)){const r=yf(n);return r&&r.default||0}return n=kf.has(n)?n:ya(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return D0(e,n,r)}build(e,n,r){P0(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){L0(e,n,r,i)}mount(e){this.isSVGTag=M0(e.tagName),super.mount(e)}}function xf(t){return sf(t)&&"ownerSVGElement"in t}function U0(t){return xf(t)&&t.tagName==="svg"}function B0(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=xf(t)&&!U0(t)?new F0(e):new A0(e);n.mount(t),di.set(t,n)}function V0(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new x0(e);n.mount(t),di.set(t,n)}function $0(t,e,n){const r=ct(t)?t:fi(t);return r.start(of("",r,e,n)),r.animation}function z0(t,e){return ct(t)||typeof t=="number"||typeof t=="string"&&!pa(e)}function Rf(t,e,n,r){const i=[];if(z0(t,e))i.push($0(t,pa(e)&&e.default||e,n&&(n.default||n)));else{const s=ed(t,e,r),o=s.length;tn(!!o,"No valid elements provided.");for(let a=0;a<o;a++){const c=s[a],u=c instanceof Element?B0:V0;di.has(c)||u(c);const d=di.get(c),l=y({},n);"delay"in l&&typeof l.delay=="function"&&(l.delay=l.delay(a,o)),i.push(...XE(d,$(y({},e),{transition:l}),{}))}}return i}function j0(t,e,n){const r=[];return tv(t,e,n,{spring:_i}).forEach(({keyframes:s,transition:o},a)=>{r.push(...Rf(a,s,o))}),r}class H0{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e){const n=this.animations.map(r=>r.attachTimeline(e));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class W0 extends H0{then(e,n){return this.finished.finally(e).then(()=>{})}}function G0(t){return Array.isArray(t)&&t.some(Array.isArray)}function q0(t){function e(n,r,i){let s=[];return G0(n)?s=j0(n,r,t):s=Rf(n,r,i,t),new W0(s)}return e}const Xe=q0(),xe={spinner:"_spinner_1lif3_1",spinnerContainer:"_spinnerContainer_1lif3_5",success:"_success_1lif3_9",successContainer:"_successContainer_1lif3_14",container:"_container_1lif3_57",card:"_card_1lif3_66",warning:"_warning_1lif3_75",svg:"_svg_1lif3_83",srOnly:"_srOnly_1lif3_88",backButton:"_backButton_1lif3_92"};function Pe(t,e){if(!e)return;const n=e.trim().split(/\s+/).filter(r=>r.length>0);t.classList.add(...n)}class Nf{constructor(){N(this,"template",`
|
|
3
3
|
<svg class="${xe.spinner}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 215 215" fill="none">
|
|
4
4
|
<path d="M214.476 107.728C214.476 132.466 205.898 156.439 190.204 175.562C174.51 194.686 152.671 207.775 128.408 212.602C104.144 217.428 78.9585 213.692 57.141 202.03C35.3236 190.369 18.2247 171.503 8.75763 148.647C-0.709393 125.792 -1.95874 100.361 5.22248 76.6878C12.4037 53.0145 27.5711 32.5636 48.1405 18.8196C68.7098 5.07558 93.4083 -1.11108 118.028 1.31372C142.647 3.73851 165.664 14.6247 183.157 32.1175L168.035 47.2395C154.041 33.2453 135.627 24.5363 115.932 22.5965C96.236 20.6566 76.4772 25.606 60.0217 36.6012C43.5663 47.5964 31.4323 63.9571 25.6874 82.8957C19.9424 101.834 20.9419 122.179 28.5155 140.463C36.0891 158.748 49.7683 173.84 67.2222 183.17C84.6761 192.499 104.825 195.488 124.235 191.627C143.646 187.766 161.117 177.294 173.672 161.995C186.228 146.697 193.09 127.518 193.09 107.728L214.476 107.728Z" fill="currentColor"/>
|
|
5
5
|
</svg>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<%s {...props} />
|
|
27
27
|
React keys must be passed directly to JSX without using spread:
|
|
28
28
|
let props = %s;
|
|
29
|
-
<%s key={someKey} {...props} />`,S,x,X,x),E[x+S]=!0)}if(x=null,W!==void 0&&(n(W),x=""+W),o(P)&&(n(P.key),x=""+P.key),"key"in P){W={};for(var ne in P)ne!=="key"&&(W[ne]=P[ne])}else W=P;return x&&a(W,typeof v=="function"?v.displayName||v.name||"Unknown":v),u(v,x,T,R,i(),W,F,G)}function l(v){typeof v=="object"&&v!==null&&v.$$typeof===p&&v._store&&(v._store.validated=1)}var f=ge,p=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),Y=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,U=Array.isArray,z=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(v){return v()}};var Q,B={},K=f.react_stack_bottom_frame.bind(f,s)(),H=z(r(s)),E={};Ai.Fragment=m,Ai.jsx=function(v,P,W,S,R){var T=1e4>Y.recentlyCreatedOwnerStacks++;return d(v,P,W,!1,S,R,T?Error("react-stack-top-frame"):K,T?z(r(v)):H)},Ai.jsxs=function(v,P,W,S,R){var T=1e4>Y.recentlyCreatedOwnerStacks++;return d(v,P,W,!0,S,R,T?Error("react-stack-top-frame"):K,T?z(r(v)):H)}}()),Ai}var Gf;function b1(){return Gf||(Gf=1,process.env.NODE_ENV==="production"?Es.exports=_1():Es.exports=y1()),Es.exports}b1();const v1=[Hn.Mastercard,Hn.Visa],Ss=(t,e)=>(console.error("Error: ",t),e.status.error);class E1{constructor(e){N(this,"element");N(this,"events",{ready:new qe});N(this,"ev");N(this,"customButtonStyles");N(this,"isInitialized",!1);N(this,"onPaymentAttempt");this.config=e;const n=this.config.state.styles.getState().ApplePayButton;this.onPaymentAttempt=this.config.state.checkout.getState().onCheckoutAttempt,this.ev=this.config.service.ev,this.customButtonStyles=n,this.element=document.createElement("div"),this.element.classList.add(Qa.applePay,Qa.hidden)}init(e){return j(this,null,function*(){if(!this.config)return!1;const n=this.config.state.transaction.getState(),r=this.config.state.translate.locale(),i=f1(n);if(!i)return!1;const s=e?$(y({},e),{onError:o=>{var
|
|
29
|
+
<%s key={someKey} {...props} />`,S,x,X,x),E[x+S]=!0)}if(x=null,W!==void 0&&(n(W),x=""+W),o(P)&&(n(P.key),x=""+P.key),"key"in P){W={};for(var ne in P)ne!=="key"&&(W[ne]=P[ne])}else W=P;return x&&a(W,typeof v=="function"?v.displayName||v.name||"Unknown":v),u(v,x,T,R,i(),W,F,G)}function l(v){typeof v=="object"&&v!==null&&v.$$typeof===p&&v._store&&(v._store.validated=1)}var f=ge,p=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),Y=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,U=Array.isArray,z=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(v){return v()}};var Q,B={},K=f.react_stack_bottom_frame.bind(f,s)(),H=z(r(s)),E={};Ai.Fragment=m,Ai.jsx=function(v,P,W,S,R){var T=1e4>Y.recentlyCreatedOwnerStacks++;return d(v,P,W,!1,S,R,T?Error("react-stack-top-frame"):K,T?z(r(v)):H)},Ai.jsxs=function(v,P,W,S,R){var T=1e4>Y.recentlyCreatedOwnerStacks++;return d(v,P,W,!0,S,R,T?Error("react-stack-top-frame"):K,T?z(r(v)):H)}}()),Ai}var Gf;function b1(){return Gf||(Gf=1,process.env.NODE_ENV==="production"?Es.exports=_1():Es.exports=y1()),Es.exports}b1();const v1=[Hn.Mastercard,Hn.Visa],Ss=(t,e)=>(console.error("Error: ",t),e.status.error);class E1{constructor(e){N(this,"element");N(this,"events",{ready:new qe});N(this,"ev");N(this,"customButtonStyles");N(this,"isInitialized",!1);N(this,"onPaymentAttempt");this.config=e;const n=this.config.state.styles.getState().ApplePayButton;this.onPaymentAttempt=this.config.state.checkout.getState().onCheckoutAttempt,this.ev=this.config.service.ev,this.customButtonStyles=n,this.element=document.createElement("div"),this.element.classList.add(Qa.applePay,Qa.hidden)}init(e){return j(this,null,function*(){if(!this.config)return!1;const n=this.config.state.transaction.getState(),r=this.config.state.translate.locale(),i=f1(n);if(!i)return!1;const s=e?$(y({},e),{onError:o=>{var u,d;if(!this.isInitialized){console.error("Apple Pay error:",o);return}const a=this.config.state.translate.messages();(typeof o=="string"?o:(o==null?void 0:o.message)||"").toLowerCase().includes("cancelled")?(u=e.onCancel)==null||u.call(e):(Ss(o,a),(d=e.onError)==null||d.call(e,{e:o,paymentMethod:J.APPLE_PAY}))},onSuccess:o=>{var a;(a=e.onSuccess)==null||a.call(e,o)}}):void 0;return yield this.ev.initApple($(y({},s),{transaction:i,supportedCardTypes:p1(v1),locale:h1(r||"en"),onPaymentAttempt:this.onPaymentAttempt}),this.customButtonStyles),this.ev.isAppleAvailable()?(yield this.ev.renderApple(this.element),this.isInitialized=!0,this.element.classList.remove(Qa.hidden),this.events.ready.emit(),!0):!1})}addEventListener(e,n){return this.events[e].addListener(n)}render(){return this.element}}const S1=[{type:J.PAYPAL,is_active:!1,order:1},{type:J.APPLE_PAY,is_active:!1,order:2},{type:J.GOOGLE_PAY,is_active:!1,order:3},{type:J.VENMO,is_active:!1,order:4},{type:J.CARD,is_active:!0,order:5}],Ir={open:{y:0,opacity:1},close:{y:100,opacity:0},transition:{duration:.25,ease:"easeOut"}},ws={open:{y:0,opacity:1},close:{y:-100,opacity:0},transition:{duration:.25,ease:"easeOut"}},st={open:{y:0,opacity:1},close:{y:15,opacity:0},transition:{duration:.25,type:"spring",bounce:0}},Tt={open:{y:0,opacity:1,height:"auto"},close:{y:-15,opacity:0,height:0},transition:{duration:.25,type:"spring",bounce:0}},ec={googlePay:"_googlePay_17y0j_1",hidden:"_hidden_17y0j_19"};class w1{constructor(e){N(this,"element");N(this,"events",{ready:new qe});N(this,"ev");N(this,"customButtonStyles");N(this,"isInitialized",!1);N(this,"onPaymentAttempt");this.config=e,this.ev=this.config.service.ev,this.customButtonStyles=this.config.state.styles.getState().GooglePayButton,this.onPaymentAttempt=this.config.state.checkout.getState().onCheckoutAttempt,this.element=document.createElement("div"),this.element.classList.add(ec.googlePay,ec.hidden)}init(e){return j(this,null,function*(){if(!this.config)return!1;const n=this.config.state.transaction.getState(),r=this.config.state.translate.locale(),i=d1(n);if(!i)return!1;const s=e?$(y({},e),{onError:o=>{var a;if(!this.isInitialized){console.error("Google Pay error:",o);return}Ss(o,this.config.state.translate.messages()),(a=e.onError)==null||a.call(e,{e:o,paymentMethod:J.GOOGLE_PAY})},onSuccess:o=>{var a;(a=e.onSuccess)==null||a.call(e,o)}}):void 0;return yield this.ev.initGoogle($(y({},s),{transaction:i,locale:m1(r||"en"),onPaymentAttempt:this.onPaymentAttempt}),this.customButtonStyles),yield this.ev.renderGoogle(this.element),this.element.classList.remove(ec.hidden),this.isInitialized=!0,this.events.ready.emit(),!0})}addEventListener(e,n){return this.events[e].addListener(n)}render(){return this.element}}const tc={paypal:"_paypal_iyh6g_1",hidden:"_hidden_iyh6g_7"};class C1{constructor(e){N(this,"element");N(this,"events",{ready:new qe,onPaymentAttempt:new qe});N(this,"paypal");N(this,"customButtonStyles");N(this,"isInitialized",!1);this.config=e,this.paypal=this.config.service.paypal,this.customButtonStyles=this.config.state.styles.getState().PayPalButton,this.element=document.createElement("div"),this.element.classList.add(tc.paypal,tc.hidden)}init(e){return j(this,null,function*(){var o,a;if(!this.config)return!1;const n=this.config.state.transaction.getState(),r=this.config.state.checkout.getState(),i=()=>j(this,null,function*(){try{return yield Bb(r.clientToken,r.environment,r.apiVersion)}catch(c){throw c}});if(!n||Object.keys(n).length===0)return console.error("PayPal transaction data is empty or invalid"),!1;if(!((o=n==null?void 0:n.paypal_info)!=null&&o.client_id))return!1;try{if(yield this.paypal.init({clientId:n.paypal_info.client_id,environment:n.paypal_info.environment||"sandbox",vault:!0,locale:g1(this.config.state.translate.locale()),intent:"tokenize"}),!this.paypal.isLoaded())return!1}catch(c){return!1}const s=e?$(y({},e),{onError:c=>{var d,l;if(!this.isInitialized){console.error("PayPal error:",c);return}!this.isUserCancellationError(c)&&c?(d=e.onError)==null||d.call(e,{e:c,paymentMethod:J.PAYPAL}):(l=e.onCancel)==null||l.call(e)},onCancel:()=>{var c;(c=e.onCancel)==null||c.call(e)},onSuccess:c=>{var u;(u=e.onSuccess)==null||u.call(e,c)}}):void 0;try{yield this.paypal.render(this.element,$(y({},s),{createBillingAgreement:i,onApprove:u=>j(this,[u],function*({billingToken:c}){var d;this.events.onPaymentAttempt.emit(J.PAYPAL),(d=s==null?void 0:s.onSuccess)==null||d.call(s,c||"")}),style:(a=this.customButtonStyles)==null?void 0:a.styles,onCancel:()=>{var c;(c=s==null?void 0:s.onCancel)==null||c.call(s)},onError:c=>{var d,l;const u=this.isUserCancellationError(c);!u&&c?(d=s==null?void 0:s.onError)==null||d.call(s,c):u&&((l=s==null?void 0:s.onCancel)==null||l.call(s))}}))}catch(c){return!1}return this.element.classList.remove(tc.hidden),this.isInitialized=!0,this.events.ready.emit(),!0})}addEventListener(e,n){return this.events[e].addListener(n)}isUserCancellationError(e){var i;if(!e)return!1;const n=typeof e=="string"?e:(e==null?void 0:e.message)||((i=e==null?void 0:e.status_reason)==null?void 0:i.message)||"";return["window is closed","window closed","popup closed","user closed","cancelled by user","user cancelled","popup close"].some(s=>{var o;return(o=n==null?void 0:n.toLowerCase())==null?void 0:o.includes(s)})}render(){return this.element}}class T1{constructor(){N(this,"template",`
|
|
30
30
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
31
31
|
width="24"
|
|
32
32
|
height="24"
|
|
@@ -44,7 +44,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
44
44
|
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.card),this.element.innerHTML=this.template}render(){return this.element}}const qf={button:"_button_1trim_1"};class I1{constructor(e){N(this,"element");N(this,"icon",new T1);this.config=e;const n=this.config.state.styles.getState().WalletButton,r=this.config.state.translate;this.element=document.createElement("button"),this.element.classList.add(qf.button,qf.press),n!=null&&n.className&&Pe(this.element,n.className),n!=null&&n.styles&&Object.assign(this.element.style,n.styles);const i=document.createElement("span");i.textContent=r.getState().messages.card.compact.button,this.element.append(this.icon.render(),i),r.subscribe(({messages:s})=>{i.textContent=s.card.compact.button})}addEventListener(e){return this.element.addEventListener("click",e)}render(){return this.element}}const A1=(t,e,n)=>e.concat(t.filter(r=>e.every(i=>!n(r,i)))),Cs={container:"_container_10ziz_2",venmo:"_venmo_10ziz_8",hidden:"_hidden_10ziz_35"},k1={display:"flex",height:40,borderRadius:12},x1=`<svg viewBox="2.3 484.3 611.9 117.80000000000001" xmlns="http://www.w3.org/2000/svg">
|
|
45
45
|
<path d="M103.1 485.8c4.2 7 5.7 14 5.7 22.4 0 28-23.8 65.9-43.4 91.1H20.5L2.3 491.5l40.6-2.8 9.8 77.1c8.4-14 19.7-37.9 19.7-53.2 0-8.4-1.4-14-4.2-19.7zm51.8 47.7c7 0 25.2-2.8 25.2-14 0-5.7-2.8-7-7-7-8.3 0-18.2 8.4-18.2 21zm-1.3 21c0 12.7 7 18.2 16.8 18.2s19.7-2.8 32.2-8.4l-5.7 30.8c-8.4 4.2-22.4 7-36.4 7-33.5 0-46.2-21-46.2-46.2 0-33.5 19.7-68.6 60.2-68.6 22.4 0 35 12.7 35 30.8 1.5 26.6-35 36.4-55.9 36.4zM324.4 511c0 4.2 0 9.8-1.4 14l-11.2 74.2H274l11.2-68.6c0-1.4 1.4-5.7 1.4-7 0-5.7-2.8-5.7-7-5.7-5.7 0-9.8 2.8-12.7 4.2l-14 77.1H215l16.8-112.1h33.5v8.4c8.4-5.7 18.2-11.2 32.2-11.2 19.9 3 26.9 12.7 26.9 26.7zm113.4-12.5c11.2-8.4 21-12.7 35-12.7 19.7 0 26.7 9.8 26.7 25.2 0 4.2 0 9.8-1.4 14L487 599.3h-37.9l11.2-70v-5.7c0-5.7-2.8-7-7-7s-9.8 1.4-12.7 4.2L428 599.2h-37.9l11.2-70v-5.7c0-5.7-2.8-7-7-7-5.7 0-9.8 2.8-12.7 4.2L369 599h-37.9L348 487h32.2l1.4 9.8c7-5.7 18.2-11.2 32.2-11.2 11.4 1.7 19.7 5.9 24 12.9zM575 532.1c0-9.8-2.8-15.4-9.8-15.4-15.4 0-18.2 26.7-18.2 40.6 0 9.8 2.8 16.8 9.8 16.8 15.5-1.4 18.2-29.4 18.2-42zm-65.8 22.4c0-35 18.2-68.6 61.6-68.6 32.2 0 43.4 19.7 43.4 44.9 0 35-18.2 70-61.6 70-32.2 1.3-43.4-19.7-43.4-46.3z"
|
|
46
46
|
fill="currentColor"/>
|
|
47
|
-
</svg>`;class R1{constructor(e){N(this,"isProcessing",!1);N(this,"container");N(this,"venmoButton");N(this,"events",{ready:new qe});N(this,"braintree");N(this,"isInitialized",!1);this.config=e,this.braintree=this.config.service.braintree;const n=this.config.state.styles.getState().BraintreeButton;this.container=document.createElement("div"),this.container.classList.add(Cs.container),this.venmoButton=document.createElement("button"),this.venmoButton.classList.add(Cs.venmo,Cs.hidden),n!=null&&n.className&&Pe(this.venmoButton,n.className),n!=null&&n.styles&&Object.assign(this.venmoButton.style,n.styles),this.venmoButton.setAttribute("aria-label","Venmo"),this.venmoButton.innerHTML=x1,this.container.append(this.venmoButton)}init(e){return j(this,null,function*(){var r;if(!this.config)return!1;const n=this.config.state.transaction.getState();if(!n||Object.keys(n).length===0)return!1;try{return yield this.braintree.init({authorization:((r=n==null?void 0:n.brain_tree_info)==null?void 0:r.client_token)||""}),yield this.braintree.createVenmo({}),this.braintree.isBrowserSupported()?(this.displayVenmoButton(e),this.braintree.hasTokenizationResult()?(yield this.handleExistingTokenization(e),!1):(this.venmoButton.classList.remove(Cs.hidden),this.isInitialized=!0,this.events.ready.emit(),!0)):(this.handleVenmoError(new Error("Browser does not support Venmo")),!1)}catch(i){return this.handleVenmoError(i),!1}})}displayVenmoButton(e){Object.assign(this.venmoButton.style,k1),this.venmoButton.addEventListener("click",()=>j(this,null,function*(){if(!this.isProcessing){this.isProcessing=!0,this.venmoButton.disabled=!0;try{const n=yield this.braintree.tokenize();this.handleVenmoSuccess(n,e)}catch(n){this.handleVenmoError(n,e)}finally{this.isProcessing=!1,this.venmoButton.disabled=!1}}}))}handleExistingTokenization(e){return j(this,null,function*(){try{const n=yield this.braintree.tokenize();this.handleVenmoSuccess(n,e)}catch(n){this.handleVenmoError(n,e)}})}handleVenmoSuccess(e,n){var r;(r=n.onSuccess)==null||r.call(n,e)}handleVenmoError(e,n){var r,i,s;this.isInitialized&&((r=e==null?void 0:e.message)
|
|
47
|
+
</svg>`;class R1{constructor(e){N(this,"isProcessing",!1);N(this,"container");N(this,"venmoButton");N(this,"events",{ready:new qe});N(this,"braintree");N(this,"isInitialized",!1);this.config=e,this.braintree=this.config.service.braintree;const n=this.config.state.styles.getState().BraintreeButton;this.container=document.createElement("div"),this.container.classList.add(Cs.container),this.venmoButton=document.createElement("button"),this.venmoButton.classList.add(Cs.venmo,Cs.hidden),n!=null&&n.className&&Pe(this.venmoButton,n.className),n!=null&&n.styles&&Object.assign(this.venmoButton.style,n.styles),this.venmoButton.setAttribute("aria-label","Venmo"),this.venmoButton.innerHTML=x1,this.container.append(this.venmoButton)}init(e){return j(this,null,function*(){var r;if(!this.config)return!1;const n=this.config.state.transaction.getState();if(!n||Object.keys(n).length===0)return!1;try{return yield this.braintree.init({authorization:((r=n==null?void 0:n.brain_tree_info)==null?void 0:r.client_token)||""}),yield this.braintree.createVenmo({}),this.braintree.isBrowserSupported()?(this.displayVenmoButton(e),this.braintree.hasTokenizationResult()?(yield this.handleExistingTokenization(e),!1):(this.venmoButton.classList.remove(Cs.hidden),this.isInitialized=!0,this.events.ready.emit(),!0)):(this.handleVenmoError(new Error("Browser does not support Venmo")),!1)}catch(i){return this.handleVenmoError(i),!1}})}displayVenmoButton(e){Object.assign(this.venmoButton.style,k1),this.venmoButton.addEventListener("click",()=>j(this,null,function*(){if(!this.isProcessing){this.isProcessing=!0,this.venmoButton.disabled=!0;try{const n=yield this.braintree.tokenize();this.handleVenmoSuccess(n,e)}catch(n){this.handleVenmoError(n,e)}finally{this.isProcessing=!1,this.venmoButton.disabled=!1}}}))}handleExistingTokenization(e){return j(this,null,function*(){try{const n=yield this.braintree.tokenize();this.handleVenmoSuccess(n,e)}catch(n){this.handleVenmoError(n,e)}})}handleVenmoSuccess(e,n){var r;(r=n.onSuccess)==null||r.call(n,e)}handleVenmoError(e,n){var r,i,s,o;this.isInitialized&&((i=(r=e==null?void 0:e.message)==null?void 0:r.toLowerCase())!=null&&i.includes("close")?(s=n==null?void 0:n.onCancel)==null||s.call(n):(o=n==null?void 0:n.onError)==null||o.call(n,{e,paymentMethod:J.VENMO}))}addEventListener(e,n){return this.events[e].addListener(n)}render(){return this.container}}class N1{constructor(e){N(this,"attempted",new Set);N(this,"buttons");N(this,"applePay");N(this,"googlePay");N(this,"paypal");N(this,"card");N(this,"braintree");N(this,"events",{onFormLoaded:new qe,ready:new qe,open:new qe,error:new qe,cancel:new qe,success:new qe,onPaymentAttempt:new qe});this.config=e,this.buttons=document.createElement("div"),this.buttons.classList.add(jn.buttons,jn.hidden)}init(){return j(this,null,function*(){this.config.service.ev.addEventListener("ready",()=>{this.initPaymentMethods().catch(console.error)})})}initApple(e){return j(this,null,function*(){if(!this.applePay){e==null||e.remove();return}e==null||e.classList.add(jn.skeleton);try{if(yield this.applePay.init({onError:r=>{this.events.error.emit(r),console.log("Apple Pay error:",r.e),e==null||e.remove(),this.attempted.delete(J.APPLE_PAY)},onCancel:()=>{this.events.cancel.emit(),this.attempted.delete(J.APPLE_PAY)},onSuccess:r=>{this.events.success.emit($(y({},r),{type:"apple"})),this.attempted.delete(J.APPLE_PAY)}})){const r=this.applePay.render();e==null||e.appendChild(r)}else e==null||e.remove()}catch(n){console.error(n),e==null||e.remove()}})}initGoogle(e){return j(this,null,function*(){if(!this.googlePay){e==null||e.remove();return}e==null||e.classList.add(jn.skeleton);try{if(yield this.googlePay.init({onError:r=>{this.events.error.emit(r),e==null||e.remove(),this.attempted.delete(J.GOOGLE_PAY)},onCancel:()=>{this.events.cancel.emit(),this.attempted.delete(J.GOOGLE_PAY)},onSuccess:r=>{this.events.success.emit($(y({},r),{type:"google"})),this.attempted.delete(J.GOOGLE_PAY)}})){const r=this.googlePay.render();e==null||e.appendChild(r)}else e==null||e.remove()}catch(n){console.error(n),e==null||e.remove()}})}initPayPal(e){return j(this,null,function*(){if(!this.paypal){e==null||e.remove();return}e==null||e.classList.add(jn.skeleton);try{const n=this.paypal.render();e==null||e.appendChild(n),(yield this.paypal.init({onError:i=>{this.events.error.emit(i),this.attempted.delete(J.PAYPAL)},onCancel:()=>{this.events.cancel.emit(),this.attempted.delete(J.PAYPAL)},onSuccess:i=>{this.events.success.emit({paypalId:i,type:"paypal"}),this.attempted.delete(J.PAYPAL)}}))||e==null||e.remove()}catch(n){e==null||e.remove()}})}initBraintreeVenmo(e){return j(this,null,function*(){if(!this.braintree){e==null||e.remove();return}e==null||e.classList.add(jn.skeleton);try{if(yield this.braintree.init({onError:r=>{this.events.onPaymentAttempt.emit(J.VENMO),this.events.error.emit(r),e==null||e.remove()},onCancel:()=>this.events.cancel.emit(),onSuccess:r=>{this.events.onPaymentAttempt.emit(J.VENMO),this.events.success.emit({nonce:r==null?void 0:r.nonce,type:"venmo"})}})){const r=this.braintree.render();e==null||e.appendChild(r)}else e==null||e.remove()}catch(n){console.error(n),e==null||e.remove()}})}initCard(e){return j(this,null,function*(){if(!this.card){e==null||e.remove();return}e==null||e.appendChild(this.card.render())})}initPaymentMethods(){return j(this,null,function*(){const e=this.config.state.transaction.getState(),n=A1(S1,(e==null?void 0:e.checkout_config)||[],(o,a)=>o.type===a.type),r=this.config.state.checkout.getState();let i=n.filter(({is_active:o})=>o);(r==null?void 0:r.variant)==="default"&&(i=i.filter(({type:o})=>o!==J.CARD));const s=this.initializeButtonInstances(i);Promise.all(s).then(()=>{this.handleOnFormLoaded()}),this.handleReady()})}initializeButtonInstances(e){const n=e.map(({type:l})=>l),r=n.includes(J.APPLE_PAY),i=n.includes(J.GOOGLE_PAY),s=n.includes(J.PAYPAL),o=n.includes(J.VENMO),a=n.includes(J.CARD);r&&!this.applePay&&(this.applePay=new E1(this.config)),i&&!this.googlePay&&(this.googlePay=new w1(this.config)),s&&!this.paypal&&(this.paypal=new C1(this.config),this.paypal.addEventListener("onPaymentAttempt",l=>this.events.onPaymentAttempt.emit(l))),o&&!this.braintree&&(this.braintree=new R1(this.config)),a&&!this.card&&(this.card=new I1(this.config),this.card.addEventListener(()=>{this.events.open.emit()}));const c=e.filter(({type:l})=>{var m,g,_,b,C,A;const f=navigator,p=(_=(g=(m=f==null?void 0:f.userAgentData)==null?void 0:m.platform)==null?void 0:g.toLowerCase())==null?void 0:_.includes("android"),h=(A=(C=(b=f==null?void 0:f.userAgentData)==null?void 0:b.platform)==null?void 0:C.toLowerCase())==null?void 0:A.includes("windows");return!(l===J.APPLE_PAY&&(p||h))}).sort((l,f)=>l.order-f.order),u=new Map;for(const{type:l}of c){const f=document.createElement("div");this.buttons.appendChild(f),u.set(l,f)}return c.map(({type:l})=>{const f=u.get(l);if(l===J.APPLE_PAY&&this.applePay)return this.initApple(f);if(l===J.GOOGLE_PAY&&this.googlePay)return this.initGoogle(f);if(l===J.PAYPAL&&this.paypal)return this.initPayPal(f);if(l===J.VENMO&&this.braintree)return this.initBraintreeVenmo(f);if(l===J.CARD&&this.card)return this.initCard(f);throw new Error("Unknown button type")})}handleReady(){this.events.ready.emit()}handleOnFormLoaded(){this.events.onFormLoaded.emit()}addEventListener(e,n){return this.events[e].addListener(n)}showButton(){this.buttons.classList.remove(jn.hidden)}render(){return this.buttons}}class O1{constructor(e){N(this,"template",`
|
|
48
48
|
<svg
|
|
49
49
|
xmlns='http://www.w3.org/2000/svg'
|
|
50
50
|
width='24'
|
|
@@ -71,7 +71,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
71
71
|
</g>
|
|
72
72
|
</svg>
|
|
73
73
|
<span class="${xe.srOnly}">Warning</span>
|
|
74
|
-
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.warning),this.element.innerHTML=this.template}render(){return this.element}}class D1{constructor(e,n){N(this,"id","paynext-card-input-name");N(this,"element");N(this,"inputContainer",document.createElement("div"));N(this,"input",document.createElement("input"));N(this,"label",document.createElement("label"));N(this,"labelText",document.createElement("span"));N(this,"labelError",document.createElement("span"));N(this,"endContent",document.createElement("div"));N(this,"warning",new Ts);N(this,"placeholderStyle",document.createElement("style"));N(this,"isTouchSubmit",!1);N(this,"isRequired",!1);N(this,"isDisabled",!1);N(this,"isChanged",!1);N(this,"events",{change:new qe});var i,s,o,a,c,u,d,l,f;const r=e.messages();if(this.element=document.createElement("div"),this.element.classList.add(ze.wrapper),this.inputContainer.classList.add(ze.inputContainer),(i=n==null?void 0:n.container)!=null&&i.className&&Pe(this.inputContainer,n.container.className),(s=n==null?void 0:n.container)!=null&&s.styles&&Object.assign(this.inputContainer.style,n.container.styles),this.input.setAttribute("id",this.id),this.input.setAttribute("autocomplete","cc-name"),this.input.setAttribute("placeholder",r.card.name.placeholder),this.input.classList.add(ze.input),(o=n==null?void 0:n.field)!=null&&o.className&&Pe(this.input,n.field.className),(a=n==null?void 0:n.field)!=null&&a.styles&&Object.assign(this.input.style,n.field.styles),(c=n==null?void 0:n.placeholder)!=null&&c.styles&&Object.keys(n.placeholder.styles).length){const p=m=>m.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),h=Object.entries(n.placeholder.styles).map(([m,g])=>`${p(m)}:${g};`).join("");this.placeholderStyle.textContent=`#${this.id}::placeholder{${h}}`,this.element.appendChild(this.placeholderStyle)}this.endContent.classList.add(ze.hidden),this.endContent.appendChild(this.warning.render()),this.inputContainer.append(this.input,this.endContent),this.label.setAttribute("for",this.id),this.label.classList.add(ze.label),(u=n==null?void 0:n.label)!=null&&u.className&&Pe(this.label,n.label.className),(d=n==null?void 0:n.label)!=null&&d.styles&&Object.assign(this.label.style,n.label.styles),this.labelText.textContent=r.card.name.label,this.labelError.textContent=r.card.required,this.labelError.classList.add(ze.labelError,ze.hidden),(l=n==null?void 0:n.error)!=null&&l.className&&Pe(this.labelError,n.error.className),(f=n==null?void 0:n.error)!=null&&f.styles&&Object.assign(this.labelError.style,n.error.styles),this.label.append(this.labelText,this.labelError),this.element.append(this.label,this.inputContainer),this.input.addEventListener("input",()=>this.handleChange(this.input.value)),this.input.addEventListener("paste",()=>this.handleChange(this.input.value)),this.input.addEventListener("blur",()=>this.validate(this.input.value)),e.subscribe(({messages:p})=>{this.input.setAttribute("placeholder",p.card.name.placeholder),this.labelText.textContent=p.card.name.label,this.labelError.textContent=p.card.required})}validator(e){return e?null:Qe.Empty}filterInput(e){return e.replace(/[^\p{L}\s'-]/gu,"")}handleChange(e){if(this.isDisabled)return;const n=this.filterInput(e);n!==e&&(this.input.value=n),this.isRequired=!1,this.isChanged||(this.isChanged=!0),this.events.change.emit({value:n,isValid:this.validator(n)===null}),this.render()}toggleLabelError(e){return j(this,null,function*(){if(e){this.inputContainer.classList.add(ze.errorInput),this.endContent.classList.remove(ze.hidden),this.labelError.classList.remove(ze.hidden),yield Xe(this.labelError,st.open,st.transition);return}this.inputContainer.classList.remove(ze.errorInput),this.endContent.classList.add(ze.hidden),yield Xe(this.labelError,st.close,st.transition),this.labelError.classList.add(ze.hidden)})}addEventListener(e,n){return this.events[e].addListener(n)}disable(e){e?(this.input.setAttribute("disabled","true"),this.input.classList.add(ze.disabledInput),this.inputContainer.classList.add(ze.disabled)):(this.input.removeAttribute("disabled"),this.input.classList.remove(ze.disabledInput),this.inputContainer.classList.remove(ze.disabled))}touchSubmit(){this.isTouchSubmit=!0,this.render()}value(){return this.input.value}validate(e){const n=this.validator(e);return this.isRequired=!!n,this.render(),!n}render(){const r=(this.isTouchSubmit||this.isChanged)&&this.isRequired&&!this.isDisabled;return this.toggleLabelError(r),this.isDisabled?(this.inputContainer.classList.add(ze.disabled),this.input.classList.add(ze.disabledInput)):(this.inputContainer.classList.remove(ze.disabled),this.input.classList.remove(ze.disabledInput)),this.element}}const Me={wrapper:"_wrapper_1xw0g_1",inputContainer:"_inputContainer_1xw0g_5",disabled:"_disabled_1xw0g_23",input:"_input_1xw0g_5",endContent:"_endContent_1xw0g_39",errorInput:"_errorInput_1xw0g_18",error:"_error_1xw0g_18",label:"_label_1xw0g_56",labelError:"_labelError_1xw0g_67",disabledInput:"_disabledInput_1xw0g_75",hidden:"_hidden_1xw0g_82"};class F1{constructor(){N(this,"template",`
|
|
74
|
+
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.warning),this.element.innerHTML=this.template}render(){return this.element}}class D1{constructor(e,n){N(this,"id","paynext-card-input-name");N(this,"element");N(this,"inputContainer",document.createElement("div"));N(this,"input",document.createElement("input"));N(this,"label",document.createElement("label"));N(this,"labelText",document.createElement("span"));N(this,"labelError",document.createElement("span"));N(this,"endContent",document.createElement("div"));N(this,"warning",new Ts);N(this,"placeholderStyle",document.createElement("style"));N(this,"isTouchSubmit",!1);N(this,"isRequired",!1);N(this,"isDisabled",!1);N(this,"isChanged",!1);N(this,"events",{change:new qe});var i,s,o,a,c,u,d,l,f;const r=e.messages();if(this.element=document.createElement("div"),this.element.classList.add(ze.wrapper),this.inputContainer.classList.add(ze.inputContainer),(i=n==null?void 0:n.container)!=null&&i.className&&Pe(this.inputContainer,n.container.className),(s=n==null?void 0:n.container)!=null&&s.styles&&Object.assign(this.inputContainer.style,n.container.styles),this.input.setAttribute("id",this.id),this.input.setAttribute("autocomplete","cc-name"),this.input.setAttribute("placeholder",r.card.name.placeholder),this.input.classList.add(ze.input),(o=n==null?void 0:n.field)!=null&&o.className&&Pe(this.input,n.field.className),(a=n==null?void 0:n.field)!=null&&a.styles&&Object.assign(this.input.style,n.field.styles),(c=n==null?void 0:n.placeholder)!=null&&c.styles&&Object.keys(n.placeholder.styles).length){const p=m=>m.replace(/[A-Z]/g,g=>"-"+(g==null?void 0:g.toLowerCase())),h=Object.entries(n.placeholder.styles).map(([m,g])=>`${p(m)}:${g};`).join("");this.placeholderStyle.textContent=`#${this.id}::placeholder{${h}}`,this.element.appendChild(this.placeholderStyle)}this.endContent.classList.add(ze.hidden),this.endContent.appendChild(this.warning.render()),this.inputContainer.append(this.input,this.endContent),this.label.setAttribute("for",this.id),this.label.classList.add(ze.label),(u=n==null?void 0:n.label)!=null&&u.className&&Pe(this.label,n.label.className),(d=n==null?void 0:n.label)!=null&&d.styles&&Object.assign(this.label.style,n.label.styles),this.labelText.textContent=r.card.name.label,this.labelError.textContent=r.card.required,this.labelError.classList.add(ze.labelError,ze.hidden),(l=n==null?void 0:n.error)!=null&&l.className&&Pe(this.labelError,n.error.className),(f=n==null?void 0:n.error)!=null&&f.styles&&Object.assign(this.labelError.style,n.error.styles),this.label.append(this.labelText,this.labelError),this.element.append(this.label,this.inputContainer),this.input.addEventListener("input",()=>this.handleChange(this.input.value)),this.input.addEventListener("paste",()=>this.handleChange(this.input.value)),this.input.addEventListener("blur",()=>this.validate(this.input.value)),e.subscribe(({messages:p})=>{this.input.setAttribute("placeholder",p.card.name.placeholder),this.labelText.textContent=p.card.name.label,this.labelError.textContent=p.card.required})}validator(e){return e?null:Qe.Empty}filterInput(e){return e.replace(/[^\p{L}\s'-]/gu,"")}handleChange(e){if(this.isDisabled)return;const n=this.filterInput(e);n!==e&&(this.input.value=n),this.isRequired=!1,this.isChanged||(this.isChanged=!0),this.events.change.emit({value:n,isValid:this.validator(n)===null}),this.render()}toggleLabelError(e){return j(this,null,function*(){if(e){this.inputContainer.classList.add(ze.errorInput),this.endContent.classList.remove(ze.hidden),this.labelError.classList.remove(ze.hidden),yield Xe(this.labelError,st.open,st.transition);return}this.inputContainer.classList.remove(ze.errorInput),this.endContent.classList.add(ze.hidden),yield Xe(this.labelError,st.close,st.transition),this.labelError.classList.add(ze.hidden)})}addEventListener(e,n){return this.events[e].addListener(n)}disable(e){e?(this.input.setAttribute("disabled","true"),this.input.classList.add(ze.disabledInput),this.inputContainer.classList.add(ze.disabled)):(this.input.removeAttribute("disabled"),this.input.classList.remove(ze.disabledInput),this.inputContainer.classList.remove(ze.disabled))}touchSubmit(){this.isTouchSubmit=!0,this.render()}value(){return this.input.value}validate(e){const n=this.validator(e);return this.isRequired=!!n,this.render(),!n}render(){const r=(this.isTouchSubmit||this.isChanged)&&this.isRequired&&!this.isDisabled;return this.toggleLabelError(r),this.isDisabled?(this.inputContainer.classList.add(ze.disabled),this.input.classList.add(ze.disabledInput)):(this.inputContainer.classList.remove(ze.disabled),this.input.classList.remove(ze.disabledInput)),this.element}}const Me={wrapper:"_wrapper_1xw0g_1",inputContainer:"_inputContainer_1xw0g_5",disabled:"_disabled_1xw0g_23",input:"_input_1xw0g_5",endContent:"_endContent_1xw0g_39",errorInput:"_errorInput_1xw0g_18",error:"_error_1xw0g_18",label:"_label_1xw0g_56",labelError:"_labelError_1xw0g_67",disabledInput:"_disabledInput_1xw0g_75",hidden:"_hidden_1xw0g_82"};class F1{constructor(){N(this,"template",`
|
|
75
75
|
<svg
|
|
76
76
|
width='28'
|
|
77
77
|
height='19'
|
|
@@ -151,7 +151,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
151
151
|
</g>
|
|
152
152
|
</svg>
|
|
153
153
|
<span class="${xe.srOnly}">Visa</span>
|
|
154
|
-
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.container),this.element.innerHTML=this.template}render(){return this.element}}class V1{constructor(e,n){N(this,"id","paynext-card-input-number");N(this,"initialCardTypes",vs.map(e=>e.type));N(this,"element");N(this,"inputContainer",document.createElement("div"));N(this,"input",document.createElement("input"));N(this,"label",document.createElement("label"));N(this,"labelText",document.createElement("span"));N(this,"labelError",document.createElement("span"));N(this,"endContent",document.createElement("div"));N(this,"error",document.createElement("p"));N(this,"unknownCard",new F1);N(this,"masterCard",new U1);N(this,"visa",new B1);N(this,"placeholderStyle",document.createElement("style"));N(this,"supportedCardTypes",this.initialCardTypes);N(this,"isTouchSubmit",!1);N(this,"errorMessage","");N(this,"isRequired",!1);N(this,"isDisabled",!1);N(this,"isChanged",!1);N(this,"events",{change:new qe});var i,s,o,a,c,u,d,l,f;this.translate=e;const r=e.messages();if(this.element=document.createElement("div"),this.element.classList.add(Me.wrapper),this.inputContainer.classList.add(Me.inputContainer),(i=n==null?void 0:n.container)!=null&&i.className&&Pe(this.inputContainer,n.container.className),(s=n==null?void 0:n.container)!=null&&s.styles&&Object.assign(this.inputContainer.style,n.container.styles),this.input.setAttribute("id",this.id),this.input.setAttribute("autocomplete","cc-number"),this.input.setAttribute("placeholder","1234 1234 1234 1234"),this.input.setAttribute("inputmode","numeric"),this.input.setAttribute("pattern","[0-9]*"),this.input.setAttribute("enterkeyhint","done"),this.input.classList.add(Me.input),(o=n==null?void 0:n.field)!=null&&o.className&&Pe(this.input,n.field.className),(a=n==null?void 0:n.field)!=null&&a.styles&&Object.assign(this.input.style,n.field.styles),(c=n==null?void 0:n.placeholder)!=null&&c.styles&&Object.keys(n.placeholder.styles).length){const p=g=>g.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=Object.entries(n.placeholder.styles).map(([g,_])=>`${p(g)}:${_} !important;`).join(""),m=`#${this.id}`;this.placeholderStyle.textContent=`${m}::placeholder{${h}}
|
|
154
|
+
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.container),this.element.innerHTML=this.template}render(){return this.element}}class V1{constructor(e,n){N(this,"id","paynext-card-input-number");N(this,"initialCardTypes",vs.map(e=>e.type));N(this,"element");N(this,"inputContainer",document.createElement("div"));N(this,"input",document.createElement("input"));N(this,"label",document.createElement("label"));N(this,"labelText",document.createElement("span"));N(this,"labelError",document.createElement("span"));N(this,"endContent",document.createElement("div"));N(this,"error",document.createElement("p"));N(this,"unknownCard",new F1);N(this,"masterCard",new U1);N(this,"visa",new B1);N(this,"placeholderStyle",document.createElement("style"));N(this,"supportedCardTypes",this.initialCardTypes);N(this,"isTouchSubmit",!1);N(this,"errorMessage","");N(this,"isRequired",!1);N(this,"isDisabled",!1);N(this,"isChanged",!1);N(this,"events",{change:new qe});var i,s,o,a,c,u,d,l,f;this.translate=e;const r=e.messages();if(this.element=document.createElement("div"),this.element.classList.add(Me.wrapper),this.inputContainer.classList.add(Me.inputContainer),(i=n==null?void 0:n.container)!=null&&i.className&&Pe(this.inputContainer,n.container.className),(s=n==null?void 0:n.container)!=null&&s.styles&&Object.assign(this.inputContainer.style,n.container.styles),this.input.setAttribute("id",this.id),this.input.setAttribute("autocomplete","cc-number"),this.input.setAttribute("placeholder","1234 1234 1234 1234"),this.input.setAttribute("inputmode","numeric"),this.input.setAttribute("pattern","[0-9]*"),this.input.setAttribute("enterkeyhint","done"),this.input.classList.add(Me.input),(o=n==null?void 0:n.field)!=null&&o.className&&Pe(this.input,n.field.className),(a=n==null?void 0:n.field)!=null&&a.styles&&Object.assign(this.input.style,n.field.styles),(c=n==null?void 0:n.placeholder)!=null&&c.styles&&Object.keys(n.placeholder.styles).length){const p=g=>g.replace(/[A-Z]/g,_=>"-"+(_==null?void 0:_.toLowerCase())),h=Object.entries(n.placeholder.styles).map(([g,_])=>`${p(g)}:${_} !important;`).join(""),m=`#${this.id}`;this.placeholderStyle.textContent=`${m}::placeholder{${h}}
|
|
155
155
|
${m}::-webkit-input-placeholder{${h}}
|
|
156
156
|
${m}::-moz-placeholder{${h}}
|
|
157
157
|
${m}:-ms-input-placeholder{${h}}
|
|
@@ -175,7 +175,7 @@ ${m}::-ms-input-placeholder{${h}}
|
|
|
175
175
|
</g>
|
|
176
176
|
</svg>
|
|
177
177
|
<span class="${xe.srOnly}">Card CVC</span>
|
|
178
|
-
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.container),this.element.innerHTML=this.template}render(){return this.element}}class z1{constructor(e,n){N(this,"cvcId","paynext-card-input-cvc");N(this,"expiryId","paynext-card-input-expiry");N(this,"element");N(this,"expiryWarning",new Ts);N(this,"cvcWarning",new Ts);N(this,"cardCvc",new $1);N(this,"expiryInputContainer",document.createElement("div"));N(this,"expiryInput",document.createElement("input"));N(this,"expiryLabel",document.createElement("label"));N(this,"expiryLabelText",document.createElement("span"));N(this,"expiryLabelError",document.createElement("span"));N(this,"expiryEndContent",document.createElement("div"));N(this,"expiryError",document.createElement("p"));N(this,"cvcInputContainer",document.createElement("div"));N(this,"cvcInput",document.createElement("input"));N(this,"cvcLabel",document.createElement("label"));N(this,"cvcLabelText",document.createElement("span"));N(this,"cvcLabelError",document.createElement("span"));N(this,"cvcEndContent",document.createElement("div"));N(this,"cvcError",document.createElement("p"));N(this,"placeholderStyle",document.createElement("style"));N(this,"cardType",null);N(this,"isTouchSubmit",!1);N(this,"isDisabled",!1);N(this,"expiryErrorMessage","");N(this,"isExpiryRequired",!1);N(this,"isExpiryChanged",!1);N(this,"cvcErrorMessage","");N(this,"isCvcRequired",!1);N(this,"isCvcChanged",!1);N(this,"events",{expiryChange:new qe,cvcChange:new qe});var o,a,c,u,d,l,f,p,h,m,g,_,b,C,A,I,k;this.translate=e;const r=e.messages();this.element=document.createElement("div"),this.element.classList.add(se.securityContent),this.expiryInputContainer.classList.add(se.inputContainer),(o=n==null?void 0:n.container)!=null&&o.className&&Pe(this.expiryInputContainer,n.container.className),(a=n==null?void 0:n.container)!=null&&a.styles&&Object.assign(this.expiryInputContainer.style,n.container.styles),this.expiryInput.setAttribute("id",this.expiryId),this.expiryInput.setAttribute("autocomplete","cc-exp"),this.expiryInput.setAttribute("placeholder",r.card.expiry.placeholder),this.expiryInput.setAttribute("inputmode","numeric"),this.expiryInput.setAttribute("pattern","[0-9]*"),this.expiryInput.setAttribute("enterkeyhint","next"),this.expiryInput.classList.add(se.input),(c=n==null?void 0:n.field)!=null&&c.className&&Pe(this.expiryInput,n.field.className),(u=n==null?void 0:n.field)!=null&&u.styles&&Object.assign(this.expiryInput.style,n.field.styles),this.expiryEndContent.classList.add(se.endContent),this.expiryEndContent.appendChild(this.expiryWarning.render()),this.expiryInputContainer.append(this.expiryInput,this.expiryEndContent),this.expiryLabel.setAttribute("for",this.expiryId),this.expiryLabel.classList.add(se.label),(d=n==null?void 0:n.label)!=null&&d.className&&Pe(this.expiryLabel,n.label.className),(l=n==null?void 0:n.label)!=null&&l.styles&&Object.assign(this.expiryLabel.style,n.label.styles),this.expiryLabelText.contentEditable="false",this.expiryLabelText.textContent=r.card.expiry.label,this.expiryLabelError.textContent=r.card.required,this.expiryLabelError.classList.add(se.labelError,se.hidden),this.expiryLabel.append(this.expiryLabelText,this.expiryLabelError),this.expiryError.classList.add(se.error,se.hidden),(f=n==null?void 0:n.error)!=null&&f.className&&Pe(this.expiryError,n.error.className),(p=n==null?void 0:n.error)!=null&&p.styles&&Object.assign(this.expiryError.style,n.error.styles);const i=document.createElement("div");if(i.appendChild(this.expiryError),this.cvcInputContainer.classList.add(se.inputContainer),(h=n==null?void 0:n.container)!=null&&h.className&&Pe(this.cvcInputContainer,n.container.className),(m=n==null?void 0:n.container)!=null&&m.styles&&Object.assign(this.cvcInputContainer.style,n.container.styles),this.cvcInput.setAttribute("id",this.cvcId),this.cvcInput.setAttribute("autocomplete","cc-csc"),this.cvcInput.setAttribute("placeholder",r.card.cvc.placeholder),this.cvcInput.setAttribute("inputmode","numeric"),this.cvcInput.setAttribute("pattern","[0-9]*"),this.cvcInput.setAttribute("enterkeyhint","done"),this.cvcInput.classList.add(se.input),(g=n==null?void 0:n.field)!=null&&g.className&&Pe(this.cvcInput,n.field.className),(_=n==null?void 0:n.field)!=null&&_.styles&&Object.assign(this.cvcInput.style,n.field.styles),(b=n==null?void 0:n.placeholder)!=null&&b.styles&&Object.keys(n.placeholder.styles).length){const w=M=>M.replace(/[A-Z]/g,V=>"-"+V.toLowerCase()),O=Object.entries(n.placeholder.styles).map(([M,V])=>`${w(M)}:${V};`).join("");this.placeholderStyle.textContent=`#${this.expiryId}::placeholder{${O}}#${this.cvcId}::placeholder{${O}}`,this.element.appendChild(this.placeholderStyle)}this.cvcEndContent.classList.add(se.endContent),this.cvcEndContent.appendChild(this.cardCvc.render()),this.cvcInputContainer.append(this.cvcInput,this.cvcEndContent),this.cvcLabel.setAttribute("for",this.cvcId),this.cvcLabel.classList.add(se.label),(C=n==null?void 0:n.label)!=null&&C.className&&Pe(this.cvcLabel,n.label.className),(A=n==null?void 0:n.label)!=null&&A.styles&&Object.assign(this.cvcLabel.style,n.label.styles),this.cvcLabelText.textContent=r.card.cvc.label,this.cvcLabelError.textContent=r.card.required,this.cvcLabelError.classList.add(se.labelError,se.hidden),(I=n==null?void 0:n.error)!=null&&I.className&&Pe(this.cvcLabel,n.error.className),(k=n==null?void 0:n.error)!=null&&k.styles&&Object.assign(this.cvcLabelError.style,n.error.styles),this.cvcLabel.append(this.cvcLabelText,this.cvcLabelError),this.cvcError.classList.add(se.error,se.hidden);const s=document.createElement("div");s.appendChild(this.cvcError),this.element.append(this.expiryLabel,this.cvcLabel,this.expiryInputContainer,this.cvcInputContainer,i,s),this.expiryInput.addEventListener("input",w=>{w.preventDefault();const M=this.expiryInput.value.replace(/\D/g,"");this.handleExpiryChange(M)}),this.expiryInput.addEventListener("paste",w=>{var V;w.preventDefault();const M=(((V=w.clipboardData)==null?void 0:V.getData("text"))||"").replace(/\D/g,"");this.handleExpiryChange(M)}),this.expiryInput.addEventListener("keydown",w=>{this.isDisabled||["Backspace","Delete","Tab","ArrowLeft","ArrowRight","Home","End"].includes(w.key)||w.ctrlKey||w.metaKey||/^\d$/.test(w.key)||w.preventDefault()}),this.expiryInput.addEventListener("blur",()=>this.validateExpiry(this.expiryInput.value)),this.cvcInput.addEventListener("input",w=>{w.preventDefault();const M=this.cvcInput.value.replace(/\D/g,"");this.handleCvcChange(M)}),this.cvcInput.addEventListener("paste",w=>{var V;w.preventDefault();const M=(((V=w.clipboardData)==null?void 0:V.getData("text"))||"").replace(/\D/g,"");this.handleCvcChange(M)}),this.cvcInput.addEventListener("keydown",w=>{this.isDisabled||["Backspace","Delete","Tab","ArrowLeft","ArrowRight","Home","End"].includes(w.key)||w.ctrlKey||w.metaKey||/^\d$/.test(w.key)||w.preventDefault()}),this.cvcInput.addEventListener("blur",()=>this.validateCvc(this.cvcInput.value)),this.translate.subscribe(({messages:w})=>{this.cvcInput.setAttribute("placeholder",w.card.cvc.placeholder),this.expiryInput.setAttribute("placeholder",w.card.expiry.placeholder),this.expiryLabelText.textContent=w.card.expiry.label,this.cvcLabelText.textContent=w.card.cvc.label,this.expiryLabelError.textContent=w.card.required,this.cvcLabelError.textContent=w.card.required,this.render()})}cvcValidator(e){const n=Cr.getTypeInfo(this.cardType||""),r=!e,i=e.length<((n==null?void 0:n.code.size)||3);return!r&&!i?null:r?Qe.Empty:Qe.Incomplete}validateCvc(e){const n=this.translate.messages(),r=this.cvcValidator(e);return r?(r===Qe.Empty?(this.cvcErrorMessage="",this.isCvcRequired=!0):(this.cvcErrorMessage=n.card.cvc.error.incomplete,this.isCvcRequired=!1),this.render(),!r):(this.isCvcRequired=!1,this.cvcErrorMessage="",this.render(),!r)}handleCvcChange(e){if(this.isDisabled)return;this.isCvcRequired=!1,this.cvcErrorMessage="",this.isCvcChanged||(this.isCvcChanged=!0);const n=n1(e,this.cardType||""),r=Cr.getTypeInfo(this.cardType||"");n.length===(r==null?void 0:r.code.size)&&this.validateCvc(n),this.events.cvcChange.emit({value:n,isValid:this.cvcValidator(n)===null}),this.cvcInput.value=n,this.render()}toggleCvcLabelError(e){return j(this,null,function*(){if(e){this.cvcInputContainer.classList.add(se.errorInput),this.cvcLabelError.classList.remove(se.hidden),yield Xe(this.cvcLabelError,st.open,st.transition);return}yield Xe(this.cvcLabelError,st.close,st.transition),this.cvcLabelError.classList.add(se.hidden)})}toggleCvcErrorMessage(e){return j(this,null,function*(){if(e){this.cvcInputContainer.classList.add(se.errorInput),this.cvcError.textContent=this.cvcErrorMessage,this.cvcError.classList.remove(se.hidden),yield Xe(this.cvcError,Tt.open,Tt.transition);return}yield Xe(this.cvcError,Tt.close,Tt.transition),this.cvcError.classList.add(se.hidden)})}expiryValidator(e){const n=!e,r=e.length<7,i=new Date,[s,o]=e.split(" / ");i.setFullYear(2e3+parseInt(o),parseInt(s)-1,31);const a=i.getTime()<Date.now(),c=new Date,u=new Date;u.setFullYear(c.getFullYear()+50);const d=i.getTime()>u.getTime()||i.getFullYear()<c.getFullYear();return!n&&!r&&!a&&!d?null:n?Qe.Empty:r?Qe.Incomplete:d?"tooFarInFuture":i.getFullYear()===new Date().getFullYear()?"dateExpired":"expired"}validateExpiry(e){const n=this.translate.messages(),r=this.expiryValidator(e);if(r){if(r===Qe.Empty)this.expiryErrorMessage="",this.isExpiryRequired=!0;else{let i=n.card.expiry.error.invalid;r==="expired"?i=n.card.expiry.error.expired.replace("{date}","year"):r==="dateExpired"?i=n.card.expiry.error.expired.replace("{date}",e.replace(/ /g,"")):r==="tooFarInFuture"?i=n.card.expiry.error.tooFarInFuture:r===Qe.Incomplete&&(i=n.card.expiry.error.incomplete),this.isExpiryRequired=!1,this.expiryErrorMessage=i}return this.render(),!r}return this.isExpiryRequired=!1,this.expiryErrorMessage="",this.render(),!r}handleExpiryChange(e){if(this.isDisabled)return;this.isExpiryRequired=!1,this.expiryErrorMessage="",this.isExpiryChanged||(this.isExpiryChanged=!0);const n=r1(e);n.length===7&&this.validateExpiry(n),this.events.expiryChange.emit({value:n,isValid:this.expiryValidator(n)===null}),this.expiryInput.value=n,this.render()}toggleExpiryLabelError(e){return j(this,null,function*(){if(e){this.expiryInputContainer.classList.add(se.errorInput),this.expiryLabelError.classList.remove(se.hidden),yield Xe(this.expiryLabelError,st.open,st.transition);return}yield Xe(this.expiryLabelError,st.close,st.transition),this.expiryLabelError.classList.add(se.hidden)})}toggleExpiryErrorMessage(e){return j(this,null,function*(){if(e){this.expiryInputContainer.classList.add(se.errorInput),this.expiryError.textContent=this.expiryErrorMessage,this.expiryError.classList.remove(se.hidden),yield Xe(this.expiryError,Tt.open,Tt.transition);return}yield Xe(this.expiryError,Tt.close,Tt.transition),this.expiryError.classList.add(se.hidden)})}addEventListener(e,n){return this.events[e].addListener(n)}disable(e){e?(this.expiryInput.setAttribute("disabled","true"),this.expiryInput.classList.add(se.disabledInput),this.expiryInputContainer.classList.add(se.disabled),this.cvcInput.setAttribute("disabled","true"),this.cvcInput.classList.add(se.disabledInput),this.cvcInputContainer.classList.add(se.disabled)):(this.expiryInput.removeAttribute("disabled"),this.expiryInput.classList.remove(se.disabledInput),this.expiryInputContainer.classList.remove(se.disabled),this.cvcInput.removeAttribute("disabled"),this.cvcInput.classList.remove(se.disabledInput),this.cvcInputContainer.classList.remove(se.disabled))}touchSubmit(){this.isTouchSubmit=!0,this.render()}value(){return{expiry:this.expiryInput.value,cvc:this.cvcInput.value}}validate({expiry:e,cvc:n}){const r=this.validateExpiry(e),i=this.validateCvc(n);return r&&i}updateCardType(e){this.cardType=e,this.handleCvcChange(this.cvcInput.value)}render(){const e=this.isTouchSubmit||this.isExpiryChanged,n=e&&!this.isDisabled&&this.isExpiryRequired,r=e&&!this.isDisabled&&!!this.expiryErrorMessage;this.toggleExpiryLabelError(n),this.toggleExpiryErrorMessage(r),!n&&!r?(this.expiryInputContainer.classList.remove(se.errorInput),this.expiryEndContent.classList.add(se.hidden)):this.expiryEndContent.classList.remove(se.hidden);const i=this.isTouchSubmit||this.isCvcChanged,s=i&&!this.isDisabled&&this.isCvcRequired,o=i&&!this.isDisabled&&!!this.cvcErrorMessage;return this.toggleCvcLabelError(s),this.toggleCvcErrorMessage(o),!s&&!o?(this.cvcInputContainer.classList.remove(se.errorInput),this.cvcEndContent.innerHTML="",this.cvcEndContent.appendChild(this.cardCvc.render())):(this.cvcEndContent.innerHTML="",this.cvcEndContent.appendChild(this.cvcWarning.render())),this.isDisabled?(this.expiryInputContainer.classList.add(se.disabled),this.expiryInput.classList.add(se.disabledInput),this.cvcInputContainer.classList.add(se.disabled),this.cvcInput.classList.add(se.disabledInput)):(this.expiryInputContainer.classList.remove(se.disabled),this.expiryInput.classList.remove(se.disabledInput),this.cvcInputContainer.classList.remove(se.disabled),this.cvcInput.classList.remove(se.disabledInput)),this.element}}class j1{constructor({translate:e,className:n,stylesState:r,isDefaultVariant:i,onPaymentAttempt:s}){N(this,"element");N(this,"submit");N(this,"back");N(this,"number");N(this,"name");N(this,"cardSecurity");N(this,"onPaymentAttempt");N(this,"isBackVisible",!0);N(this,"events",{submit:new qe,close:new qe});const o=r.getState();this.element=document.createElement("form"),this.onPaymentAttempt=s,this.submit=new L1(e,o.SubmitButton),this.back=new M1(o.BackButton),this.number=new V1(e,o.Input),this.name=new D1(e,o.Input),this.cardSecurity=new z1(e,o.Input),this.element.classList.add(Wn.cardForm),n&&Pe(this.element,n);const a=this.back.render();i&&(this.isBackVisible=!1,a.classList.add(Wn.hidden),this.element.classList.add(Wn.topOffset)),this.element.append(a,this.number.render(),this.cardSecurity.render(),this.name.render(),this.submit.render()),requestAnimationFrame(()=>{const c=this.submit.render(),d=window.getComputedStyle(c).backgroundColor||"#5A67D8";this.element.style.setProperty("--input-focus-shadow-color",d)}),this.back.addEventListener(()=>this.events.close.emit()),this.number.addEventListener("change",({cardType:c})=>this.cardSecurity.updateCardType(c||null)),this.submit.addEventListener(c=>{var p;c.preventDefault();const{cvc:u,expiry:d}=this.cardSecurity.value(),{value:l,cardType:f}=this.number.value();this.touchSubmit(),this.validate()&&((p=this.onPaymentAttempt)==null||p.call(this,{paymentMethod:J.CARD}),this.events.submit.emit({number:l,expiry:d,cvc:u,name:this.name.value(),cardBrand:f}))})}addEventListener(e,n){return this.events[e].addListener(n)}setLoading(e){this.cardSecurity.disable(e),this.name.disable(e),this.number.disable(e),this.submit.disable(e)}touchSubmit(){this.cardSecurity.touchSubmit(),this.name.touchSubmit(),this.number.touchSubmit()}validate(){const e=this.number.validate(this.number.value().value),n=this.name.validate(this.name.value()),r=this.cardSecurity.validate(this.cardSecurity.value());return e&&n&&r}setDefaultVariant(e){const n=this.back.render();if(e&&this.isBackVisible){n.classList.add(Wn.hidden),this.element.classList.add(Wn.topOffset),this.isBackVisible=!1;return}!e&&!this.isBackVisible&&(n.classList.remove(Wn.hidden),this.element.classList.remove(Wn.topOffset),this.isBackVisible=!0)}render(){return this.element}}let H1=class{constructor(){N(this,"template",`
|
|
178
|
+
`);N(this,"element",document.createElement("div"));this.element.classList.add(xe.container),this.element.innerHTML=this.template}render(){return this.element}}class z1{constructor(e,n){N(this,"cvcId","paynext-card-input-cvc");N(this,"expiryId","paynext-card-input-expiry");N(this,"element");N(this,"expiryWarning",new Ts);N(this,"cvcWarning",new Ts);N(this,"cardCvc",new $1);N(this,"expiryInputContainer",document.createElement("div"));N(this,"expiryInput",document.createElement("input"));N(this,"expiryLabel",document.createElement("label"));N(this,"expiryLabelText",document.createElement("span"));N(this,"expiryLabelError",document.createElement("span"));N(this,"expiryEndContent",document.createElement("div"));N(this,"expiryError",document.createElement("p"));N(this,"cvcInputContainer",document.createElement("div"));N(this,"cvcInput",document.createElement("input"));N(this,"cvcLabel",document.createElement("label"));N(this,"cvcLabelText",document.createElement("span"));N(this,"cvcLabelError",document.createElement("span"));N(this,"cvcEndContent",document.createElement("div"));N(this,"cvcError",document.createElement("p"));N(this,"placeholderStyle",document.createElement("style"));N(this,"cardType",null);N(this,"isTouchSubmit",!1);N(this,"isDisabled",!1);N(this,"expiryErrorMessage","");N(this,"isExpiryRequired",!1);N(this,"isExpiryChanged",!1);N(this,"cvcErrorMessage","");N(this,"isCvcRequired",!1);N(this,"isCvcChanged",!1);N(this,"events",{expiryChange:new qe,cvcChange:new qe});var o,a,c,u,d,l,f,p,h,m,g,_,b,C,A,I,k;this.translate=e;const r=e.messages();this.element=document.createElement("div"),this.element.classList.add(se.securityContent),this.expiryInputContainer.classList.add(se.inputContainer),(o=n==null?void 0:n.container)!=null&&o.className&&Pe(this.expiryInputContainer,n.container.className),(a=n==null?void 0:n.container)!=null&&a.styles&&Object.assign(this.expiryInputContainer.style,n.container.styles),this.expiryInput.setAttribute("id",this.expiryId),this.expiryInput.setAttribute("autocomplete","cc-exp"),this.expiryInput.setAttribute("placeholder",r.card.expiry.placeholder),this.expiryInput.setAttribute("inputmode","numeric"),this.expiryInput.setAttribute("pattern","[0-9]*"),this.expiryInput.setAttribute("enterkeyhint","next"),this.expiryInput.classList.add(se.input),(c=n==null?void 0:n.field)!=null&&c.className&&Pe(this.expiryInput,n.field.className),(u=n==null?void 0:n.field)!=null&&u.styles&&Object.assign(this.expiryInput.style,n.field.styles),this.expiryEndContent.classList.add(se.endContent),this.expiryEndContent.appendChild(this.expiryWarning.render()),this.expiryInputContainer.append(this.expiryInput,this.expiryEndContent),this.expiryLabel.setAttribute("for",this.expiryId),this.expiryLabel.classList.add(se.label),(d=n==null?void 0:n.label)!=null&&d.className&&Pe(this.expiryLabel,n.label.className),(l=n==null?void 0:n.label)!=null&&l.styles&&Object.assign(this.expiryLabel.style,n.label.styles),this.expiryLabelText.contentEditable="false",this.expiryLabelText.textContent=r.card.expiry.label,this.expiryLabelError.textContent=r.card.required,this.expiryLabelError.classList.add(se.labelError,se.hidden),this.expiryLabel.append(this.expiryLabelText,this.expiryLabelError),this.expiryError.classList.add(se.error,se.hidden),(f=n==null?void 0:n.error)!=null&&f.className&&Pe(this.expiryError,n.error.className),(p=n==null?void 0:n.error)!=null&&p.styles&&Object.assign(this.expiryError.style,n.error.styles);const i=document.createElement("div");if(i.appendChild(this.expiryError),this.cvcInputContainer.classList.add(se.inputContainer),(h=n==null?void 0:n.container)!=null&&h.className&&Pe(this.cvcInputContainer,n.container.className),(m=n==null?void 0:n.container)!=null&&m.styles&&Object.assign(this.cvcInputContainer.style,n.container.styles),this.cvcInput.setAttribute("id",this.cvcId),this.cvcInput.setAttribute("autocomplete","cc-csc"),this.cvcInput.setAttribute("placeholder",r.card.cvc.placeholder),this.cvcInput.setAttribute("inputmode","numeric"),this.cvcInput.setAttribute("pattern","[0-9]*"),this.cvcInput.setAttribute("enterkeyhint","done"),this.cvcInput.classList.add(se.input),(g=n==null?void 0:n.field)!=null&&g.className&&Pe(this.cvcInput,n.field.className),(_=n==null?void 0:n.field)!=null&&_.styles&&Object.assign(this.cvcInput.style,n.field.styles),(b=n==null?void 0:n.placeholder)!=null&&b.styles&&Object.keys(n.placeholder.styles).length){const w=M=>M.replace(/[A-Z]/g,V=>"-"+(V==null?void 0:V.toLowerCase())),O=Object.entries(n.placeholder.styles).map(([M,V])=>`${w(M)}:${V};`).join("");this.placeholderStyle.textContent=`#${this.expiryId}::placeholder{${O}}#${this.cvcId}::placeholder{${O}}`,this.element.appendChild(this.placeholderStyle)}this.cvcEndContent.classList.add(se.endContent),this.cvcEndContent.appendChild(this.cardCvc.render()),this.cvcInputContainer.append(this.cvcInput,this.cvcEndContent),this.cvcLabel.setAttribute("for",this.cvcId),this.cvcLabel.classList.add(se.label),(C=n==null?void 0:n.label)!=null&&C.className&&Pe(this.cvcLabel,n.label.className),(A=n==null?void 0:n.label)!=null&&A.styles&&Object.assign(this.cvcLabel.style,n.label.styles),this.cvcLabelText.textContent=r.card.cvc.label,this.cvcLabelError.textContent=r.card.required,this.cvcLabelError.classList.add(se.labelError,se.hidden),(I=n==null?void 0:n.error)!=null&&I.className&&Pe(this.cvcLabel,n.error.className),(k=n==null?void 0:n.error)!=null&&k.styles&&Object.assign(this.cvcLabelError.style,n.error.styles),this.cvcLabel.append(this.cvcLabelText,this.cvcLabelError),this.cvcError.classList.add(se.error,se.hidden);const s=document.createElement("div");s.appendChild(this.cvcError),this.element.append(this.expiryLabel,this.cvcLabel,this.expiryInputContainer,this.cvcInputContainer,i,s),this.expiryInput.addEventListener("input",w=>{w.preventDefault();const M=this.expiryInput.value.replace(/\D/g,"");this.handleExpiryChange(M)}),this.expiryInput.addEventListener("paste",w=>{var V;w.preventDefault();const M=(((V=w.clipboardData)==null?void 0:V.getData("text"))||"").replace(/\D/g,"");this.handleExpiryChange(M)}),this.expiryInput.addEventListener("keydown",w=>{this.isDisabled||["Backspace","Delete","Tab","ArrowLeft","ArrowRight","Home","End"].includes(w.key)||w.ctrlKey||w.metaKey||/^\d$/.test(w.key)||w.preventDefault()}),this.expiryInput.addEventListener("blur",()=>this.validateExpiry(this.expiryInput.value)),this.cvcInput.addEventListener("input",w=>{w.preventDefault();const M=this.cvcInput.value.replace(/\D/g,"");this.handleCvcChange(M)}),this.cvcInput.addEventListener("paste",w=>{var V;w.preventDefault();const M=(((V=w.clipboardData)==null?void 0:V.getData("text"))||"").replace(/\D/g,"");this.handleCvcChange(M)}),this.cvcInput.addEventListener("keydown",w=>{this.isDisabled||["Backspace","Delete","Tab","ArrowLeft","ArrowRight","Home","End"].includes(w.key)||w.ctrlKey||w.metaKey||/^\d$/.test(w.key)||w.preventDefault()}),this.cvcInput.addEventListener("blur",()=>this.validateCvc(this.cvcInput.value)),this.translate.subscribe(({messages:w})=>{this.cvcInput.setAttribute("placeholder",w.card.cvc.placeholder),this.expiryInput.setAttribute("placeholder",w.card.expiry.placeholder),this.expiryLabelText.textContent=w.card.expiry.label,this.cvcLabelText.textContent=w.card.cvc.label,this.expiryLabelError.textContent=w.card.required,this.cvcLabelError.textContent=w.card.required,this.render()})}cvcValidator(e){const n=Cr.getTypeInfo(this.cardType||""),r=!e,i=e.length<((n==null?void 0:n.code.size)||3);return!r&&!i?null:r?Qe.Empty:Qe.Incomplete}validateCvc(e){const n=this.translate.messages(),r=this.cvcValidator(e);return r?(r===Qe.Empty?(this.cvcErrorMessage="",this.isCvcRequired=!0):(this.cvcErrorMessage=n.card.cvc.error.incomplete,this.isCvcRequired=!1),this.render(),!r):(this.isCvcRequired=!1,this.cvcErrorMessage="",this.render(),!r)}handleCvcChange(e){if(this.isDisabled)return;this.isCvcRequired=!1,this.cvcErrorMessage="",this.isCvcChanged||(this.isCvcChanged=!0);const n=n1(e,this.cardType||""),r=Cr.getTypeInfo(this.cardType||"");n.length===(r==null?void 0:r.code.size)&&this.validateCvc(n),this.events.cvcChange.emit({value:n,isValid:this.cvcValidator(n)===null}),this.cvcInput.value=n,this.render()}toggleCvcLabelError(e){return j(this,null,function*(){if(e){this.cvcInputContainer.classList.add(se.errorInput),this.cvcLabelError.classList.remove(se.hidden),yield Xe(this.cvcLabelError,st.open,st.transition);return}yield Xe(this.cvcLabelError,st.close,st.transition),this.cvcLabelError.classList.add(se.hidden)})}toggleCvcErrorMessage(e){return j(this,null,function*(){if(e){this.cvcInputContainer.classList.add(se.errorInput),this.cvcError.textContent=this.cvcErrorMessage,this.cvcError.classList.remove(se.hidden),yield Xe(this.cvcError,Tt.open,Tt.transition);return}yield Xe(this.cvcError,Tt.close,Tt.transition),this.cvcError.classList.add(se.hidden)})}expiryValidator(e){const n=!e,r=e.length<7,i=new Date,[s,o]=e.split(" / ");i.setFullYear(2e3+parseInt(o),parseInt(s)-1,31);const a=i.getTime()<Date.now(),c=new Date,u=new Date;u.setFullYear(c.getFullYear()+50);const d=i.getTime()>u.getTime()||i.getFullYear()<c.getFullYear();return!n&&!r&&!a&&!d?null:n?Qe.Empty:r?Qe.Incomplete:d?"tooFarInFuture":i.getFullYear()===new Date().getFullYear()?"dateExpired":"expired"}validateExpiry(e){const n=this.translate.messages(),r=this.expiryValidator(e);if(r){if(r===Qe.Empty)this.expiryErrorMessage="",this.isExpiryRequired=!0;else{let i=n.card.expiry.error.invalid;r==="expired"?i=n.card.expiry.error.expired.replace("{date}","year"):r==="dateExpired"?i=n.card.expiry.error.expired.replace("{date}",e.replace(/ /g,"")):r==="tooFarInFuture"?i=n.card.expiry.error.tooFarInFuture:r===Qe.Incomplete&&(i=n.card.expiry.error.incomplete),this.isExpiryRequired=!1,this.expiryErrorMessage=i}return this.render(),!r}return this.isExpiryRequired=!1,this.expiryErrorMessage="",this.render(),!r}handleExpiryChange(e){if(this.isDisabled)return;this.isExpiryRequired=!1,this.expiryErrorMessage="",this.isExpiryChanged||(this.isExpiryChanged=!0);const n=r1(e);n.length===7&&this.validateExpiry(n),this.events.expiryChange.emit({value:n,isValid:this.expiryValidator(n)===null}),this.expiryInput.value=n,this.render()}toggleExpiryLabelError(e){return j(this,null,function*(){if(e){this.expiryInputContainer.classList.add(se.errorInput),this.expiryLabelError.classList.remove(se.hidden),yield Xe(this.expiryLabelError,st.open,st.transition);return}yield Xe(this.expiryLabelError,st.close,st.transition),this.expiryLabelError.classList.add(se.hidden)})}toggleExpiryErrorMessage(e){return j(this,null,function*(){if(e){this.expiryInputContainer.classList.add(se.errorInput),this.expiryError.textContent=this.expiryErrorMessage,this.expiryError.classList.remove(se.hidden),yield Xe(this.expiryError,Tt.open,Tt.transition);return}yield Xe(this.expiryError,Tt.close,Tt.transition),this.expiryError.classList.add(se.hidden)})}addEventListener(e,n){return this.events[e].addListener(n)}disable(e){e?(this.expiryInput.setAttribute("disabled","true"),this.expiryInput.classList.add(se.disabledInput),this.expiryInputContainer.classList.add(se.disabled),this.cvcInput.setAttribute("disabled","true"),this.cvcInput.classList.add(se.disabledInput),this.cvcInputContainer.classList.add(se.disabled)):(this.expiryInput.removeAttribute("disabled"),this.expiryInput.classList.remove(se.disabledInput),this.expiryInputContainer.classList.remove(se.disabled),this.cvcInput.removeAttribute("disabled"),this.cvcInput.classList.remove(se.disabledInput),this.cvcInputContainer.classList.remove(se.disabled))}touchSubmit(){this.isTouchSubmit=!0,this.render()}value(){return{expiry:this.expiryInput.value,cvc:this.cvcInput.value}}validate({expiry:e,cvc:n}){const r=this.validateExpiry(e),i=this.validateCvc(n);return r&&i}updateCardType(e){this.cardType=e,this.handleCvcChange(this.cvcInput.value)}render(){const e=this.isTouchSubmit||this.isExpiryChanged,n=e&&!this.isDisabled&&this.isExpiryRequired,r=e&&!this.isDisabled&&!!this.expiryErrorMessage;this.toggleExpiryLabelError(n),this.toggleExpiryErrorMessage(r),!n&&!r?(this.expiryInputContainer.classList.remove(se.errorInput),this.expiryEndContent.classList.add(se.hidden)):this.expiryEndContent.classList.remove(se.hidden);const i=this.isTouchSubmit||this.isCvcChanged,s=i&&!this.isDisabled&&this.isCvcRequired,o=i&&!this.isDisabled&&!!this.cvcErrorMessage;return this.toggleCvcLabelError(s),this.toggleCvcErrorMessage(o),!s&&!o?(this.cvcInputContainer.classList.remove(se.errorInput),this.cvcEndContent.innerHTML="",this.cvcEndContent.appendChild(this.cardCvc.render())):(this.cvcEndContent.innerHTML="",this.cvcEndContent.appendChild(this.cvcWarning.render())),this.isDisabled?(this.expiryInputContainer.classList.add(se.disabled),this.expiryInput.classList.add(se.disabledInput),this.cvcInputContainer.classList.add(se.disabled),this.cvcInput.classList.add(se.disabledInput)):(this.expiryInputContainer.classList.remove(se.disabled),this.expiryInput.classList.remove(se.disabledInput),this.cvcInputContainer.classList.remove(se.disabled),this.cvcInput.classList.remove(se.disabledInput)),this.element}}class j1{constructor({translate:e,className:n,stylesState:r,isDefaultVariant:i,onPaymentAttempt:s}){N(this,"element");N(this,"submit");N(this,"back");N(this,"number");N(this,"name");N(this,"cardSecurity");N(this,"onPaymentAttempt");N(this,"isBackVisible",!0);N(this,"events",{submit:new qe,close:new qe});const o=r.getState();this.element=document.createElement("form"),this.onPaymentAttempt=s,this.submit=new L1(e,o.SubmitButton),this.back=new M1(o.BackButton),this.number=new V1(e,o.Input),this.name=new D1(e,o.Input),this.cardSecurity=new z1(e,o.Input),this.element.classList.add(Wn.cardForm),n&&Pe(this.element,n);const a=this.back.render();i&&(this.isBackVisible=!1,a.classList.add(Wn.hidden),this.element.classList.add(Wn.topOffset)),this.element.append(a,this.number.render(),this.cardSecurity.render(),this.name.render(),this.submit.render()),requestAnimationFrame(()=>{const c=this.submit.render(),d=window.getComputedStyle(c).backgroundColor||"#5A67D8";this.element.style.setProperty("--input-focus-shadow-color",d)}),this.back.addEventListener(()=>this.events.close.emit()),this.number.addEventListener("change",({cardType:c})=>this.cardSecurity.updateCardType(c||null)),this.submit.addEventListener(c=>{var p;c.preventDefault();const{cvc:u,expiry:d}=this.cardSecurity.value(),{value:l,cardType:f}=this.number.value();this.touchSubmit(),this.validate()&&((p=this.onPaymentAttempt)==null||p.call(this,{paymentMethod:J.CARD}),this.events.submit.emit({number:l,expiry:d,cvc:u,name:this.name.value(),cardBrand:f}))})}addEventListener(e,n){return this.events[e].addListener(n)}setLoading(e){this.cardSecurity.disable(e),this.name.disable(e),this.number.disable(e),this.submit.disable(e)}touchSubmit(){this.cardSecurity.touchSubmit(),this.name.touchSubmit(),this.number.touchSubmit()}validate(){const e=this.number.validate(this.number.value().value),n=this.name.validate(this.name.value()),r=this.cardSecurity.validate(this.cardSecurity.value());return e&&n&&r}setDefaultVariant(e){const n=this.back.render();if(e&&this.isBackVisible){n.classList.add(Wn.hidden),this.element.classList.add(Wn.topOffset),this.isBackVisible=!1;return}!e&&!this.isBackVisible&&(n.classList.remove(Wn.hidden),this.element.classList.remove(Wn.topOffset),this.isBackVisible=!0)}render(){return this.element}}let H1=class{constructor(){N(this,"template",`
|
|
179
179
|
<svg
|
|
180
180
|
fill='none'
|
|
181
181
|
height='24'
|