@miden-npm/vue 0.0.4 → 0.0.6

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.cjs.js CHANGED
@@ -1,2 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=Symbol("MidenPGConfig");function oe(o){if(!(o!=null&&o.publishableKey))throw new Error("[@miden-npm/vue] publishableKey is required");return{install(l){l.provide(q,o)}}}function le(){const o=e.inject(q);if(!o)throw new Error("[@miden-npm/vue] Missing provider. Did you forget to app.use(createMidenPG(...))?");return o}const K=o=>o==null||typeof o!="object"?!1:Object.values(o).every(Boolean),ne=o=>o==="sandbox"?"https://sandbox-api.midencards.io/payment-gateway-api":"",ae=o=>o==="USD"?"$":o==="NGN"?"₦":o==="EUR"?"€":o==="GBP"?"£":o==="JPY"||o==="CNY"?"¥":o==="USDC"||o==="usdc"?"$⧫":o==="USDT"||o==="usdt"?"₮":"$",M=(o,l)=>{const t=typeof o=="string"?parseFloat(o):o;return isNaN(t)?"0":`${l?ae(l):""} ${t==null?void 0:t.toLocaleString("en-US")}`},re=(o,l)=>o.length<=l?o:o.slice(0,l)+"...",se=o=>{const l=["Backspace","Tab","ArrowLeft","ArrowRight","Delete","Home","End","."];(o.ctrlKey||o.metaKey)&&["a","c","v","x"].includes(o.key.toLowerCase())||(!l.includes(o.key)&&!/^\d$/.test(o.key)&&o.preventDefault(),o.key==="."&&o.target.value.includes(".")&&o.preventDefault())},ce=["width","height"],ie=["stroke"],ue=["fill"],R=e.defineComponent({__name:"icon-loader",props:{size:{default:24},color:{default:"currentColor"},className:{default:""}},setup(o){const l=o,t=e.useAttrs(),{size:a,color:n,className:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({class:["animate-spin",e.unref(r)],xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:e.unref(a),height:e.unref(a),role:"img","aria-label":"loading"},e.unref(t)),[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:e.unref(n),"stroke-width":"4"},null,8,ie),e.createElementVNode("path",{class:"opacity-75",fill:e.unref(n),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,8,ue)],16,ce))}}),de=["disabled"],pe={key:1},V=e.defineComponent({__name:"button",props:{label:{default:""},type:{default:"neutral"},size:{default:"de"},paddingClassX:{default:"px-8"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},customClass:{default:""}},emits:["click"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.disabled||t.loading);function r(){n.value||a("click")}function c(s,m){if(m)return"bg-gray-200 text-gray-400 cursor-not-allowed border-gray-200";switch(s){case"primary":return"bg-primary text-white hover:bg-primary-black hover:border-primary-black border-primary";case"secondary":return"bg-gray-200 border-gray-200 hover:bg-gray-300 text-heading-text";case"danger":return"bg-red-500 border-red-500 text-white hover:bg-red-600";case"neutral":default:return"bg-off-white border-grey-border hover:bg-gray-100"}}function i(s){switch(s){case"de":return"h-68px rounded-xl";case"md":return"h-42px rounded-lg";case"sm":return"h-32px rounded-md";default:return"h-68px rounded-xl"}}function d(s){switch(s){case"de":case"md":case"sm":return"text-body-2xs font-normal";default:return"text-body-xs font-normal"}}return(s,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["flex items-center justify-center gap-2 py-3 border font-normal text-input-grey transition-colors duration-300 ease-in-out",c(s.type,n.value),i(s.size),s.paddingClassX,s.customClass]),type:"button",disabled:n.value,onClick:r},[e.renderSlot(s.$slots,"prefix"),s.loading?(e.openBlock(),e.createBlock(R,{key:0})):(e.openBlock(),e.createElementBlock("div",pe,[s.label?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["mb-0",d(s.size)])},e.toDisplayString(s.label),3)):e.renderSlot(s.$slots,"default",{key:1})])),e.renderSlot(s.$slots,"suffix")],10,de))}}),me={class:"mb-0 text-body-3xs font-normal text-red-500"},Z=e.defineComponent({__name:"input-error",props:{errorMessage:{}},setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(l.errorMessage),1))}});async function O(o,l,t){try{const a=ne(l);return await(await fetch(`${a}/api/v1/checkout/generate-payment-link2`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t},body:JSON.stringify({...o,LinkName:`${Date.now()}-Link`})})).json()}catch{}}const fe={key:0,class:"absolute inset-0 grid place-items-center bg-white/60"},Y=e.defineComponent({__name:"checkout-iframe",props:{style:{default:()=>({width:"100%",height:"100vh",border:"0",borderRadius:"6px",overflow:"hidden"})},url:{default:void 0},secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})}},setup(o){const l=o,t=e.computed(()=>({...l.style})),a=e.ref(null),n=e.ref(null),r=e.ref(""),c=e.ref(!1);function i(){n.value&&n.value.parentNode&&n.value.parentNode.removeChild(n.value),n.value=null}function d(m){var k;i();const f=document.createElement("iframe");f.src=m;const p=l.style;p.width&&(f.style.width=p.width),p.height&&(f.style.height=p.height),p.border&&(f.style.border=p.border),p.borderRadius&&(f.style.borderRadius=p.borderRadius),p.overflow&&(f.style.overflow=p.overflow),(k=a.value)==null||k.appendChild(f),n.value=f}async function s(){if(l.url){d(l.url);return}if(!l.secretKey){r.value="Secret key is required.";return}if(!K(l.paymentObject)){r.value="Kindly ensure you are passing all the required data.";return}c.value=!0,r.value="";try{const m=await O(l.paymentObject,l.environment,l.secretKey);m!=null&&m.isSuccessful&&m.launchUrl?(r.value="Payment link created successfully",d(m.launchUrl)):r.value="Failed to create payment link"}catch(m){r.value=(m==null?void 0:m.message)||"Failed to create payment link"}finally{c.value=!1}}return e.onMounted(()=>{a.value&&s()}),e.watch(()=>l.url,m=>{m&&d(m)}),e.onBeforeUnmount(()=>{i()}),(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative",style:e.normalizeStyle(t.value)},[e.createElementVNode("div",{ref_key:"containerRef",ref:a,class:"w-full h-full"},null,512),c.value?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(R)])):e.createCommentVNode("",!0)],4))}}),he={key:1},ve=e.defineComponent({__name:"checkout-button",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})},mode:{default:"redirect"}},setup(o){const l=o,t=e.ref(""),a=e.ref(""),n=e.ref(!1);async function r(){if(!l.secretKey){t.value="Secret key is required.";return}if(!K(l.paymentObject)){t.value="Kindly ensure you are passing all the required data.";return}n.value=!0,t.value="";try{const s=await O(l.paymentObject,l.environment,l.secretKey);s!=null&&s.isSuccessful&&s.launchUrl?(a.value=s.launchUrl,t.value="Payment link created successfully",l.mode==="redirect"&&window.open(s.launchUrl,"_blank","noopener,noreferrer")):t.value="Failed to create payment link"}catch(s){t.value=(s==null?void 0:s.message)||"Failed to create payment link"}finally{n.value=!1}}const{secretKey:c,environment:i,mode:d}=l;return(s,m)=>a.value&&e.unref(d)==="iframe"?(e.openBlock(),e.createBlock(Y,{key:0,url:a.value,secretKey:e.unref(c),environment:e.unref(i)},null,8,["url","secretKey","environment"])):(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(V,{label:"Pay",type:"primary",customClass:"w-full",loading:n.value,onClick:r},null,8,["loading"]),e.createVNode(Z,{errorMessage:t.value},null,8,["errorMessage"])]))}}),ye=["width","height"],Ce=["fill"],ge=e.defineComponent({__name:"icon-chevron-left",props:{width:{default:17},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M10.5 14.28C10.3734 14.28 10.2467 14.2333 10.1467 14.1333L5.80002 9.78668C5.09335 9.08001 5.09335 7.92001 5.80002 7.21335L10.1467 2.86668C10.34 2.67335 10.66 2.67335 10.8534 2.86668C11.0467 3.06001 11.0467 3.38001 10.8534 3.57335L6.50669 7.92001C6.18669 8.24001 6.18669 8.76001 6.50669 9.08001L10.8534 13.4267C11.0467 13.62 11.0467 13.94 10.8534 14.1333C10.7534 14.2267 10.6267 14.28 10.5 14.28Z",fill:e.unref(r)},null,8,Ce)],16,ye))}}),be=e.defineComponent({__name:"back",emits:["back"],setup(o,{emit:l}){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 cursor-pointer",onClick:a[0]||(a[0]=n=>t.$emit("back"))},[e.createVNode(ge),a[1]||(a[1]=e.createElementVNode("p",{class:"mb-0 text-body-xs font-normal"},"Back",-1))]))}}),_e=["width","height"],ke=["fill"],xe=e.defineComponent({__name:"icon-buzapay-icon",props:{width:{default:15},height:{default:13},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 15 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M9.97919 0.5C10.8854 0.5 11.6276 0.585938 12.2057 0.757812C12.7891 0.924479 13.2188 1.22396 13.4948 1.65625C13.7761 2.08333 13.9167 2.6901 13.9167 3.47656C13.9167 4.1849 13.7526 4.77083 13.4245 5.23438C13.0964 5.69792 12.5938 5.95312 11.9167 6C12.8021 6.08854 13.4401 6.40625 13.8307 6.95312C14.2214 7.49479 14.4167 8.17708 14.4167 9C14.4167 9.71354 14.3334 10.2995 14.1667 10.7578C14.0052 11.2161 13.7318 11.5729 13.3464 11.8281C12.961 12.0781 12.4375 12.2526 11.7761 12.3516C11.1198 12.4505 10.2995 12.5 9.31512 12.5H0.416687V0.5H9.97919ZM2.91669 7.77344H5.97235V11.167L10.2497 5.22754H7.19501V1.83398L2.91669 7.77344ZM5.97235 6.07617H8.2702L7.19501 7.57324V6.9248H4.89716L5.97235 5.42676V6.07617Z",fill:e.unref(r)},null,8,ke)],16,_e))}}),Ve={class:"checkout-card w-full h-screen flex flex-col items-center justify-center text-white"},we={class:"flex w-1/2"},Be={class:"flex gap-2 w-full"},Ne={class:"flex flex-col gap-8 w-full"},Ee={class:"bg-off-white rounded-xl"},$e={class:"flex items-center gap-2 justify-center"},Se=e.defineComponent({__name:"card",props:{showBackButton:{type:Boolean,default:!1}},emits:["back","close"],setup(o,{emit:l}){const t=l;return(a,n)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",we,[a.showBackButton?(e.openBlock(),e.createBlock(be,{key:0,onBack:n[0]||(n[0]=r=>t("back"))})):e.createCommentVNode("",!0),e.createElementVNode("div",Be,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.renderSlot(a.$slots,"default")]),e.createElementVNode("div",$e,[n[2]||(n[2]=e.createElementVNode("p",{class:"text-light-white-100 text-body-2xs font-regular"}," Powered by Buzapay ",-1)),e.createVNode(xe,{color:"#E8F4FF"})])]),e.createElementVNode("div",{class:"close-icon flex flex-col items-center justify-center self-start cursor-pointer hover:bg-gray-500",onClick:n[1]||(n[1]=r=>t("close")),role:"button","aria-label":"Close"},[...n[3]||(n[3]=[e.createElementVNode("p",{class:"text-white"},"x",-1)])])])])]))}}),De=["src","height","alt"],x=e.defineComponent({__name:"image",props:{src:{},height:{default:50},width:{default:50},alt:{default:"Image"},customClass:{default:""},isFullWidth:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:l}){const t=o,a=l,{src:n,height:r,width:c,alt:i,customClass:d,isFullWidth:s}=t;return(m,f)=>(e.openBlock(),e.createElementBlock("img",{src:e.unref(n),height:e.unref(r),alt:e.unref(i),class:e.normalizeClass([e.unref(d),e.unref(s)?"w-full":""]),style:e.normalizeStyle({width:e.unref(s)?"100%":e.unref(c)+"px"}),onClick:f[0]||(f[0]=p=>a("click"))},null,14,De))}}),Le=["aria-orientation"],Me=["aria-checked","onClick"],Te={key:0,class:"bg-white w-2 h-2 rounded-full"},Ae={class:"mb-0 text-body-2xs font-medium text-heading-text"},Pe=e.defineComponent({__name:"radio-group",props:{options:{default:()=>[]},type:{default:"vertical"},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""}},emits:["update:modelValue","selectedChange"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.modelValue!==void 0),r=e.ref("");e.onMounted(()=>{if(n.value)return;const p=t.defaultValue??(t.options.length?t.options[0].value:"");r.value=p,p&&(a("update:modelValue",p),a("selectedChange",p))}),e.watch(()=>t.modelValue,p=>{n.value&&(r.value=p??"")},{immediate:!0});const c=e.computed(()=>n.value?t.modelValue??"":r.value);function i(p){n.value||(r.value=p),a("update:modelValue",p),a("selectedChange",p)}const d=e.computed(()=>t.type==="horizontal"?"flex-row gap-5":"flex-col gap-6"),{options:s,type:m,className:f}=t;return(p,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex",d.value,e.unref(f)]),role:"radiogroup","aria-orientation":e.unref(m)==="horizontal"?"horizontal":"vertical",tabindex:"0"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),g=>(e.openBlock(),e.createElementBlock("div",{key:g.value,role:"radio","aria-checked":c.value===g.value,tabindex:"-1",onClick:_=>i(g.value),class:"flex items-center gap-2 cursor-pointer transition-colors duration-200"},[e.createElementVNode("div",{class:e.normalizeClass(["w-4 h-4 rounded-full border flex items-center justify-center",c.value===g.value?"bg-orange-500 border-orange-500":"bg-white border-grey-200"])},[c.value===g.value?(e.openBlock(),e.createElementBlock("div",Te)):e.createCommentVNode("",!0)],2),e.createElementVNode("p",Ae,e.toDisplayString(g.label),1)],8,Me))),128))],10,Le))}}),Ie=["width","height"],He=["fill"],Ue=["fill"],ze=["fill"],Fe=e.defineComponent({__name:"icon-copy-success",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M11.4002 1.6875H8.60016C5.9935 1.6875 4.8335 2.8475 4.8335 5.45417V6.1875C4.8335 6.46083 5.06016 6.6875 5.3335 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V11.5208C10.1668 11.7942 10.3935 12.0208 10.6668 12.0208H11.4002C14.0068 12.0208 15.1668 10.8608 15.1668 8.25417V5.45417C15.1668 2.8475 14.0068 1.6875 11.4002 1.6875ZM5.8335 5.6875V5.45417C5.8335 3.3875 6.5335 2.6875 8.60016 2.6875H11.4002C13.4668 2.6875 14.1668 3.3875 14.1668 5.45417V8.25417C14.1668 10.3208 13.4668 11.0208 11.4002 11.0208H11.1668V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875H5.8335Z",fill:e.unref(r)},null,8,He),e.createElementVNode("path",{d:"M7.40016 5.6875H4.60016C1.9935 5.6875 0.833496 6.8475 0.833496 9.45417V12.2542C0.833496 14.8608 1.9935 16.0208 4.60016 16.0208H7.40016C10.0068 16.0208 11.1668 14.8608 11.1668 12.2542V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875ZM4.60016 15.0208C2.5335 15.0208 1.8335 14.3208 1.8335 12.2542V9.45417C1.8335 7.3875 2.5335 6.6875 4.60016 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V12.2542C10.1668 14.3208 9.46683 15.0208 7.40016 15.0208H4.60016Z",fill:e.unref(r)},null,8,Ue),e.createElementVNode("path",{d:"M5.35302 12.6542C5.22635 12.6542 5.09969 12.6075 4.99969 12.5075L3.69969 11.2075C3.50635 11.0142 3.50635 10.6942 3.69969 10.5008C3.89302 10.3075 4.21302 10.3075 4.40635 10.5008L5.35302 11.4475L7.59302 9.2075C7.78635 9.01417 8.10635 9.01417 8.29969 9.2075C8.49302 9.40083 8.49302 9.72083 8.29969 9.91417L5.69969 12.5075C5.60635 12.6008 5.47969 12.6542 5.35302 12.6542Z",fill:e.unref(r)},null,8,ze)],16,Ie))}}),N=e.defineComponent({__name:"copy",props:{copyText:{},color:{}},setup(o){const l=o;function t(n){return navigator.clipboard.writeText(n)}function a(){t(l.copyText).then(()=>{}).catch(n=>{console.error("Copy failed:",n)})}return(n,r)=>(e.openBlock(),e.createBlock(Fe,{class:"cursor-pointer",color:n.color,onClick:a},null,8,["color"]))}}),je={class:"flex items-center gap-1"},qe={key:1,class:"flex items-center justify-between"},Ke={class:"flex items-center gap-1"},B=e.defineComponent({__name:"label-info",props:{type:{default:"vertical"},label:{default:""},labelCustomClass:{default:"text-body-4xs font-medium text-light-copy"},valueImageSrc:{default:""},valueImageCustomClass:{default:""},valueImagePosition:{default:"prefix"},hasValueCopy:{type:Boolean,default:!1},value:{default:""},valueCustomClass:{default:"text-body-2xs font-medium text-sub-copy"},alignRight:{type:Boolean,default:!1}},setup(o){const l=o,t=e.computed(()=>(l.label??"").toUpperCase()),a=e.computed(()=>!!l.valueImageSrc&&l.valueImagePosition==="prefix"),n=e.computed(()=>!!l.valueImageSrc&&l.valueImagePosition==="suffix"),r=e.computed(()=>re(l.value,40)),{type:c,labelCustomClass:i,valueImageSrc:d,valueImageCustomClass:s,hasValueCopy:m,value:f,valueCustomClass:p,alignRight:k}=l;return(g,_)=>e.unref(c)==="vertical"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex flex-col gap-1",e.unref(k)?"text-right items-end":""])},[e.createElementVNode("p",{class:e.normalizeClass(e.unref(i))},e.toDisplayString(t.value),3),e.createElementVNode("div",je,[a.value?(e.openBlock(),e.createBlock(x,{key:0,src:e.unref(d),alt:e.unref(f),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("p",{key:2,class:e.normalizeClass([e.unref(p),"truncate"])},e.toDisplayString(r.value),3)):(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(p))},e.toDisplayString(e.unref(f)),3)),e.unref(m)?(e.openBlock(),e.createBlock(N,{key:3,copyText:e.unref(f),color:"#9DBFDE"},null,8,["copyText"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(x,{key:4,src:e.unref(d),alt:e.unref(f),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0)])],2)):(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("p",{class:e.normalizeClass(e.unref(i))},e.toDisplayString(t.value),3),e.createElementVNode("div",Ke,[a.value?(e.openBlock(),e.createBlock(x,{key:0,src:e.unref(d),alt:e.unref(f),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(e.unref(p))},e.toDisplayString(e.unref(f)),3),e.unref(m)?(e.openBlock(),e.createBlock(N,{key:1,copyText:e.unref(f),color:"#9DBFDE"},null,8,["copyText"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(x,{key:2,src:e.unref(d),alt:e.unref(f),width:22,customClass:e.unref(s)},null,8,["src","alt","customClass"])):e.createCommentVNode("",!0)])]))}}),Re=["width","height"],Ze=["fill"],Oe=e.defineComponent({__name:"icon-check-circle",props:{width:{default:67},height:{default:67},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M33.6705 0.0820312C15.2758 0.0820312 0.36377 14.9941 0.36377 33.3888C0.36377 51.7846 15.2758 66.6956 33.6705 66.6956C52.0663 66.6956 66.9773 51.7846 66.9773 33.3888C66.9773 14.9941 52.0663 0.0820312 33.6705 0.0820312ZM33.6705 62.5978C17.6011 62.5978 4.52712 49.4583 4.52712 33.3887C4.52712 17.3192 17.6011 4.24525 33.6705 4.24525C49.74 4.24525 62.814 17.3193 62.814 33.3887C62.814 49.4581 49.74 62.5978 33.6705 62.5978ZM46.9631 21.2016L27.4213 40.8662L18.621 32.0659C17.8081 31.253 16.4904 31.253 15.6765 32.0659C14.8636 32.8788 14.8636 34.1965 15.6765 35.0094L25.9797 45.3137C26.7926 46.1255 28.1103 46.1255 28.9243 45.3137C29.0179 45.22 29.0981 45.1179 29.171 45.0118L49.9086 24.1461C50.7205 23.3332 50.7205 22.0155 49.9086 21.2016C49.0947 20.3888 47.777 20.3888 46.9631 21.2016Z",fill:e.unref(r)},null,8,Ze)],16,Re))}}),Ye={class:"flex flex-col gap-8 p-16"},Ge={class:"flex flex-col gap-8"},We={class:"flex flex-col gap-8"},Je={class:"flex flex-col"},Xe={class:"py-4 border-b border-grey-100"},Qe={class:"py-4"},et={class:"mx-auto",style:{width:"80%"}},tt=e.defineComponent({__name:"success",setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",Ge,[e.createElementVNode("div",We,[e.createVNode(Oe,{color:"#F47A1F",class:"mx-auto"}),t[0]||(t[0]=e.createElementVNode("div",{class:"flex flex-col text-center",style:{gap:"2px"}},[e.createElementVNode("p",{class:"text-heading-text font-medium text-header-2xl"},"₦2,500.00"),e.createElementVNode("p",{class:"text-sub-copy font-regular text-body-3xs"}," Has been paid successfully ")],-1))]),e.createElementVNode("div",Je,[e.createElementVNode("div",Xe,[e.createVNode(B,{type:"horizontal",label:"Order ID",value:"9900009000-8890-8829hd7"})]),e.createElementVNode("div",Qe,[e.createVNode(B,{type:"horizontal",label:"Payment date",value:"July 24, 2025"})])])]),e.createElementVNode("div",et,[e.createVNode(V,{label:"Return to Merchant Website",type:"secondary",customClass:"w-full"})])]))}}),ot={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},lt={key:0,class:"text-orange-required"},nt=["type","value","disabled","placeholder","inputmode"],at={key:1,class:"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"},rt={key:1,class:"text-body-3xs text-light-copy"},st={key:2,class:"text-body-3xs text-red-500"},b=e.defineComponent({__name:"input",props:{label:{default:""},type:{default:"text"},placeholder:{default:void 0},validationError:{default:""},hint:{default:""},mask:{default:""},rules:{default:()=>[]},isAmountInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},showCopyIcon:{type:Boolean,default:!1},modelValue:{default:void 0},defaultValue:{default:""},className:{default:""}},emits:["update:modelValue","blur","copied"],setup(o,{emit:l}){const t=o,a=l,n=e.computed(()=>t.modelValue!==void 0),r=e.ref(t.modelValue??t.defaultValue??""),c=e.ref(""),i=e.ref(""),d=e.ref(null);e.watch(()=>t.modelValue,h=>{n.value&&(r.value=h??"")});const s=e.computed(()=>t.isAmountInput?M(r.value.replace(/,/g,"")):r.value);function m(h){const $=h.target.value.replace(/,/g,"");n.value||(r.value=$),a("update:modelValue",$),e.nextTick(()=>{const w=d.value;if(w){const S=w.value.length;w.setSelectionRange(S,S)}})}function f(){a("blur",r.value)}function p(h){t.rules.includes("numeric")&&se(h)}const k=e.computed(()=>t.disabled?"bg-grey-50 cursor-not-allowed":"bg-white"),g=e.computed(()=>t.validationError||i.value?"border-red-300 bg-red-50":"border-grey-100");function _(h){return navigator.clipboard.writeText(h)}function A(){_(r.value).then(()=>{i.value="",c.value="Text copied to clipboard",a("copied")}).catch(()=>{c.value="",i.value="Failed to copy text to clipboard"})}return(h,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",h.className])},[h.label?(e.openBlock(),e.createElementBlock("p",ot,[e.createTextVNode(e.toDisplayString(h.label)+" ",1),h.required?(e.openBlock(),e.createElementBlock("span",lt," *")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["border-c px-3 py-2 flex items-center justify-between rounded-md h-12",k.value,g.value])},[e.renderSlot(h.$slots,"prefix"),e.createElementVNode("input",{ref_key:"inputEl",ref:d,type:h.type,value:s.value,disabled:h.disabled,placeholder:h.placeholder??(h.label?`Enter ${h.label.toLowerCase()}`:void 0),inputmode:h.isAmountInput?"decimal":void 0,class:"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full",onInput:m,onBlur:f,onKeydown:p},null,40,nt),h.loading?(e.openBlock(),e.createElementBlock("div",at)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(h.$slots,"suffix"),h.showCopyIcon&&r.value.trim()!==""?(e.openBlock(),e.createBlock(x,{key:0,src:"assets/images/copyIcon.svg",alt:"copy",width:16,height:16,customClass:"cursor-pointer hover:opacity-70 transition-opacity",onClick:A})):e.createCommentVNode("",!0)],64))],2),h.hint||c.value?(e.openBlock(),e.createElementBlock("p",rt,e.toDisplayString(c.value||h.hint),1)):e.createCommentVNode("",!0),h.validationError||i.value?(e.openBlock(),e.createElementBlock("p",st,e.toDisplayString(i.value||h.validationError),1)):e.createCommentVNode("",!0)],2))}}),ct=["width","height"],it={opacity:"0.6"},ut=["fill"],dt=e.defineComponent({__name:"icon-chevron-down",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",it,[e.createElementVNode("path",{d:"M16.5813 7.83128L10.3313 14.0813C10.2434 14.1691 10.1242 14.2184 10 14.2184C9.87581 14.2184 9.75667 14.1691 9.66878 14.0813L3.41878 7.83128C3.33598 7.74242 3.2909 7.62489 3.29304 7.50345C3.29518 7.38201 3.34438 7.26615 3.43026 7.18026C3.51615 7.09438 3.63201 7.04518 3.75345 7.04304C3.87489 7.0409 3.99242 7.08598 4.08128 7.16878L10 13.0867L15.9188 7.16878C16.0076 7.08598 16.1252 7.0409 16.2466 7.04304C16.368 7.04518 16.4839 7.09438 16.5698 7.18026C16.6557 7.26615 16.7049 7.38201 16.707 7.50345C16.7092 7.62489 16.6641 7.74242 16.5813 7.83128Z",fill:e.unref(r)},null,8,ut)])],16,ct))}}),pt=["width","height"],mt={opacity:"0.7"},ft=["fill"],ht=e.defineComponent({__name:"icon-chevron-up",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",mt,[e.createElementVNode("path",{d:"M2.73508 9.73495L7.73508 4.73495C7.80539 4.66473 7.9007 4.62528 8.00008 4.62528C8.09945 4.62528 8.19476 4.66473 8.26508 4.73495L13.2651 9.73495C13.3313 9.80604 13.3674 9.90006 13.3657 9.99722C13.364 10.0944 13.3246 10.1871 13.2559 10.2558C13.1872 10.3245 13.0945 10.3638 12.9973 10.3655C12.9002 10.3673 12.8062 10.3312 12.7351 10.265L8.00008 5.53058L3.26508 10.265C3.19399 10.3312 3.09997 10.3673 3.00282 10.3655C2.90566 10.3638 2.81297 10.3245 2.74427 10.2558C2.67556 10.1871 2.6362 10.0944 2.63449 9.99722C2.63277 9.90006 2.66884 9.80604 2.73508 9.73495Z",fill:e.unref(r)},null,8,ft)])],16,pt))}}),vt={class:"mb-0 text-body-3xs font-medium text-orange-500"},yt=e.defineComponent({__name:"hint",props:{hint:{}},setup(o){return(l,t)=>(e.openBlock(),e.createElementBlock("p",vt,e.toDisplayString(l.hint),1))}}),Ct={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},gt={key:0,class:"text-orange-required"},bt=["aria-expanded","aria-controls","aria-disabled","aria-activedescendant"],_t={class:"flex items-center gap-2"},kt={class:"flex items-center gap-2"},xt={key:0,class:"inline-block h-4 w-4 border-2 border-current border-t-transparent rounded-full animate-spin"},Vt=["aria-label"],wt={key:0,class:"px-4 pt-2 pb-1"},Bt=["placeholder"],Nt=["onClick","id","aria-selected"],Et={class:"mb-0 text-body-2xs font-medium"},T=e.defineComponent({__name:"select",props:{options:{default:()=>[]},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""},placeholder:{default:"Select an option"},hasSearch:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},validationError:{default:""},label:{default:""},hint:{default:""},required:{type:Boolean,default:!1},itemImageType:{default:null}},emits:["update:modelValue","change"],setup(o,{emit:l}){const t=o,a=l,n=e.ref(!1),r=e.ref(t.defaultValue??t.modelValue??""),c=e.ref([...t.options]),i=e.ref(-1),d=e.ref(null),s=e.ref(null),m=e.ref(null),f=e.computed(()=>t.modelValue!==void 0);e.watch(()=>t.modelValue,u=>{f.value&&(r.value=u??"")}),e.watch(()=>t.options,u=>{c.value=[...u]},{immediate:!0});const p=e.computed(()=>{const u=f.value?t.modelValue:r.value;return t.options.find(v=>v.value===u)??null}),k=e.computed(()=>{var u;return((u=p.value)==null?void 0:u.label)||t.placeholder||(t.label?`Select ${t.label}`:"Select an option")});function g(){if(t.disabled||n.value)return;c.value=[...t.options];const u=p.value?Math.max(0,t.options.findIndex(v=>v.value===p.value.value)):0;i.value=u,n.value=!0,e.nextTick(()=>{t.hasSearch&&m.value&&(m.value.focus(),m.value.select())})}function _(){n.value&&(n.value=!1,i.value=-1)}function A(){t.disabled||(n.value?_():g())}function h(u){if(!n.value)return;const v=u.target,C=d.value,y=s.value;C&&!C.contains(v)&&y&&!y.contains(v)&&_()}e.watch(n,u=>{u?document.addEventListener("mousedown",h):document.removeEventListener("mousedown",h)}),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",h));function E(u){f.value||(r.value=u),a("update:modelValue",u),a("change",u),_()}function $(u){const v=u.target.value.toLowerCase(),C=t.options.filter(y=>y.label.toLowerCase().includes(v));c.value=C,i.value=C.length?0:-1}function w(u){if(!t.disabled)switch(u.key){case"Enter":case" ":case"Spacebar":case"ArrowDown":u.preventDefault(),n.value?D(1):g();break;case"ArrowUp":u.preventDefault(),n.value?D(-1):g();break;case"Escape":n.value&&(u.preventDefault(),_());break}}function S(u){switch(u.key){case"ArrowDown":u.preventDefault(),D(1);break;case"ArrowUp":u.preventDefault(),D(-1);break;case"Home":u.preventDefault(),i.value=c.value.length?0:-1,P(0);break;case"End":u.preventDefault(),i.value=c.value.length-1,P(c.value.length-1);break;case"Enter":if(u.preventDefault(),i.value>=0){const v=c.value[i.value];v&&E(v.value)}break;case"Escape":u.preventDefault(),_();break;case"Tab":_();break}}function D(u){if(!c.value.length)return;const v=c.value.length-1,C=i.value<0?0:Math.min(v,Math.max(0,i.value+u));i.value=C,P(C)}function P(u){var y;const v=s.value;if(!v)return;const C=v.querySelectorAll("[data-option]");u>=0&&u<C.length&&((y=C[u])==null||y.scrollIntoView({block:"nearest"}))}const G=e.computed(()=>t.disabled?"bg-grey-100 cursor-not-allowed":"bg-white"),W=e.computed(()=>t.validationError?"border-red-300 bg-red-50":"border-grey-100 bg-white"),{options:Ho,placeholder:Uo,hasSearch:J,disabled:X,loading:Q,validationError:H,label:L,hint:U,required:ee,itemImageType:z,className:te}=t;return(u,v)=>{var C;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 relative",e.unref(te)])},[e.unref(L)?(e.openBlock(),e.createElementBlock("p",Ct,[e.createTextVNode(e.toDisplayString(e.unref(L))+" ",1),e.unref(ee)?(e.openBlock(),e.createElementBlock("span",gt," *")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerRef",ref:d,class:e.normalizeClass(["border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2",G.value,W.value]),role:"combobox","aria-haspopup":"listbox","aria-expanded":n.value,"aria-controls":n.value?"select-menu":void 0,"aria-disabled":e.unref(X)||void 0,"aria-activedescendant":n.value&&i.value>=0?`option-${i.value}`:void 0,tabindex:"0",onClick:A,onKeydown:w},[e.createElementVNode("div",_t,[e.renderSlot(u.$slots,"prefix"),e.createElementVNode("div",kt,[p.value&&e.unref(z)==="country"&&p.value.countryCode?(e.openBlock(),e.createBlock(x,{key:0,src:`https://flagcdn.com/w40/${p.value.countryCode.toLowerCase()}.png`,alt:p.value.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(["text-body-2xs font-normal mb-0",(C=p.value)!=null&&C.label?"text-sub-copy":"text-grey-500"])},e.toDisplayString(k.value),3)])]),e.unref(Q)?(e.openBlock(),e.createElementBlock("span",xt)):n.value?(e.openBlock(),e.createBlock(ht,{key:1,color:"#8FAECA"})):(e.openBlock(),e.createBlock(dt,{key:2,color:"#8FAECA"}))],42,bt),n.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"menuRef",ref:s,id:"select-menu",class:"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto",role:"listbox","aria-label":e.unref(L)||"Options",style:{position:"absolute",top:"100%",zIndex:10},onKeydown:S},[e.unref(J)?(e.openBlock(),e.createElementBlock("div",wt,[e.createElementVNode("input",{ref_key:"searchRef",ref:m,type:"text",placeholder:`Search ${e.unref(L)||"options"}`,class:"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal",onInput:$},null,40,Bt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(y,F)=>{var j;return e.openBlock(),e.createElementBlock("div",{key:y.value,onClick:zo=>E(y.value),id:`option-${F}`,"data-option":"",role:"option","aria-selected":((j=p.value)==null?void 0:j.value)===y.value,class:e.normalizeClass(["px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer",F===i.value?"bg-gray-100":""])},[e.unref(z)==="country"&&y.countryCode?(e.openBlock(),e.createBlock(x,{key:0,src:`https://flagcdn.com/w40/${y.countryCode.toLowerCase()}.png`,alt:y.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):e.createCommentVNode("",!0),e.createElementVNode("p",Et,e.toDisplayString(y.label),1)],10,Nt)}),128))],40,Vt)):e.createCommentVNode("",!0),e.unref(U)?(e.openBlock(),e.createBlock(yt,{key:2,hint:e.unref(U)},null,8,["hint"])):e.createCommentVNode("",!0),e.unref(H)?(e.openBlock(),e.createBlock(Z,{key:3,errorMessage:e.unref(H)},null,8,["errorMessage"])):e.createCommentVNode("",!0)],2)}}}),$t={class:"flex flex-col gap-6"},St={key:0,class:"grid grid-cols-2 gap-6 overflow-y-auto"},Dt={class:"col-span-2"},Lt={key:1,class:"grid grid-cols-2 gap-6 overflow-y-auto",style:{"max-height":"320px"}},Mt={class:"col-span-2"},Tt={class:"col-span-2"},At=e.defineComponent({__name:"pay-by-card",setup(o){const l=e.ref(0);return(t,a)=>(e.openBlock(),e.createElementBlock("div",$t,[l.value===0?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(b,{label:"First Name",required:!0}),e.createVNode(b,{label:"Last Name",required:!0}),e.createVNode(b,{label:"Email",required:!0}),e.createVNode(b,{label:"Phone Number",required:!0}),e.createVNode(T,{label:"Select Country",required:!0,options:[{label:"United States",value:"US"},{label:"Canada",value:"CA"},{label:"United Kingdom",value:"UK"}]}),e.createVNode(T,{label:"Select State",required:!0,options:[{label:"California",value:"CA"},{label:"Texas",value:"TX"},{label:"New York",value:"NY"}]}),e.createVNode(b,{label:"City",required:!0}),e.createVNode(b,{label:"Postal Code",required:!0}),e.createElementVNode("div",Dt,[e.createVNode(b,{label:"Street Address",required:!0})])])):l.value===1?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("div",Mt,[e.createVNode(b,{label:"Card Name",required:!0})]),e.createElementVNode("div",Tt,[e.createVNode(b,{label:"Card Number",required:!0})]),e.createVNode(b,{label:"Expiry Date",required:!0}),e.createVNode(b,{label:"CVV",required:!0})])):e.createCommentVNode("",!0),e.createVNode(V,{label:l.value===0?"Proceed":"Pay",type:"primary",customClass:"w-full",onClick:a[0]||(a[0]=n=>l.value===0&&(l.value=1))},null,8,["label"])]))}}),Pt={class:"flex flex-col gap-10"},It={class:"text-sub-copy text-sm font-semibold text-center"},Ht={class:"bg-[#EFF7FF] p-4 rounded-lg flex flex-col gap-6"},Ut={class:"flex items-center justify-between"},zt={class:"flex items-center justify-between"},Ft={class:"w-2/3 mx-auto text-center text-body-2xs font-medium text-sub-copy"},jt={class:"text-orange-500"},qt={class:"flex flex-col gap-4"},Kt=e.defineComponent({__name:"pay-by-transfer",props:{amountDisplay:{default:"NGN 200,500.00"},bankName:{default:"Teerus MFB"},accountNumber:{default:"0001928940"},initialSeconds:{default:30*60}},emits:["confirm","cancel"],setup(o,{emit:l}){const t=o,a=l,n=e.ref(t.initialSeconds),r=e.ref(null),c=e.computed(()=>{const i=Math.max(0,n.value),d=Math.floor(i/60),s=i%60;return`${String(d).padStart(2,"0")}:${String(s).padStart(2,"0")}`});return e.onMounted(()=>{r.value=window.setInterval(()=>{n.value-=1},1e3)}),e.onBeforeUnmount(()=>{r.value&&(clearInterval(r.value),r.value=null)}),e.watch(n,i=>{i<0&&r.value&&(clearInterval(r.value),r.value=null)}),(i,d)=>(e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("p",It," Amount to Pay "+e.toDisplayString(i.amountDisplay),1),e.createElementVNode("div",Ht,[e.createVNode(B,{label:"Bank Name",value:i.bankName,type:"horizontal"},null,8,["value"]),e.createElementVNode("div",Ut,[e.createVNode(B,{label:"Account Number",value:i.accountNumber,type:"horizontal"},null,8,["value"]),e.createVNode(N,{color:"#9DBFDE",copyText:i.accountNumber},null,8,["copyText"])]),e.createElementVNode("div",zt,[e.createVNode(B,{label:"Amount",value:i.amountDisplay,type:"horizontal"},null,8,["value"]),e.createVNode(N,{color:"#9DBFDE",copyText:i.amountDisplay},null,8,["copyText"])])]),e.createElementVNode("p",Ft,[d[2]||(d[2]=e.createTextVNode(" This account is for this transaction only and expires in ",-1)),e.createElementVNode("span",jt,e.toDisplayString(n.value>=0?c.value:"00:00"),1)]),e.createElementVNode("div",qt,[e.createVNode(V,{label:"I have paid the money",type:"primary",customClass:"w-full",onClick:d[0]||(d[0]=s=>a("confirm"))}),e.createElementVNode("button",{type:"button",onClick:d[1]||(d[1]=s=>a("cancel")),class:"text-heading-text text-body-2xs font-medium text-center py-2 cursor-pointer"}," Cancel Payment ")])]))}}),Rt=["width","height"],Zt={"clip-path":"url(#clip0_10908_387048)"},Ot=["fill"],Yt={id:"clip0_10908_387048"},Gt=["fill"],Wt=e.defineComponent({__name:"icon-usdc",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",Zt,[e.createElementVNode("path",{d:"M14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0ZM16.933 4.865C16.7195 4.76 16.506 4.865 16.4535 5.07762C16.4001 5.131 16.4001 5.18438 16.4001 5.29025V6.034L16.4089 6.125C16.4546 6.30501 16.5652 6.46177 16.7195 6.56512C20.8792 8.05262 23.0125 12.6726 21.4655 16.7615C20.6657 18.9928 18.9061 20.6911 16.7195 21.4883C16.506 21.5941 16.4001 21.7534 16.4001 22.0194V22.7631L16.4045 22.8401C16.4128 22.9241 16.4479 23.0033 16.5047 23.0658C16.5614 23.1284 16.6367 23.171 16.7195 23.1875C16.7729 23.1875 16.8796 23.1875 16.933 23.135C18.1331 22.7602 19.2473 22.1517 20.2113 21.3446C21.1753 20.5375 21.9701 19.5476 22.5499 18.432C23.1298 17.3164 23.4833 16.0972 23.59 14.8444C23.6967 13.5917 23.5546 12.3302 23.1718 11.1326C22.2128 8.10512 19.866 5.8205 16.933 4.865ZM11.2805 4.8125C11.2271 4.8125 11.1204 4.8125 11.067 4.865C9.86688 5.23978 8.75274 5.84826 7.78874 6.6554C6.82475 7.46254 6.02993 8.4524 5.45006 9.56797C4.87019 10.6836 4.51673 11.9028 4.41001 13.1556C4.30329 14.4083 4.44543 15.6698 4.82825 16.8674C5.78725 19.8424 8.08062 22.1261 11.067 23.0816C11.2805 23.1875 11.494 23.0816 11.5465 22.869C11.5999 22.8165 11.5999 22.7622 11.5999 22.6564V21.9126L11.5911 21.8426C11.5544 21.6947 11.417 21.5259 11.2805 21.4349C7.12075 19.9474 4.9875 15.3274 6.5345 11.2385C7.33425 9.00725 9.09388 7.30887 11.2805 6.51175C11.494 6.40587 11.5999 6.24663 11.5999 5.98063V5.23688L11.5955 5.15987C11.5872 5.07585 11.5521 4.99673 11.4954 4.93418C11.4386 4.87163 11.3633 4.82898 11.2805 4.8125ZM14.3736 7.574H13.573L13.496 7.581C13.321 7.616 13.1933 7.7665 13.146 7.99925V9.22075L12.9649 9.24875C11.4704 9.51475 10.5341 10.5464 10.5341 11.823C10.5341 13.5748 11.5999 14.2651 13.8399 14.5311C15.3335 14.7963 15.813 15.1156 15.813 15.9653C15.813 16.814 15.0666 17.3985 14.0534 17.3985C12.6665 17.3985 12.187 16.8149 12.0269 16.0177C11.9744 15.806 11.8134 15.6992 11.6532 15.6992H10.7467L10.6776 15.7054C10.5913 15.7193 10.513 15.7641 10.4572 15.8313C10.4014 15.8985 10.3718 15.9838 10.374 16.0711V16.1236L10.4029 16.2811C10.6566 17.5271 11.5106 18.4187 13.2003 18.6734V19.9483L13.2072 20.0252C13.2422 20.1985 13.3936 20.3263 13.6273 20.3726H14.427L14.504 20.3656C14.679 20.3306 14.8067 20.1801 14.854 19.9483V18.6725L15.0351 18.6375C16.534 18.3207 17.5201 17.2366 17.5201 15.8576C17.5201 13.9991 16.4001 13.3621 14.1601 13.0961C12.5598 12.8835 12.2404 12.4591 12.2404 11.7154C12.2404 10.9716 12.7741 10.4939 13.8399 10.4939C14.7998 10.4939 15.3335 10.8124 15.5995 11.6095C15.6272 11.6866 15.6779 11.7533 15.7447 11.8007C15.8115 11.8481 15.8912 11.8739 15.9731 11.8746H16.8262L16.8954 11.8694C16.982 11.8556 17.0606 11.8108 17.1166 11.7434C17.1726 11.6759 17.2022 11.5904 17.1999 11.5027V11.4503L17.1675 11.2989C17.0361 10.755 16.7366 10.2664 16.3115 9.90255C15.8864 9.53872 15.3574 9.31821 14.7997 9.27238V7.99925L14.7928 7.92225C14.7578 7.74812 14.6073 7.62038 14.3736 7.574Z",fill:e.unref(r)},null,8,Ot)]),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Yt,[e.createElementVNode("rect",{width:"28",height:"28",fill:e.unref(r)},null,8,Gt)])])],16,Rt))}}),Jt=["width","height"],Xt={"clip-path":"url(#clip0_10908_387045)"},Qt=["fill"],eo={id:"clip0_10908_387045"},to=["fill"],oo=e.defineComponent({__name:"icon-usdt",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("g",Xt,[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28ZM15.6818 12.0689V9.99863H20.419V6.84162H7.52063V9.99863H12.2579V12.068C8.40787 12.2447 5.5125 13.0077 5.5125 13.9212C5.5125 14.8347 8.40787 15.5969 12.2579 15.7745V22.4088H15.6818V15.7727C19.5256 15.596 22.414 14.8339 22.414 13.9212C22.414 13.0086 19.5256 12.2465 15.6818 12.0689ZM15.6818 15.2101V15.2084C15.5855 15.2154 15.0894 15.2451 13.9825 15.2451C13.0987 15.2451 12.4766 15.2189 12.2579 15.2084V15.211C8.85587 15.0614 6.31662 14.469 6.31662 13.7602C6.31662 13.0524 8.85587 12.46 12.2579 12.3077V14.6212C12.4801 14.637 13.1171 14.6746 13.9974 14.6746C15.0535 14.6746 15.5829 14.6309 15.6818 14.6221V12.3095C19.0768 12.4609 21.6099 13.0532 21.6099 13.7602C21.6099 14.469 19.0768 15.0596 15.6818 15.2101Z",fill:e.unref(r)},null,8,Qt)]),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",eo,[e.createElementVNode("rect",{width:"28",height:"28",fill:e.unref(r)},null,8,to)])])],16,Jt))}}),lo={key:1,class:"flex items-center gap-1"},I=e.defineComponent({__name:"currency-amount",props:{currency:{},amount:{},textClass:{default:""},iconColorClass:{default:""},iconWidth:{default:16},iconHeight:{default:16}},setup(o){const l=o,t=e.computed(()=>{var a;return(a=l.currency)==null?void 0:a.toUpperCase()});return(a,n)=>t.value!=="USDT"&&t.value!=="USDC"?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(a.textClass)},e.toDisplayString(e.unref(M)(a.amount,t.value)),3)):(e.openBlock(),e.createElementBlock("div",lo,[t.value==="USDT"?(e.openBlock(),e.createBlock(oo,{key:0,width:a.iconWidth,height:a.iconHeight,color:a.iconColorClass},null,8,["width","height","color"])):e.createCommentVNode("",!0),t.value==="USDC"?(e.openBlock(),e.createBlock(Wt,{key:1,width:a.iconWidth,height:a.iconHeight,color:a.iconColorClass},null,8,["width","height","color"])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:e.normalizeClass(a.textClass)},e.toDisplayString(e.unref(M)(a.amount)),3)]))}}),no=["width","height"],ao=["fill"],ro=["fill"],so=["fill"],co=["fill"],io=e.defineComponent({__name:"icon-arrow-swap",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const l=o,t=e.useAttrs(),{width:a,height:n,color:r}=l;return(c,i)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({width:e.unref(a),height:e.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.unref(t)),[e.createElementVNode("path",{d:"M10.3265 14.1948C10.1998 14.1948 10.0731 14.1481 9.97313 14.0481C9.77979 13.8548 9.77979 13.5348 9.97313 13.3414L13.3131 10.0014C13.5065 9.80811 13.8265 9.80811 14.0198 10.0014C14.2131 10.1948 14.2131 10.5148 14.0198 10.7081L10.6798 14.0481C10.5798 14.1414 10.4531 14.1948 10.3265 14.1948Z",fill:e.unref(r)},null,8,ao),e.createElementVNode("path",{d:"M13.6668 10.8477H2.3335C2.06016 10.8477 1.8335 10.621 1.8335 10.3477C1.8335 10.0743 2.06016 9.84766 2.3335 9.84766H13.6668C13.9402 9.84766 14.1668 10.0743 14.1668 10.3477C14.1668 10.621 13.9402 10.8477 13.6668 10.8477Z",fill:e.unref(r)},null,8,ro),e.createElementVNode("path",{d:"M2.33329 6.86079C2.20663 6.86079 2.07996 6.81413 1.97996 6.71413C1.78663 6.52079 1.78663 6.20079 1.97996 6.00746L5.31996 2.66746C5.51329 2.47413 5.83329 2.47413 6.02663 2.66746C6.21996 2.86079 6.21996 3.18079 6.02663 3.37413L2.68663 6.71413C2.59329 6.80746 2.45996 6.86079 2.33329 6.86079Z",fill:e.unref(r)},null,8,so),e.createElementVNode("path",{d:"M13.6668 6.86133H2.3335C2.06016 6.86133 1.8335 6.63466 1.8335 6.36133C1.8335 6.08799 2.06016 5.86133 2.3335 5.86133H13.6668C13.9402 5.86133 14.1668 6.08799 14.1668 6.36133C14.1668 6.63466 13.9402 6.86133 13.6668 6.86133Z",fill:e.unref(r)},null,8,co)],16,no))}}),uo={class:"flex flex-col gap-6"},po={class:"grid grid-cols-1 gap-6"},mo={key:1,class:"flex flex-col gap-6"},fo={class:"mx-auto"},ho={class:"flex flex-col gap-6 border-c border-grey-100 p-4 rounded-2xl bg-light-white-50"},vo={class:"border-b border-grey-border pb-4 flex flex-col gap-2"},yo={class:"flex justify-between"},Co={class:"flex flex-col gap-1"},go={class:"flex items-center gap-2"},bo={class:"pb-4 flex flex-col gap-2"},_o={class:"flex justify-between"},ko={class:"flex flex-col gap-2"},xo={class:"flex items-center justify-between border-b border-grey-border py-3"},Vo={class:"flex items-center justify-between py-4"},wo={class:"flex flex-col gap-6"},Bo=e.defineComponent({__name:"pay-by-stable-coin",emits:["proceed"],setup(o,{emit:l}){const t=l,a=e.ref(0);function n(){a.value=1,t("proceed")}return(r,c)=>(e.openBlock(),e.createElementBlock("div",uo,[a.value===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",po,[e.createVNode(T,{label:"Select Crypto",required:!0,options:[{label:"USDT",value:"USDT"},{label:"USDC",value:"USDC"},{label:"BUSD",value:"BUSD"}]}),e.createVNode(T,{label:"Select Network",required:!0,options:[{label:"Ethereum",value:"ETH"},{label:"Binance Smart Chain",value:"BSC"},{label:"Polygon",value:"MATIC"}]})]),e.createVNode(V,{label:"Pay",type:"primary",customClass:"w-full",onClick:n})],64)):(e.openBlock(),e.createElementBlock("div",mo,[e.createElementVNode("div",fo,[e.createVNode(x,{src:"../../../assets/images/stable-coin-qr-code.png",alt:"QR Code",width:122,height:122,customClass:"mb-1"}),c[0]||(c[0]=e.createElementVNode("p",{class:"mb-0 text-body-4xs text-light-copy font-normal text-center"}," USDC ",-1))]),e.createElementVNode("div",ho,[e.createElementVNode("div",vo,[c[4]||(c[4]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"Network",-1)),e.createElementVNode("div",yo,[e.createElementVNode("div",Co,[c[3]||(c[3]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-sub-copy"}," BNB Smart Chain (BEP20) ",-1)),e.createElementVNode("div",go,[c[1]||(c[1]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," *Est. arrival = 3 mins ",-1)),c[2]||(c[2]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"|",-1)),e.createVNode(I,{currency:"USDC",amount:10,textClass:"mb-0 text-body-3xs text-light-copy font-normal",iconColorClass:"#557591",iconWidth:12,iconHeight:12})])]),e.createVNode(io)])]),e.createElementVNode("div",bo,[c[6]||(c[6]=e.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," Deposit Address > ",-1)),e.createElementVNode("div",_o,[c[5]||(c[5]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-sub-copy w-2/3 break-words"}," 0j8938ysheeee8333c162883a4d4f5g6t111nhk8uey37777yt6 ",-1)),e.createVNode(N,{copyText:"0j8938ysheeee8333c162883a4d4f5g6t111nhk8uey37777yt6"})])])]),e.createElementVNode("div",ko,[e.createElementVNode("div",xo,[c[7]||(c[7]=e.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-primary-black"}," Network fee ",-1)),e.createVNode(I,{currency:"USDC",amount:12,textClass:"mb-0 text-body-2xs font-extrabold text-primary-black",iconColorClass:"#231F20"})]),e.createElementVNode("div",Vo,[c[8]||(c[8]=e.createElementVNode("p",{class:"mb-0 text-body-lg font-semibold text-primary-black"},"Pay",-1)),e.createVNode(I,{currency:"USDC",amount:15,textClass:"mb-0 text-body-lg font-extrabold text-primary-black",iconColorClass:"#231F20",iconWidth:20,iconHeight:20})])]),e.createElementVNode("div",wo,[e.createVNode(V,{label:"Confirm Payment",type:"primary",customClass:"w-full"})])]))]))}}),No={class:"grid grid-cols-3"},Eo={key:0,class:"bg-[#EFF7FF] px-6 py-8 flex flex-col gap-5 col-span-1 rounded-l-xl"},$o={class:"col-span-2"},So={key:0},Do={key:0,class:"flex items-center justify-between px-12 py-8"},Lo={key:1,class:"bg-heading-text rounded flex flex-col justify-center",style:{width:"52px",height:"52px"}},Mo={class:"flex flex-col gap-1"},To={class:"text-body-2xs font-regular text-sub-copy text-right"},Ao={class:"text-orange-500 font-extrabold"},Po={class:"overflow-y-scroll px-10 pb-10 pt-2"},Io=e.defineComponent({__name:"checkout-card",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})},options:{default:void 0}},setup(o){const l=o,t=e.ref("PAYMENT"),a=e.ref([{label:"Card",value:"CARD"},{label:"Bank Transfer",value:"BANK_TRANSFER"},{label:"Stable Coin",value:"STABLE_COIN"}]),n=e.computed(()=>l.paymentObject.currency==="NGN"?a.value.filter(d=>d.value!=="STABLE_COIN"):a.value.filter(d=>d.value!=="BANK_TRANSFER")),r=e.ref(a.value[0].value);function c(d){r.value=d}const i=e.computed(()=>M(l.paymentObject.amount||0,l.paymentObject.currency||"NGN"));return(d,s)=>(e.openBlock(),e.createBlock(Se,{showBackButton:t.value==="STABLE_COIN_PAYMENT",onBack:s[2]||(s[2]=m=>t.value="PAYMENT")},{default:e.withCtx(()=>{var m;return[e.createElementVNode("div",No,[t.value==="PAYMENT"?(e.openBlock(),e.createElementBlock("div",Eo,[s[3]||(s[3]=e.createElementVNode("p",{class:"text-heading-text text-body-xs font-semibold"},"Pay with",-1)),e.createVNode(Pe,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=f=>r.value=f),options:n.value,onSelectedChange:c},null,8,["modelValue","options"])])):e.createCommentVNode("",!0),e.createElementVNode("div",$o,[t.value==="PAYMENT"||t.value==="STABLE_COIN_PAYMENT"?(e.openBlock(),e.createElementBlock("div",So,[t.value==="PAYMENT"?(e.openBlock(),e.createElementBlock("div",Do,[(m=d.options)!=null&&m.imageUrl?(e.openBlock(),e.createBlock(x,{key:0,src:d.options.imageUrl,alt:"Merchant Logo",width:52,height:52,customClass:"rounded-lg"},null,8,["src"])):(e.openBlock(),e.createElementBlock("div",Lo,[...s[4]||(s[4]=[e.createElementVNode("p",{class:"text-white text-center text-body-2xs font-medium"}," Logo ",-1)])])),e.createElementVNode("div",Mo,[s[6]||(s[6]=e.createElementVNode("p",{class:"text-body-2xs font-regular text-sub-copy text-right"}," Raymahni Merchant LLC ",-1)),e.createElementVNode("p",To,[s[5]||(s[5]=e.createTextVNode(" Pay: ",-1)),e.createElementVNode("span",Ao,e.toDisplayString(i.value),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",Po,[r.value==="CARD"?(e.openBlock(),e.createBlock(At,{key:0})):r.value==="BANK_TRANSFER"?(e.openBlock(),e.createBlock(Kt,{key:1})):(e.openBlock(),e.createBlock(Bo,{key:2,onProceed:s[1]||(s[1]=f=>t.value="STABLE_COIN_PAYMENT")}))])])):t.value==="SUCCESS"?(e.openBlock(),e.createBlock(tt,{key:1})):e.createCommentVNode("",!0)])])]}),_:1},8,["showBackButton"]))}});exports.BzpCheckoutButton=ve;exports.BzpCheckoutCard=Io;exports.BzpCheckoutIframe=Y;exports.createMidenPG=oe;exports.useMidenPG=le;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),$0=Symbol("MidenPGConfig");function fr(o){if(!(o!=null&&o.publishableKey))throw new Error("[@miden-npm/vue] publishableKey is required");return{install(e){e.provide($0,o)}}}function pr(){const o=a.inject($0);if(!o)throw new Error("[@miden-npm/vue] Missing provider. Did you forget to app.use(createMidenPG(...))?");return o}const ze=o=>o==null||typeof o!="object"?!1:Object.values(o).every(Boolean),Ht=o=>{const e={};return new URL(o).searchParams.forEach((r,n)=>{e[n]=r}),e},he=o=>o==="sandbox"?"https://sandbox-api.midencards.io/payment-gateway-api":"",vr=o=>o==="USD"?"$":o==="NGN"?"₦":o==="EUR"?"€":o==="GBP"?"£":o==="JPY"||o==="CNY"?"¥":o==="USDC"||o==="usdc"?"$⧫":o==="USDT"||o==="usdt"?"₮":"$",we=(o,e)=>{const t=typeof o=="string"?parseFloat(o):o;return isNaN(t)?"0":`${e?vr(e):""} ${t==null?void 0:t.toLocaleString("en-US")}`},mr=(o,e)=>o.length<=e?o:o.slice(0,e)+"...",Cr=o=>{const e=["Backspace","Tab","ArrowLeft","ArrowRight","Delete","Home","End","."];(o.ctrlKey||o.metaKey)&&["a","c","v","x"].includes(o.key.toLowerCase())||(!e.includes(o.key)&&!/^\d$/.test(o.key)&&o.preventDefault(),o.key==="."&&o.target.value.includes(".")&&o.preventDefault())},xe=(o,e)=>e.test(o);function gr(o){return o?o.split("|").map(e=>{const[t,r]=e.split(":");return{rule:t,value:r}}):[]}function Br(o,e,t){const r=[],n=gr(o),i=(t||"This field").toLowerCase(),u=e??"",l=Number(u),f=!Number.isNaN(l);for(const s of n)switch(s.rule){case"required":u||r.push(`The ${i} field is required`);break;case"alpha":xe(u,/^[a-zA-Z]+$/)||r.push(`The ${i} field must only contain alphabetic characters`);break;case"at_least_one_uppercase":xe(u,/.*[A-Z].*/)||r.push(`The ${i} field must contain at least one uppercase character`);break;case"at_least_one_lowercase":xe(u,/.*[a-z].*/)||r.push(`The ${i} field must contain at least one lowercase character`);break;case"at_least_one_number":xe(u,/.*\d.*/)||r.push(`The ${i} field must contain at least one number`);break;case"alpha_num":xe(u,/^[a-z0-9]+$/i)||r.push(`The ${i} field must only contain alphabetic characters and numbers`);break;case"num_spaces":xe(u,/^[0-9\s]+$/i)||r.push(`The ${i} field must only contain space and numbers`);break;case"alpha_spaces":xe(u,/^[A-Za-z\s]*$/)||r.push(`The ${i} field must only contain alphabetic characters and spaces`);break;case"numeric":xe(u,/^\d+$/)||r.push(`The ${i} field must only contain numbers`);break;case"no_special":xe(u,/[^a-zA-Z0-9\s]/)&&r.push(`The ${i} field must not contain special characters`);break;case"at_least_one_special":xe(u,/[^a-zA-Z0-9\s]/)||r.push(`The ${i} field must contain at least one special character`);break;case"email":xe(u,/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/)||r.push("Please enter a valid email address");break;case"is":s.value!==u&&r.push(`Value entered must be ${s.value}`);break;case"is_not":s.value===u&&r.push(`Value entered must not be ${s.value}`);break;case"char_length":u.length!==Number(s.value)&&r.push(`The ${i} field must be ${s.value} characters long`);break;case"min_char_length":u.length<Number(s.value)&&r.push(`The ${i} field must not be less than ${s.value} characters long`);break;case"max_char_length":u.length>Number(s.value)&&r.push(`The ${i} field must not be greater than ${s.value} characters long`);break;case"age":(!f||l!==Number(s.value))&&r.push(`Age entered must be ${s.value}`);break;case"min_age":(!f||l<Number(s.value))&&r.push(`Age entered must not be less than ${s.value}`);break;case"max_age":(!f||l>Number(s.value))&&r.push(`Age entered must not be greater than ${s.value}`);break;case"num_is":(!f||l!==Number(s.value))&&r.push(`Number entered must be ${s.value}`);break;case"num_is_not":f&&l===Number(s.value)&&r.push(`Number entered must not be ${s.value}`);break;case"min_number":(!f||l<Number(s.value))&&r.push(`Number entered must not be less than ${s.value}`);break;case"max_number":(!f||l>Number(s.value))&&r.push(`Number entered must not be greater than ${s.value}`);break}return r.length>0?r[0]:null}const je=(o,e,t)=>{const r={};for(const[n,i]of Object.entries(e)){if(!i)continue;const u=(t==null?void 0:t[n])??n,l=Br(i,o[n]??"",u);l&&(r[n]=l)}return r};var L0=(o=>(o[o.Visa=1]="Visa",o[o.MasterCard=2]="MasterCard",o[o.Verve=3]="Verve",o[o.MastercardAndVisa=4]="MastercardAndVisa",o[o.AmericanExpress=5]="AmericanExpress",o[o.Discover=6]="Discover",o[o.JCB=7]="JCB",o[o.DinersClub=8]="DinersClub",o[o.Maestro=9]="Maestro",o[o.UnionPay=10]="UnionPay",o[o.UnionPay3DS=11]="UnionPay3DS",o[o.UnionPayNon3DS=12]="UnionPayNon3DS",o[o.UATP=13]="UATP",o[o.PayPak=14]="PayPak",o[o.Jaywan=15]="Jaywan",o[o.Mada=16]="Mada",o[o.MadaVisa=17]="MadaVisa",o[o.MadaMastercard=18]="MadaMastercard",o[o.Unknown=19]="Unknown",o))(L0||{});const e0=/^4\d{12}(\d{3}){0,2}$/,t0=/^(?:5[1-5]\d{14}|2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d{2}|7(?:[01]\d|20))\d{12})(?:\d{0,3})?$/,_r=/^(34|37)\d{13}$/,Er=/^(?:6011|65|64[4-9]|622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9(?:0\d|1\d|2[0-5])))\d{12,15}$/,yr=/^(?:35(?:2[8-9]|[3-8]\d))\d{12,15}$/,kr=/^(?:3(?:0[0-5]\d|095|6\d|[89]\d))\d{11,13}$/,Ar=/^(?:50|5[6-9]|6[0-9])\d{10,17}$/,et=/^62\d{14,17}$/,br=/^1\d{14}$/,Fr=[[506099,506198],[650002,650027]],Dr=new Set([507865,507866]),wr=new Set([220545,220543]),Sr=new Set([6690109]),Vr=new Set([968209,873646]),Nr=new Set([422818,486094]),Rr=new Set([529741,543357]),Ir=new Set([620108]),Tr=new Set([621423]);function Mr(o){const e=Pr(o);return L0[e]}function Pr(o){if(!o||!o.trim())return 19;const e=o.replace(/\D/g,"");if(e.length<12||e.length>19)return 19;if(e.length>=6){const t=parseInt(e.slice(0,6),10);if(Vr.has(t)&&e.length>=16&&e.length<=19)return 16;if(Nr.has(t)&&e0.test(e))return 17;if(Rr.has(t)&&t0.test(e))return 18;if(wr.has(t)&&e.length===16)return 14;if(Ir.has(t)&&et.test(e))return 11;if(Tr.has(t)&&et.test(e))return 12;if(Or(t,e.length))return 3}if(e.length>=7){const t=parseInt(e.slice(0,7),10);if(Sr.has(t)&&e.length===16)return 15}return br.test(e)?13:_r.test(e)?5:Er.test(e)?6:yr.test(e)?7:kr.test(e)?8:t0.test(e)?2:e0.test(e)?1:et.test(e)?10:Ar.test(e)?9:19}function Or(o,e){return e<16||e>19?!1:Fr.some(([r,n])=>o>=r&&o<=n)||Dr.has(o)}const Hr=["width","height"],$r=["stroke"],Lr=["fill"],z0=a.defineComponent({__name:"icon-loader",props:{size:{default:24},color:{default:"currentColor"},className:{default:""}},setup(o){const e=o,t=a.useAttrs(),{size:r,color:n,className:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({class:["animate-spin",a.unref(i)],xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:a.unref(r),height:a.unref(r),role:"img","aria-label":"loading"},a.unref(t)),[a.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:a.unref(n),"stroke-width":"4"},null,8,$r),a.createElementVNode("path",{class:"opacity-75",fill:a.unref(n),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,8,Lr)],16,Hr))}}),zr=["disabled"],Ur={key:1},Se=a.defineComponent({__name:"button",props:{label:{default:""},type:{default:"neutral"},size:{default:"de"},paddingClassX:{default:"px-8"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},customClass:{default:""}},emits:["click"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.disabled||t.loading);function i(){n.value||r("click")}function u(s,d){if(d)return"bg-gray-200 text-gray-400 cursor-not-allowed border-gray-200";switch(s){case"primary":return"bg-primary text-white hover:bg-primary-black hover:border-primary-black border-primary";case"secondary":return"bg-gray-200 border-gray-200 hover:bg-gray-300 text-heading-text";case"danger":return"bg-red-500 border-red-500 text-white hover:bg-red-600";case"neutral":default:return"bg-off-white border-grey-border hover:bg-gray-100"}}function l(s){switch(s){case"de":return"h-68px rounded-xl";case"md":return"h-42px rounded-lg";case"sm":return"h-32px rounded-md";default:return"h-68px rounded-xl"}}function f(s){switch(s){case"de":case"md":case"sm":return"text-body-2xs font-normal";default:return"text-body-xs font-normal"}}return(s,d)=>(a.openBlock(),a.createElementBlock("button",{class:a.normalizeClass(["flex items-center justify-center gap-2 py-3 border font-normal text-input-grey transition-colors duration-300 ease-in-out",u(s.type,n.value),l(s.size),s.paddingClassX,s.customClass]),type:"button",disabled:n.value,onClick:i},[a.renderSlot(s.$slots,"prefix"),s.loading?(a.openBlock(),a.createBlock(z0,{key:0})):(a.openBlock(),a.createElementBlock("div",Ur,[s.label?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(["mb-0",f(s.size)])},a.toDisplayString(s.label),3)):a.renderSlot(s.$slots,"default",{key:1})])),a.renderSlot(s.$slots,"suffix")],10,zr))}}),qr={class:"mb-0 text-body-3xs font-normal text-red-500"},U0=a.defineComponent({__name:"input-error",props:{errorMessage:{}},setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("p",qr,a.toDisplayString(e.errorMessage),1))}});async function Ue(o,e,t){try{const r=he(e);return await(await fetch(`${r}/api/v1/checkout/generate-payment-link2`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t},body:JSON.stringify({...o,LinkName:`${Date.now()}-Link`})})).json()}catch{}}async function jr(o,{merchantId:e,...t}){try{const r=he(o);return await(await fetch(`${r}/api/v1/checkout/authorize-card-3ds-payment`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}async function Kr(o,{merchantId:e,...t}){try{const r=he(o);return await(await fetch(`${r}/api/v1/checkout/generate-payment-account`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}async function q0(o,e){try{const t=he(o);return await(await fetch(`${t}/api/v1/checkout/details/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}async function Wr(o,{merchantId:e,...t}){try{const r=he(o);return await(await fetch(`${r}/api/v1/checkout/generate-payment-walletaddress`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e},body:JSON.stringify(t)})).json()}catch{}}const Gr={key:0,class:"absolute inset-0 grid place-items-center bg-white/60"},j0=a.defineComponent({__name:"checkout-iframe",props:{style:{default:()=>({width:"100%",height:"100vh",border:"0",borderRadius:"6px",overflow:"hidden"})},url:{default:void 0},secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})}},setup(o){const e=o,t=a.computed(()=>({...e.style})),r=a.ref(null),n=a.ref(null),i=a.ref(""),u=a.ref(!1);function l(){n.value&&n.value.parentNode&&n.value.parentNode.removeChild(n.value),n.value=null}function f(d){var v;l();const g=document.createElement("iframe");g.src=d;const c=e.style;c.width&&(g.style.width=c.width),c.height&&(g.style.height=c.height),c.border&&(g.style.border=c.border),c.borderRadius&&(g.style.borderRadius=c.borderRadius),c.overflow&&(g.style.overflow=c.overflow),(v=r.value)==null||v.appendChild(g),n.value=g}async function s(){if(e.url){f(e.url);return}if(!e.secretKey){i.value="Secret key is required.";return}if(!ze(e.paymentObject)){i.value="Kindly ensure you are passing all the required data.";return}u.value=!0,i.value="";try{const d=await Ue(e.paymentObject,e.environment,e.secretKey);d!=null&&d.isSuccessful&&d.launchUrl?(i.value="Payment link created successfully",f(d.launchUrl)):i.value="Failed to create payment link"}catch(d){i.value=(d==null?void 0:d.message)||"Failed to create payment link"}finally{u.value=!1}}return a.onMounted(()=>{r.value&&s()}),a.watch(()=>e.url,d=>{d&&f(d)}),a.onBeforeUnmount(()=>{l()}),(d,g)=>(a.openBlock(),a.createElementBlock("div",{class:"relative",style:a.normalizeStyle(t.value)},[a.createElementVNode("div",{ref_key:"containerRef",ref:r,class:"w-full h-full"},null,512),u.value?(a.openBlock(),a.createElementBlock("div",Gr,[a.createVNode(z0)])):a.createCommentVNode("",!0)],4))}}),Zr={key:1},Xr=a.defineComponent({__name:"checkout-button",props:{secretKey:{},environment:{default:"sandbox"},paymentObject:{default:()=>({amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""})},mode:{default:"redirect"}},setup(o){const e=o,t=a.ref(""),r=a.ref(""),n=a.ref(!1);async function i(){if(!e.secretKey){t.value="Secret key is required.";return}if(!ze(e.paymentObject)){t.value="Kindly ensure you are passing all the required data.";return}n.value=!0,t.value="";try{const s=await Ue(e.paymentObject,e.environment,e.secretKey);s!=null&&s.isSuccessful&&s.launchUrl?(r.value=s.launchUrl,t.value="Payment link created successfully",e.mode==="redirect"&&window.open(s.launchUrl,"_blank","noopener,noreferrer")):t.value="Failed to create payment link"}catch(s){t.value=(s==null?void 0:s.message)||"Failed to create payment link"}finally{n.value=!1}}const{secretKey:u,environment:l,mode:f}=e;return(s,d)=>r.value&&a.unref(f)==="iframe"?(a.openBlock(),a.createBlock(j0,{key:0,url:r.value,secretKey:a.unref(u),environment:a.unref(l)},null,8,["url","secretKey","environment"])):(a.openBlock(),a.createElementBlock("div",Zr,[a.createVNode(Se,{label:"Pay",type:"primary",customClass:"w-full",loading:n.value,onClick:i},null,8,["loading"]),a.createVNode(U0,{errorMessage:t.value},null,8,["errorMessage"])]))}}),Yr=["width","height"],Qr=["fill"],Jr=a.defineComponent({__name:"icon-chevron-left",props:{width:{default:17},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M10.5 14.28C10.3734 14.28 10.2467 14.2333 10.1467 14.1333L5.80002 9.78668C5.09335 9.08001 5.09335 7.92001 5.80002 7.21335L10.1467 2.86668C10.34 2.67335 10.66 2.67335 10.8534 2.86668C11.0467 3.06001 11.0467 3.38001 10.8534 3.57335L6.50669 7.92001C6.18669 8.24001 6.18669 8.76001 6.50669 9.08001L10.8534 13.4267C11.0467 13.62 11.0467 13.94 10.8534 14.1333C10.7534 14.2267 10.6267 14.28 10.5 14.28Z",fill:a.unref(i)},null,8,Qr)],16,Yr))}}),ea=a.defineComponent({__name:"back",emits:["back"],setup(o,{emit:e}){return(t,r)=>(a.openBlock(),a.createElementBlock("div",{class:"flex items-center gap-2 cursor-pointer",onClick:r[0]||(r[0]=n=>t.$emit("back"))},[a.createVNode(Jr),r[1]||(r[1]=a.createElementVNode("p",{class:"mb-0 text-body-xs font-normal"},"Back",-1))]))}}),ta=["width","height"],ra=["fill"],aa=a.defineComponent({__name:"icon-buzapay-icon",props:{width:{default:15},height:{default:13},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 15 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M9.97919 0.5C10.8854 0.5 11.6276 0.585938 12.2057 0.757812C12.7891 0.924479 13.2188 1.22396 13.4948 1.65625C13.7761 2.08333 13.9167 2.6901 13.9167 3.47656C13.9167 4.1849 13.7526 4.77083 13.4245 5.23438C13.0964 5.69792 12.5938 5.95312 11.9167 6C12.8021 6.08854 13.4401 6.40625 13.8307 6.95312C14.2214 7.49479 14.4167 8.17708 14.4167 9C14.4167 9.71354 14.3334 10.2995 14.1667 10.7578C14.0052 11.2161 13.7318 11.5729 13.3464 11.8281C12.961 12.0781 12.4375 12.2526 11.7761 12.3516C11.1198 12.4505 10.2995 12.5 9.31512 12.5H0.416687V0.5H9.97919ZM2.91669 7.77344H5.97235V11.167L10.2497 5.22754H7.19501V1.83398L2.91669 7.77344ZM5.97235 6.07617H8.2702L7.19501 7.57324V6.9248H4.89716L5.97235 5.42676V6.07617Z",fill:a.unref(i)},null,8,ra)],16,ta))}}),na={class:"checkout-card w-full h-screen flex flex-col items-center justify-center text-white"},sa={class:"flex w-1/2"},ia={class:"flex gap-2 w-full"},oa={class:"flex flex-col gap-8 w-full"},la={class:"bg-off-white rounded-xl"},ua={class:"flex items-center gap-2 justify-center"},ca=a.defineComponent({__name:"card",props:{showBackButton:{type:Boolean,default:!1}},emits:["back","close"],setup(o,{emit:e}){const t=e;return(r,n)=>(a.openBlock(),a.createElementBlock("div",na,[a.createElementVNode("div",sa,[r.showBackButton?(a.openBlock(),a.createBlock(ea,{key:0,onBack:n[0]||(n[0]=i=>t("back"))})):a.createCommentVNode("",!0),a.createElementVNode("div",ia,[a.createElementVNode("div",oa,[a.createElementVNode("div",la,[a.renderSlot(r.$slots,"default")]),a.createElementVNode("div",ua,[n[2]||(n[2]=a.createElementVNode("p",{class:"text-light-white-100 text-body-2xs font-regular"}," Powered by Buzapay ",-1)),a.createVNode(aa,{color:"#E8F4FF"})])]),a.createElementVNode("div",{class:"close-icon flex flex-col items-center justify-center self-start cursor-pointer hover:bg-gray-500",onClick:n[1]||(n[1]=i=>t("close")),role:"button","aria-label":"Close"},[...n[3]||(n[3]=[a.createElementVNode("p",{class:"text-white"},"x",-1)])])])])]))}}),da=["aria-orientation"],xa=["aria-checked","onClick"],ha={key:0,class:"bg-white w-2 h-2 rounded-full"},fa={class:"mb-0 text-body-2xs font-medium text-heading-text"},pa=a.defineComponent({__name:"radio-group",props:{options:{default:()=>[]},type:{default:"vertical"},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""}},emits:["update:modelValue","selectedChange"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.modelValue!==void 0),i=a.ref("");a.onMounted(()=>{if(n.value)return;const c=t.defaultValue??(t.options.length?t.options[0].value:"");i.value=c,c&&(r("update:modelValue",c),r("selectedChange",c))}),a.watch(()=>t.modelValue,c=>{n.value&&(i.value=c??"")},{immediate:!0});const u=a.computed(()=>n.value?t.modelValue??"":i.value);function l(c){n.value||(i.value=c),r("update:modelValue",c),r("selectedChange",c)}const f=a.computed(()=>t.type==="horizontal"?"flex-row gap-5":"flex-col gap-6"),{options:s,type:d,className:g}=t;return(c,v)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex",f.value,a.unref(g)]),role:"radiogroup","aria-orientation":a.unref(d)==="horizontal"?"horizontal":"vertical",tabindex:"0"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(s),x=>(a.openBlock(),a.createElementBlock("div",{key:x.value,role:"radio","aria-checked":u.value===x.value,tabindex:"-1",onClick:C=>l(x.value),class:"flex items-center gap-2 cursor-pointer transition-colors duration-200"},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 rounded-full border flex items-center justify-center",u.value===x.value?"bg-orange-500 border-orange-500":"bg-white border-grey-200"])},[u.value===x.value?(a.openBlock(),a.createElementBlock("div",ha)):a.createCommentVNode("",!0)],2),a.createElementVNode("p",fa,a.toDisplayString(x.label),1)],8,xa))),128))],10,da))}}),va=["src","height","alt"],ke=a.defineComponent({__name:"image",props:{src:{},height:{default:50},width:{default:50},alt:{default:"Image"},customClass:{default:""},isFullWidth:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:e}){const t=o,r=e,{src:n,height:i,width:u,alt:l,customClass:f,isFullWidth:s}=t;return(d,g)=>(a.openBlock(),a.createElementBlock("img",{src:a.unref(n),height:a.unref(i),alt:a.unref(l),class:a.normalizeClass([a.unref(f),a.unref(s)?"w-full":""]),style:a.normalizeStyle({width:a.unref(s)?"100%":a.unref(u)+"px"}),onClick:g[0]||(g[0]=c=>r("click"))},null,14,va))}});var W=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ma(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function Ca(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(o).forEach(function(r){var n=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return o[r]}})}),t}var K0={exports:{}};function ga(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tt={exports:{}};const Ba={},_a=Object.freeze(Object.defineProperty({__proto__:null,default:Ba},Symbol.toStringTag,{value:"Module"})),Ea=Ca(_a);var r0;function G(){return r0||(r0=1,function(o,e){(function(t,r){o.exports=r()})(W,function(){var t=t||function(r,n){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof W<"u"&&W.crypto&&(i=W.crypto),!i&&typeof ga=="function")try{i=Ea}catch{}var u=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function h(){}return function(m){var B;return h.prototype=m,B=new h,h.prototype=null,B}}(),f={},s=f.lib={},d=s.Base=function(){return{extend:function(h){var m=l(this);return h&&m.mixIn(h),(!m.hasOwnProperty("init")||this.init===m.init)&&(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var m in h)h.hasOwnProperty(m)&&(this[m]=h[m]);h.hasOwnProperty("toString")&&(this.toString=h.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=s.WordArray=d.extend({init:function(h,m){h=this.words=h||[],m!=n?this.sigBytes=m:this.sigBytes=h.length*4},toString:function(h){return(h||v).stringify(this)},concat:function(h){var m=this.words,B=h.words,b=this.sigBytes,A=h.sigBytes;if(this.clamp(),b%4)for(var w=0;w<A;w++){var V=B[w>>>2]>>>24-w%4*8&255;m[b+w>>>2]|=V<<24-(b+w)%4*8}else for(var T=0;T<A;T+=4)m[b+T>>>2]=B[T>>>2];return this.sigBytes+=A,this},clamp:function(){var h=this.words,m=this.sigBytes;h[m>>>2]&=4294967295<<32-m%4*8,h.length=r.ceil(m/4)},clone:function(){var h=d.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var m=[],B=0;B<h;B+=4)m.push(u());return new g.init(m,h)}}),c=f.enc={},v=c.Hex={stringify:function(h){for(var m=h.words,B=h.sigBytes,b=[],A=0;A<B;A++){var w=m[A>>>2]>>>24-A%4*8&255;b.push((w>>>4).toString(16)),b.push((w&15).toString(16))}return b.join("")},parse:function(h){for(var m=h.length,B=[],b=0;b<m;b+=2)B[b>>>3]|=parseInt(h.substr(b,2),16)<<24-b%8*4;return new g.init(B,m/2)}},x=c.Latin1={stringify:function(h){for(var m=h.words,B=h.sigBytes,b=[],A=0;A<B;A++){var w=m[A>>>2]>>>24-A%4*8&255;b.push(String.fromCharCode(w))}return b.join("")},parse:function(h){for(var m=h.length,B=[],b=0;b<m;b++)B[b>>>2]|=(h.charCodeAt(b)&255)<<24-b%4*8;return new g.init(B,m)}},C=c.Utf8={stringify:function(h){try{return decodeURIComponent(escape(x.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return x.parse(unescape(encodeURIComponent(h)))}},p=s.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=C.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var m,B=this._data,b=B.words,A=B.sigBytes,w=this.blockSize,V=w*4,T=A/V;h?T=r.ceil(T):T=r.max((T|0)-this._minBufferSize,0);var k=T*w,S=r.min(k*4,A);if(k){for(var F=0;F<k;F+=w)this._doProcessBlock(b,F);m=b.splice(0,k),B.sigBytes-=S}return new g.init(m,S)},clone:function(){var h=d.clone.call(this);return h._data=this._data.clone(),h},_minBufferSize:0});s.Hasher=p.extend({cfg:d.extend(),init:function(h){this.cfg=this.cfg.extend(h),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(h){return this._append(h),this._process(),this},finalize:function(h){h&&this._append(h);var m=this._doFinalize();return m},blockSize:16,_createHelper:function(h){return function(m,B){return new h.init(B).finalize(m)}},_createHmacHelper:function(h){return function(m,B){return new E.HMAC.init(h,B).finalize(m)}}});var E=f.algo={};return f}(Math);return t})}(tt)),tt.exports}var rt={exports:{}},a0;function Ze(){return a0||(a0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,i=n.lib,u=i.Base,l=i.WordArray,f=n.x64={};f.Word=u.extend({init:function(s,d){this.high=s,this.low=d}}),f.WordArray=u.extend({init:function(s,d){s=this.words=s||[],d!=r?this.sigBytes=d:this.sigBytes=s.length*8},toX32:function(){for(var s=this.words,d=s.length,g=[],c=0;c<d;c++){var v=s[c];g.push(v.high),g.push(v.low)}return l.create(g,this.sigBytes)},clone:function(){for(var s=u.clone.call(this),d=s.words=this.words.slice(0),g=d.length,c=0;c<g;c++)d[c]=d[c].clone();return s}})}(),t})}(rt)),rt.exports}var at={exports:{}},n0;function ya(){return n0||(n0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){if(typeof ArrayBuffer=="function"){var r=t,n=r.lib,i=n.WordArray,u=i.init,l=i.init=function(f){if(f instanceof ArrayBuffer&&(f=new Uint8Array(f)),(f instanceof Int8Array||typeof Uint8ClampedArray<"u"&&f instanceof Uint8ClampedArray||f instanceof Int16Array||f instanceof Uint16Array||f instanceof Int32Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array)&&(f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength)),f instanceof Uint8Array){for(var s=f.byteLength,d=[],g=0;g<s;g++)d[g>>>2]|=f[g]<<24-g%4*8;u.call(this,d,s)}else u.apply(this,arguments)};l.prototype=i}}(),t.lib.WordArray})}(at)),at.exports}var nt={exports:{}},s0;function ka(){return s0||(s0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=r.enc;u.Utf16=u.Utf16BE={stringify:function(f){for(var s=f.words,d=f.sigBytes,g=[],c=0;c<d;c+=2){var v=s[c>>>2]>>>16-c%4*8&65535;g.push(String.fromCharCode(v))}return g.join("")},parse:function(f){for(var s=f.length,d=[],g=0;g<s;g++)d[g>>>1]|=f.charCodeAt(g)<<16-g%2*16;return i.create(d,s*2)}},u.Utf16LE={stringify:function(f){for(var s=f.words,d=f.sigBytes,g=[],c=0;c<d;c+=2){var v=l(s[c>>>2]>>>16-c%4*8&65535);g.push(String.fromCharCode(v))}return g.join("")},parse:function(f){for(var s=f.length,d=[],g=0;g<s;g++)d[g>>>1]|=l(f.charCodeAt(g)<<16-g%2*16);return i.create(d,s*2)}};function l(f){return f<<8&4278255360|f>>>8&16711935}}(),t.enc.Utf16})}(nt)),nt.exports}var st={exports:{}},i0;function Ve(){return i0||(i0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=r.enc;u.Base64={stringify:function(f){var s=f.words,d=f.sigBytes,g=this._map;f.clamp();for(var c=[],v=0;v<d;v+=3)for(var x=s[v>>>2]>>>24-v%4*8&255,C=s[v+1>>>2]>>>24-(v+1)%4*8&255,p=s[v+2>>>2]>>>24-(v+2)%4*8&255,E=x<<16|C<<8|p,h=0;h<4&&v+h*.75<d;h++)c.push(g.charAt(E>>>6*(3-h)&63));var m=g.charAt(64);if(m)for(;c.length%4;)c.push(m);return c.join("")},parse:function(f){var s=f.length,d=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var c=0;c<d.length;c++)g[d.charCodeAt(c)]=c}var v=d.charAt(64);if(v){var x=f.indexOf(v);x!==-1&&(s=x)}return l(f,s,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(f,s,d){for(var g=[],c=0,v=0;v<s;v++)if(v%4){var x=d[f.charCodeAt(v-1)]<<v%4*2,C=d[f.charCodeAt(v)]>>>6-v%4*2,p=x|C;g[c>>>2]|=p<<24-c%4*8,c++}return i.create(g,c)}}(),t.enc.Base64})}(st)),st.exports}var it={exports:{}},o0;function Aa(){return o0||(o0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=r.enc;u.Base64url={stringify:function(f,s){s===void 0&&(s=!0);var d=f.words,g=f.sigBytes,c=s?this._safe_map:this._map;f.clamp();for(var v=[],x=0;x<g;x+=3)for(var C=d[x>>>2]>>>24-x%4*8&255,p=d[x+1>>>2]>>>24-(x+1)%4*8&255,E=d[x+2>>>2]>>>24-(x+2)%4*8&255,h=C<<16|p<<8|E,m=0;m<4&&x+m*.75<g;m++)v.push(c.charAt(h>>>6*(3-m)&63));var B=c.charAt(64);if(B)for(;v.length%4;)v.push(B);return v.join("")},parse:function(f,s){s===void 0&&(s=!0);var d=f.length,g=s?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var v=0;v<g.length;v++)c[g.charCodeAt(v)]=v}var x=g.charAt(64);if(x){var C=f.indexOf(x);C!==-1&&(d=C)}return l(f,d,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(f,s,d){for(var g=[],c=0,v=0;v<s;v++)if(v%4){var x=d[f.charCodeAt(v-1)]<<v%4*2,C=d[f.charCodeAt(v)]>>>6-v%4*2,p=x|C;g[c>>>2]|=p<<24-c%4*8,c++}return i.create(g,c)}}(),t.enc.Base64url})}(it)),it.exports}var ot={exports:{}},l0;function Ne(){return l0||(l0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,i=n.lib,u=i.WordArray,l=i.Hasher,f=n.algo,s=[];(function(){for(var C=0;C<64;C++)s[C]=r.abs(r.sin(C+1))*4294967296|0})();var d=f.MD5=l.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(C,p){for(var E=0;E<16;E++){var h=p+E,m=C[h];C[h]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}var B=this._hash.words,b=C[p+0],A=C[p+1],w=C[p+2],V=C[p+3],T=C[p+4],k=C[p+5],S=C[p+6],F=C[p+7],_=C[p+8],y=C[p+9],M=C[p+10],$=C[p+11],L=C[p+12],H=C[p+13],P=C[p+14],O=C[p+15],D=B[0],R=B[1],I=B[2],N=B[3];D=g(D,R,I,N,b,7,s[0]),N=g(N,D,R,I,A,12,s[1]),I=g(I,N,D,R,w,17,s[2]),R=g(R,I,N,D,V,22,s[3]),D=g(D,R,I,N,T,7,s[4]),N=g(N,D,R,I,k,12,s[5]),I=g(I,N,D,R,S,17,s[6]),R=g(R,I,N,D,F,22,s[7]),D=g(D,R,I,N,_,7,s[8]),N=g(N,D,R,I,y,12,s[9]),I=g(I,N,D,R,M,17,s[10]),R=g(R,I,N,D,$,22,s[11]),D=g(D,R,I,N,L,7,s[12]),N=g(N,D,R,I,H,12,s[13]),I=g(I,N,D,R,P,17,s[14]),R=g(R,I,N,D,O,22,s[15]),D=c(D,R,I,N,A,5,s[16]),N=c(N,D,R,I,S,9,s[17]),I=c(I,N,D,R,$,14,s[18]),R=c(R,I,N,D,b,20,s[19]),D=c(D,R,I,N,k,5,s[20]),N=c(N,D,R,I,M,9,s[21]),I=c(I,N,D,R,O,14,s[22]),R=c(R,I,N,D,T,20,s[23]),D=c(D,R,I,N,y,5,s[24]),N=c(N,D,R,I,P,9,s[25]),I=c(I,N,D,R,V,14,s[26]),R=c(R,I,N,D,_,20,s[27]),D=c(D,R,I,N,H,5,s[28]),N=c(N,D,R,I,w,9,s[29]),I=c(I,N,D,R,F,14,s[30]),R=c(R,I,N,D,L,20,s[31]),D=v(D,R,I,N,k,4,s[32]),N=v(N,D,R,I,_,11,s[33]),I=v(I,N,D,R,$,16,s[34]),R=v(R,I,N,D,P,23,s[35]),D=v(D,R,I,N,A,4,s[36]),N=v(N,D,R,I,T,11,s[37]),I=v(I,N,D,R,F,16,s[38]),R=v(R,I,N,D,M,23,s[39]),D=v(D,R,I,N,H,4,s[40]),N=v(N,D,R,I,b,11,s[41]),I=v(I,N,D,R,V,16,s[42]),R=v(R,I,N,D,S,23,s[43]),D=v(D,R,I,N,y,4,s[44]),N=v(N,D,R,I,L,11,s[45]),I=v(I,N,D,R,O,16,s[46]),R=v(R,I,N,D,w,23,s[47]),D=x(D,R,I,N,b,6,s[48]),N=x(N,D,R,I,F,10,s[49]),I=x(I,N,D,R,P,15,s[50]),R=x(R,I,N,D,k,21,s[51]),D=x(D,R,I,N,L,6,s[52]),N=x(N,D,R,I,V,10,s[53]),I=x(I,N,D,R,M,15,s[54]),R=x(R,I,N,D,A,21,s[55]),D=x(D,R,I,N,_,6,s[56]),N=x(N,D,R,I,O,10,s[57]),I=x(I,N,D,R,S,15,s[58]),R=x(R,I,N,D,H,21,s[59]),D=x(D,R,I,N,T,6,s[60]),N=x(N,D,R,I,$,10,s[61]),I=x(I,N,D,R,w,15,s[62]),R=x(R,I,N,D,y,21,s[63]),B[0]=B[0]+D|0,B[1]=B[1]+R|0,B[2]=B[2]+I|0,B[3]=B[3]+N|0},_doFinalize:function(){var C=this._data,p=C.words,E=this._nDataBytes*8,h=C.sigBytes*8;p[h>>>5]|=128<<24-h%32;var m=r.floor(E/4294967296),B=E;p[(h+64>>>9<<4)+15]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,p[(h+64>>>9<<4)+14]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,C.sigBytes=(p.length+1)*4,this._process();for(var b=this._hash,A=b.words,w=0;w<4;w++){var V=A[w];A[w]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360}return b},clone:function(){var C=l.clone.call(this);return C._hash=this._hash.clone(),C}});function g(C,p,E,h,m,B,b){var A=C+(p&E|~p&h)+m+b;return(A<<B|A>>>32-B)+p}function c(C,p,E,h,m,B,b){var A=C+(p&h|E&~h)+m+b;return(A<<B|A>>>32-B)+p}function v(C,p,E,h,m,B,b){var A=C+(p^E^h)+m+b;return(A<<B|A>>>32-B)+p}function x(C,p,E,h,m,B,b){var A=C+(E^(p|~h))+m+b;return(A<<B|A>>>32-B)+p}n.MD5=l._createHelper(d),n.HmacMD5=l._createHmacHelper(d)}(Math),t.MD5})}(ot)),ot.exports}var lt={exports:{}},u0;function W0(){return u0||(u0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=n.Hasher,l=r.algo,f=[],s=l.SHA1=u.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,g){for(var c=this._hash.words,v=c[0],x=c[1],C=c[2],p=c[3],E=c[4],h=0;h<80;h++){if(h<16)f[h]=d[g+h]|0;else{var m=f[h-3]^f[h-8]^f[h-14]^f[h-16];f[h]=m<<1|m>>>31}var B=(v<<5|v>>>27)+E+f[h];h<20?B+=(x&C|~x&p)+1518500249:h<40?B+=(x^C^p)+1859775393:h<60?B+=(x&C|x&p|C&p)-1894007588:B+=(x^C^p)-899497514,E=p,p=C,C=x<<30|x>>>2,x=v,v=B}c[0]=c[0]+v|0,c[1]=c[1]+x|0,c[2]=c[2]+C|0,c[3]=c[3]+p|0,c[4]=c[4]+E|0},_doFinalize:function(){var d=this._data,g=d.words,c=this._nDataBytes*8,v=d.sigBytes*8;return g[v>>>5]|=128<<24-v%32,g[(v+64>>>9<<4)+14]=Math.floor(c/4294967296),g[(v+64>>>9<<4)+15]=c,d.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var d=u.clone.call(this);return d._hash=this._hash.clone(),d}});r.SHA1=u._createHelper(s),r.HmacSHA1=u._createHmacHelper(s)}(),t.SHA1})}(lt)),lt.exports}var ut={exports:{}},c0;function $t(){return c0||(c0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){return function(r){var n=t,i=n.lib,u=i.WordArray,l=i.Hasher,f=n.algo,s=[],d=[];(function(){function v(E){for(var h=r.sqrt(E),m=2;m<=h;m++)if(!(E%m))return!1;return!0}function x(E){return(E-(E|0))*4294967296|0}for(var C=2,p=0;p<64;)v(C)&&(p<8&&(s[p]=x(r.pow(C,1/2))),d[p]=x(r.pow(C,1/3)),p++),C++})();var g=[],c=f.SHA256=l.extend({_doReset:function(){this._hash=new u.init(s.slice(0))},_doProcessBlock:function(v,x){for(var C=this._hash.words,p=C[0],E=C[1],h=C[2],m=C[3],B=C[4],b=C[5],A=C[6],w=C[7],V=0;V<64;V++){if(V<16)g[V]=v[x+V]|0;else{var T=g[V-15],k=(T<<25|T>>>7)^(T<<14|T>>>18)^T>>>3,S=g[V-2],F=(S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10;g[V]=k+g[V-7]+F+g[V-16]}var _=B&b^~B&A,y=p&E^p&h^E&h,M=(p<<30|p>>>2)^(p<<19|p>>>13)^(p<<10|p>>>22),$=(B<<26|B>>>6)^(B<<21|B>>>11)^(B<<7|B>>>25),L=w+$+_+d[V]+g[V],H=M+y;w=A,A=b,b=B,B=m+L|0,m=h,h=E,E=p,p=L+H|0}C[0]=C[0]+p|0,C[1]=C[1]+E|0,C[2]=C[2]+h|0,C[3]=C[3]+m|0,C[4]=C[4]+B|0,C[5]=C[5]+b|0,C[6]=C[6]+A|0,C[7]=C[7]+w|0},_doFinalize:function(){var v=this._data,x=v.words,C=this._nDataBytes*8,p=v.sigBytes*8;return x[p>>>5]|=128<<24-p%32,x[(p+64>>>9<<4)+14]=r.floor(C/4294967296),x[(p+64>>>9<<4)+15]=C,v.sigBytes=x.length*4,this._process(),this._hash},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});n.SHA256=l._createHelper(c),n.HmacSHA256=l._createHmacHelper(c)}(Math),t.SHA256})}(ut)),ut.exports}var ct={exports:{}},d0;function ba(){return d0||(d0=1,function(o,e){(function(t,r,n){o.exports=r(G(),$t())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=r.algo,l=u.SHA256,f=u.SHA224=l.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var s=l._doFinalize.call(this);return s.sigBytes-=4,s}});r.SHA224=l._createHelper(f),r.HmacSHA224=l._createHmacHelper(f)}(),t.SHA224})}(ct)),ct.exports}var dt={exports:{}},x0;function G0(){return x0||(x0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ze())})(W,function(t){return function(){var r=t,n=r.lib,i=n.Hasher,u=r.x64,l=u.Word,f=u.WordArray,s=r.algo;function d(){return l.create.apply(l,arguments)}var g=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],c=[];(function(){for(var x=0;x<80;x++)c[x]=d()})();var v=s.SHA512=i.extend({_doReset:function(){this._hash=new f.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(x,C){for(var p=this._hash.words,E=p[0],h=p[1],m=p[2],B=p[3],b=p[4],A=p[5],w=p[6],V=p[7],T=E.high,k=E.low,S=h.high,F=h.low,_=m.high,y=m.low,M=B.high,$=B.low,L=b.high,H=b.low,P=A.high,O=A.low,D=w.high,R=w.low,I=V.high,N=V.low,X=T,Z=k,Q=S,j=F,ge=_,ve=y,Re=M,Be=$,ae=L,ee=H,Fe=P,_e=O,fe=D,Y=R,oe=I,de=N,le=0;le<80;le++){var ne,U,Ee=c[le];if(le<16)U=Ee.high=x[C+le*2]|0,ne=Ee.low=x[C+le*2+1]|0;else{var Ie=c[le-15],Te=Ie.high,Pe=Ie.low,tr=(Te>>>1|Pe<<31)^(Te>>>8|Pe<<24)^Te>>>7,Ut=(Pe>>>1|Te<<31)^(Pe>>>8|Te<<24)^(Pe>>>7|Te<<25),qt=c[le-2],Me=qt.high,Oe=qt.low,rr=(Me>>>19|Oe<<13)^(Me<<3|Oe>>>29)^Me>>>6,jt=(Oe>>>19|Me<<13)^(Oe<<3|Me>>>29)^(Oe>>>6|Me<<26),Kt=c[le-7],ar=Kt.high,nr=Kt.low,Wt=c[le-16],sr=Wt.high,Gt=Wt.low;ne=Ut+nr,U=tr+ar+(ne>>>0<Ut>>>0?1:0),ne=ne+jt,U=U+rr+(ne>>>0<jt>>>0?1:0),ne=ne+Gt,U=U+sr+(ne>>>0<Gt>>>0?1:0),Ee.high=U,Ee.low=ne}var ir=ae&Fe^~ae&fe,Zt=ee&_e^~ee&Y,or=X&Q^X&ge^Q&ge,lr=Z&j^Z&ve^j&ve,ur=(X>>>28|Z<<4)^(X<<30|Z>>>2)^(X<<25|Z>>>7),Xt=(Z>>>28|X<<4)^(Z<<30|X>>>2)^(Z<<25|X>>>7),cr=(ae>>>14|ee<<18)^(ae>>>18|ee<<14)^(ae<<23|ee>>>9),dr=(ee>>>14|ae<<18)^(ee>>>18|ae<<14)^(ee<<23|ae>>>9),Yt=g[le],xr=Yt.high,Qt=Yt.low,se=de+dr,ye=oe+cr+(se>>>0<de>>>0?1:0),se=se+Zt,ye=ye+ir+(se>>>0<Zt>>>0?1:0),se=se+Qt,ye=ye+xr+(se>>>0<Qt>>>0?1:0),se=se+ne,ye=ye+U+(se>>>0<ne>>>0?1:0),Jt=Xt+lr,hr=ur+or+(Jt>>>0<Xt>>>0?1:0);oe=fe,de=Y,fe=Fe,Y=_e,Fe=ae,_e=ee,ee=Be+se|0,ae=Re+ye+(ee>>>0<Be>>>0?1:0)|0,Re=ge,Be=ve,ge=Q,ve=j,Q=X,j=Z,Z=se+Jt|0,X=ye+hr+(Z>>>0<se>>>0?1:0)|0}k=E.low=k+Z,E.high=T+X+(k>>>0<Z>>>0?1:0),F=h.low=F+j,h.high=S+Q+(F>>>0<j>>>0?1:0),y=m.low=y+ve,m.high=_+ge+(y>>>0<ve>>>0?1:0),$=B.low=$+Be,B.high=M+Re+($>>>0<Be>>>0?1:0),H=b.low=H+ee,b.high=L+ae+(H>>>0<ee>>>0?1:0),O=A.low=O+_e,A.high=P+Fe+(O>>>0<_e>>>0?1:0),R=w.low=R+Y,w.high=D+fe+(R>>>0<Y>>>0?1:0),N=V.low=N+de,V.high=I+oe+(N>>>0<de>>>0?1:0)},_doFinalize:function(){var x=this._data,C=x.words,p=this._nDataBytes*8,E=x.sigBytes*8;C[E>>>5]|=128<<24-E%32,C[(E+128>>>10<<5)+30]=Math.floor(p/4294967296),C[(E+128>>>10<<5)+31]=p,x.sigBytes=C.length*4,this._process();var h=this._hash.toX32();return h},clone:function(){var x=i.clone.call(this);return x._hash=this._hash.clone(),x},blockSize:1024/32});r.SHA512=i._createHelper(v),r.HmacSHA512=i._createHmacHelper(v)}(),t.SHA512})}(dt)),dt.exports}var xt={exports:{}},h0;function Fa(){return h0||(h0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ze(),G0())})(W,function(t){return function(){var r=t,n=r.x64,i=n.Word,u=n.WordArray,l=r.algo,f=l.SHA512,s=l.SHA384=f.extend({_doReset:function(){this._hash=new u.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var d=f._doFinalize.call(this);return d.sigBytes-=16,d}});r.SHA384=f._createHelper(s),r.HmacSHA384=f._createHmacHelper(s)}(),t.SHA384})}(xt)),xt.exports}var ht={exports:{}},f0;function Da(){return f0||(f0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ze())})(W,function(t){return function(r){var n=t,i=n.lib,u=i.WordArray,l=i.Hasher,f=n.x64,s=f.Word,d=n.algo,g=[],c=[],v=[];(function(){for(var p=1,E=0,h=0;h<24;h++){g[p+5*E]=(h+1)*(h+2)/2%64;var m=E%5,B=(2*p+3*E)%5;p=m,E=B}for(var p=0;p<5;p++)for(var E=0;E<5;E++)c[p+5*E]=E+(2*p+3*E)%5*5;for(var b=1,A=0;A<24;A++){for(var w=0,V=0,T=0;T<7;T++){if(b&1){var k=(1<<T)-1;k<32?V^=1<<k:w^=1<<k-32}b&128?b=b<<1^113:b<<=1}v[A]=s.create(w,V)}})();var x=[];(function(){for(var p=0;p<25;p++)x[p]=s.create()})();var C=d.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var p=this._state=[],E=0;E<25;E++)p[E]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(p,E){for(var h=this._state,m=this.blockSize/2,B=0;B<m;B++){var b=p[E+2*B],A=p[E+2*B+1];b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360;var w=h[B];w.high^=A,w.low^=b}for(var V=0;V<24;V++){for(var T=0;T<5;T++){for(var k=0,S=0,F=0;F<5;F++){var w=h[T+5*F];k^=w.high,S^=w.low}var _=x[T];_.high=k,_.low=S}for(var T=0;T<5;T++)for(var y=x[(T+4)%5],M=x[(T+1)%5],$=M.high,L=M.low,k=y.high^($<<1|L>>>31),S=y.low^(L<<1|$>>>31),F=0;F<5;F++){var w=h[T+5*F];w.high^=k,w.low^=S}for(var H=1;H<25;H++){var k,S,w=h[H],P=w.high,O=w.low,D=g[H];D<32?(k=P<<D|O>>>32-D,S=O<<D|P>>>32-D):(k=O<<D-32|P>>>64-D,S=P<<D-32|O>>>64-D);var R=x[c[H]];R.high=k,R.low=S}var I=x[0],N=h[0];I.high=N.high,I.low=N.low;for(var T=0;T<5;T++)for(var F=0;F<5;F++){var H=T+5*F,w=h[H],X=x[H],Z=x[(T+1)%5+5*F],Q=x[(T+2)%5+5*F];w.high=X.high^~Z.high&Q.high,w.low=X.low^~Z.low&Q.low}var w=h[0],j=v[V];w.high^=j.high,w.low^=j.low}},_doFinalize:function(){var p=this._data,E=p.words;this._nDataBytes*8;var h=p.sigBytes*8,m=this.blockSize*32;E[h>>>5]|=1<<24-h%32,E[(r.ceil((h+1)/m)*m>>>5)-1]|=128,p.sigBytes=E.length*4,this._process();for(var B=this._state,b=this.cfg.outputLength/8,A=b/8,w=[],V=0;V<A;V++){var T=B[V],k=T.high,S=T.low;k=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,w.push(S),w.push(k)}return new u.init(w,b)},clone:function(){for(var p=l.clone.call(this),E=p._state=this._state.slice(0),h=0;h<25;h++)E[h]=E[h].clone();return p}});n.SHA3=l._createHelper(C),n.HmacSHA3=l._createHmacHelper(C)}(Math),t.SHA3})}(ht)),ht.exports}var ft={exports:{}},p0;function wa(){return p0||(p0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){/** @preserve
2
+ (c) 2012 by Cédric Mesnil. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10
+ */return function(r){var n=t,i=n.lib,u=i.WordArray,l=i.Hasher,f=n.algo,s=u.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=u.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=u.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=u.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=u.create([0,1518500249,1859775393,2400959708,2840853838]),x=u.create([1352829926,1548603684,1836072691,2053994217,0]),C=f.RIPEMD160=l.extend({_doReset:function(){this._hash=u.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(A,w){for(var V=0;V<16;V++){var T=w+V,k=A[T];A[T]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var S=this._hash.words,F=v.words,_=x.words,y=s.words,M=d.words,$=g.words,L=c.words,H,P,O,D,R,I,N,X,Z,Q;I=H=S[0],N=P=S[1],X=O=S[2],Z=D=S[3],Q=R=S[4];for(var j,V=0;V<80;V+=1)j=H+A[w+y[V]]|0,V<16?j+=p(P,O,D)+F[0]:V<32?j+=E(P,O,D)+F[1]:V<48?j+=h(P,O,D)+F[2]:V<64?j+=m(P,O,D)+F[3]:j+=B(P,O,D)+F[4],j=j|0,j=b(j,$[V]),j=j+R|0,H=R,R=D,D=b(O,10),O=P,P=j,j=I+A[w+M[V]]|0,V<16?j+=B(N,X,Z)+_[0]:V<32?j+=m(N,X,Z)+_[1]:V<48?j+=h(N,X,Z)+_[2]:V<64?j+=E(N,X,Z)+_[3]:j+=p(N,X,Z)+_[4],j=j|0,j=b(j,L[V]),j=j+Q|0,I=Q,Q=Z,Z=b(X,10),X=N,N=j;j=S[1]+O+Z|0,S[1]=S[2]+D+Q|0,S[2]=S[3]+R+I|0,S[3]=S[4]+H+N|0,S[4]=S[0]+P+X|0,S[0]=j},_doFinalize:function(){var A=this._data,w=A.words,V=this._nDataBytes*8,T=A.sigBytes*8;w[T>>>5]|=128<<24-T%32,w[(T+64>>>9<<4)+14]=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360,A.sigBytes=(w.length+1)*4,this._process();for(var k=this._hash,S=k.words,F=0;F<5;F++){var _=S[F];S[F]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}return k},clone:function(){var A=l.clone.call(this);return A._hash=this._hash.clone(),A}});function p(A,w,V){return A^w^V}function E(A,w,V){return A&w|~A&V}function h(A,w,V){return(A|~w)^V}function m(A,w,V){return A&V|w&~V}function B(A,w,V){return A^(w|~V)}function b(A,w){return A<<w|A>>>32-w}n.RIPEMD160=l._createHelper(C),n.HmacRIPEMD160=l._createHmacHelper(C)}(),t.RIPEMD160})}(ft)),ft.exports}var pt={exports:{}},v0;function Lt(){return v0||(v0=1,function(o,e){(function(t,r){o.exports=r(G())})(W,function(t){(function(){var r=t,n=r.lib,i=n.Base,u=r.enc,l=u.Utf8,f=r.algo;f.HMAC=i.extend({init:function(s,d){s=this._hasher=new s.init,typeof d=="string"&&(d=l.parse(d));var g=s.blockSize,c=g*4;d.sigBytes>c&&(d=s.finalize(d)),d.clamp();for(var v=this._oKey=d.clone(),x=this._iKey=d.clone(),C=v.words,p=x.words,E=0;E<g;E++)C[E]^=1549556828,p[E]^=909522486;v.sigBytes=x.sigBytes=c,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var d=this._hasher,g=d.finalize(s);d.reset();var c=d.finalize(this._oKey.clone().concat(g));return c}})})()})}(pt)),pt.exports}var vt={exports:{}},m0;function Sa(){return m0||(m0=1,function(o,e){(function(t,r,n){o.exports=r(G(),$t(),Lt())})(W,function(t){return function(){var r=t,n=r.lib,i=n.Base,u=n.WordArray,l=r.algo,f=l.SHA256,s=l.HMAC,d=l.PBKDF2=i.extend({cfg:i.extend({keySize:128/32,hasher:f,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,c){for(var v=this.cfg,x=s.create(v.hasher,g),C=u.create(),p=u.create([1]),E=C.words,h=p.words,m=v.keySize,B=v.iterations;E.length<m;){var b=x.update(c).finalize(p);x.reset();for(var A=b.words,w=A.length,V=b,T=1;T<B;T++){V=x.finalize(V),x.reset();for(var k=V.words,S=0;S<w;S++)A[S]^=k[S]}C.concat(b),h[0]++}return C.sigBytes=m*4,C}});r.PBKDF2=function(g,c,v){return d.create(v).compute(g,c)}}(),t.PBKDF2})}(vt)),vt.exports}var mt={exports:{}},C0;function be(){return C0||(C0=1,function(o,e){(function(t,r,n){o.exports=r(G(),W0(),Lt())})(W,function(t){return function(){var r=t,n=r.lib,i=n.Base,u=n.WordArray,l=r.algo,f=l.MD5,s=l.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:f,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,g){for(var c,v=this.cfg,x=v.hasher.create(),C=u.create(),p=C.words,E=v.keySize,h=v.iterations;p.length<E;){c&&x.update(c),c=x.update(d).finalize(g),x.reset();for(var m=1;m<h;m++)c=x.finalize(c),x.reset();C.concat(c)}return C.sigBytes=E*4,C}});r.EvpKDF=function(d,g,c){return s.create(c).compute(d,g)}}(),t.EvpKDF})}(mt)),mt.exports}var Ct={exports:{}},g0;function J(){return g0||(g0=1,function(o,e){(function(t,r,n){o.exports=r(G(),be())})(W,function(t){t.lib.Cipher||function(r){var n=t,i=n.lib,u=i.Base,l=i.WordArray,f=i.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var d=s.Base64,g=n.algo,c=g.EvpKDF,v=i.Cipher=f.extend({cfg:u.extend(),createEncryptor:function(k,S){return this.create(this._ENC_XFORM_MODE,k,S)},createDecryptor:function(k,S){return this.create(this._DEC_XFORM_MODE,k,S)},init:function(k,S,F){this.cfg=this.cfg.extend(F),this._xformMode=k,this._key=S,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(k){return this._append(k),this._process()},finalize:function(k){k&&this._append(k);var S=this._doFinalize();return S},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function k(S){return typeof S=="string"?T:A}return function(S){return{encrypt:function(F,_,y){return k(_).encrypt(S,F,_,y)},decrypt:function(F,_,y){return k(_).decrypt(S,F,_,y)}}}}()});i.StreamCipher=v.extend({_doFinalize:function(){var k=this._process(!0);return k},blockSize:1});var x=n.mode={},C=i.BlockCipherMode=u.extend({createEncryptor:function(k,S){return this.Encryptor.create(k,S)},createDecryptor:function(k,S){return this.Decryptor.create(k,S)},init:function(k,S){this._cipher=k,this._iv=S}}),p=x.CBC=function(){var k=C.extend();k.Encryptor=k.extend({processBlock:function(F,_){var y=this._cipher,M=y.blockSize;S.call(this,F,_,M),y.encryptBlock(F,_),this._prevBlock=F.slice(_,_+M)}}),k.Decryptor=k.extend({processBlock:function(F,_){var y=this._cipher,M=y.blockSize,$=F.slice(_,_+M);y.decryptBlock(F,_),S.call(this,F,_,M),this._prevBlock=$}});function S(F,_,y){var M,$=this._iv;$?(M=$,this._iv=r):M=this._prevBlock;for(var L=0;L<y;L++)F[_+L]^=M[L]}return k}(),E=n.pad={},h=E.Pkcs7={pad:function(k,S){for(var F=S*4,_=F-k.sigBytes%F,y=_<<24|_<<16|_<<8|_,M=[],$=0;$<_;$+=4)M.push(y);var L=l.create(M,_);k.concat(L)},unpad:function(k){var S=k.words[k.sigBytes-1>>>2]&255;k.sigBytes-=S}};i.BlockCipher=v.extend({cfg:v.cfg.extend({mode:p,padding:h}),reset:function(){var k;v.reset.call(this);var S=this.cfg,F=S.iv,_=S.mode;this._xformMode==this._ENC_XFORM_MODE?k=_.createEncryptor:(k=_.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==k?this._mode.init(this,F&&F.words):(this._mode=k.call(_,this,F&&F.words),this._mode.__creator=k)},_doProcessBlock:function(k,S){this._mode.processBlock(k,S)},_doFinalize:function(){var k,S=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(S.pad(this._data,this.blockSize),k=this._process(!0)):(k=this._process(!0),S.unpad(k)),k},blockSize:128/32});var m=i.CipherParams=u.extend({init:function(k){this.mixIn(k)},toString:function(k){return(k||this.formatter).stringify(this)}}),B=n.format={},b=B.OpenSSL={stringify:function(k){var S,F=k.ciphertext,_=k.salt;return _?S=l.create([1398893684,1701076831]).concat(_).concat(F):S=F,S.toString(d)},parse:function(k){var S,F=d.parse(k),_=F.words;return _[0]==1398893684&&_[1]==1701076831&&(S=l.create(_.slice(2,4)),_.splice(0,4),F.sigBytes-=16),m.create({ciphertext:F,salt:S})}},A=i.SerializableCipher=u.extend({cfg:u.extend({format:b}),encrypt:function(k,S,F,_){_=this.cfg.extend(_);var y=k.createEncryptor(F,_),M=y.finalize(S),$=y.cfg;return m.create({ciphertext:M,key:F,iv:$.iv,algorithm:k,mode:$.mode,padding:$.padding,blockSize:k.blockSize,formatter:_.format})},decrypt:function(k,S,F,_){_=this.cfg.extend(_),S=this._parse(S,_.format);var y=k.createDecryptor(F,_).finalize(S.ciphertext);return y},_parse:function(k,S){return typeof k=="string"?S.parse(k,this):k}}),w=n.kdf={},V=w.OpenSSL={execute:function(k,S,F,_,y){if(_||(_=l.random(64/8)),y)var M=c.create({keySize:S+F,hasher:y}).compute(k,_);else var M=c.create({keySize:S+F}).compute(k,_);var $=l.create(M.words.slice(S),F*4);return M.sigBytes=S*4,m.create({key:M,iv:$,salt:_})}},T=i.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:V}),encrypt:function(k,S,F,_){_=this.cfg.extend(_);var y=_.kdf.execute(F,k.keySize,k.ivSize,_.salt,_.hasher);_.iv=y.iv;var M=A.encrypt.call(this,k,S,y.key,_);return M.mixIn(y),M},decrypt:function(k,S,F,_){_=this.cfg.extend(_),S=this._parse(S,_.format);var y=_.kdf.execute(F,k.keySize,k.ivSize,S.salt,_.hasher);_.iv=y.iv;var M=A.decrypt.call(this,k,S,y.key,_);return M}})}()})}(Ct)),Ct.exports}var gt={exports:{}},B0;function Va(){return B0||(B0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.mode.CFB=function(){var r=t.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(i,u){var l=this._cipher,f=l.blockSize;n.call(this,i,u,f,l),this._prevBlock=i.slice(u,u+f)}}),r.Decryptor=r.extend({processBlock:function(i,u){var l=this._cipher,f=l.blockSize,s=i.slice(u,u+f);n.call(this,i,u,f,l),this._prevBlock=s}});function n(i,u,l,f){var s,d=this._iv;d?(s=d.slice(0),this._iv=void 0):s=this._prevBlock,f.encryptBlock(s,0);for(var g=0;g<l;g++)i[u+g]^=s[g]}return r}(),t.mode.CFB})}(gt)),gt.exports}var Bt={exports:{}},_0;function Na(){return _0||(_0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.mode.CTR=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,u){var l=this._cipher,f=l.blockSize,s=this._iv,d=this._counter;s&&(d=this._counter=s.slice(0),this._iv=void 0);var g=d.slice(0);l.encryptBlock(g,0),d[f-1]=d[f-1]+1|0;for(var c=0;c<f;c++)i[u+c]^=g[c]}});return r.Decryptor=n,r}(),t.mode.CTR})}(Bt)),Bt.exports}var _t={exports:{}},E0;function Ra(){return E0||(E0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){/** @preserve
11
+ * Counter block mode compatible with Dr Brian Gladman fileenc.c
12
+ * derived from CryptoJS.mode.CTR
13
+ * Jan Hruby jhruby.web@gmail.com
14
+ */return t.mode.CTRGladman=function(){var r=t.lib.BlockCipherMode.extend();function n(l){if((l>>24&255)===255){var f=l>>16&255,s=l>>8&255,d=l&255;f===255?(f=0,s===255?(s=0,d===255?d=0:++d):++s):++f,l=0,l+=f<<16,l+=s<<8,l+=d}else l+=1<<24;return l}function i(l){return(l[0]=n(l[0]))===0&&(l[1]=n(l[1])),l}var u=r.Encryptor=r.extend({processBlock:function(l,f){var s=this._cipher,d=s.blockSize,g=this._iv,c=this._counter;g&&(c=this._counter=g.slice(0),this._iv=void 0),i(c);var v=c.slice(0);s.encryptBlock(v,0);for(var x=0;x<d;x++)l[f+x]^=v[x]}});return r.Decryptor=u,r}(),t.mode.CTRGladman})}(_t)),_t.exports}var Et={exports:{}},y0;function Ia(){return y0||(y0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.mode.OFB=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,u){var l=this._cipher,f=l.blockSize,s=this._iv,d=this._keystream;s&&(d=this._keystream=s.slice(0),this._iv=void 0),l.encryptBlock(d,0);for(var g=0;g<f;g++)i[u+g]^=d[g]}});return r.Decryptor=n,r}(),t.mode.OFB})}(Et)),Et.exports}var yt={exports:{}},k0;function Ta(){return k0||(k0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.mode.ECB=function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(n,i){this._cipher.encryptBlock(n,i)}}),r.Decryptor=r.extend({processBlock:function(n,i){this._cipher.decryptBlock(n,i)}}),r}(),t.mode.ECB})}(yt)),yt.exports}var kt={exports:{}},A0;function Ma(){return A0||(A0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.pad.AnsiX923={pad:function(r,n){var i=r.sigBytes,u=n*4,l=u-i%u,f=i+l-1;r.clamp(),r.words[f>>>2]|=l<<24-f%4*8,r.sigBytes+=l},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Ansix923})}(kt)),kt.exports}var At={exports:{}},b0;function Pa(){return b0||(b0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.pad.Iso10126={pad:function(r,n){var i=n*4,u=i-r.sigBytes%i;r.concat(t.lib.WordArray.random(u-1)).concat(t.lib.WordArray.create([u<<24],1))},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Iso10126})}(At)),At.exports}var bt={exports:{}},F0;function Oa(){return F0||(F0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.pad.Iso97971={pad:function(r,n){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,n)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(bt)),bt.exports}var Ft={exports:{}},D0;function Ha(){return D0||(D0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.pad.ZeroPadding={pad:function(r,n){var i=n*4;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var n=r.words,i=r.sigBytes-1,i=r.sigBytes-1;i>=0;i--)if(n[i>>>2]>>>24-i%4*8&255){r.sigBytes=i+1;break}}},t.pad.ZeroPadding})}(Ft)),Ft.exports}var Dt={exports:{}},w0;function $a(){return w0||(w0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Dt)),Dt.exports}var wt={exports:{}},S0;function La(){return S0||(S0=1,function(o,e){(function(t,r,n){o.exports=r(G(),J())})(W,function(t){return function(r){var n=t,i=n.lib,u=i.CipherParams,l=n.enc,f=l.Hex,s=n.format;s.Hex={stringify:function(d){return d.ciphertext.toString(f)},parse:function(d){var g=f.parse(d);return u.create({ciphertext:g})}}}(),t.format.Hex})}(wt)),wt.exports}var St={exports:{}},V0;function za(){return V0||(V0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,u=r.algo,l=[],f=[],s=[],d=[],g=[],c=[],v=[],x=[],C=[],p=[];(function(){for(var m=[],B=0;B<256;B++)B<128?m[B]=B<<1:m[B]=B<<1^283;for(var b=0,A=0,B=0;B<256;B++){var w=A^A<<1^A<<2^A<<3^A<<4;w=w>>>8^w&255^99,l[b]=w,f[w]=b;var V=m[b],T=m[V],k=m[T],S=m[w]*257^w*16843008;s[b]=S<<24|S>>>8,d[b]=S<<16|S>>>16,g[b]=S<<8|S>>>24,c[b]=S;var S=k*16843009^T*65537^V*257^b*16843008;v[w]=S<<24|S>>>8,x[w]=S<<16|S>>>16,C[w]=S<<8|S>>>24,p[w]=S,b?(b=V^m[m[m[k^V]]],A^=m[m[A]]):b=A=1}})();var E=[0,1,2,4,8,16,32,64,128,27,54],h=u.AES=i.extend({_doReset:function(){var m;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var B=this._keyPriorReset=this._key,b=B.words,A=B.sigBytes/4,w=this._nRounds=A+6,V=(w+1)*4,T=this._keySchedule=[],k=0;k<V;k++)k<A?T[k]=b[k]:(m=T[k-1],k%A?A>6&&k%A==4&&(m=l[m>>>24]<<24|l[m>>>16&255]<<16|l[m>>>8&255]<<8|l[m&255]):(m=m<<8|m>>>24,m=l[m>>>24]<<24|l[m>>>16&255]<<16|l[m>>>8&255]<<8|l[m&255],m^=E[k/A|0]<<24),T[k]=T[k-A]^m);for(var S=this._invKeySchedule=[],F=0;F<V;F++){var k=V-F;if(F%4)var m=T[k];else var m=T[k-4];F<4||k<=4?S[F]=m:S[F]=v[l[m>>>24]]^x[l[m>>>16&255]]^C[l[m>>>8&255]]^p[l[m&255]]}}},encryptBlock:function(m,B){this._doCryptBlock(m,B,this._keySchedule,s,d,g,c,l)},decryptBlock:function(m,B){var b=m[B+1];m[B+1]=m[B+3],m[B+3]=b,this._doCryptBlock(m,B,this._invKeySchedule,v,x,C,p,f);var b=m[B+1];m[B+1]=m[B+3],m[B+3]=b},_doCryptBlock:function(m,B,b,A,w,V,T,k){for(var S=this._nRounds,F=m[B]^b[0],_=m[B+1]^b[1],y=m[B+2]^b[2],M=m[B+3]^b[3],$=4,L=1;L<S;L++){var H=A[F>>>24]^w[_>>>16&255]^V[y>>>8&255]^T[M&255]^b[$++],P=A[_>>>24]^w[y>>>16&255]^V[M>>>8&255]^T[F&255]^b[$++],O=A[y>>>24]^w[M>>>16&255]^V[F>>>8&255]^T[_&255]^b[$++],D=A[M>>>24]^w[F>>>16&255]^V[_>>>8&255]^T[y&255]^b[$++];F=H,_=P,y=O,M=D}var H=(k[F>>>24]<<24|k[_>>>16&255]<<16|k[y>>>8&255]<<8|k[M&255])^b[$++],P=(k[_>>>24]<<24|k[y>>>16&255]<<16|k[M>>>8&255]<<8|k[F&255])^b[$++],O=(k[y>>>24]<<24|k[M>>>16&255]<<16|k[F>>>8&255]<<8|k[_&255])^b[$++],D=(k[M>>>24]<<24|k[F>>>16&255]<<16|k[_>>>8&255]<<8|k[y&255])^b[$++];m[B]=H,m[B+1]=P,m[B+2]=O,m[B+3]=D},keySize:256/32});r.AES=i._createHelper(h)}(),t.AES})}(St)),St.exports}var Vt={exports:{}},N0;function Ua(){return N0||(N0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,u=n.BlockCipher,l=r.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=l.DES=u.extend({_doReset:function(){for(var E=this._key,h=E.words,m=[],B=0;B<56;B++){var b=f[B]-1;m[B]=h[b>>>5]>>>31-b%32&1}for(var A=this._subKeys=[],w=0;w<16;w++){for(var V=A[w]=[],T=d[w],B=0;B<24;B++)V[B/6|0]|=m[(s[B]-1+T)%28]<<31-B%6,V[4+(B/6|0)]|=m[28+(s[B+24]-1+T)%28]<<31-B%6;V[0]=V[0]<<1|V[0]>>>31;for(var B=1;B<7;B++)V[B]=V[B]>>>(B-1)*4+3;V[7]=V[7]<<5|V[7]>>>27}for(var k=this._invSubKeys=[],B=0;B<16;B++)k[B]=A[15-B]},encryptBlock:function(E,h){this._doCryptBlock(E,h,this._subKeys)},decryptBlock:function(E,h){this._doCryptBlock(E,h,this._invSubKeys)},_doCryptBlock:function(E,h,m){this._lBlock=E[h],this._rBlock=E[h+1],x.call(this,4,252645135),x.call(this,16,65535),C.call(this,2,858993459),C.call(this,8,16711935),x.call(this,1,1431655765);for(var B=0;B<16;B++){for(var b=m[B],A=this._lBlock,w=this._rBlock,V=0,T=0;T<8;T++)V|=g[T][((w^b[T])&c[T])>>>0];this._lBlock=w,this._rBlock=A^V}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,x.call(this,1,1431655765),C.call(this,8,16711935),C.call(this,2,858993459),x.call(this,16,65535),x.call(this,4,252645135),E[h]=this._lBlock,E[h+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function x(E,h){var m=(this._lBlock>>>E^this._rBlock)&h;this._rBlock^=m,this._lBlock^=m<<E}function C(E,h){var m=(this._rBlock>>>E^this._lBlock)&h;this._lBlock^=m,this._rBlock^=m<<E}r.DES=u._createHelper(v);var p=l.TripleDES=u.extend({_doReset:function(){var E=this._key,h=E.words;if(h.length!==2&&h.length!==4&&h.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var m=h.slice(0,2),B=h.length<4?h.slice(0,2):h.slice(2,4),b=h.length<6?h.slice(0,2):h.slice(4,6);this._des1=v.createEncryptor(i.create(m)),this._des2=v.createEncryptor(i.create(B)),this._des3=v.createEncryptor(i.create(b))},encryptBlock:function(E,h){this._des1.encryptBlock(E,h),this._des2.decryptBlock(E,h),this._des3.encryptBlock(E,h)},decryptBlock:function(E,h){this._des3.decryptBlock(E,h),this._des2.encryptBlock(E,h),this._des1.decryptBlock(E,h)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=u._createHelper(p)}(),t.TripleDES})}(Vt)),Vt.exports}var Nt={exports:{}},R0;function qa(){return R0||(R0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,u=r.algo,l=u.RC4=i.extend({_doReset:function(){for(var d=this._key,g=d.words,c=d.sigBytes,v=this._S=[],x=0;x<256;x++)v[x]=x;for(var x=0,C=0;x<256;x++){var p=x%c,E=g[p>>>2]>>>24-p%4*8&255;C=(C+v[x]+E)%256;var h=v[x];v[x]=v[C],v[C]=h}this._i=this._j=0},_doProcessBlock:function(d,g){d[g]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var d=this._S,g=this._i,c=this._j,v=0,x=0;x<4;x++){g=(g+1)%256,c=(c+d[g])%256;var C=d[g];d[g]=d[c],d[c]=C,v|=d[(d[g]+d[c])%256]<<24-x*8}return this._i=g,this._j=c,v}r.RC4=i._createHelper(l);var s=u.RC4Drop=l.extend({cfg:l.cfg.extend({drop:192}),_doReset:function(){l._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)f.call(this)}});r.RC4Drop=i._createHelper(s)}(),t.RC4})}(Nt)),Nt.exports}var Rt={exports:{}},I0;function ja(){return I0||(I0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,u=r.algo,l=[],f=[],s=[],d=u.Rabbit=i.extend({_doReset:function(){for(var c=this._key.words,v=this.cfg.iv,x=0;x<4;x++)c[x]=(c[x]<<8|c[x]>>>24)&16711935|(c[x]<<24|c[x]>>>8)&4278255360;var C=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],p=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var x=0;x<4;x++)g.call(this);for(var x=0;x<8;x++)p[x]^=C[x+4&7];if(v){var E=v.words,h=E[0],m=E[1],B=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,b=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,A=B>>>16|b&4294901760,w=b<<16|B&65535;p[0]^=B,p[1]^=A,p[2]^=b,p[3]^=w,p[4]^=B,p[5]^=A,p[6]^=b,p[7]^=w;for(var x=0;x<4;x++)g.call(this)}},_doProcessBlock:function(c,v){var x=this._X;g.call(this),l[0]=x[0]^x[5]>>>16^x[3]<<16,l[1]=x[2]^x[7]>>>16^x[5]<<16,l[2]=x[4]^x[1]>>>16^x[7]<<16,l[3]=x[6]^x[3]>>>16^x[1]<<16;for(var C=0;C<4;C++)l[C]=(l[C]<<8|l[C]>>>24)&16711935|(l[C]<<24|l[C]>>>8)&4278255360,c[v+C]^=l[C]},blockSize:128/32,ivSize:64/32});function g(){for(var c=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var C=c[x]+v[x],p=C&65535,E=C>>>16,h=((p*p>>>17)+p*E>>>15)+E*E,m=((C&4294901760)*C|0)+((C&65535)*C|0);s[x]=h^m}c[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,c[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,c[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,c[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,c[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,c[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,c[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,c[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}r.Rabbit=i._createHelper(d)}(),t.Rabbit})}(Rt)),Rt.exports}var It={exports:{}},T0;function Ka(){return T0||(T0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,u=r.algo,l=[],f=[],s=[],d=u.RabbitLegacy=i.extend({_doReset:function(){var c=this._key.words,v=this.cfg.iv,x=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],C=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var p=0;p<4;p++)g.call(this);for(var p=0;p<8;p++)C[p]^=x[p+4&7];if(v){var E=v.words,h=E[0],m=E[1],B=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,b=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,A=B>>>16|b&4294901760,w=b<<16|B&65535;C[0]^=B,C[1]^=A,C[2]^=b,C[3]^=w,C[4]^=B,C[5]^=A,C[6]^=b,C[7]^=w;for(var p=0;p<4;p++)g.call(this)}},_doProcessBlock:function(c,v){var x=this._X;g.call(this),l[0]=x[0]^x[5]>>>16^x[3]<<16,l[1]=x[2]^x[7]>>>16^x[5]<<16,l[2]=x[4]^x[1]>>>16^x[7]<<16,l[3]=x[6]^x[3]>>>16^x[1]<<16;for(var C=0;C<4;C++)l[C]=(l[C]<<8|l[C]>>>24)&16711935|(l[C]<<24|l[C]>>>8)&4278255360,c[v+C]^=l[C]},blockSize:128/32,ivSize:64/32});function g(){for(var c=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var C=c[x]+v[x],p=C&65535,E=C>>>16,h=((p*p>>>17)+p*E>>>15)+E*E,m=((C&4294901760)*C|0)+((C&65535)*C|0);s[x]=h^m}c[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,c[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,c[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,c[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,c[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,c[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,c[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,c[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}r.RabbitLegacy=i._createHelper(d)}(),t.RabbitLegacy})}(It)),It.exports}var Tt={exports:{}},M0;function Wa(){return M0||(M0=1,function(o,e){(function(t,r,n){o.exports=r(G(),Ve(),Ne(),be(),J())})(W,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,u=r.algo;const l=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function g(p,E){let h=E>>24&255,m=E>>16&255,B=E>>8&255,b=E&255,A=p.sbox[0][h]+p.sbox[1][m];return A=A^p.sbox[2][B],A=A+p.sbox[3][b],A}function c(p,E,h){let m=E,B=h,b;for(let A=0;A<l;++A)m=m^p.pbox[A],B=g(p,m)^B,b=m,m=B,B=b;return b=m,m=B,B=b,B=B^p.pbox[l],m=m^p.pbox[l+1],{left:m,right:B}}function v(p,E,h){let m=E,B=h,b;for(let A=l+1;A>1;--A)m=m^p.pbox[A],B=g(p,m)^B,b=m,m=B,B=b;return b=m,m=B,B=b,B=B^p.pbox[1],m=m^p.pbox[0],{left:m,right:B}}function x(p,E,h){for(let w=0;w<4;w++){p.sbox[w]=[];for(let V=0;V<256;V++)p.sbox[w][V]=s[w][V]}let m=0;for(let w=0;w<l+2;w++)p.pbox[w]=f[w]^E[m],m++,m>=h&&(m=0);let B=0,b=0,A=0;for(let w=0;w<l+2;w+=2)A=c(p,B,b),B=A.left,b=A.right,p.pbox[w]=B,p.pbox[w+1]=b;for(let w=0;w<4;w++)for(let V=0;V<256;V+=2)A=c(p,B,b),B=A.left,b=A.right,p.sbox[w][V]=B,p.sbox[w][V+1]=b;return!0}var C=u.Blowfish=i.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var p=this._keyPriorReset=this._key,E=p.words,h=p.sigBytes/4;x(d,E,h)}},encryptBlock:function(p,E){var h=c(d,p[E],p[E+1]);p[E]=h.left,p[E+1]=h.right},decryptBlock:function(p,E){var h=v(d,p[E],p[E+1]);p[E]=h.left,p[E+1]=h.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=i._createHelper(C)}(),t.Blowfish})}(Tt)),Tt.exports}(function(o,e){(function(t,r,n){o.exports=r(G(),Ze(),ya(),ka(),Ve(),Aa(),Ne(),W0(),$t(),ba(),G0(),Fa(),Da(),wa(),Lt(),Sa(),be(),J(),Va(),Na(),Ra(),Ia(),Ta(),Ma(),Pa(),Oa(),Ha(),$a(),La(),za(),Ua(),qa(),ja(),Ka(),Wa())})(W,function(t){return t})})(K0);var Ga=K0.exports;const ce=ma(Ga);function Za(o,e={}){const t=he(o),r=ce.enc.Utf8.parse(t),n=ce.enc.Utf8.parse(t),i=JSON.stringify(e);return{requestParam:ce.AES.encrypt(ce.enc.Utf8.parse(i),r,{keySize:128/8,iv:n,mode:ce.mode.CBC,padding:ce.pad.Pkcs7}).toString()}}function P0(o,e){const t=he(o),r=ce.enc.Utf8.parse(t),n=ce.enc.Utf8.parse(t),u=ce.AES.decrypt(e,r,{keySize:128/8,iv:n,mode:ce.mode.CBC,padding:ce.pad.Pkcs7}).toString(ce.enc.Utf8);return JSON.parse(u)}async function Xa(o,e){try{const t=he(o);return await(await fetch(`${t}/api/v1/countries-iso`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:e}})).json()}catch{}}async function Ya(o,e,t){try{const r=he(e);return await(await fetch(`${r}/api/v1/state-by-country/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",merchantId:t}})).json()}catch{}}async function Qa(o){try{const e=he(o);return await(await fetch(`${e}/api/v1/checkout/stable-coin`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}async function Ja(o,e){try{const t=he(o);return await(await fetch(`${t}/api/v1/checkout/networks/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json()}catch{}}function Ae(o){return typeof o=="string"||o instanceof String}function O0(o){var e;return typeof o=="object"&&o!=null&&(o==null||(e=o.constructor)==null?void 0:e.name)==="Object"}function Z0(o,e){return Array.isArray(e)?Z0(o,(t,r)=>e.includes(r)):Object.entries(o).reduce((t,r)=>{let[n,i]=r;return e(i,n)&&(t[n]=i),t},{})}const z={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function en(o){switch(o){case z.LEFT:return z.FORCE_LEFT;case z.RIGHT:return z.FORCE_RIGHT;default:return o}}function Mt(o){return o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Ke(o,e){if(e===o)return!0;const t=Array.isArray(e),r=Array.isArray(o);let n;if(t&&r){if(e.length!=o.length)return!1;for(n=0;n<e.length;n++)if(!Ke(e[n],o[n]))return!1;return!0}if(t!=r)return!1;if(e&&o&&typeof e=="object"&&typeof o=="object"){const i=e instanceof Date,u=o instanceof Date;if(i&&u)return e.getTime()==o.getTime();if(i!=u)return!1;const l=e instanceof RegExp,f=o instanceof RegExp;if(l&&f)return e.toString()==o.toString();if(l!=f)return!1;const s=Object.keys(e);for(n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(o,s[n]))return!1;for(n=0;n<s.length;n++)if(!Ke(o[s[n]],e[s[n]]))return!1;return!0}else if(e&&o&&typeof e=="function"&&typeof o=="function")return e.toString()===o.toString();return!1}class tn{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?z.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?z.RIGHT:z.LEFT}}function q(o,e){return new q.InputMask(o,e)}function X0(o){if(o==null)throw new Error("mask property should be defined");return o instanceof RegExp?q.MaskedRegExp:Ae(o)?q.MaskedPattern:o===Date?q.MaskedDate:o===Number?q.MaskedNumber:Array.isArray(o)||o===Array?q.MaskedDynamic:q.Masked&&o.prototype instanceof q.Masked?o:q.Masked&&o instanceof q.Masked?o.constructor:o instanceof Function?q.MaskedFunction:(console.warn("Mask not found for mask",o),q.Masked)}function $e(o){if(!o)throw new Error("Options in not defined");if(q.Masked){if(o.prototype instanceof q.Masked)return{mask:o};const{mask:e=void 0,...t}=o instanceof q.Masked?{mask:o}:O0(o)&&o.mask instanceof q.Masked?o:{};if(e){const r=e.mask;return{...Z0(e,(n,i)=>!i.startsWith("_")),mask:e.constructor,_mask:r,...t}}}return O0(o)?{...o}:{mask:o}}function Ce(o){if(q.Masked&&o instanceof q.Masked)return o;const e=$e(o),t=X0(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}q.createMask=Ce;class zt{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}q.MaskElement=zt;const H0=90,rn=89;class Xe extends zt{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,r;return(e=(t=(r=this.input).getRootNode)==null?void 0:t.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===H0&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===rn&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===H0&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}q.HTMLMaskElement=Xe;class an extends Xe{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}q.HTMLMaskElement=Xe;class Y0 extends Xe{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,n=t&&t.focusOffset;return n==null||r==null||r<n?r:n}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),r=t&&t.anchorOffset,n=t&&t.focusOffset;return n==null||r==null||r>n?r:n}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,t);const n=this.rootElement,i=n.getSelection&&n.getSelection();i&&(i.removeAllRanges(),i.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}q.HTMLContenteditableMaskElement=Y0;class Ye{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Ye.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Ye.MAX_LENGTH=100;class nn{constructor(e,t){this.el=e instanceof zt?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Y0(e):new an(e),this.masked=Ce(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Ye,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof q.Masked)&&this.masked.constructor===X0(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof q.Masked?e:Ce({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const r=this._listeners[e];r&&r.forEach(n=>n(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,i=this.displayValue,u=this.unmaskedValue!==t||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=t,this._value=r,this._rawInputValue=n,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),u&&this._fireChangeEvents(),!this._historyChanging&&(u||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...r}=e,n=!this.maskEquals(t),i=this.masked.optionsIsChanged(r);n&&(this.mask=t),i&&this.masked.updateOptions(r),(n||i)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,z.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(t);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new tn({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=r===this.masked.rawInputValue?t.removeDirection:z.NONE;let u=this.masked.nearestInputPos(t.startChangePos+n,i);i!==z.NONE&&(u=this.masked.nearestInputPos(u,z.NONE)),this.updateControl(u),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}q.InputMask=nn;class K{static normalize(e){return Array.isArray(e)?e:[e,new K]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}q.ChangeDetails=K;class pe{constructor(e,t,r){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class te{constructor(e){this._value="",this._update({...te.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new pe(this.extractInput(e,t),e)}appendTail(e){return Ae(e)&&(e=new pe(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new K({inserted:e,rawInserted:e})):new K}_appendChar(e,t,r){t===void 0&&(t={});const n=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix==="pad")){const u=this.state;this.state=n;let l=this.pad(t);const f=this._appendCharRaw(e,t);l=l.aggregate(f),f.rawInserted||l.equals(i)?i=l:this.state=u}if(i.inserted){let u,l=this.doValidate(t)!==!1;if(l&&r!=null){const f=this.state;if(this.overwrite===!0){u=r.state;for(let d=0;d<i.rawInserted.length;++d)r.unshift(this.displayValue.length-i.tailShift)}let s=this.appendTail(r);if(l=s.rawInserted.length===r.toString().length,!(l&&s.inserted)&&this.overwrite==="shift"){this.state=f,u=r.state;for(let d=0;d<i.rawInserted.length;++d)r.shift();s=this.appendTail(r),l=s.rawInserted.length===r.toString().length}l&&s.inserted&&(this.state=f)}l||(i=new K,this.state=n,r&&u&&(r.state=u))}return i}_appendPlaceholder(){return new K}_appendEager(){return new K}append(e,t,r){if(!Ae(e))throw new Error("value should be string");const n=Ae(r)?new pe(String(r)):r;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let u=0;u<e.length;++u){const l=this._appendChar(e[u],t,n);if(!l.rawInserted&&!this.doSkipInvalid(e[u],t,n))break;i.aggregate(l)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),n!=null&&(i.tailShift+=this.appendTail(n).tailShift),i}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new K}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,r=this.value,n=e();return this.rawInputValue=t,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,r=e(this);return this.state=t,delete this._isolated,r}doSkipInvalid(e,t,r){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),K.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),K.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,r,n,i){r===void 0&&(r=""),n===void 0&&(n=z.NONE),i===void 0&&(i={input:!0});const u=e+t,l=this.extractTail(u),f=this.eager===!0||this.eager==="remove";let s;f&&(n=en(n),s=this.extractInput(0,u,{raw:!0}));let d=e;const g=new K;if(n!==z.NONE&&(d=this.nearestInputPos(e,t>1&&e!==0&&!f?z.NONE:n),g.tailShift=d-e),g.aggregate(this.remove(d)),f&&n!==z.NONE&&s===this.rawInputValue)if(n===z.FORCE_LEFT){let c;for(;s===this.rawInputValue&&(c=this.displayValue.length);)g.aggregate(new K({tailShift:-1})).aggregate(this.remove(c-1))}else n===z.FORCE_RIGHT&&l.unshift();return g.aggregate(this.append(r,i,l))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Ke(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||te.EMPTY_VALUES.includes(e)&&te.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new K}}te.DEFAULTS={skipInvalid:!0};te.EMPTY_VALUES=[void 0,null,""];q.Masked=te;class De{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Ae(e)?new pe(String(e)):e;const t=this.chunks[this.chunks.length-1],r=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof pe)r?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof De){if(e.stop==null){let n;for(;e.chunks.length&&e.chunks[0].stop==null;)n=e.chunks.shift(),n.from+=e.from,this.extend(n)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof q.MaskedPattern))return new pe(this.toString()).appendTo(e);const t=new K;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],i=e._mapPosToBlock(e.displayValue.length),u=n.stop;let l;if(u!=null&&(!i||i.index<=u)&&((n instanceof De||e._stops.indexOf(u)>=0)&&t.aggregate(e._appendPlaceholder(u)),l=n instanceof De&&e._blocks[u]),l){const f=l.appendTail(n);t.aggregate(f);const s=n.toString().slice(f.rawInserted.length);s&&t.aggregate(e.append(s,{tail:!0}))}else t.aggregate(e.append(n.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...r}=e;Object.assign(this,r),this.chunks=t.map(n=>{const i="chunks"in n?new De:new pe;return i.state=n,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const n=this.chunks[r],i=n.unshift(t);if(n.toString()){if(!i)break;++r}else this.chunks.splice(r,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],r=t.shift();if(t.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class sn{constructor(e,t){this.masked=e,this._log=[];const{offset:r,index:n}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,z.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,z.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,z.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,z.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,z.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,z.NONE),!0})}}class Q0{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new K}nearestInputPos(e,t){t===void 0&&(t=z.NONE);const r=0,n=this._value.length;switch(t){case z.LEFT:case z.FORCE_LEFT:return r;case z.NONE:case z.RIGHT:case z.FORCE_RIGHT:default:return n}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new K;const r=this.eager===!0||this.eager==="append",i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!r)&&!t.tail,u=new K({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),u}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new K;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new pe("")}appendTail(e){return Ae(e)&&(e=new pe(String(e))),e.appendTo(this)}append(e,t,r){const n=this._appendChar(e[0],t);return r!=null&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class We{constructor(e){const{parent:t,isOptional:r,placeholderChar:n,displayChar:i,lazy:u,eager:l,...f}=e;this.masked=Ce(f),Object.assign(this,{parent:t,isOptional:r,placeholderChar:n,displayChar:i,lazy:u,eager:l})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new K}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new K;const r=this.masked.state;let n=this.masked._appendChar(e,this.currentMaskFlags(t));return n.inserted&&this.doValidate(t)===!1&&(n=new K,this.masked.state=r),!n.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(e,t,r){return this.masked.append(e,this.currentMaskFlags(t),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new K:(this.isFilled=!0,new K({inserted:this.placeholderChar}))}_appendEager(){return new K}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,r)}nearestInputPos(e,t){t===void 0&&(t=z.NONE);const r=0,n=this.value.length,i=Math.min(Math.max(e,r),n);switch(t){case z.LEFT:case z.FORCE_LEFT:return this.isComplete?i:r;case z.RIGHT:case z.FORCE_RIGHT:return this.isComplete?i:n;case z.NONE:default:return i}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||(e==null?void 0:e._beforeTailState)}}pad(e){return new K}}We.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class on extends te{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=r=>r.search(t)>=0),super._update(e)}}q.MaskedRegExp=on;class re extends te{constructor(e){super({...re.DEFAULTS,...e,definitions:Object.assign({},We.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let r=!1,n=!1;for(let i=0;i<t.length;++i){if(this.blocks){const s=t.slice(i),d=Object.keys(this.blocks).filter(c=>s.indexOf(c)===0);d.sort((c,v)=>v.length-c.length);const g=d[0];if(g){const{expose:c,repeat:v,...x}=$e(this.blocks[g]),C={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...x,repeat:v,parent:this},p=v!=null?new q.RepeatBlock(C):Ce(C);p&&(this._blocks.push(p),c&&(this.exposeBlock=p),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),i+=g.length-1;continue}}let u=t[i],l=u in e;if(u===re.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(u==="{"||u==="}"){r=!r;continue}if(u==="["||u==="]"){n=!n;continue}if(u===re.ESCAPE_CHAR){if(++i,u=t[i],!u)break;l=!1}const f=l?new We({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...$e(e[u]),parent:this}):new Q0({char:u,eager:this.eager,isUnmasking:r});this._blocks.push(f)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...r}=e;this._blocks.forEach((n,i)=>n.state=t[i]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new K;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return t;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const i=this._blocks[n]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const r=this._mapPosToBlock(this.displayValue.length),n=new K;if(!r)return n;for(let u=r.index,l;l=this._blocks[u];++u){var i;const f=l._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[u]});if(n.aggregate(f),f.consumed)break}return n}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=new De;return e===t||this._forEachBlocksInRange(e,t,(n,i,u,l)=>{const f=n.extractTail(u,l);f.stop=this._findStopBefore(i),f.from=this._blockStartPos(i),f instanceof De&&(f.blockIndex=i),r.extend(f)}),r}extractInput(e,t,r){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),r===void 0&&(r={}),e===t)return"";let n="";return this._forEachBlocksInRange(e,t,(i,u,l,f)=>{n+=i.extractInput(l,f,r)}),n}_findStopBefore(e){let t;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(n<=e)t=n;else break}return t}_appendPlaceholder(e){const t=new K;if(this.lazy&&e==null)return t;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return t;const n=r.index,i=e??this._blocks.length;return this._blocks.slice(n,i).forEach(u=>{if(!u.lazy||e!=null){var l;t.aggregate(u._appendPlaceholder((l=u._blocks)==null?void 0:l.length))}}),t}_mapPosToBlock(e){let t="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],i=t.length;if(t+=n.displayValue,e<=t.length)return{index:r,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,r)=>t+=r.displayValue.length,0)}_forEachBlocksInRange(e,t,r){t===void 0&&(t=this.displayValue.length);const n=this._mapPosToBlock(e);if(n){const i=this._mapPosToBlock(t),u=i&&n.index===i.index,l=n.offset,f=i&&u?i.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,l,f),i&&!u){for(let s=n.index+1;s<i.index;++s)r(this._blocks[s],s,0,this._blocks[s].displayValue.length);r(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=super.remove(e,t);return this._forEachBlocksInRange(e,t,(n,i,u,l)=>{r.aggregate(n.remove(u,l))}),r}nearestInputPos(e,t){if(t===void 0&&(t=z.NONE),!this._blocks.length)return 0;const r=new sn(this,e);if(t===z.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(t===z.LEFT||t===z.FORCE_LEFT){if(t===z.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),t===z.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:t===z.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return t===z.RIGHT||t===z.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:t===z.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,z.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,t,(n,i,u,l)=>{r+=n.totalInputPositions(u,l)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(r=>this._blocks[r]):[]}pad(e){const t=new K;return this._forEachBlocksInRange(0,this.displayValue.length,r=>t.aggregate(r.pad(e))),t}}re.DEFAULTS={...te.DEFAULTS,lazy:!0,placeholderChar:"_"};re.STOP_CHAR="`";re.ESCAPE_CHAR="\\";re.InputDefinition=We;re.FixedDefinition=Q0;q.MaskedPattern=re;class qe extends re{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:i=this.autofix,...u}=e;this.to=t,this.from=r,this.maxLength=Math.max(String(t).length,n),this.autofix=i;const l=String(this.from).padStart(this.maxLength,"0"),f=String(this.to).padStart(this.maxLength,"0");let s=0;for(;s<f.length&&f[s]===l[s];)++s;u.mask=f.slice(0,s).replace(/0/g,"\\0")+"0".repeat(this.maxLength-s),super._update(u)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",r="";const[,n,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(n.length)+i,r="9".repeat(n.length)+i),t=t.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[t,r]}doPrepareChar(e,t){t===void 0&&(t={});let r;return[e,r]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(r.skip=!this.isComplete),[e,r]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[i,u]=this.boundaries(this.value+e);return Number(u)<this.from?super._appendCharRaw(r[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(n[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[n,i]=this.boundaries(t);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){const t=new K;if(this.value.length===this.maxLength)return t;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let i=0;i<n;++i)t.aggregate(super._appendCharRaw("0",e));r.split("").forEach(i=>this._appendCharRaw(i))}return t}}q.MaskedRange=qe;const ln="d{.}`m{.}`Y";class me extends re{static extractPatternOptions(e){const{mask:t,pattern:r,...n}=e;return{...n,mask:Ae(t)?t:r}}constructor(e){super(me.extractPatternOptions({...me.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:r,blocks:n,...i}={...me.DEFAULTS,...e},u=Object.assign({},me.GET_DEFAULT_BLOCKS());e.min&&(u.Y.from=e.min.getFullYear()),e.max&&(u.Y.to=e.max.getFullYear()),e.min&&e.max&&u.Y.from===u.Y.to&&(u.m.from=e.min.getMonth()+1,u.m.to=e.max.getMonth()+1,u.m.from===u.m.to&&(u.d.from=e.min.getDate(),u.d.to=e.max.getDate())),Object.assign(u,this.blocks,n),super._update({...i,mask:Ae(t)?t:r,blocks:u})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(me.extractPatternOptions(e))}}me.GET_DEFAULT_BLOCKS=()=>({d:{mask:qe,from:1,to:31,maxLength:2},m:{mask:qe,from:1,to:12,maxLength:2},Y:{mask:qe,from:1900,to:9999}});me.DEFAULTS={...re.DEFAULTS,mask:Date,pattern:ln,format:(o,e)=>{if(!o)return"";const t=String(o.getDate()).padStart(2,"0"),r=String(o.getMonth()+1).padStart(2,"0"),n=o.getFullYear();return[t,r,n].join(".")},parse:(o,e)=>{const[t,r,n]=o.split(".").map(Number);return new Date(n,r-1,t)}};q.MaskedDate=me;class Qe extends te{constructor(e){super({...Qe.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:r,...n}=$e(t),i=Ce({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return r&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const r=this._applyDispatch(e,t);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),r}_applyDispatch(e,t,r){e===void 0&&(e=""),t===void 0&&(t={}),r===void 0&&(r="");const n=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,u=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,l=i.slice(u.length),f=this.currentMask,s=new K,d=f==null?void 0:f.state;return this.currentMask=this.doDispatch(e,{...t},r),this.currentMask&&(this.currentMask!==f?(this.currentMask.reset(),u&&(this.currentMask.append(u,{raw:!0}),s.tailShift=this.currentMask.value.length-n.length),l&&(s.tailShift+=this.currentMask.append(l,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),s}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new K;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,r;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,t,r){return t===void 0&&(t={}),r===void 0&&(r=""),this.dispatch(e,this,t,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[r,n]=super.doPrepare(e,t);if(this.currentMask){let i;[r,i]=super.doPrepare(r,this.currentMaskFlags(t)),n=n.aggregate(i)}return[r,n]}doPrepareChar(e,t){t===void 0&&(t={});let[r,n]=super.doPrepareChar(e,t);if(this.currentMask){let i;[r,i]=super.doPrepareChar(r,this.currentMaskFlags(t)),n=n.aggregate(i)}return[r,n]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const r=new K;return this.currentMask&&r.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:r,currentMask:n,...i}=e;t&&this.compiledMasks.forEach((u,l)=>u.state=t[l]),r!=null&&(this.currentMask=r,this.currentMask.state=n),super.state=i}extractInput(e,t,r){return this.currentMask?this.currentMask.extractInput(e,t,r):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,r)=>{if(!e[r])return;const{mask:n,...i}=e[r];return Ke(t,i)&&t.maskEquals(n)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Qe.DEFAULTS={...te.DEFAULTS,dispatch:(o,e,t,r)=>{if(!e.compiledMasks.length)return;const n=e.rawInputValue,i=e.compiledMasks.map((u,l)=>{const f=e.currentMask===u,s=f?u.displayValue.length:u.nearestInputPos(u.displayValue.length,z.FORCE_LEFT);return u.rawInputValue!==n?(u.reset(),u.append(n,{raw:!0})):f||u.remove(s),u.append(o,e.currentMaskFlags(t)),u.appendTail(r),{index:l,weight:u.rawInputValue.length,totalInputPositions:u.totalInputPositions(0,Math.max(s,u.nearestInputPos(u.displayValue.length,z.FORCE_LEFT)))}});return i.sort((u,l)=>l.weight-u.weight||l.totalInputPositions-u.totalInputPositions),e.compiledMasks[i[0].index]}};q.MaskedDynamic=Qe;class Je extends re{constructor(e){super({...Je.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...r}=e;if(t){const n=t.map(l=>l.length),i=Math.min(...n),u=Math.max(...n)-i;r.mask="*".repeat(i),u&&(r.mask+="["+"*".repeat(u)+"]"),this.enum=t}super._update(r)}_appendCharRaw(e,t){t===void 0&&(t={});const r=Math.min(this.nearestInputPos(0,z.FORCE_RIGHT),this.value.length),n=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,r));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(u,l)=>{const f=n[0][l];l>=this.value.length||f===u.value||(u.reset(),u._appendChar(f,t))});const i=super._appendCharRaw(n[0][this.value.length],t);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(u=>i.aggregate(super._appendCharRaw(u))),i}return new K({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new pe("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new K;const r=Math.min(super.nearestInputPos(0,z.FORCE_RIGHT),this.value.length);let n;for(n=e;n>=0&&!(this.enum.filter(l=>this.matchValue(l,this.value.slice(r,n),r)).length>1);--n);const i=super.remove(n,t);return i.tailShift+=n-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}Je.DEFAULTS={...re.DEFAULTS,matchValue:(o,e,t)=>o.indexOf(e,t)===t};q.MaskedEnum=Je;class un extends te{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}q.MaskedFunction=un;var J0;class ie extends te{constructor(e){super({...ie.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",r=(this.scale?"("+Mt(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Mt).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Mt(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!r&&(n.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(e,t){t===void 0&&(t=!1);let r=0;for(let n=0;n<e;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,t&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,r))}_appendCharRaw(e,t){t===void 0&&(t={});const r=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const u=this.number;let l=!isNaN(u),f=!1;if(l){let c;this.min!=null&&this.min<0&&this.number<this.min&&(c=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(c=this.max),c!=null&&(this.autofix?(this._value=this.format(c,this).replace(ie.UNMASKED_RADIX,this.radix),f||(f=i===this._value&&!t.tail)):l=!1),l&&(l=!!this._value.match(this._numberRegExp))}let s;l?s=new K({inserted:this._value.slice(i.length),rawInserted:f?"":e,skip:f}):(this._value=i,s=new K),this._value=this._insertThousandsSeparators(this._value);const d=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,g=this._separatorsCountFromSlice(d);return s.tailShift+=(g-n)*this.thousandsSeparator.length,s}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,t);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,t){const r=this._findSeparatorAround(e);r>=0&&(e=r);const n=this._findSeparatorAround(t);return n>=0&&(t=n+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const r=this.value.slice(0,e),n=this.value.slice(t),i=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const u=this._separatorsCountFromSlice(r);return new K({tailShift:(u-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case z.NONE:case z.LEFT:case z.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(e<n||this.value.length<=n||t===z.FORCE_LEFT)return r}break}case z.RIGHT:case z.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(r,n,i,u)=>n+u),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,r){t===void 0&&(t={});const n=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===ie.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ie.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(ie.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||ie.EMPTY_VALUES.includes(e)&&ie.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}J0=ie;ie.UNMASKED_RADIX=".";ie.EMPTY_VALUES=[...te.EMPTY_VALUES,0];ie.DEFAULTS={...te.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[J0.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:o=>o.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};q.MaskedNumber=ie;const Ot={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function er(o,e,t){e===void 0&&(e=Ot.MASKED),t===void 0&&(t=Ot.MASKED);const r=Ce(o);return n=>r.runIsolated(i=>(i[e]=n,i[t]))}function cn(o,e,t,r){return er(e,t,r)(o)}q.PIPE_TYPE=Ot;q.createPipe=er;q.pipe=cn;class dn extends re{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,r,n;const{repeat:i,...u}=$e(e);this._blockOpts=Object.assign({},this._blockOpts,u);const l=Ce(this._blockOpts);this.repeat=(t=(r=i??l.repeat)!=null?r:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:l},eager:l.eager,overwrite:l.overwrite,skipInvalid:l.skipInvalid,lazy:l.lazy,placeholderChar:l.placeholderChar,displayChar:l.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Ce(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const r=new K;for(let f=(n=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?n:Math.max(this._blocks.length-1,0),s,d;s=(u=this._blocks[f])!=null?u:d=!d&&this._allocateBlock(f);++f){var n,i,u,l;const g=s._appendChar(e,{...t,_beforeTailState:(l=t._beforeTailState)==null||(l=l._blocks)==null?void 0:l[f]});if(g.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(g),g.consumed)break}return r}_trimEmptyTail(e,t){var r,n;e===void 0&&(e=0);const i=Math.max(((r=this._mapPosToBlock(e))==null?void 0:r.index)||0,this.repeatFrom,0);let u;t!=null&&(u=(n=this._mapPosToBlock(t))==null?void 0:n.index),u==null&&(u=this._blocks.length-1);let l=0;for(let f=u;i<=f&&!this._blocks[f].unmaskedValue;--f,++l);l&&(this._blocks.splice(u-l+1,l),this.mask=this.mask.slice(l))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const r=super.remove(e,t);return this._trimEmptyTail(e,t),r}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}q.RepeatBlock=dn;try{globalThis.IMask=q}catch{}const xn={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},hn={key:0,class:"text-orange-required"},fn=["type","value","disabled","mask","placeholder","inputmode"],pn={key:1,class:"animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full"},vn={key:1,class:"text-body-3xs text-light-copy"},mn={key:2,class:"text-body-3xs text-red-500"},ue=a.defineComponent({__name:"input",props:{label:{default:""},type:{default:"text"},placeholder:{default:void 0},validationError:{default:""},hint:{default:""},mask:{default:""},rules:{default:()=>[]},isAmountInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},showCopyIcon:{type:Boolean,default:!1},modelValue:{default:void 0},defaultValue:{default:""},className:{default:""}},emits:["update:modelValue","blur","copied"],setup(o,{emit:e}){const t=o,r=e,n=a.computed(()=>t.modelValue!==void 0),i=a.ref(t.modelValue??t.defaultValue??""),u=a.ref(""),l=a.ref(""),f=a.ref(null);let s=null;a.watch(()=>t.modelValue,h=>{n.value&&(i.value=h??"",s&&s.value!==(h??"")&&(s.value=h??""))});const d=a.computed(()=>t.isAmountInput?we(i.value.replace(/,/g,"")):i.value);function g(h){const B=h.target.value.replace(/,/g,"");n.value||(i.value=B),r("update:modelValue",B),a.nextTick(()=>{const b=f.value;if(b){const A=b.value.length;b.setSelectionRange(A,A)}})}function c(){r("blur",i.value)}function v(h){t.rules.includes("numeric")&&Cr(h)}const x=a.computed(()=>t.disabled?"bg-grey-50 cursor-not-allowed":"bg-white"),C=a.computed(()=>t.validationError||l.value?"border-red-300 bg-red-50":"border-grey-100");function p(h){return navigator.clipboard.writeText(h)}function E(){p(i.value).then(()=>{l.value="",u.value="Text copied to clipboard",r("copied")}).catch(()=>{u.value="",l.value="Failed to copy text to clipboard"})}return a.onMounted(()=>{if(!f.value)return;const h=t.mask?{mask:t.mask}:void 0;h&&(s=q(f.value,h),i.value&&(s.value=i.value),s.on("accept",()=>{const m=(s==null?void 0:s.value)??"";n.value||(i.value=m),r("update:modelValue",m),a.nextTick(()=>{const B=f.value;if(B){const b=B.value.length;B.setSelectionRange(b,b)}})}))}),a.onBeforeUnmount(()=>{s==null||s.destroy(),s=null}),(h,m)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex flex-col gap-2",h.className])},[h.label?(a.openBlock(),a.createElementBlock("p",xn,[a.createTextVNode(a.toDisplayString(h.label)+" ",1),h.required?(a.openBlock(),a.createElementBlock("span",hn," *")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["border-c px-3 py-2 flex items-center justify-between rounded-md h-12",x.value,C.value])},[a.renderSlot(h.$slots,"prefix"),a.createElementVNode("input",{ref_key:"inputEl",ref:f,type:h.type,value:d.value,disabled:h.disabled,mask:h.mask,placeholder:h.placeholder??(h.label?`Enter ${h.label.toLowerCase()}`:void 0),inputmode:h.isAmountInput?"decimal":void 0,class:"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full",onInput:g,onBlur:c,onKeydown:v},null,40,fn),h.loading?(a.openBlock(),a.createElementBlock("div",pn)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(h.$slots,"suffix"),h.showCopyIcon&&i.value.trim()!==""?(a.openBlock(),a.createBlock(ke,{key:0,src:"assets/images/copyIcon.svg",alt:"copy",width:16,height:16,customClass:"cursor-pointer hover:opacity-70 transition-opacity",onClick:E})):a.createCommentVNode("",!0)],64))],2),h.hint||u.value?(a.openBlock(),a.createElementBlock("p",vn,a.toDisplayString(u.value||h.hint),1)):a.createCommentVNode("",!0),h.validationError||l.value?(a.openBlock(),a.createElementBlock("p",mn,a.toDisplayString(l.value||h.validationError),1)):a.createCommentVNode("",!0)],2))}}),Cn=["width","height"],gn={opacity:"0.6"},Bn=["fill"],_n=a.defineComponent({__name:"icon-chevron-down",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",gn,[a.createElementVNode("path",{d:"M16.5813 7.83128L10.3313 14.0813C10.2434 14.1691 10.1242 14.2184 10 14.2184C9.87581 14.2184 9.75667 14.1691 9.66878 14.0813L3.41878 7.83128C3.33598 7.74242 3.2909 7.62489 3.29304 7.50345C3.29518 7.38201 3.34438 7.26615 3.43026 7.18026C3.51615 7.09438 3.63201 7.04518 3.75345 7.04304C3.87489 7.0409 3.99242 7.08598 4.08128 7.16878L10 13.0867L15.9188 7.16878C16.0076 7.08598 16.1252 7.0409 16.2466 7.04304C16.368 7.04518 16.4839 7.09438 16.5698 7.18026C16.6557 7.26615 16.7049 7.38201 16.707 7.50345C16.7092 7.62489 16.6641 7.74242 16.5813 7.83128Z",fill:a.unref(i)},null,8,Bn)])],16,Cn))}}),En=["width","height"],yn={opacity:"0.7"},kn=["fill"],An=a.defineComponent({__name:"icon-chevron-up",props:{width:{default:24},height:{default:24},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",yn,[a.createElementVNode("path",{d:"M2.73508 9.73495L7.73508 4.73495C7.80539 4.66473 7.9007 4.62528 8.00008 4.62528C8.09945 4.62528 8.19476 4.66473 8.26508 4.73495L13.2651 9.73495C13.3313 9.80604 13.3674 9.90006 13.3657 9.99722C13.364 10.0944 13.3246 10.1871 13.2559 10.2558C13.1872 10.3245 13.0945 10.3638 12.9973 10.3655C12.9002 10.3673 12.8062 10.3312 12.7351 10.265L8.00008 5.53058L3.26508 10.265C3.19399 10.3312 3.09997 10.3673 3.00282 10.3655C2.90566 10.3638 2.81297 10.3245 2.74427 10.2558C2.67556 10.1871 2.6362 10.0944 2.63449 9.99722C2.63277 9.90006 2.66884 9.80604 2.73508 9.73495Z",fill:a.unref(i)},null,8,kn)])],16,En))}}),bn={class:"mb-0 text-body-3xs font-medium text-orange-500"},Fn=a.defineComponent({__name:"hint",props:{hint:{}},setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("p",bn,a.toDisplayString(e.hint),1))}}),Dn={key:0,class:"mb-0 text-body-2xs font-normal text-heading-text"},wn={key:0,class:"text-orange-required"},Sn=["aria-expanded","aria-controls","aria-disabled","aria-activedescendant"],Vn={class:"flex items-center gap-2"},Nn={class:"flex items-center gap-2"},Rn={key:0,class:"inline-block h-4 w-4 border-2 border-current border-t-transparent rounded-full animate-spin"},In=["aria-label"],Tn={key:0,class:"px-4 pt-2 pb-1"},Mn=["placeholder"],Pn=["onClick","id","aria-selected"],On={class:"mb-0 text-body-2xs font-medium"},Ge=a.defineComponent({__name:"select",props:{options:{default:()=>[]},modelValue:{default:void 0},defaultValue:{default:void 0},className:{default:""},placeholder:{default:"Select an option"},hasSearch:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},validationError:{default:""},label:{default:""},hint:{default:""},required:{type:Boolean,default:!1},itemImageType:{default:null}},emits:["update:modelValue","change"],setup(o,{emit:e}){const t=o,r=e,n=a.ref(!1),i=a.ref(t.defaultValue??t.modelValue??""),u=a.ref([...t.options]),l=a.ref(-1),f=a.ref(null),s=a.ref(null),d=a.ref(null),g=a.computed(()=>t.modelValue!==void 0);a.watch(()=>t.modelValue,D=>{g.value&&(i.value=D??"")}),a.watch(()=>t.options,D=>{u.value=[...D]},{immediate:!0});const c=a.computed(()=>{const D=g.value?t.modelValue:i.value;return t.options.find(R=>R.value===D)??null}),v=a.computed(()=>{var D;return((D=c.value)==null?void 0:D.label)||t.placeholder||(t.label?`Select ${t.label}`:"Select an option")});function x(){if(t.disabled||n.value)return;u.value=[...t.options];const D=c.value?Math.max(0,t.options.findIndex(R=>R.value===c.value.value)):0;l.value=D,n.value=!0,a.nextTick(()=>{t.hasSearch&&d.value&&(d.value.focus(),d.value.select())})}function C(){n.value&&(n.value=!1,l.value=-1)}function p(){t.disabled||(n.value?C():x())}function E(D){if(!n.value)return;const R=D.target,I=f.value,N=s.value;I&&!I.contains(R)&&N&&!N.contains(R)&&C()}a.watch(n,D=>{D?document.addEventListener("mousedown",E):document.removeEventListener("mousedown",E)}),a.onBeforeUnmount(()=>document.removeEventListener("mousedown",E));function h(D){g.value||(i.value=D),r("update:modelValue",D),r("change",D),C()}function m(D){const R=D.target.value.toLowerCase(),I=t.options.filter(N=>N.label.toLowerCase().includes(R));u.value=I,l.value=I.length?0:-1}function B(D){if(!t.disabled)switch(D.key){case"Enter":case" ":case"Spacebar":case"ArrowDown":D.preventDefault(),n.value?A(1):x();break;case"ArrowUp":D.preventDefault(),n.value?A(-1):x();break;case"Escape":n.value&&(D.preventDefault(),C());break}}function b(D){switch(D.key){case"ArrowDown":D.preventDefault(),A(1);break;case"ArrowUp":D.preventDefault(),A(-1);break;case"Home":D.preventDefault(),l.value=u.value.length?0:-1,w(0);break;case"End":D.preventDefault(),l.value=u.value.length-1,w(u.value.length-1);break;case"Enter":if(D.preventDefault(),l.value>=0){const R=u.value[l.value];R&&h(R.value)}break;case"Escape":D.preventDefault(),C();break;case"Tab":C();break}}function A(D){if(!u.value.length)return;const R=u.value.length-1,I=l.value<0?0:Math.min(R,Math.max(0,l.value+D));l.value=I,w(I)}function w(D){var N;const R=s.value;if(!R)return;const I=R.querySelectorAll("[data-option]");D>=0&&D<I.length&&((N=I[D])==null||N.scrollIntoView({block:"nearest"}))}const V=a.computed(()=>t.disabled?"bg-grey-100 cursor-not-allowed":"bg-white"),T=a.computed(()=>t.validationError?"border-red-300":"border-grey-100 bg-white"),{options:k,placeholder:S,hasSearch:F,disabled:_,loading:y,validationError:M,label:$,hint:L,required:H,itemImageType:P,className:O}=a.toRefs(t);return(D,R)=>{var I;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["flex flex-col gap-2 relative",a.unref(O)])},[a.unref($)?(a.openBlock(),a.createElementBlock("p",Dn,[a.createTextVNode(a.toDisplayString(a.unref($))+" ",1),a.unref(H)?(a.openBlock(),a.createElementBlock("span",wn," *")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"triggerRef",ref:f,class:a.normalizeClass(["border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2",V.value,T.value]),role:"combobox","aria-haspopup":"listbox","aria-expanded":n.value,"aria-controls":n.value?"select-menu":void 0,"aria-disabled":a.unref(_)||void 0,"aria-activedescendant":n.value&&l.value>=0?`option-${l.value}`:void 0,tabindex:"0",onClick:p,onKeydown:B},[a.createElementVNode("div",Vn,[a.renderSlot(D.$slots,"prefix"),a.createElementVNode("div",Nn,[c.value&&a.unref(P)==="country"&&c.value.countryCode?(a.openBlock(),a.createBlock(ke,{key:0,src:`https://flagcdn.com/w40/${c.value.countryCode.toLowerCase()}.png`,alt:c.value.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(["text-body-2xs font-normal mb-0",(I=c.value)!=null&&I.label?"text-sub-copy":"text-grey-500"])},a.toDisplayString(v.value),3)])]),a.unref(y)?(a.openBlock(),a.createElementBlock("span",Rn)):n.value?(a.openBlock(),a.createBlock(An,{key:1,color:"#8FAECA"})):(a.openBlock(),a.createBlock(_n,{key:2,color:"#8FAECA"}))],42,Sn),n.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"menuRef",ref:s,id:"select-menu",class:"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto",role:"listbox","aria-label":a.unref($)||"Options",style:{position:"absolute",top:"100%",zIndex:10},onKeydown:b},[a.unref(F)?(a.openBlock(),a.createElementBlock("div",Tn,[a.createElementVNode("input",{ref_key:"searchRef",ref:d,type:"text",placeholder:`Search ${a.unref($)||"options"}`,class:"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal",onInput:m},null,40,Mn)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(u.value,(N,X)=>{var Z;return a.openBlock(),a.createElementBlock("div",{key:N.value,onClick:Q=>h(N.value),id:`option-${X}`,"data-option":"",role:"option","aria-selected":((Z=c.value)==null?void 0:Z.value)===N.value,class:a.normalizeClass(["px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer",X===l.value?"bg-gray-100":""])},[a.unref(P)==="country"&&N.countryCode?(a.openBlock(),a.createBlock(ke,{key:0,src:`https://flagcdn.com/w40/${N.countryCode.toLowerCase()}.png`,alt:N.countryCode,width:28,customClass:"rounded-lg"},null,8,["src","alt"])):a.createCommentVNode("",!0),a.createElementVNode("p",On,a.toDisplayString(N.label),1)],10,Pn)}),128))],40,In)):a.createCommentVNode("",!0),a.unref(L)?(a.openBlock(),a.createBlock(Fn,{key:2,hint:a.unref(L)},null,8,["hint"])):a.createCommentVNode("",!0),a.unref(M)?(a.openBlock(),a.createBlock(U0,{key:3,errorMessage:a.unref(M)},null,8,["errorMessage"])):a.createCommentVNode("",!0)],2)}}}),Hn={class:"flex flex-col gap-6"},$n={key:0,class:"grid grid-cols-2 gap-6 overflow-y-auto"},Ln={class:"col-span-2"},zn={class:"col-span-2"},Un={key:1,class:"grid grid-cols-2 gap-6 overflow-y-auto",style:{maxHeight:"320px"}},qn={class:"col-span-2"},jn={class:"col-span-2"},Kn=a.defineComponent({__name:"pay-by-card",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(""),i=a.ref(!1),u=a.ref(!1),l=a.ref(""),f=a.ref(""),s=a.ref(!1),d=a.ref(!1),g=a.ref([]),c=a.ref([]),v=a.ref([]),x=a.reactive({address1:"",address2:"",postalCode:"",state:"",city:"",country:"",emailAddress:"",phoneNumber:""}),C=a.reactive({customerName:"",cardNo:"",expireDate:"",cvv:"",cardPin:""}),p=a.reactive({}),E=a.reactive({}),h=a.reactive({address1:"required",address2:"",country:"required",state:"required",city:"required",postalCode:"required|no_special|char_length:6",emailAddress:"required|email",phoneNumber:"required"}),m=a.reactive({customerName:"required",cardNo:"required|num_spaces",expireDate:"required",cvv:"required|numeric",cardPin:""}),B={address1:"Address Line 1",address2:"Address Line 2",postalCode:"Postal Code",state:"State",city:"City",country:"Country",emailAddress:"Email",phoneNumber:"Phone Number"},b={customerName:"Card Name",cardNo:"Card Number",expireDate:"Expiry Date",cvv:"CVV",cardPin:"Card PIN"},A=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency));async function w(){var F,_,y,M,$,L,H,P,O,D,R,I,N,X,Z,Q,j,ge,ve,Re,Be,ae,ee,Fe,_e;if(r.value===0){const fe=je(x,h,B);Object.assign(p,fe),Object.keys(fe).length===0&&(r.value=1);return}if(r.value===1){const fe=je(C,m,b);if(Object.assign(E,fe),Object.keys(fe).length>0)return;try{i.value=!0,n.value="";const Y={pan:C.cardNo??"",expiryDate:C.expireDate??"",cvv:C.cvv??"",cardScheme:l.value,nameOnCard:C.customerName??"",...l.value==="Verve"?{pin:C.cardPin??""}:{}},oe={address1:x.address1??"",address2:x.address2??"",postalCode:x.postalCode??"",state:x.state??"",city:x.city??"",country:x.country??"",emailAddress:x.emailAddress??"",phoneNumber:x.phoneNumber??""},de=Za(t,Y),ne={...{customerId:((F=e.paymentObject)==null?void 0:F.email)||C.customerName||"",amount:String(((_=e.paymentObject)==null?void 0:_.amount)??""),currency:((y=e.paymentObject)==null?void 0:y.currency)||"USD",narration:((M=e.paymentObject)==null?void 0:M.narration)||"Test transaction",encryptedCardDetails:de.requestParam,billingDetails:oe,redirectUrl:(($=e.paymentObject)==null?void 0:$.redirectUrl)||"",paymentReference:f.value,isCheckout:!0},merchantId:e.secretKey};let U=await jr(t,ne);if(U!=null&&U.responseParam&&(U=P0(t,U.responseParam)),U!=null&&U.isSuccessful){if(U.threeDsInteractionRequired===!0){const Ee={transactionReference:U.transactionReference,threeDsHtml:U.threeDsHtml,amount:U.amount,responseMessage:U.responseMessage,paReq:(L=U.threeDsHtml)==null?void 0:L.paReq,termUrl:(H=U.threeDsHtml)==null?void 0:H.termUrl,action:(P=U.threeDsHtml)==null?void 0:P.action,acsUrl:(O=U.threeDsHtml)==null?void 0:O.acsUrl,md:(D=U.threeDsHtml)==null?void 0:D.md};localStorage.setItem("threeDsData",JSON.stringify(Ee));const Ie=`${window.location.origin}/account/three-ds-confirm`;window.open(Ie,"_blank","noopener,noreferrer"),n.value="3D Secure authentication opened in new tab. Please complete the verification",i.value=!1;return}if(U.responseMessage==="Payer Interaction Required"&&U.threeDsHtml){const Ee={transactionReference:U.transactionReference,threeDsHtml:U.threeDsHtml,amount:U.amount,responseMessage:U.responseMessage,paReq:(R=U.threeDsHtml)==null?void 0:R.paReq,termUrl:(I=U.threeDsHtml)==null?void 0:I.termUrl,action:(N=U.threeDsHtml)==null?void 0:N.action,acsUrl:(X=U.threeDsHtml)==null?void 0:X.acsUrl,md:(Z=U.threeDsHtml)==null?void 0:Z.md};localStorage.setItem("threeDsData",JSON.stringify(Ee));const Ie=`${window.location.origin}/account/three-ds-confirm`;window.open(Ie,"_blank","noopener,noreferrer"),n.value="3D Secure authentication opened in new tab. Please complete the verification",i.value=!1;return}(Q=U.transactionReference)!=null&&Q.trim()&&((ge=e.onPaymentAuthorized)==null||ge.call(e,{paymentId:U.transactionReference,paymentDate:(j=U==null?void 0:U.data)==null?void 0:j.updatedAt,paymentStatus:"Authorized"})),n.value="Card payment authorized successfully",i.value=!1;return}n.value=(U==null?void 0:U.responseMessage)||"Payment failed",(Re=e.onPaymentAuthorized)==null||Re.call(e,{paymentId:U==null?void 0:U.transactionReference,paymentDate:(ve=U==null?void 0:U.data)==null?void 0:ve.updatedAt,paymentStatus:"Payment failed"}),i.value=!1}catch(Y){let oe="Payment failed";if((Be=Y==null?void 0:Y.error)!=null&&Be.responseParam)try{const de=P0(t,Y.error.responseParam);oe=(de==null?void 0:de.responseMessage)||oe}catch{oe=((ae=Y==null?void 0:Y.error)==null?void 0:ae.responseMessage)||((ee=Y==null?void 0:Y.error)==null?void 0:ee.message)||oe}else oe=((Fe=Y==null?void 0:Y.error)==null?void 0:Fe.responseMessage)||((_e=Y==null?void 0:Y.error)==null?void 0:_e.message)||"Payment failed";n.value=oe,i.value=!1}}}async function V(){if(!e.secretKey){n.value="Secret key is required.";return}if(!ze(e.paymentObject)){n.value="Kindly ensure you are passing all the required data.";return}u.value=!0,n.value="";try{const F=await Ue(e.paymentObject,t,e.secretKey);if(F!=null&&F.isSuccessful&&F.launchUrl){const _=Ht(F.launchUrl);f.value=_.paymentReference,n.value="Payment link created successfully"}else n.value="Failed to create payment link"}catch(F){n.value=(F==null?void 0:F.message)||"Failed to create payment link"}finally{u.value=!1}}async function T(){s.value=!0;try{const F=await Xa(t,e.secretKey);F!=null&&F.isSuccessful&&(g.value=F.data,c.value=(F.data??[]).map(_=>({label:_.countryName,value:_.iso2})))}catch(F){n.value=(F==null?void 0:F.message)||"Failed to get countries"}finally{s.value=!1}}async function k(F){const _=g.value.find(y=>y.iso2===F);if(_){d.value=!0;try{const y=await Ya(_.iso3,t,e.secretKey);y!=null&&y.isSuccessful&&(v.value=(y.data??[]).map(M=>({label:M.name,value:M.name})))}catch(y){n.value=(y==null?void 0:y.message)||"Failed to get country states"}finally{d.value=!1}}}function S(F){l.value=Mr(F),m.cardPin=l.value==="Verve"?"required|numeric":""}return a.onMounted(async()=>{await V(),await T()}),(F,_)=>(a.openBlock(),a.createElementBlock("div",Hn,[r.value===0?(a.openBlock(),a.createElementBlock("div",$n,[a.createElementVNode("div",Ln,[a.createVNode(ue,{label:"Address Line 1",required:"",modelValue:x.address1,"onUpdate:modelValue":[_[0]||(_[0]=y=>x.address1=y),_[1]||(_[1]=y=>{x.address1=y,p.address1&&(p.address1="")})],"validation-error":p.address1??""},null,8,["modelValue","validation-error"])]),a.createElementVNode("div",zn,[a.createVNode(ue,{label:"Address Line 2",modelValue:x.address2,"onUpdate:modelValue":[_[2]||(_[2]=y=>x.address2=y),_[3]||(_[3]=y=>x.address2=y)],"validation-error":p.address2??""},null,8,["modelValue","validation-error"])]),a.createVNode(Ge,{label:"Select Country",required:"",options:c.value,loading:s.value,modelValue:x.country,"onUpdate:modelValue":[_[4]||(_[4]=y=>x.country=y),_[5]||(_[5]=async y=>{x.country=y,x.state="",await k(y),p.country&&(p.country="")})],"validation-error":p.country??""},null,8,["options","loading","modelValue","validation-error"]),a.createVNode(Ge,{label:"Select State",required:"",options:v.value,loading:d.value,modelValue:x.state,"onUpdate:modelValue":[_[6]||(_[6]=y=>x.state=y),_[7]||(_[7]=y=>{x.state=y,p.state&&(p.state="")})],"validation-error":p.state??""},null,8,["options","loading","modelValue","validation-error"]),a.createVNode(ue,{label:"City",required:"",modelValue:x.city,"onUpdate:modelValue":[_[8]||(_[8]=y=>x.city=y),_[9]||(_[9]=y=>{x.city=y,p.city&&(p.city="")})],"validation-error":p.city??""},null,8,["modelValue","validation-error"]),a.createVNode(ue,{label:"Postal Code",required:"",modelValue:x.postalCode,"onUpdate:modelValue":[_[10]||(_[10]=y=>x.postalCode=y),_[11]||(_[11]=y=>{x.postalCode=y,p.postalCode&&(p.postalCode="")})],"validation-error":p.postalCode??""},null,8,["modelValue","validation-error"]),a.createVNode(ue,{label:"Email",required:"",modelValue:x.emailAddress,"onUpdate:modelValue":[_[12]||(_[12]=y=>x.emailAddress=y),_[13]||(_[13]=y=>{x.emailAddress=y,p.emailAddress&&(p.emailAddress="")})],"validation-error":p.emailAddress??""},null,8,["modelValue","validation-error"]),a.createVNode(ue,{label:"Phone Number",required:"",modelValue:x.phoneNumber,"onUpdate:modelValue":[_[14]||(_[14]=y=>x.phoneNumber=y),_[15]||(_[15]=y=>{x.phoneNumber=y,p.phoneNumber&&(p.phoneNumber="")})],"validation-error":p.phoneNumber??""},null,8,["modelValue","validation-error"])])):a.createCommentVNode("",!0),r.value===1?(a.openBlock(),a.createElementBlock("div",Un,[a.createElementVNode("div",qn,[a.createVNode(ue,{label:"Card Name",required:"",modelValue:C.customerName,"onUpdate:modelValue":[_[16]||(_[16]=y=>C.customerName=y),_[17]||(_[17]=y=>{C.customerName=y,E.customerName&&(E.customerName="")})],"validation-error":E.customerName??""},null,8,["modelValue","validation-error"])]),a.createElementVNode("div",jn,[a.createVNode(ue,{label:"Card Number",required:"",rules:["numeric"],mask:"0000 0000 0000 0000",placeholder:"0000 0000 0000 0000",modelValue:C.cardNo,"onUpdate:modelValue":[_[18]||(_[18]=y=>C.cardNo=y),_[19]||(_[19]=y=>{C.cardNo=y,E.cardNo&&(E.cardNo=""),S(y)})],"validation-error":E.cardNo??""},null,8,["modelValue","validation-error"])]),a.createVNode(ue,{label:"Expiry Date",required:"",modelValue:C.expireDate,"onUpdate:modelValue":[_[20]||(_[20]=y=>C.expireDate=y),_[21]||(_[21]=y=>{C.expireDate=y,E.expireDate&&(E.expireDate="")})],mask:"00/00",placeholder:"00/00","validation-error":E.expireDate??""},null,8,["modelValue","validation-error"]),a.createVNode(ue,{label:"CVV",required:"",rules:["numeric"],modelValue:C.cvv,"onUpdate:modelValue":[_[22]||(_[22]=y=>C.cvv=y),_[23]||(_[23]=y=>{C.cvv=y,E.cvv&&(E.cvv="")})],mask:"000",placeholder:"000","validation-error":E.cvv??""},null,8,["modelValue","validation-error"]),l.value==="Verve"?(a.openBlock(),a.createBlock(ue,{key:0,label:"Card Pin",required:"",rules:["numeric"],modelValue:C.cardPin,"onUpdate:modelValue":[_[24]||(_[24]=y=>C.cardPin=y),_[25]||(_[25]=y=>{C.cardPin=y,E.cardPin&&(E.cardPin="")})],mask:"0000",placeholder:"0000","validation-error":E.cardPin??""},null,8,["modelValue","validation-error"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(Se,{label:r.value===0?"Proceed":`Pay ${A.value}`,type:"primary",customClass:"w-full",loading:i.value,onClick:w,disabled:i.value},null,8,["label","loading","disabled"])]))}}),Wn=["width","height"],Gn=["fill"],Zn=["fill"],Xn=["fill"],Yn=a.defineComponent({__name:"icon-copy-success",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M11.4002 1.6875H8.60016C5.9935 1.6875 4.8335 2.8475 4.8335 5.45417V6.1875C4.8335 6.46083 5.06016 6.6875 5.3335 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V11.5208C10.1668 11.7942 10.3935 12.0208 10.6668 12.0208H11.4002C14.0068 12.0208 15.1668 10.8608 15.1668 8.25417V5.45417C15.1668 2.8475 14.0068 1.6875 11.4002 1.6875ZM5.8335 5.6875V5.45417C5.8335 3.3875 6.5335 2.6875 8.60016 2.6875H11.4002C13.4668 2.6875 14.1668 3.3875 14.1668 5.45417V8.25417C14.1668 10.3208 13.4668 11.0208 11.4002 11.0208H11.1668V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875H5.8335Z",fill:a.unref(i)},null,8,Gn),a.createElementVNode("path",{d:"M7.40016 5.6875H4.60016C1.9935 5.6875 0.833496 6.8475 0.833496 9.45417V12.2542C0.833496 14.8608 1.9935 16.0208 4.60016 16.0208H7.40016C10.0068 16.0208 11.1668 14.8608 11.1668 12.2542V9.45417C11.1668 6.8475 10.0068 5.6875 7.40016 5.6875ZM4.60016 15.0208C2.5335 15.0208 1.8335 14.3208 1.8335 12.2542V9.45417C1.8335 7.3875 2.5335 6.6875 4.60016 6.6875H7.40016C9.46683 6.6875 10.1668 7.3875 10.1668 9.45417V12.2542C10.1668 14.3208 9.46683 15.0208 7.40016 15.0208H4.60016Z",fill:a.unref(i)},null,8,Zn),a.createElementVNode("path",{d:"M5.35302 12.6542C5.22635 12.6542 5.09969 12.6075 4.99969 12.5075L3.69969 11.2075C3.50635 11.0142 3.50635 10.6942 3.69969 10.5008C3.89302 10.3075 4.21302 10.3075 4.40635 10.5008L5.35302 11.4475L7.59302 9.2075C7.78635 9.01417 8.10635 9.01417 8.29969 9.2075C8.49302 9.40083 8.49302 9.72083 8.29969 9.91417L5.69969 12.5075C5.60635 12.6008 5.47969 12.6542 5.35302 12.6542Z",fill:a.unref(i)},null,8,Xn)],16,Wn))}}),Le=a.defineComponent({__name:"copy",props:{copyText:{},color:{}},setup(o){const e=o;function t(n){return navigator.clipboard.writeText(n)}function r(){t(e.copyText).then(()=>{}).catch(n=>{console.error("Copy failed:",n)})}return(n,i)=>(a.openBlock(),a.createBlock(Yn,{class:"cursor-pointer",color:n.color,onClick:r},null,8,["color"]))}}),Qn={class:"flex items-center gap-1"},Jn={key:1,class:"flex items-center justify-between"},es={class:"flex items-center gap-1"},He=a.defineComponent({__name:"label-info",props:{type:{default:"vertical"},label:{default:""},labelCustomClass:{default:"text-body-4xs font-medium text-light-copy"},valueImageSrc:{default:""},valueImageCustomClass:{default:""},valueImagePosition:{default:"prefix"},hasValueCopy:{type:Boolean,default:!1},value:{default:""},valueCustomClass:{default:"text-body-2xs font-medium text-sub-copy"},alignRight:{type:Boolean,default:!1}},setup(o){const e=o,t=a.computed(()=>(e.label??"").toUpperCase()),r=a.computed(()=>!!e.valueImageSrc&&e.valueImagePosition==="prefix"),n=a.computed(()=>!!e.valueImageSrc&&e.valueImagePosition==="suffix"),i=a.computed(()=>mr(e.value,40)),{type:u,labelCustomClass:l,valueImageSrc:f,valueImageCustomClass:s,hasValueCopy:d,value:g,valueCustomClass:c,alignRight:v}=e;return(x,C)=>a.unref(u)==="vertical"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["flex flex-col gap-1",a.unref(v)?"text-right items-end":""])},[a.createElementVNode("p",{class:a.normalizeClass(a.unref(l))},a.toDisplayString(t.value),3),a.createElementVNode("div",Qn,[r.value?(a.openBlock(),a.createBlock(ke,{key:0,src:a.unref(f),alt:a.unref(g),width:22,customClass:a.unref(s)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0),a.unref(d)?(a.openBlock(),a.createElementBlock("p",{key:2,class:a.normalizeClass([a.unref(c),"truncate"])},a.toDisplayString(i.value),3)):(a.openBlock(),a.createElementBlock("p",{key:1,class:a.normalizeClass(a.unref(c))},a.toDisplayString(a.unref(g)),3)),a.unref(d)?(a.openBlock(),a.createBlock(Le,{key:3,copyText:a.unref(g),color:"#9DBFDE"},null,8,["copyText"])):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createBlock(ke,{key:4,src:a.unref(f),alt:a.unref(g),width:22,customClass:a.unref(s)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0)])],2)):(a.openBlock(),a.createElementBlock("div",Jn,[a.createElementVNode("p",{class:a.normalizeClass(a.unref(l))},a.toDisplayString(t.value),3),a.createElementVNode("div",es,[r.value?(a.openBlock(),a.createBlock(ke,{key:0,src:a.unref(f),alt:a.unref(g),width:22,customClass:a.unref(s)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(a.unref(c))},a.toDisplayString(a.unref(g)),3),a.unref(d)?(a.openBlock(),a.createBlock(Le,{key:1,copyText:a.unref(g),color:"#9DBFDE"},null,8,["copyText"])):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createBlock(ke,{key:2,src:a.unref(f),alt:a.unref(g),width:22,customClass:a.unref(s)},null,8,["src","alt","customClass"])):a.createCommentVNode("",!0)])]))}}),ts={class:"flex flex-col gap-10"},rs={key:0,class:"flex flex-col gap-10"},as={key:1,class:"flex flex-col gap-10"},ns={class:"bg-[#EFF7FF] p-4 rounded-lg flex flex-col gap-6"},ss={class:"flex items-center justify-between"},is={class:"flex items-center justify-between"},os={class:"w-2/3 mx-auto text-center text-body-2xs font-medium text-sub-copy"},ls={class:"text-orange-500"},us={class:"flex flex-col gap-4"},cs=a.defineComponent({__name:"pay-by-transfer",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function},onCancel:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(!1),i=a.ref(!1),u=a.ref(!1),l=a.ref(""),f=a.ref(""),s=a.ref(!1),d=a.ref(null),g=a.ref(null),c=a.ref(!1),v=a.ref(!1),x=a.ref(""),C=a.ref(60),p=a.ref("00:00"),E=a.ref(null),h=a.reactive({customerName:""}),m=a.reactive({}),B={customerName:"required"},b={customerName:"Customer Name"},A=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency));async function w(){var F,_,y;if(r.value===0){const M=je(h,B,b);if(Object.assign(m,M),Object.keys(M).length===0){const $={paymentReference:l.value,channel:"virtual_account",customerName:h.customerName??"",merchantId:e.secretKey};n.value=!0;try{const L=await Kr(t,$);if(L!=null&&L.isSuccessful){const H=((F=L.data)==null?void 0:F.data)??L.data??null;g.value=H,S(),x.value="Virtual account generated successfully for payment.",n.value=!0,r.value=1}else n.value=!1,x.value=(L==null?void 0:L.responseMessage)||"Failed to generate account"}catch(L){n.value=!1,x.value=((_=L==null?void 0:L.error)==null?void 0:_.responseMessage)||((y=L==null?void 0:L.error)==null?void 0:y.message)||"Error"}}return}}async function V(){var F,_,y,M,$,L,H;s.value=!0;try{const P=await q0(t,l.value);if(P!=null&&P.isSuccessful){const O=((F=P.data)==null?void 0:F.data)??P.data??null;d.value=O;const D=(O==null?void 0:O.paymentStatus)==="Payment Received"||(O==null?void 0:O.paymentStatus)==="Received";c.value=D,(O==null?void 0:O.finalTransactionStatus)==null||(O==null?void 0:O.paymentStatus)==null?(i.value&&(x.value="Transaction not confirmed !!"),!u.value&&!D?(f.value="pending",(_=e.onPaymentAuthorized)==null||_.call(e,{paymentId:l.value,paymentDate:O==null?void 0:O.updatedAt,paymentStatus:"pending"})):(f.value="confirmed",(y=e.onPaymentAuthorized)==null||y.call(e,{paymentId:l.value,paymentDate:O==null?void 0:O.updatedAt,paymentStatus:"confirmed"}))):((O==null?void 0:O.finalTransactionStatus)==="Success"||(O==null?void 0:O.paymentStatus)==="Received"||(O==null?void 0:O.paymentStatus)==="Payment Received")&&(f.value="confirmed",u.value=!0,x.value="Transaction confirmed !!",(M=e.onPaymentAuthorized)==null||M.call(e,{paymentId:l.value,paymentDate:O==null?void 0:O.updatedAt,paymentStatus:"confirmed"}))}else!(P!=null&&P.isSuccessful)&&(P==null?void 0:P.responseCode)==="119"&&(f.value="used",x.value=(P==null?void 0:P.responseMessage)||"",($=e.onPaymentAuthorized)==null||$.call(e,{paymentId:l.value,paymentDate:null,paymentStatus:"used"}))}catch(P){f.value="",x.value=((L=P==null?void 0:P.error)==null?void 0:L.responseMessage)||((H=P==null?void 0:P.error)==null?void 0:H.message)||"Something went wrong"}finally{s.value=!1}}async function T(){if(!e.secretKey){x.value="Secret key is required.";return}if(!ze(e.paymentObject)){x.value="Kindly ensure you are passing all the required data.";return}v.value=!0,x.value="";try{const F=await Ue(e.paymentObject,t,e.secretKey);if(F!=null&&F.isSuccessful&&F.launchUrl){const _=Ht(F.launchUrl);l.value=_.paymentReference,x.value="Payment link created successfully"}else x.value="Failed to create payment link"}catch(F){x.value=(F==null?void 0:F.message)||"Failed to create payment link"}finally{v.value=!1}}function k(F){const _=String(Math.floor(F/60)).padStart(2,"0"),y=String(F%60).padStart(2,"0");p.value=`${_}:${y}`}function S(){E.value&&(clearInterval(E.value),E.value=null),k(C.value),E.value=window.setInterval(()=>{const F=C.value-1;if(F<0){E.value&&(clearInterval(E.value),E.value=null),p.value="00:00",C.value=0;return}C.value=F,k(F)},1e3)}return a.onMounted(async()=>{await T()}),(F,_)=>{var y,M,$,L;return a.openBlock(),a.createElementBlock("div",ts,[r.value===0?(a.openBlock(),a.createElementBlock("div",rs,[a.createVNode(ue,{label:"Customer Name",required:"",modelValue:h.customerName,"onUpdate:modelValue":[_[0]||(_[0]=H=>h.customerName=H),_[1]||(_[1]=H=>{h.customerName=H,h.customerName&&(m.customerName="")})],validationError:m.customerName??""},null,8,["modelValue","validationError"]),a.createVNode(Se,{label:`Pay ${A.value}`,type:"primary",customClass:"w-full",loading:n.value,onClick:w},null,8,["label","loading"])])):r.value===1?(a.openBlock(),a.createElementBlock("div",as,[a.createElementVNode("div",ns,[a.createVNode(He,{label:"Bank Name",value:`${((y=g.value)==null?void 0:y.bank)??""} ${((M=g.value)==null?void 0:M.accountName)??""}`},null,8,["value"]),a.createElementVNode("div",ss,[a.createVNode(He,{label:"Account Number",value:($=g.value)==null?void 0:$.accountNumber},null,8,["value"]),a.createVNode(Le,{color:"#9DBFDE",copyText:((L=g.value)==null?void 0:L.accountNumber)??""},null,8,["copyText"])]),a.createElementVNode("div",is,[a.createVNode(He,{label:"Amount",value:A.value},null,8,["value"]),a.createVNode(Le,{color:"#9DBFDE",copyText:A.value},null,8,["copyText"])])]),a.createElementVNode("p",os,[_[3]||(_[3]=a.createTextVNode(" This account is for this transaction only and expires in ",-1)),a.createElementVNode("span",ls,a.toDisplayString(C.value>=0?p.value:"00:00"),1)]),a.createElementVNode("div",us,[a.createVNode(Se,{label:"I have paid the money",type:"primary",customClass:"w-full",loading:s.value,onClick:V},null,8,["loading"]),a.createElementVNode("button",{type:"button",onClick:_[2]||(_[2]=H=>{var P;return(P=F.onCancel)==null?void 0:P.call(F)}),class:"text-heading-text text-body-2xs font-medium text-center py-2 cursor-pointer"}," Cancel Payment ")])])):a.createCommentVNode("",!0)])}}}),ds=["width","height"],xs={"clip-path":"url(#clip0_10908_387048)"},hs=["fill"],fs={id:"clip0_10908_387048"},ps=["fill"],vs=a.defineComponent({__name:"icon-usdc",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",xs,[a.createElementVNode("path",{d:"M14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0ZM16.933 4.865C16.7195 4.76 16.506 4.865 16.4535 5.07762C16.4001 5.131 16.4001 5.18438 16.4001 5.29025V6.034L16.4089 6.125C16.4546 6.30501 16.5652 6.46177 16.7195 6.56512C20.8792 8.05262 23.0125 12.6726 21.4655 16.7615C20.6657 18.9928 18.9061 20.6911 16.7195 21.4883C16.506 21.5941 16.4001 21.7534 16.4001 22.0194V22.7631L16.4045 22.8401C16.4128 22.9241 16.4479 23.0033 16.5047 23.0658C16.5614 23.1284 16.6367 23.171 16.7195 23.1875C16.7729 23.1875 16.8796 23.1875 16.933 23.135C18.1331 22.7602 19.2473 22.1517 20.2113 21.3446C21.1753 20.5375 21.9701 19.5476 22.5499 18.432C23.1298 17.3164 23.4833 16.0972 23.59 14.8444C23.6967 13.5917 23.5546 12.3302 23.1718 11.1326C22.2128 8.10512 19.866 5.8205 16.933 4.865ZM11.2805 4.8125C11.2271 4.8125 11.1204 4.8125 11.067 4.865C9.86688 5.23978 8.75274 5.84826 7.78874 6.6554C6.82475 7.46254 6.02993 8.4524 5.45006 9.56797C4.87019 10.6836 4.51673 11.9028 4.41001 13.1556C4.30329 14.4083 4.44543 15.6698 4.82825 16.8674C5.78725 19.8424 8.08062 22.1261 11.067 23.0816C11.2805 23.1875 11.494 23.0816 11.5465 22.869C11.5999 22.8165 11.5999 22.7622 11.5999 22.6564V21.9126L11.5911 21.8426C11.5544 21.6947 11.417 21.5259 11.2805 21.4349C7.12075 19.9474 4.9875 15.3274 6.5345 11.2385C7.33425 9.00725 9.09388 7.30887 11.2805 6.51175C11.494 6.40587 11.5999 6.24663 11.5999 5.98063V5.23688L11.5955 5.15987C11.5872 5.07585 11.5521 4.99673 11.4954 4.93418C11.4386 4.87163 11.3633 4.82898 11.2805 4.8125ZM14.3736 7.574H13.573L13.496 7.581C13.321 7.616 13.1933 7.7665 13.146 7.99925V9.22075L12.9649 9.24875C11.4704 9.51475 10.5341 10.5464 10.5341 11.823C10.5341 13.5748 11.5999 14.2651 13.8399 14.5311C15.3335 14.7963 15.813 15.1156 15.813 15.9653C15.813 16.814 15.0666 17.3985 14.0534 17.3985C12.6665 17.3985 12.187 16.8149 12.0269 16.0177C11.9744 15.806 11.8134 15.6992 11.6532 15.6992H10.7467L10.6776 15.7054C10.5913 15.7193 10.513 15.7641 10.4572 15.8313C10.4014 15.8985 10.3718 15.9838 10.374 16.0711V16.1236L10.4029 16.2811C10.6566 17.5271 11.5106 18.4187 13.2003 18.6734V19.9483L13.2072 20.0252C13.2422 20.1985 13.3936 20.3263 13.6273 20.3726H14.427L14.504 20.3656C14.679 20.3306 14.8067 20.1801 14.854 19.9483V18.6725L15.0351 18.6375C16.534 18.3207 17.5201 17.2366 17.5201 15.8576C17.5201 13.9991 16.4001 13.3621 14.1601 13.0961C12.5598 12.8835 12.2404 12.4591 12.2404 11.7154C12.2404 10.9716 12.7741 10.4939 13.8399 10.4939C14.7998 10.4939 15.3335 10.8124 15.5995 11.6095C15.6272 11.6866 15.6779 11.7533 15.7447 11.8007C15.8115 11.8481 15.8912 11.8739 15.9731 11.8746H16.8262L16.8954 11.8694C16.982 11.8556 17.0606 11.8108 17.1166 11.7434C17.1726 11.6759 17.2022 11.5904 17.1999 11.5027V11.4503L17.1675 11.2989C17.0361 10.755 16.7366 10.2664 16.3115 9.90255C15.8864 9.53872 15.3574 9.31821 14.7997 9.27238V7.99925L14.7928 7.92225C14.7578 7.74812 14.6073 7.62038 14.3736 7.574Z",fill:a.unref(i)},null,8,hs)]),a.createElementVNode("defs",null,[a.createElementVNode("clipPath",fs,[a.createElementVNode("rect",{width:"28",height:"28",fill:a.unref(i)},null,8,ps)])])],16,ds))}}),ms=["width","height"],Cs={"clip-path":"url(#clip0_10908_387045)"},gs=["fill"],Bs={id:"clip0_10908_387045"},_s=["fill"],Es=a.defineComponent({__name:"icon-usdt",props:{width:{default:28},height:{default:28},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("g",Cs,[a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 28C6.26763 28 0 21.7324 0 14C0 6.26763 6.26763 0 14 0C21.7324 0 28 6.26763 28 14C28 21.7324 21.7324 28 14 28ZM15.6818 12.0689V9.99863H20.419V6.84162H7.52063V9.99863H12.2579V12.068C8.40787 12.2447 5.5125 13.0077 5.5125 13.9212C5.5125 14.8347 8.40787 15.5969 12.2579 15.7745V22.4088H15.6818V15.7727C19.5256 15.596 22.414 14.8339 22.414 13.9212C22.414 13.0086 19.5256 12.2465 15.6818 12.0689ZM15.6818 15.2101V15.2084C15.5855 15.2154 15.0894 15.2451 13.9825 15.2451C13.0987 15.2451 12.4766 15.2189 12.2579 15.2084V15.211C8.85587 15.0614 6.31662 14.469 6.31662 13.7602C6.31662 13.0524 8.85587 12.46 12.2579 12.3077V14.6212C12.4801 14.637 13.1171 14.6746 13.9974 14.6746C15.0535 14.6746 15.5829 14.6309 15.6818 14.6221V12.3095C19.0768 12.4609 21.6099 13.0532 21.6099 13.7602C21.6099 14.469 19.0768 15.0596 15.6818 15.2101Z",fill:a.unref(i)},null,8,gs)]),a.createElementVNode("defs",null,[a.createElementVNode("clipPath",Bs,[a.createElementVNode("rect",{width:"28",height:"28",fill:a.unref(i)},null,8,_s)])])],16,ms))}}),ys={key:1,class:"flex items-center gap-1"},Pt=a.defineComponent({__name:"currency-amount",props:{currency:{},amount:{},textClass:{default:""},iconColorClass:{default:""},iconWidth:{default:16},iconHeight:{default:16}},setup(o){const e=o,t=a.computed(()=>{var r;return(r=e.currency)==null?void 0:r.toUpperCase()});return(r,n)=>t.value!=="USDT"&&t.value!=="USDC"?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(r.textClass)},a.toDisplayString(a.unref(we)(r.amount,t.value)),3)):(a.openBlock(),a.createElementBlock("div",ys,[t.value==="USDT"?(a.openBlock(),a.createBlock(Es,{key:0,width:r.iconWidth,height:r.iconHeight,color:r.iconColorClass},null,8,["width","height","color"])):a.createCommentVNode("",!0),t.value==="USDC"?(a.openBlock(),a.createBlock(vs,{key:1,width:r.iconWidth,height:r.iconHeight,color:r.iconColorClass},null,8,["width","height","color"])):a.createCommentVNode("",!0),a.createElementVNode("p",{class:a.normalizeClass(r.textClass)},a.toDisplayString(a.unref(we)(r.amount)),3)]))}}),ks=["width","height"],As=["fill"],bs=["fill"],Fs=["fill"],Ds=["fill"],ws=a.defineComponent({__name:"icon-arrow-swap",props:{width:{default:16},height:{default:17},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M10.3265 14.1948C10.1998 14.1948 10.0731 14.1481 9.97313 14.0481C9.77979 13.8548 9.77979 13.5348 9.97313 13.3414L13.3131 10.0014C13.5065 9.80811 13.8265 9.80811 14.0198 10.0014C14.2131 10.1948 14.2131 10.5148 14.0198 10.7081L10.6798 14.0481C10.5798 14.1414 10.4531 14.1948 10.3265 14.1948Z",fill:a.unref(i)},null,8,As),a.createElementVNode("path",{d:"M13.6668 10.8477H2.3335C2.06016 10.8477 1.8335 10.621 1.8335 10.3477C1.8335 10.0743 2.06016 9.84766 2.3335 9.84766H13.6668C13.9402 9.84766 14.1668 10.0743 14.1668 10.3477C14.1668 10.621 13.9402 10.8477 13.6668 10.8477Z",fill:a.unref(i)},null,8,bs),a.createElementVNode("path",{d:"M2.33329 6.86079C2.20663 6.86079 2.07996 6.81413 1.97996 6.71413C1.78663 6.52079 1.78663 6.20079 1.97996 6.00746L5.31996 2.66746C5.51329 2.47413 5.83329 2.47413 6.02663 2.66746C6.21996 2.86079 6.21996 3.18079 6.02663 3.37413L2.68663 6.71413C2.59329 6.80746 2.45996 6.86079 2.33329 6.86079Z",fill:a.unref(i)},null,8,Fs),a.createElementVNode("path",{d:"M13.6668 6.86133H2.3335C2.06016 6.86133 1.8335 6.63466 1.8335 6.36133C1.8335 6.08799 2.06016 5.86133 2.3335 5.86133H13.6668C13.9402 5.86133 14.1668 6.08799 14.1668 6.36133C14.1668 6.63466 13.9402 6.86133 13.6668 6.86133Z",fill:a.unref(i)},null,8,Ds)],16,ks))}}),Ss={class:"flex flex-col gap-6"},Vs={class:"grid grid-cols-1 gap-6"},Ns={key:1,class:"flex flex-col gap-6"},Rs={class:"mx-auto"},Is={class:"mb-0 text-body-4xs text-light-copy font-normal text-center"},Ts={class:"flex flex-col gap-6 border-c border-grey-100 p-4 rounded-2xl bg-light-white-50"},Ms={class:"border-b border-grey-border pb-4 flex flex-col gap-2"},Ps={class:"flex justify-between"},Os={class:"flex flex-col gap-1"},Hs={class:"mb-0 text-body-2xs font-medium text-sub-copy"},$s={class:"flex items-center gap-2"},Ls={class:"pb-4 flex flex-col gap-2"},zs={class:"flex justify-between"},Us={class:"mb-0 text-body-2xs font-medium text-sub-copy w-2/3 break-words"},qs={class:"flex flex-col gap-2"},js={class:"flex items-center justify-between border-b border-grey-border py-3"},Ks={class:"flex items-center justify-between py-4"},Ws={class:"flex flex-col gap-6"},Gs=a.defineComponent({__name:"pay-by-stable-coin",props:{secretKey:{},paymentObject:{},environment:{},onPaymentAuthorized:{type:Function}},setup(o){const e=o,t=e.environment??"sandbox",r=a.ref(0),n=a.ref(""),i=a.ref(!1),u=a.ref(!1),l=a.ref(!1),f=a.ref(!1),s=a.ref(""),d=a.ref([]),g=a.ref([]),c=a.ref(null),v=a.ref(null),x=a.ref(!1),C=a.ref(null),p=a.ref(""),E=a.reactive({stableCoin:"",network:""}),h=a.reactive({}),m={stableCoin:"required",network:"required"},B={stableCoin:"Stable Coin",network:"Network"},b=a.computed(()=>we(e.paymentObject.amount,e.paymentObject.currency)),A=a.computed(()=>c.value?(Number(c.value.transactionAmount)||0)+(c.value.networkFee||0):0);async function w(){if(!e.secretKey){n.value="Secret key is required.";return}if(!ze(e.paymentObject)){n.value="Kindly ensure you are passing all the required data.";return}i.value=!0,n.value="";try{const _=await Ue(e.paymentObject,t,e.secretKey);if(_!=null&&_.isSuccessful&&_.launchUrl){const y=Ht(_.launchUrl);s.value=y.paymentReference,n.value="Payment link created successfully"}else n.value="Failed to create payment link"}catch(_){n.value=(_==null?void 0:_.message)||"Failed to create payment link"}finally{i.value=!1}}async function V(_){if(_){u.value=!0;try{const y=await Wr(t,_);y!=null&&y.isSuccessful?(c.value=y.data,r.value=1):n.value=(y==null?void 0:y.responseMessage)||"Failed to generate address"}catch(y){n.value=(y==null?void 0:y.message)||"Failed to generate address"}finally{u.value=!1}}}async function T(){l.value=!0;try{const _=await Qa(t);_!=null&&_.isSuccessful&&(d.value=(_.data??[]).map(y=>({label:y.name,value:y.name}))??[])}catch(_){n.value=(_==null?void 0:_.message)||"Failed to get stable coins"}finally{l.value=!1}}async function k(_){var y;f.value=!0;try{const M=await Ja(t,_);if(M!=null&&M.isSuccessful){const $=M.networks??((y=M.data)==null?void 0:y.networks)??[];g.value=($??[]).map(L=>({label:L,value:L}))}}catch(M){n.value=(M==null?void 0:M.message)||"Failed to get stable coin networks"}finally{f.value=!1}}async function S(){var _,y,M,$,L;x.value=!0;try{const H=await q0(t,s.value);if(H!=null&&H.isSuccessful){const P=H.data;C.value=P,(P==null?void 0:P.finalTransactionStatus)==null||(P==null?void 0:P.paymentStatus)==null?(n.value="Transaction not confirmed !!",p.value="pending",(_=e.onPaymentAuthorized)==null||_.call(e,{paymentId:s.value,paymentDate:(P==null?void 0:P.updatedAt)??"",paymentStatus:"pending"})):((P==null?void 0:P.finalTransactionStatus)==="Success"||(P==null?void 0:P.paymentStatus)==="Payment Received")&&(n.value="Transaction confirmed !!",p.value="confirmed",(y=e.onPaymentAuthorized)==null||y.call(e,{paymentId:s.value,paymentDate:P==null?void 0:P.updatedAt,paymentStatus:"confirmed"}))}else!(H!=null&&H.isSuccessful)&&(H==null?void 0:H.responseCode)==="119"&&(p.value="used",n.value=(H==null?void 0:H.responseMessage)||"",(M=e.onPaymentAuthorized)==null||M.call(e,{paymentId:s.value,paymentDate:null,paymentStatus:"used"}))}catch(H){p.value="",n.value=(($=H==null?void 0:H.error)==null?void 0:$.responseMessage)||((L=H==null?void 0:H.error)==null?void 0:L.message)||"Something went wrong"}finally{x.value=!1}}async function F(){const _=je(E,m,B);if(Object.assign(h,_),Object.keys(_).length===0){const y={paymentReference:s.value,currency:E.stableCoin,chain:E.network,transactionAmount:e.paymentObject.amount,merchantId:e.secretKey};v.value=y,await V(y)}}return a.onMounted(async()=>{await w(),await T()}),(_,y)=>{var M,$,L,H,P,O,D,R,I;return a.openBlock(),a.createElementBlock("div",Ss,[r.value===0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",Vs,[a.createVNode(Ge,{label:"Select Crypto",required:"",options:d.value,loading:l.value,value:E.stableCoin,onChange:N=>{E.stableCoin=N,k(N),h.stableCoin&&(h.stableCoin="")},validationError:h.stableCoin??""},null,8,["options","loading","value","onChange","validationError"]),a.createVNode(Ge,{label:"Select Network",required:"",options:g.value,loading:f.value,value:E.network,onChange:N=>{E.network=N,h.network&&(h.network="")},validationError:h.network??""},null,8,["options","loading","value","onChange","validationError"])]),a.createVNode(Se,{label:`Pay ${b.value}`,type:"primary",customClass:"w-full",loading:u.value,onClick:F},null,8,["label","loading"])],64)):(a.openBlock(),a.createElementBlock("div",Ns,[a.createElementVNode("div",Rs,[a.createElementVNode("p",Is,a.toDisplayString((M=v.value)==null?void 0:M.currency),1)]),a.createElementVNode("div",Ts,[a.createElementVNode("div",Ms,[y[2]||(y[2]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"Network",-1)),a.createElementVNode("div",Ps,[a.createElementVNode("div",Os,[a.createElementVNode("p",Hs,a.toDisplayString(($=c.value)==null?void 0:$.chain),1),a.createElementVNode("div",$s,[y[0]||(y[0]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," *Est. arrival = 3 mins ",-1)),y[1]||(y[1]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"},"|",-1)),a.createVNode(Pt,{currency:((L=v.value)==null?void 0:L.currency)??"",amount:((H=c.value)==null?void 0:H.networkFee)??0,textClass:"mb-0 text-body-3xs text-light-copy font-normal",iconColorClass:"#557591",iconWidth:12,iconHeight:12},null,8,["currency","amount"])])]),a.createVNode(ws)])]),a.createElementVNode("div",Ls,[y[3]||(y[3]=a.createElementVNode("p",{class:"mb-0 text-body-3xs text-light-copy font-normal"}," Deposit Address > ",-1)),a.createElementVNode("div",zs,[a.createElementVNode("p",Us,a.toDisplayString((P=c.value)==null?void 0:P.walletAddress),1),a.createVNode(Le,{copyText:((O=c.value)==null?void 0:O.walletAddress)??""},null,8,["copyText"])])])]),a.createElementVNode("div",qs,[a.createElementVNode("div",js,[y[4]||(y[4]=a.createElementVNode("p",{class:"mb-0 text-body-2xs font-medium text-primary-black"}," Network fee ",-1)),a.createVNode(Pt,{currency:((D=v.value)==null?void 0:D.currency)??"",amount:((R=c.value)==null?void 0:R.networkFee)??0,textClass:"mb-0 text-body-2xs font-extrabold text-primary-black",iconColorClass:"#231F20"},null,8,["currency","amount"])]),a.createElementVNode("div",Ks,[y[5]||(y[5]=a.createElementVNode("p",{class:"mb-0 text-body-lg font-semibold text-primary-black"},"Pay",-1)),a.createVNode(Pt,{currency:((I=v.value)==null?void 0:I.currency)??"",amount:A.value,textClass:"mb-0 text-body-lg font-extrabold text-primary-black",iconColorClass:"#231F20",iconWidth:20,iconHeight:20},null,8,["currency","amount"])])]),a.createElementVNode("div",Ws,[a.createVNode(Se,{label:"Confirm Payment",type:"primary",customClass:"w-full",loading:x.value,onClick:S},null,8,["loading"])])]))])}}}),Zs=["width","height"],Xs=["fill"],Ys=a.defineComponent({__name:"icon-check-circle",props:{width:{default:67},height:{default:67},color:{default:"currentColor"}},setup(o){const e=o,t=a.useAttrs(),{width:r,height:n,color:i}=e;return(u,l)=>(a.openBlock(),a.createElementBlock("svg",a.mergeProps({width:a.unref(r),height:a.unref(n),viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.unref(t)),[a.createElementVNode("path",{d:"M33.6705 0.0820312C15.2758 0.0820312 0.36377 14.9941 0.36377 33.3888C0.36377 51.7846 15.2758 66.6956 33.6705 66.6956C52.0663 66.6956 66.9773 51.7846 66.9773 33.3888C66.9773 14.9941 52.0663 0.0820312 33.6705 0.0820312ZM33.6705 62.5978C17.6011 62.5978 4.52712 49.4583 4.52712 33.3887C4.52712 17.3192 17.6011 4.24525 33.6705 4.24525C49.74 4.24525 62.814 17.3193 62.814 33.3887C62.814 49.4581 49.74 62.5978 33.6705 62.5978ZM46.9631 21.2016L27.4213 40.8662L18.621 32.0659C17.8081 31.253 16.4904 31.253 15.6765 32.0659C14.8636 32.8788 14.8636 34.1965 15.6765 35.0094L25.9797 45.3137C26.7926 46.1255 28.1103 46.1255 28.9243 45.3137C29.0179 45.22 29.0981 45.1179 29.171 45.0118L49.9086 24.1461C50.7205 23.3332 50.7205 22.0155 49.9086 21.2016C49.0947 20.3888 47.777 20.3888 46.9631 21.2016Z",fill:a.unref(i)},null,8,Xs)],16,Zs))}}),Qs={class:"flex flex-col gap-8 p-16"},Js={class:"flex flex-col gap-8"},ei={class:"flex flex-col gap-8"},ti={class:"flex flex-col"},ri={class:"py-4 border-b border-grey-100"},ai={class:"py-4"},ni={class:"mx-auto",style:{width:"80%"}},si=a.defineComponent({__name:"success",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("div",Qs,[a.createElementVNode("div",Js,[a.createElementVNode("div",ei,[a.createVNode(Ys,{color:"#F47A1F",class:"mx-auto"}),t[0]||(t[0]=a.createElementVNode("div",{class:"flex flex-col text-center",style:{gap:"2px"}},[a.createElementVNode("p",{class:"text-heading-text font-medium text-header-2xl"},"₦2,500.00"),a.createElementVNode("p",{class:"text-sub-copy font-regular text-body-3xs"}," Has been paid successfully ")],-1))]),a.createElementVNode("div",ti,[a.createElementVNode("div",ri,[a.createVNode(He,{type:"horizontal",label:"Order ID",value:"9900009000-8890-8829hd7"})]),a.createElementVNode("div",ai,[a.createVNode(He,{type:"horizontal",label:"Payment date",value:"July 24, 2025"})])])]),a.createElementVNode("div",ni,[a.createVNode(Se,{label:"Return to Merchant Website",type:"secondary",customClass:"w-full"})])]))}}),ii={class:"grid grid-cols-3"},oi={key:0,class:"bg-[#EFF7FF] px-6 py-8 flex flex-col gap-5 col-span-1 rounded-l-xl"},li={key:0,class:"flex items-center justify-between px-12 py-8"},ui={key:1,class:"bg-heading-text rounded flex flex-col justify-center",style:{width:"52px",height:"52px"}},ci={class:"flex flex-col gap-1"},di={class:"text-body-2xs font-regular text-sub-copy text-right"},xi={class:"text-body-2xs font-regular text-sub-copy text-right"},hi={class:"text-orange-500 font-extrabold"},fi={key:1,class:"overflow-y-scroll px-10 pb-10 pt-2"},pi=a.defineComponent({__name:"checkout-card",props:{secretKey:{},environment:{},paymentObject:{},options:{}},setup(o){const e=o,t=e.environment??"sandbox",r=e.paymentObject??{merchantName:"",amount:0,currency:"",email:"",phoneNumber:"",narration:"",redirectUrl:""},n=a.ref("PENDING"),i=a.ref([{label:"Card",value:"CARD"},{label:"Bank Transfer",value:"BANK_TRANSFER"},{label:"Stable Coin",value:"STABLE_COIN"}]),u=a.ref([]),l=a.ref(""),f=a.ref({paymentDate:"",paymentId:"",paymentStatus:""});function s(v){l.value=v}function d(v){f.value={...v},v.paymentStatus==="Authorized"?n.value="SUCCESS":v.paymentStatus==="Payment failed"?n.value="PENDING":v.paymentStatus==="used"?n.value="USED":n.value="PENDING"}a.watch(()=>r.currency,v=>{let x=[];v==="USD"?x=i.value.filter(C=>C.value!=="BANK_TRANSFER"):x=i.value.filter(C=>C.value!=="STABLE_COIN"),u.value=x},{immediate:!0}),a.watch(()=>u.value,v=>{v.length&&(l.value=v[0].value)},{immediate:!0});const g=e.secretKey,c=e.options;return(v,x)=>(a.openBlock(),a.createBlock(ca,null,{default:a.withCtx(()=>{var C,p;return[a.createElementVNode("div",ii,[n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",oi,[x[1]||(x[1]=a.createElementVNode("p",{class:"text-heading-text text-body-xs font-semibold"},"Pay with",-1)),a.createVNode(pa,{options:u.value,onSelectedChange:x[0]||(x[0]=E=>s(E))},null,8,["options"])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(n.value==="SUCCESS"?"col-span-3":"col-span-2")},[n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",li,[(C=a.unref(c))!=null&&C.imageUrl?(a.openBlock(),a.createBlock(ke,{key:0,src:((p=a.unref(c))==null?void 0:p.imageUrl)??"",alt:"Merchant Logo",width:52,height:52,customClass:"rounded-lg"},null,8,["src"])):(a.openBlock(),a.createElementBlock("div",ui,[...x[2]||(x[2]=[a.createElementVNode("p",{class:"text-white text-center text-body-2xs font-medium"},"Logo",-1)])])),a.createElementVNode("div",ci,[a.createElementVNode("p",di,a.toDisplayString(a.unref(r).merchantName),1),a.createElementVNode("p",xi,[x[3]||(x[3]=a.createTextVNode(" Pay: ",-1)),a.createElementVNode("span",hi,a.toDisplayString(a.unref(we)(a.unref(r).amount,a.unref(r).currency)),1)])])])):a.createCommentVNode("",!0),n.value==="PENDING"?(a.openBlock(),a.createElementBlock("div",fi,[l.value==="CARD"?(a.openBlock(),a.createBlock(Kn,{key:0,secretKey:a.unref(g),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:d},null,8,["secretKey","environment","paymentObject"])):l.value==="BANK_TRANSFER"?(a.openBlock(),a.createBlock(cs,{key:1,secretKey:a.unref(g),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:d},null,8,["secretKey","environment","paymentObject"])):(a.openBlock(),a.createBlock(Gs,{key:2,secretKey:a.unref(g),environment:a.unref(t),paymentObject:a.unref(r),onPaymentAuthorized:d},null,8,["secretKey","environment","paymentObject"]))])):a.createCommentVNode("",!0),n.value==="SUCCESS"?(a.openBlock(),a.createBlock(si,{key:2,amount:a.unref(r).amount,currency:a.unref(r).currency,redirectUrl:a.unref(r).redirectUrl,successObject:f.value},null,8,["amount","currency","redirectUrl","successObject"])):a.createCommentVNode("",!0)],2)])]}),_:1}))}});exports.BzpCheckoutButton=Xr;exports.BzpCheckoutCard=pi;exports.BzpCheckoutIframe=j0;exports.createMidenPG=fr;exports.useMidenPG=pr;
2
15
  //# sourceMappingURL=index.cjs.js.map