@payos-inc/payos-react 1.0.3-staging.6 → 1.0.4-staging.7

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.PayOSReact=t(require("react"),require("react-dom")):e.PayOSReact=t(e.React,e.ReactDOM)}(this,(e,t)=>(()=>{"use strict";var n,r,a={3:e=>{e.exports=t},20:(e,t,n)=>{var r=n(442),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,n){var r,s={},d=null,c=null;for(r in void 0!==n&&(d=""+n),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:a,type:e,key:d,ref:c,props:s,_owner:i.current}}t.Fragment=s,t.jsx=d,t.jsxs=d},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},61:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(601),a=n.n(r),s=n(314),o=n.n(s)()(a());o.push([e.id,"*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: var(--payos-font-family, system-ui, -apple-system, sans-serif); /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n.\\!container {\n width: 100% !important;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .\\!container {\n max-width: 640px !important;\n }\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .\\!container {\n max-width: 768px !important;\n }\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .\\!container {\n max-width: 1024px !important;\n }\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .\\!container {\n max-width: 1280px !important;\n }\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .\\!container {\n max-width: 1536px !important;\n }\n\n .container {\n max-width: 1536px;\n }\n}\n.pointer-events-none {\n pointer-events: none;\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.inset-0 {\n inset: 0px;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-full {\n bottom: 100%;\n}\n.left-0 {\n left: 0px;\n}\n.left-1\\/2 {\n left: 50%;\n}\n.right-0 {\n right: 0px;\n}\n.right-4 {\n right: 1rem;\n}\n.top-full {\n top: 100%;\n}\n.z-10 {\n z-index: 10;\n}\n.z-50 {\n z-index: 50;\n}\n.z-\\[9998\\] {\n z-index: 9998;\n}\n.z-\\[9999\\] {\n z-index: 9999;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.-mt-1 {\n margin-top: -0.25rem;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.ml-auto {\n margin-left: auto;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-3 {\n margin-top: 0.75rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.inline-block {\n display: inline-block;\n}\n.inline {\n display: inline;\n}\n.flex {\n display: flex;\n}\n.inline-flex {\n display: inline-flex;\n}\n.grid {\n display: grid;\n}\n.hidden {\n display: none;\n}\n.h-1 {\n height: 0.25rem;\n}\n.h-10 {\n height: 2.5rem;\n}\n.h-11 {\n height: 2.75rem;\n}\n.h-12 {\n height: 3rem;\n}\n.h-14 {\n height: 3.5rem;\n}\n.h-16 {\n height: 4rem;\n}\n.h-3 {\n height: 0.75rem;\n}\n.h-3\\.5 {\n height: 0.875rem;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-9 {\n height: 2.25rem;\n}\n.h-\\[1px\\] {\n height: 1px;\n}\n.h-auto {\n height: auto;\n}\n.h-full {\n height: 100%;\n}\n.h-px {\n height: 1px;\n}\n.max-h-60 {\n max-height: 15rem;\n}\n.max-h-\\[90vh\\] {\n max-height: 90vh;\n}\n.min-h-0 {\n min-height: 0px;\n}\n.min-h-\\[10px\\] {\n min-height: 10px;\n}\n.min-h-\\[280px\\] {\n min-height: 280px;\n}\n.min-h-\\[300px\\] {\n min-height: 300px;\n}\n.w-10 {\n width: 2.5rem;\n}\n.w-12 {\n width: 3rem;\n}\n.w-16 {\n width: 4rem;\n}\n.w-3 {\n width: 0.75rem;\n}\n.w-3\\.5 {\n width: 0.875rem;\n}\n.w-4 {\n width: 1rem;\n}\n.w-48 {\n width: 12rem;\n}\n.w-5 {\n width: 1.25rem;\n}\n.w-6 {\n width: 1.5rem;\n}\n.w-64 {\n width: 16rem;\n}\n.w-8 {\n width: 2rem;\n}\n.w-\\[1px\\] {\n width: 1px;\n}\n.w-full {\n width: 100%;\n}\n.min-w-0 {\n min-width: 0px;\n}\n.max-w-\\[480px\\] {\n max-width: 480px;\n}\n.max-w-md {\n max-width: 28rem;\n}\n.max-w-sm {\n max-width: 24rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.-translate-x-1\\/2 {\n --tw-translate-x: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.rotate-180 {\n --tw-rotate: 180deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes pulse {\n\n 50% {\n opacity: .5;\n }\n}\n.animate-pulse {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.resize {\n resize: both;\n}\n.appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-start {\n align-items: flex-start;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-1\\.5 {\n gap: 0.375rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.space-y-1 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));\n}\n.space-y-1\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-y-auto {\n overflow-y: auto;\n}\n.overscroll-y-contain {\n overscroll-behavior-y: contain;\n}\n.truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.rounded {\n border-radius: var(--payos-border-radius, 0.75rem);\n}\n.rounded-2xl {\n border-radius: 1rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-t-2xl {\n border-top-left-radius: 1rem;\n border-top-right-radius: 1rem;\n}\n.border {\n border-width: 1px;\n}\n.border-0 {\n border-width: 0px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-4 {\n border-width: 4px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-r {\n border-right-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-100 {\n --tw-border-opacity: 1;\n border-color: rgb(243 244 246 / var(--tw-border-opacity, 1));\n}\n.border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n}\n.border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));\n}\n.border-green-500 {\n --tw-border-opacity: 1;\n border-color: rgb(34 197 94 / var(--tw-border-opacity, 1));\n}\n.border-indigo-100 {\n --tw-border-opacity: 1;\n border-color: rgb(224 231 255 / var(--tw-border-opacity, 1));\n}\n.border-indigo-200 {\n --tw-border-opacity: 1;\n border-color: rgb(199 210 254 / var(--tw-border-opacity, 1));\n}\n.border-purple-200 {\n --tw-border-opacity: 1;\n border-color: rgb(233 213 255 / var(--tw-border-opacity, 1));\n}\n.border-red-200 {\n --tw-border-opacity: 1;\n border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));\n}\n.border-red-500 {\n --tw-border-opacity: 1;\n border-color: rgb(239 68 68 / var(--tw-border-opacity, 1));\n}\n.border-slate-900 {\n --tw-border-opacity: 1;\n border-color: rgb(15 23 42 / var(--tw-border-opacity, 1));\n}\n.border-transparent {\n border-color: transparent;\n}\n.border-t-black {\n --tw-border-opacity: 1;\n border-top-color: rgb(0 0 0 / var(--tw-border-opacity, 1));\n}\n.border-t-gray-900 {\n --tw-border-opacity: 1;\n border-top-color: rgb(17 24 39 / var(--tw-border-opacity, 1));\n}\n.bg-black\\/40 {\n background-color: rgb(0 0 0 / 0.4);\n}\n.bg-black\\/50 {\n background-color: rgb(0 0 0 / 0.5);\n}\n.bg-gray-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-50\\/50 {\n background-color: rgb(249 250 251 / 0.5);\n}\n.bg-gray-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(224 231 255 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(238 242 255 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-50\\/50 {\n background-color: rgb(238 242 255 / 0.5);\n}\n.bg-primary {\n background-color: var(--payos-color-primary, #0f172a);\n}\n.bg-purple-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(250 245 255 / var(--tw-bg-opacity, 1));\n}\n.bg-red-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-violet-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(237 233 254 / var(--tw-bg-opacity, 1));\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-gradient-to-br {\n background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));\n}\n.from-blue-500 {\n --tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-green-500 {\n --tw-gradient-from: #22c55e var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-indigo-500 {\n --tw-gradient-from: #6366f1 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-orange-500 {\n --tw-gradient-from: #f97316 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-pink-500 {\n --tw-gradient-from: #ec4899 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-purple-500 {\n --tw-gradient-from: #a855f7 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.to-cyan-500 {\n --tw-gradient-to: #06b6d4 var(--tw-gradient-to-position);\n}\n.to-emerald-500 {\n --tw-gradient-to: #10b981 var(--tw-gradient-to-position);\n}\n.to-pink-500 {\n --tw-gradient-to: #ec4899 var(--tw-gradient-to-position);\n}\n.to-purple-500 {\n --tw-gradient-to: #a855f7 var(--tw-gradient-to-position);\n}\n.to-red-500 {\n --tw-gradient-to: #ef4444 var(--tw-gradient-to-position);\n}\n.to-rose-500 {\n --tw-gradient-to: #f43f5e var(--tw-gradient-to-position);\n}\n.object-contain {\n -o-object-fit: contain;\n object-fit: contain;\n}\n.object-cover {\n -o-object-fit: cover;\n object-fit: cover;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.py-12 {\n padding-top: 3rem;\n padding-bottom: 3rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pt-0 {\n padding-top: 0px;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-\\[10px\\] {\n font-size: 10px;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-semibold {\n font-weight: 600;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.leading-none {\n line-height: 1;\n}\n.leading-relaxed {\n line-height: 1.625;\n}\n.tracking-tight {\n letter-spacing: -0.025em;\n}\n.tracking-wide {\n letter-spacing: 0.025em;\n}\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity, 1));\n}\n.text-blue-600 {\n --tw-text-opacity: 1;\n color: rgb(37 99 235 / var(--tw-text-opacity, 1));\n}\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-700 {\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-500 {\n --tw-text-opacity: 1;\n color: rgb(34 197 94 / var(--tw-text-opacity, 1));\n}\n.text-indigo-600 {\n --tw-text-opacity: 1;\n color: rgb(79 70 229 / var(--tw-text-opacity, 1));\n}\n.text-indigo-700 {\n --tw-text-opacity: 1;\n color: rgb(67 56 202 / var(--tw-text-opacity, 1));\n}\n.text-purple-800 {\n --tw-text-opacity: 1;\n color: rgb(107 33 168 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-red-600 {\n --tw-text-opacity: 1;\n color: rgb(220 38 38 / var(--tw-text-opacity, 1));\n}\n.text-red-700 {\n --tw-text-opacity: 1;\n color: rgb(185 28 28 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-slate-700 {\n --tw-text-opacity: 1;\n color: rgb(51 65 85 / var(--tw-text-opacity, 1));\n}\n.text-slate-900 {\n --tw-text-opacity: 1;\n color: rgb(15 23 42 / var(--tw-text-opacity, 1));\n}\n.text-violet-500 {\n --tw-text-opacity: 1;\n color: rgb(139 92 246 / var(--tw-text-opacity, 1));\n}\n.text-violet-700 {\n --tw-text-opacity: 1;\n color: rgb(109 40 217 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.underline-offset-4 {\n text-underline-offset: 4px;\n}\n.placeholder-gray-400::-moz-placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1));\n}\n.placeholder-gray-400::placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1));\n}\n.opacity-50 {\n opacity: 0.5;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-2xl {\n --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.outline {\n outline-style: solid;\n}\n.ring {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n.ring-offset-white {\n --tw-ring-offset-color: #fff;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.backdrop-blur-sm {\n --tw-backdrop-blur: blur(4px);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-transform {\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-100 {\n transition-duration: 100ms;\n}\n.duration-150 {\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.ease-\\[cubic-bezier\\(0\\.16\\2c 1\\2c 0\\.3\\2c 1\\)\\] {\n transition-timing-function: cubic-bezier(0.16,1,0.3,1);\n}\n\n/* PayOS Elements custom styles */\n.payos-drawer-backdrop {\n backdrop-filter: blur(2px);\n}\n\n.payos-drawer-container {\n box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* Scrollbar styling for drawer body */\n.payos-drawer-body::-webkit-scrollbar {\n width: 6px;\n}\n\n.payos-drawer-body::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.payos-drawer-body::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 3px;\n}\n\n.payos-drawer-body::-webkit-scrollbar-thumb:hover {\n background: #9ca3af;\n}\n\n.placeholder\\:font-light::-moz-placeholder {\n font-weight: 300;\n}\n\n.placeholder\\:font-light::placeholder {\n font-weight: 300;\n}\n\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.focus-within\\:ring-2:focus-within {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus-within\\:ring-slate-900:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(15 23 42 / var(--tw-ring-opacity, 1));\n}\n\n.focus-within\\:ring-offset-0:focus-within {\n --tw-ring-offset-width: 0px;\n}\n\n.hover\\:border-gray-400:hover {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n\n.hover\\:bg-blue-50:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(239 246 255 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-50:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-800:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-red-600:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-600:hover {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-700:hover {\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-900:hover {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-red-500:hover {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:underline:hover {\n text-decoration-line: underline;\n}\n\n.hover\\:opacity-90:hover {\n opacity: 0.9;\n}\n\n.focus\\:border-black:focus {\n --tw-border-opacity: 1;\n border-color: rgb(0 0 0 / var(--tw-border-opacity, 1));\n}\n\n.focus\\:border-red-600:focus {\n --tw-border-opacity: 1;\n border-color: rgb(220 38 38 / var(--tw-border-opacity, 1));\n}\n\n.focus\\:border-transparent:focus {\n border-color: transparent;\n}\n\n.focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.focus\\:ring-0:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus\\:ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus\\:ring-black:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1));\n}\n\n.focus\\:ring-gray-100:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(243 244 246 / var(--tw-ring-opacity, 1));\n}\n\n.focus-visible\\:outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.focus-visible\\:ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus-visible\\:ring-slate-950:focus-visible {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1));\n}\n\n.focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n\n.active\\:scale-95:active {\n --tw-scale-x: .95;\n --tw-scale-y: .95;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.active\\:scale-\\[0\\.98\\]:active {\n --tw-scale-x: 0.98;\n --tw-scale-y: 0.98;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.active\\:bg-blue-100:active {\n --tw-bg-opacity: 1;\n background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));\n}\n\n.active\\:bg-gray-100:active {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.disabled\\:pointer-events-none:disabled {\n pointer-events: none;\n}\n\n.disabled\\:cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n\n.disabled\\:bg-gray-100:disabled {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.disabled\\:bg-slate-900\\/20:disabled {\n background-color: rgb(15 23 42 / 0.2);\n}\n\n.disabled\\:text-gray-400:disabled {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.disabled\\:text-slate-900\\/50:disabled {\n color: rgb(15 23 42 / 0.5);\n}\n\n.disabled\\:no-underline:disabled {\n text-decoration-line: none;\n}\n\n.disabled\\:opacity-50:disabled {\n opacity: 0.5;\n}\n\n.peer:disabled ~ .peer-disabled\\:cursor-not-allowed {\n cursor: not-allowed;\n}\n\n.peer:disabled ~ .peer-disabled\\:opacity-70 {\n opacity: 0.7;\n}\n\n.dark\\:border-green-400:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(74 222 128 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-indigo-900:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(49 46 129 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-purple-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(126 34 206 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-red-400:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(248 113 113 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-red-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(185 28 28 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-600:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(71 85 105 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-800:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(30 41 59 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-white:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-t-white:is(.dark *) {\n --tw-border-opacity: 1;\n border-top-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:bg-black\\/60:is(.dark *) {\n background-color: rgb(0 0 0 / 0.6);\n}\n\n.dark\\:bg-indigo-900\\/30:is(.dark *) {\n background-color: rgb(49 46 129 / 0.3);\n}\n\n.dark\\:bg-indigo-950\\/30:is(.dark *) {\n background-color: rgb(30 27 75 / 0.3);\n}\n\n.dark\\:bg-purple-900\\/20:is(.dark *) {\n background-color: rgb(88 28 135 / 0.2);\n}\n\n.dark\\:bg-red-900:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(127 29 29 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-red-900\\/20:is(.dark *) {\n background-color: rgb(127 29 29 / 0.2);\n}\n\n.dark\\:bg-slate-700:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-slate-800:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-slate-800\\/50:is(.dark *) {\n background-color: rgb(30 41 59 / 0.5);\n}\n\n.dark\\:bg-slate-900:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-violet-900\\/30:is(.dark *) {\n background-color: rgb(76 29 149 / 0.3);\n}\n\n.dark\\:bg-white:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:text-blue-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(96 165 250 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-gray-900:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-green-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(74 222 128 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-indigo-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(129 140 248 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-purple-200:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(233 213 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-red-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(252 165 165 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-red-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(248 113 113 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(203 213 225 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-500:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-900:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(15 23 42 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-violet-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(196 181 253 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-white:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:placeholder-slate-500:is(.dark *)::-moz-placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(100 116 139 / var(--tw-placeholder-opacity, 1));\n}\n\n.dark\\:placeholder-slate-500:is(.dark *)::placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(100 116 139 / var(--tw-placeholder-opacity, 1));\n}\n\n.dark\\:ring-offset-slate-950:is(.dark *) {\n --tw-ring-offset-color: #020617;\n}\n\n.dark\\:placeholder\\:text-slate-500:is(.dark *)::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:placeholder\\:text-slate-500:is(.dark *)::placeholder {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:border-slate-500:hover:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(100 116 139 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:hover\\:bg-gray-100:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-red-800:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(153 27 27 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-600:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(71 85 105 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-700:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-800:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-800\\/50:hover:is(.dark *) {\n background-color: rgb(30 41 59 / 0.5);\n}\n\n.dark\\:hover\\:text-red-400:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(248 113 113 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:text-slate-300:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(203 213 225 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:text-white:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:focus\\:border-white:focus:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:focus\\:ring-white:focus:is(.dark *) {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1));\n}\n\n.dark\\:focus-visible\\:ring-slate-300:focus-visible:is(.dark *) {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(203 213 225 / var(--tw-ring-opacity, 1));\n}\n\n.dark\\:active\\:bg-slate-700:active:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:active\\:bg-slate-800:active:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n@media (min-width: 768px) {\n\n .md\\:bottom-0 {\n bottom: 0px;\n }\n\n .md\\:left-auto {\n left: auto;\n }\n\n .md\\:right-0 {\n right: 0px;\n }\n\n .md\\:top-0 {\n top: 0px;\n }\n\n .md\\:hidden {\n display: none;\n }\n\n .md\\:h-full {\n height: 100%;\n }\n\n .md\\:max-h-none {\n max-height: none;\n }\n\n .md\\:w-\\[480px\\] {\n width: 480px;\n }\n\n .md\\:max-w-none {\n max-width: none;\n }\n\n .md\\:rounded-none {\n border-radius: 0px;\n }\n\n .md\\:border-l {\n border-left-width: 1px;\n }\n\n .md\\:border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n }\n\n .md\\:dark\\:border-slate-800:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(30 41 59 / var(--tw-border-opacity, 1));\n }\n}\n",""]);const i=o},72:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},o=[],i=0;i<e.length;i++){var l=e[i],d=r.base?l[0]+r.base:l[0],c=s[d]||0,p="".concat(d," ").concat(c);s[d]=c+1;var u=n(p),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var h=a(m,r);r.byIndex=i,t.splice(i,0,{identifier:p,updater:h,references:1})}o.push(p)}return o}function a(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,a){var s=r(e=e||[],a=a||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var i=n(s[o]);t[i].references--}for(var l=r(e,a),d=0;d<s.length;d++){var c=n(s[d]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}s=l}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,a,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(o[l]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);r&&o[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),t.push(c))}},t}},442:t=>{t.exports=e},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601:e=>{e.exports=function(e){return e[1]}},659:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var a=void 0!==n.layer;a&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,a&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},848:(e,t,n)=>{e.exports=n(20)}},s={};function o(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,exports:{}};return a[e](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);o.r(a);var s={};n=n||[null,r({}),r([]),r(r)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~n.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(t=>s[t]=()=>e[t]);return s.default=()=>e,o.d(a,s),a},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};o.r(i),o.d(i,{ActiveCardWidget:()=>Vt,AgentRegistrationView:()=>hn,Button:()=>Je,Card:()=>Qe,CardAddView:()=>tn,CardContent:()=>rt,CardDescription:()=>nt,CardFooter:()=>at,CardHeader:()=>et,CardTitle:()=>tt,CheckoutView:()=>Gt,IdentityView:()=>Ct,Input:()=>Xe,Label:()=>dt,MethodListView:()=>Xt,OTPInput:()=>xt,OTPView:()=>qt,OrderSummary:()=>Bt,PayOSDrawer:()=>Ot,PayOSFooter:()=>_t,PaymentMethodRow:()=>Ft,PaymentSheet:()=>tr,PhoneInput:()=>yt,PriceTag:()=>jt,ReceiptPanel:()=>Tt,Separator:()=>ht,SuccessView:()=>rn,ViewHeader:()=>$t,VisaMethodView:()=>dn,VisaOtpView:()=>pn,WelcomeBackView:()=>It,cn:()=>We,createTestSessionWithRealIntent:()=>fr,useBodyScrollLock:()=>Rt,useCheckoutFlow:()=>or,useSession:()=>jn,useVisualViewport:()=>Lt,useVisualViewportStyle:()=>Ut});var l=o(848),d=o(442),c=o.t(d,2);function p(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let n=!1;const r=e.map(e=>{const r=p(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():p(e[t],null)}}}}var m=Symbol.for("react.lazy"),h=c[" use ".trim().toString()];function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===m&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function b(e){const t=w(e),n=d.forwardRef((e,n)=>{let{children:r,...a}=e;g(r)&&"function"==typeof h&&(r=h(r._payload));const s=d.Children.toArray(r),o=s.find(x);if(o){const e=o.props.children,r=s.map(t=>t===o?d.Children.count(e)>1?d.Children.only(null):d.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...a,ref:n,children:d.isValidElement(e)?d.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...a,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var f=b("Slot");function w(e){const t=d.forwardRef((e,t)=>{let{children:n,...r}=e;if(g(n)&&"function"==typeof h&&(n=h(n._payload)),d.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...s}:"className"===r&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==d.Fragment&&(a.ref=t?u(t,e):e),d.cloneElement(n,a)}return d.Children.count(n)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y=Symbol("radix.slottable");function x(e){return d.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}function v(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=v(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=v(e))&&(r&&(r+=" "),r+=t);return r}const C=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,S=k,N=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return S(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(e=>{const t=null==n?void 0:n[e],r=null==s?void 0:s[e];if(null===t)return null;const o=C(t)||C(r);return a[e][o]}),i=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...s,...i}[t]):{...s,...i}[t]===n})?[...e,n,r]:e},[]);return S(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},I=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},A=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),j=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var E={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const T=(0,d.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:o,...i},l)=>(0,d.createElement)("svg",{ref:l,...E,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:A("lucide",a),...!s&&!j(i)&&{"aria-hidden":"true"},...i},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(s)?s:[s]])),D=(e,t)=>{const n=(0,d.forwardRef)(({className:n,...r},a)=>{return(0,d.createElement)(T,{ref:a,iconNode:t,className:A(`lucide-${s=I(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var s});return n.displayName=I(e),n},_=D("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),R=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),P="-",L=[],U=e=>{const t=M(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return z(e);const n=e.split(P),r=""===n[0]&&n.length>1?1:0;return O(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],a=n[e];return t?a?((e,t)=>{const n=new Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(a,t):t:a||L}return n[e]||L}}},O=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],a=n.nextPart.get(r);if(a){const n=O(e,t+1,a);if(n)return n}const s=n.validators;if(null===s)return;const o=0===t?e.join(P):e.slice(t).join(P),i=s.length;for(let e=0;e<i;e++){const t=s[e];if(t.validator(o))return t.classGroupId}},z=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),M=e=>{const{theme:t,classGroups:n}=e;return F(n,t)},F=(e,t)=>{const n=R();for(const r in e){const a=e[r];V(a,n,r,t)}return n},V=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];H(a,t,n,r)}},H=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?q(e,t,n,r):B(e,t,n,r):$(e,t,n)},$=(e,t,n)=>{(""===e?t:K(t,e)).classGroupId=n},B=(e,t,n,r)=>{G(e)?V(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},q=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,o]=a[e];V(o,K(t,s),n,r)}},K=(e,t)=>{let n=e;const r=t.split(P),a=r.length;for(let e=0;e<a;e++){const t=r[e];let a=n.nextPart.get(t);a||(a=R(),n.nextPart.set(t,a)),n=a}return n},G=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,W=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in n?n[e]=t:a(e,t)}}},Y=[],J=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),X=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,a=0,s=0;const o=e.length;for(let i=0;i<o;i++){const o=e[i];if(0===r&&0===a){if(":"===o){t.push(e.slice(s,i)),s=i+1;continue}if("/"===o){n=i;continue}}"["===o?r++:"]"===o?r--:"("===o?a++:")"===o&&a--}const i=0===t.length?e:e.slice(s);let l=i,d=!1;i.endsWith("!")?(l=i.slice(0,-1),d=!0):i.startsWith("!")&&(l=i.slice(1),d=!0);return J(t,d,l,n&&n>s?n-s:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):J(Y,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Z=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let a=0;a<e.length;a++){const s=e[a],o="["===s[0],i=t.has(s);o||i?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(s)):r.push(s)}return r.length>0&&(r.sort(),n.push(...r)),n}},Q=/\s+/,ee=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ee(e[r]))&&(n&&(n+=" "),n+=t);return n},te=(e,...t)=>{let n,r,a,s;const o=e=>{const t=r(e);if(t)return t;const s=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],i=e.trim().split(Q);let l="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:d,modifiers:c,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:m}=n(t);if(d){l=t+(l.length>0?" "+l:l);continue}let h=!!m,g=r(h?u.substring(0,m):u);if(!g){if(!h){l=t+(l.length>0?" "+l:l);continue}if(g=r(u),!g){l=t+(l.length>0?" "+l:l);continue}h=!1}const b=0===c.length?"":1===c.length?c[0]:s(c).join(":"),f=p?b+"!":b,w=f+g;if(o.indexOf(w)>-1)continue;o.push(w);const y=a(g,h);for(let e=0;e<y.length;++e){const t=y[e];o.push(f+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return a(e,s),s};return s=i=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:W(e.cacheSize),parseClassName:X(e),sortModifiers:Z(e),...U(e)}))(l),r=n.cache.get,a=n.cache.set,s=o,o(i)},(...e)=>s(((...e)=>{let t,n,r=0,a="";for(;r<e.length;)(t=e[r++])&&(n=ee(t))&&(a&&(a+=" "),a+=n);return a})(...e))},ne=[],re=e=>{const t=t=>t[e]||ne;return t.isThemeGetter=!0,t},ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,se=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oe=/^\d+\/\d+$/,ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,de=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>oe.test(e),me=e=>!!e&&!Number.isNaN(Number(e)),he=e=>!!e&&Number.isInteger(Number(e)),ge=e=>e.endsWith("%")&&me(e.slice(0,-1)),be=e=>ie.test(e),fe=()=>!0,we=e=>le.test(e)&&!de.test(e),ye=()=>!1,xe=e=>ce.test(e),ve=e=>pe.test(e),ke=e=>!Se(e)&&!Te(e),Ce=e=>Oe(e,Ve,ye),Se=e=>ae.test(e),Ne=e=>Oe(e,He,we),Ie=e=>Oe(e,$e,me),Ae=e=>Oe(e,Me,ye),je=e=>Oe(e,Fe,ve),Ee=e=>Oe(e,qe,xe),Te=e=>se.test(e),De=e=>ze(e,He),_e=e=>ze(e,Be),Re=e=>ze(e,Me),Pe=e=>ze(e,Ve),Le=e=>ze(e,Fe),Ue=e=>ze(e,qe,!0),Oe=(e,t,n)=>{const r=ae.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ze=(e,t,n=!1)=>{const r=se.exec(e);return!!r&&(r[1]?t(r[1]):n)},Me=e=>"position"===e||"percentage"===e,Fe=e=>"image"===e||"url"===e,Ve=e=>"length"===e||"size"===e||"bg-size"===e,He=e=>"length"===e,$e=e=>"number"===e,Be=e=>"family-name"===e,qe=e=>"shadow"===e,Ke=(Symbol.toStringTag,()=>{const e=re("color"),t=re("font"),n=re("text"),r=re("font-weight"),a=re("tracking"),s=re("leading"),o=re("breakpoint"),i=re("container"),l=re("spacing"),d=re("radius"),c=re("shadow"),p=re("inset-shadow"),u=re("text-shadow"),m=re("drop-shadow"),h=re("blur"),g=re("perspective"),b=re("aspect"),f=re("ease"),w=re("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Te,Se],x=()=>[Te,Se,l],v=()=>[ue,"full","auto",...x()],k=()=>[he,"none","subgrid",Te,Se],C=()=>["auto",{span:["full",he,Te,Se]},he,Te,Se],S=()=>[he,"auto",Te,Se],N=()=>["auto","min","max","fr",Te,Se],I=()=>["auto",...x()],A=()=>[ue,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[e,Te,Se],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Re,Ae,{position:[Te,Se]}],T=()=>["auto","cover","contain",Pe,Ce,{size:[Te,Se]}],D=()=>[ge,De,Ne],_=()=>["","none","full",d,Te,Se],R=()=>["",me,De,Ne],P=()=>[me,ge,Re,Ae],L=()=>["","none",h,Te,Se],U=()=>["none",me,Te,Se],O=()=>["none",me,Te,Se],z=()=>[me,Te,Se],M=()=>[ue,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[be],breakpoint:[be],color:[fe],container:[be],"drop-shadow":[be],ease:["in","out","in-out"],font:[ke],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[be],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[be],shadow:[be],spacing:["px",me],text:[be],"text-shadow":[be],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ue,Se,Te,b]}],container:["container"],columns:[{columns:[me,Se,Te,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:v()}],"inset-x":[{"inset-x":v()}],"inset-y":[{"inset-y":v()}],start:[{start:v()}],end:[{end:v()}],top:[{top:v()}],right:[{right:v()}],bottom:[{bottom:v()}],left:[{left:v()}],visibility:["visible","invisible","collapse"],z:[{z:[he,"auto",Te,Se]}],basis:[{basis:[ue,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[me,ue,"auto","initial","none",Se]}],grow:[{grow:["",me,Te,Se]}],shrink:[{shrink:["",me,Te,Se]}],order:[{order:[he,"first","last","none",Te,Se]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[i,"screen",...A()]}],"min-w":[{"min-w":[i,"screen","none",...A()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",n,De,Ne]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Te,Ie]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ge,Se]}],"font-family":[{font:[_e,Se,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Te,Se]}],"line-clamp":[{"line-clamp":[me,"none",Te,Ie]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",Te,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[me,"from-font","auto",Te,Ne]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[me,"auto",Te,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:E()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},he,Te,Se],radial:["",Te,Se],conic:[he,Te,Se]},Le,je]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[me,Te,Se]}],"outline-w":[{outline:["",me,De,Ne]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",c,Ue,Ee]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",p,Ue,Ee]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[me,Ne]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",u,Ue,Ee]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[me,Te,Se]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[me]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Te,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[me]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:E()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Se]}],filter:[{filter:["","none",Te,Se]}],blur:[{blur:L()}],brightness:[{brightness:[me,Te,Se]}],contrast:[{contrast:[me,Te,Se]}],"drop-shadow":[{"drop-shadow":["","none",m,Ue,Ee]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",me,Te,Se]}],"hue-rotate":[{"hue-rotate":[me,Te,Se]}],invert:[{invert:["",me,Te,Se]}],saturate:[{saturate:[me,Te,Se]}],sepia:[{sepia:["",me,Te,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Se]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[me,Te,Se]}],"backdrop-contrast":[{"backdrop-contrast":[me,Te,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",me,Te,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[me,Te,Se]}],"backdrop-invert":[{"backdrop-invert":["",me,Te,Se]}],"backdrop-opacity":[{"backdrop-opacity":[me,Te,Se]}],"backdrop-saturate":[{"backdrop-saturate":[me,Te,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",me,Te,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[me,"initial",Te,Se]}],ease:[{ease:["linear","initial",f,Te,Se]}],delay:[{delay:[me,Te,Se]}],animate:[{animate:["none",w,Te,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Te,Se]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[Te,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:M()}],"translate-x":[{"translate-x":M()}],"translate-y":[{"translate-y":M()}],"translate-z":[{"translate-z":M()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,Se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te,Se]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[me,De,Ne,Ie]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Ge=te(Ke);function We(...e){return Ge(k(e))}const Ye=N("inline-flex items-center justify-center whitespace-nowrap rounded-xl text-base font-semibold ring-offset-white dark:ring-offset-slate-950 transition-all duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 dark:focus-visible:ring-slate-300 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:bg-slate-900/20 disabled:text-slate-900/50 active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-white hover:opacity-90 shadow-lg",destructive:"bg-red-500 text-white hover:bg-red-600 shadow-sm dark:bg-red-900 dark:hover:bg-red-800",outline:"border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 hover:border-gray-400 dark:hover:border-slate-500",secondary:"bg-gray-100 dark:bg-slate-700 text-gray-900 dark:text-white hover:bg-gray-200 dark:hover:bg-slate-600",ghost:"hover:bg-gray-100 dark:hover:bg-slate-800 hover:text-gray-900 dark:hover:text-white",link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline"},size:{default:"h-12 px-4 py-3",sm:"h-9 px-3 text-sm",lg:"h-14 px-6 py-4 text-lg",icon:"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),Je=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,isLoading:a,loadingText:s,children:o,disabled:i,...d},c)=>{const p=r?f:"button";return(0,l.jsx)(p,{className:We(Ye({variant:t,size:n,className:e})),ref:c,disabled:i||a,"aria-busy":a,...d,children:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(_,{className:"mr-2 h-4 w-4 animate-spin"}),(0,l.jsx)("span",{children:s||("string"==typeof o?"Loading...":o)})]}):o})});Je.displayName="Button";const Xe=d.forwardRef(({className:e,type:t,...n},r)=>(0,l.jsx)("input",{type:t,className:We("flex h-11 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-base text-gray-900 placeholder:text-gray-400 focus:border-black focus:outline-none focus:ring-2 focus:ring-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 transition-colors","-webkit-appearance-none appearance-none",e),ref:r,...n}));Xe.displayName="Input";const Ze=N("rounded-xl overflow-hidden mb-4",{variants:{variant:{default:"bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 shadow-sm",flat:"bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700",transparent:"bg-transparent border-none shadow-none"}},defaultVariants:{variant:"default"}}),Qe=d.forwardRef(({className:e,variant:t,...n},r)=>(0,l.jsx)("div",{ref:r,className:We(Ze({variant:t}),e),...n}));Qe.displayName="Card";const et=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("flex flex-col space-y-1.5 p-4",e),...t}));et.displayName="CardHeader";const tt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("h3",{ref:n,className:We("text-lg font-semibold leading-none tracking-tight text-gray-900 dark:text-white",e),...t}));tt.displayName="CardTitle";const nt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("p",{ref:n,className:We("text-sm text-gray-500 dark:text-slate-400",e),...t}));nt.displayName="CardDescription";const rt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("p-4 pt-0",e),...t}));rt.displayName="CardContent";const at=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("flex items-center p-4 pt-0",e),...t}));at.displayName="CardFooter";o(3);var st=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=b(`Primitive.${t}`),r=d.forwardRef((e,r)=>{const{asChild:a,...s}=e,o=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,l.jsx)(o,{...s,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var ot=d.forwardRef((e,t)=>(0,l.jsx)(st.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ot.displayName="Label";var it=ot;const lt=N("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-gray-700"),dt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)(it,{ref:n,className:We(lt(),e),...t}));dt.displayName=it.displayName;var ct="horizontal",pt=["horizontal","vertical"],ut=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=ct,...a}=e,s=function(e){return pt.includes(e)}(r)?r:ct,o=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return(0,l.jsx)(st.div,{"data-orientation":s,...o,...a,ref:t})});ut.displayName="Separator";var mt=ut;const ht=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>(0,l.jsx)(mt,{ref:a,decorative:n,orientation:t,className:We("shrink-0 bg-gray-200","horizontal"===t?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ht.displayName=mt.displayName;const gt=D("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),bt=D("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ft=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"}];function wt(e,t="US"){const n=e.replace(/\D/g,"");if("US"===t||"CA"===t){const e=n.startsWith("1")&&n.length>10?n.slice(1):n;return 0===e.length?"":e.length<=3?`(${e}`:e.length<=6?`(${e.slice(0,3)}) ${e.slice(3)}`:`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6,10)}`}return n}const yt=d.forwardRef(({className:e,value:t,onChange:n,countryCode:r="US",onCountryChange:a,...s},o)=>{const[i,c]=(0,d.useState)(!1),p=(0,d.useRef)(null),u=ft.find(e=>e.code===r)||ft[0],m=wt(t||"",r);(0,d.useEffect)(()=>{if(!i)return;const e=e=>{p.current&&!p.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);const h="US"===r||"CA"===r?"(555) 000-0000":"Phone number";return(0,l.jsxs)("div",{className:"relative",ref:p,children:[(0,l.jsxs)("div",{className:We("flex items-center h-14 bg-white dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-xl overflow-hidden transition-all duration-150","focus-within:ring-2 focus-within:ring-slate-900 focus-within:ring-offset-0",e),children:[(0,l.jsxs)("button",{type:"button",onClick:()=>c(!i),className:"flex items-center gap-1.5 px-3 h-full bg-gray-50 dark:bg-slate-900 border-r border-gray-200 dark:border-slate-700 cursor-pointer hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors","aria-label":"Select country code","aria-expanded":i,children:[(0,l.jsx)("span",{className:"text-xl",children:u.flag}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:u.dial}),(0,l.jsx)(gt,{className:We("w-3.5 h-3.5 text-gray-400 transition-transform",i&&"rotate-180")})]}),(0,l.jsx)("input",{ref:o,type:"tel",inputMode:"tel",autoComplete:"tel",value:m,onChange:e=>{if(n){const t=wt(e.target.value,r);n(t)}},className:We("flex-1 h-full px-3 border-0 outline-none","text-lg font-normal tracking-wide text-gray-900 dark:text-white","placeholder:text-gray-400 dark:placeholder:text-slate-500 placeholder:font-light","bg-transparent"),placeholder:h,...s}),(0,l.jsx)("div",{className:"px-3",children:(0,l.jsx)(bt,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"})})]}),i&&(0,l.jsx)("div",{className:"absolute top-full left-0 mt-1 w-64 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-xl shadow-lg z-50 max-h-60 overflow-y-auto",children:ft.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>{return t=e.code,a?.(t),c(!1),void(t!==r&&n&&n(""));var t},className:We("w-full px-3 py-2.5 flex items-center gap-3 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors text-left",e.code===r&&"bg-gray-50 dark:bg-slate-700"),children:[(0,l.jsx)("span",{className:"text-xl",children:e.flag}),(0,l.jsx)("span",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e.name}),(0,l.jsx)("span",{className:"text-sm text-gray-500 dark:text-slate-400",children:e.dial})]},e.code))})]})});yt.displayName="PhoneInput";const xt=d.forwardRef(({value:e="",onChange:t,onComplete:n,length:r=6,className:a},s)=>{const o=d.useRef([]),[i,c]=d.useState(e.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r));d.useEffect(()=>{const t=e.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r);c(t)},[e,r]);return(0,l.jsx)("div",{ref:s,className:We("flex gap-2 justify-center",a),onPaste:e=>{e.preventDefault();const a=e.clipboardData.getData("text").slice(0,r).replace(/\D/g,"");if(a){const e=a.split("").concat(Array(r).fill("")).slice(0,r);c(e),t?.(a);const s=Math.min(a.length,r-1);o.current[s]?.focus(),a.length===r&&n?.(a)}},children:Array.from({length:r},(e,a)=>(0,l.jsx)("input",{ref:e=>o.current[a]=e,type:"text",inputMode:"numeric",maxLength:1,value:i[a]||"",onChange:e=>((e,a)=>{if(a.length>1&&(a=a.slice(-1)),!/^\d*$/.test(a))return;const s=[...i];s[e]=a,c(s);const l=s.join("");t?.(l),a&&e<r-1&&o.current[e+1]?.focus(),s.every(e=>e)&&l.length===r&&n?.(l)})(a,e.target.value),onKeyDown:e=>((e,n)=>{if("Backspace"===n.key){n.preventDefault();const r=[...i];i[e]?(r[e]="",c(r),t?.(r.join(""))):e>0&&(r[e-1]="",c(r),t?.(r.join("")),o.current[e-1]?.focus())}"ArrowLeft"===n.key&&e>0&&o.current[e-1]?.focus(),"ArrowRight"===n.key&&e<r-1&&o.current[e+1]?.focus()})(a,e),onFocus:()=>(e=>{o.current[e]?.select()})(a),className:We("w-12 h-14 text-center text-2xl font-bold","border-2 border-gray-300 dark:border-slate-600 rounded-md","bg-white dark:bg-slate-800","text-gray-900 dark:text-white","focus:ring-2 focus:ring-black dark:focus:ring-white focus:border-transparent focus:outline-none","transition-all duration-150"),"aria-label":`Digit ${a+1} of ${r}`},a))})});xt.displayName="OTPInput";const vt=D("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function kt(e,t){const n=e.replace(/\D/g,"");return"US"===t||"CA"===t?10===n.length||11===n.length:n.length>=7&&n.length<=15}const Ct=({phone:e,onPhoneChange:t,countryCode:n="US",onCountryChange:r,onSubmit:a,isLoading:s=!1,error:o})=>{const i=kt(e,n);return(0,l.jsx)("form",{onSubmit:e=>{e.preventDefault(),a()},className:"space-y-4",children:(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center tracking-tight mx-auto",children:"Complete your purchase"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center mx-auto",children:"Verify your mobile number to secure this payment."})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(yt,{value:e,onChange:t,countryCode:n,onCountryChange:r,onKeyDown:e=>{"Enter"===e.key&&i&&!s&&a()},autoFocus:!0}),o&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 mt-2",children:o})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!i||s,isLoading:s,loadingText:"Sending code...",children:"Continue"})]})})};Ct.displayName="IdentityView";const St=D("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Nt=D("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),It=({phone:e,onContinue:t,onSwitchAccount:n,isLoading:r=!1})=>(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),t()},className:"space-y-4",children:[(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center",children:"Welcome back!"}),(0,l.jsxs)("div",{className:"w-full bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-xl p-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex-shrink-0 bg-gray-100 dark:bg-slate-700 rounded-full p-1",children:(0,l.jsx)(St,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"})}),(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)("p",{className:"text-lg font-semibold text-slate-900 dark:text-white truncate",children:e})}),(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)(Nt,{className:"w-5 h-5 text-green-500 dark:text-green-400"})})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full mt-4",disabled:r,isLoading:r,loadingText:"Sending code...",children:"Send Verification Code"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 dark:text-slate-500 text-center mt-4",children:"We'll send you a verification code to confirm it's you"})]}),(0,l.jsx)("div",{className:"text-center px-4 mt-4",children:(0,l.jsx)("button",{type:"button",onClick:n,disabled:r,className:"text-sm text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50",children:"Not you? Use a different number"})})]});It.displayName="WelcomeBackView";const At=D("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),jt=({amount:e,label:t="Total",onClick:n,isExpanded:r=!1,showChevron:a=!1,showIcon:s=!1,className:o=""})=>{const i=!!n,d=We("border rounded-lg px-3 py-2 flex items-center gap-2 transition-colors","bg-gray-50/50 dark:bg-slate-800/50 border-gray-200 dark:border-slate-700",i&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-slate-700",i&&"text-slate-700 dark:text-slate-300 hover:text-black dark:hover:text-white",!i&&"bg-gray-50 dark:bg-slate-800",o),c=(0,l.jsxs)(l.Fragment,{children:[s&&i&&(0,l.jsx)(At,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),(0,l.jsx)("span",{className:"text-xs font-medium text-gray-500 dark:text-slate-400",children:t}),(0,l.jsx)("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:e}),a&&i&&(0,l.jsx)(gt,{className:We("w-4 h-4 text-gray-400 dark:text-slate-500 transition-transform duration-200",r&&"rotate-180")})]});return i?(0,l.jsx)("button",{type:"button",onClick:n,className:d,"aria-expanded":r,"aria-label":(r?"Hide":"Show")+" order details",children:c}):(0,l.jsx)("div",{className:d,children:c})};jt.displayName="PriceTag";const Et=D("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),Tt=({items:e,subtotal:t,shipping:n,tax:r,agentFee:a,total:s,isAgentMode:o=!1})=>(0,l.jsx)("div",{className:"bg-gray-50 dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700",children:(0,l.jsxs)("div",{className:"px-6 py-4 space-y-3",children:[o&&(0,l.jsxs)("div",{className:"flex items-center gap-2 pb-2 border-b border-gray-200 dark:border-slate-700",children:[(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-violet-100 text-violet-700 text-xs font-medium dark:bg-violet-900/30 dark:text-violet-300",children:[(0,l.jsx)(Et,{className:"h-3 w-3"}),"Agent"]}),(0,l.jsx)("span",{className:"text-xs text-gray-600 dark:text-slate-400",children:"AI Agent Purchase"})]}),e&&e.length>0&&(0,l.jsxs)("div",{className:"space-y-2",children:[e.map((e,t)=>(0,l.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-sm text-slate-900 dark:text-white truncate",children:e.label}),e.description&&(0,l.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:e.description})]}),(0,l.jsx)("div",{className:"text-sm font-medium text-slate-900 dark:text-white whitespace-nowrap",children:e.value})]},t)),(0,l.jsx)("div",{className:"h-px bg-gray-200 dark:bg-slate-700"})]}),(0,l.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Subtotal"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:t})]}),n&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Shipping"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:n})]}),r&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Tax"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:r})]}),a&&o&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:["Agent Fee",(0,l.jsx)(Et,{className:"h-3 w-3 text-violet-500"})]}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:a})]})]}),(0,l.jsx)("div",{className:"pt-2 border-t border-gray-200 dark:border-slate-700",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:"Total"}),(0,l.jsx)("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:s})]})})]})});Tt.displayName="ReceiptPanel";const Dt=D("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),_t=d.forwardRef(({className:e},t)=>(0,l.jsxs)("div",{ref:t,className:We("flex items-center justify-center gap-1.5 text-xs text-gray-500 dark:text-slate-400",e),children:[(0,l.jsx)(Dt,{className:"w-3.5 h-3.5"}),(0,l.jsx)("span",{children:"Powered by PayOS"})]}));function Rt(e,t={}){const{preventTouch:n=!1}=t;d.useEffect(()=>{if(!e)return;const t=document.body.style.overflow,r=document.body.style.position,a=document.body.style.top,s=document.body.style.width,o=document.body.style.touchAction,i=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${i}px`,document.body.style.width="100%",n&&(document.body.style.touchAction="none"),()=>{document.body.style.overflow=t,document.body.style.position=r,document.body.style.top=a,document.body.style.width=s,document.body.style.touchAction=o,window.scrollTo(0,i)}},[e,n])}_t.displayName="PayOSFooter";const Pt=450;function Lt(){const[e,t]=d.useState(0);return d.useEffect(()=>{if("undefined"==typeof window||!window.visualViewport)return;const e=window.visualViewport,n=()=>{const n=window.innerHeight-e.height;t(Math.max(0,n));const r=e.height;r<Pt?document.documentElement.style.setProperty("--visual-viewport-height",.85*window.innerHeight+"px"):document.documentElement.style.setProperty("--visual-viewport-height",`${r}px`)};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),document.documentElement.style.removeProperty("--visual-viewport-height")}},[]),e}function Ut(){const e=Lt();return d.useMemo(()=>({bottom:e>0?`${e}px`:void 0}),[e])}const Ot=d.forwardRef(({open:e=!1,onClose:t,title:n,subtitle:r,amount:a,orderItems:s,subtotal:o,shipping:i,tax:c,orderAgentFee:p,mode:u="standard",children:m,className:h,prefill:g,onPhoneSubmit:b,onContinue:f},w)=>{const[y,x]=d.useState(g?.phone?"welcome-back":"identity"),[v,k]=d.useState(""),[C,S]=d.useState(!1),[N,I]=d.useState(!1);Rt(e),Lt(),d.useEffect(()=>{x(g?.phone?"welcome-back":"identity")},[g?.phone]),d.useEffect(()=>{const n=n=>{"Escape"===n.key&&e&&t&&t()};return e&&document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t]);const A=async()=>{if(b){S(!0);try{await b(v)}finally{S(!1)}}},j=async()=>{if(f){S(!0);try{await f()}finally{S(!1)}}},E=()=>{x("identity"),k("")};if(!e)return null;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 bg-black/40 dark:bg-black/60 z-[9998] animate-in fade-in duration-200",onClick:t,"aria-hidden":"true"}),(0,l.jsxs)("div",{ref:w,className:We("fixed z-[9999] flex flex-col shadow-2xl","left-0 right-0 bottom-0 w-full max-w-[480px] mx-auto","h-auto rounded-t-2xl max-h-[90vh]","animate-in slide-in-from-bottom duration-300","md:top-0 md:bottom-0 md:right-0 md:left-auto","md:w-[480px] md:max-w-none md:h-full","md:rounded-none md:border-l md:max-h-none","md:animate-in md:slide-in-from-right","bg-gray-50 dark:bg-slate-900","md:border-gray-200 md:dark:border-slate-800","overscroll-y-contain",h),style:{maxHeight:"var(--visual-viewport-height, 90vh)"},role:"dialog","aria-modal":"true","aria-labelledby":n?"drawer-title":void 0,children:[(0,l.jsx)("div",{className:"flex justify-center pt-3 pb-2 md:hidden",children:(0,l.jsx)("div",{className:"w-10 h-1 bg-gray-300 dark:bg-slate-700 rounded-full"})}),(n||r||a||t)&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-slate-800",children:[n&&(0,l.jsx)("h2",{id:"drawer-title",className:"text-lg font-bold text-gray-900 dark:text-white",children:n}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[a&&s&&(0,l.jsx)(jt,{amount:a,onClick:()=>I(!N),isExpanded:N,showChevron:!0,showIcon:!0}),a&&!s&&(0,l.jsx)(jt,{amount:a}),!a&&r&&(0,l.jsx)("div",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r}),t&&(0,l.jsx)("button",{onClick:t,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors active:scale-95","aria-label":"Close drawer",children:(0,l.jsx)(vt,{className:"w-5 h-5 text-gray-600 dark:text-slate-400"})})]})]}),N&&a&&s&&(0,l.jsx)(Tt,{items:s,subtotal:o||a,shipping:i,tax:c,agentFee:p,total:a,isAgentMode:"agent"===u}),(0,l.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto overscroll-y-contain px-6 pt-6 pb-8",children:m||("welcome-back"===y&&g?.phone?(0,l.jsx)(It,{phone:g.phone,onContinue:j,onSwitchAccount:E,isLoading:C}):(0,l.jsx)(Ct,{phone:v,onPhoneChange:k,onSubmit:A,isLoading:C}))}),(0,l.jsx)(_t,{className:"px-6 pb-6"})]})]})});Ot.displayName="PayOSDrawer";const zt=D("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Mt=({brand:e,size:t="md",className:n=""})=>{const r="sm"===t?"h-4":"h-5";return"visa"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("path",{d:"M18.5 0L15.2 15.8H11.7L15 0H18.5Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M32.5 10.3L34.2 5.4L35.3 10.3H32.5ZM36.8 15.8H40L37.1 0H34.1C33.4 0 32.8 0.4 32.5 1L27 15.8H30.8L31.6 13.5H36.3L36.8 15.8Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M13.2 10.7L13.6 8.3L12.5 7.9C11.7 7.6 10.3 7.2 10.3 6.2C10.3 5.4 11.1 4.6 12.7 4.6C13.9 4.6 14.8 4.9 15.5 5.2L16 2.6C15.3 2.3 14.2 2 12.8 2C9.2 2 6.6 4 6.6 6.8C6.6 8.9 8.4 10 9.7 10.7C11.1 11.4 11.6 11.9 11.6 12.5C11.6 13.5 10.4 14 9.3 14C7.7 14 6.8 13.7 5.6 13.2L5.1 15.9C6 16.3 7.6 16.7 9.3 16.7C13.2 16.7 15.7 14.8 15.7 11.8C15.7 10.2 14.7 9.1 13.2 10.7Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M26 0L22.9 11L22.7 10C21.9 7.8 19.6 5.4 17 4.2L20.1 15.8H24L29.8 0H26Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M20.5 0H15.8L15.7 0.3C20.1 1.5 23 4.3 24.2 7.9L22.8 1.2C22.6 0.5 22 0 21.3 0H20.5Z",fill:"#FCA121"})]}):"mastercard"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 32",fill:"none",children:[(0,l.jsx)("circle",{cx:"18",cy:"16",r:"14",fill:"#EB001B"}),(0,l.jsx)("circle",{cx:"30",cy:"16",r:"14",fill:"#F79E1B"}),(0,l.jsx)("path",{d:"M24 6C26.2 7.6 27.7 10.2 28 13H20C20.3 10.2 21.8 7.6 24 6ZM24 26C21.8 24.4 20.3 21.8 20 19H28C27.7 21.8 26.2 24.4 24 26Z",fill:"#FF5F00"})]}):"amex"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"16",rx:"2",fill:"#006FCF"}),(0,l.jsx)("path",{d:"M10 5H8L6 11H8L10 5Z",fill:"white"}),(0,l.jsx)("path",{d:"M15 5L13 8L11 5H9L12 11H14L17 5H15Z",fill:"white"}),(0,l.jsx)("path",{d:"M22 5H18V11H22C23.7 11 25 9.7 25 8C25 6.3 23.7 5 22 5Z",fill:"white"})]}):"discover"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"16",rx:"2",fill:"#FF6000"}),(0,l.jsx)("path",{d:"M8 5H6V11H8V5Z",fill:"white"}),(0,l.jsx)("path",{d:"M14 5H10V11H14C15.7 11 17 9.7 17 8C17 6.3 15.7 5 14 5Z",fill:"white"})]}):null},Ft=({last4:e,brand:t,expiry:n,cardArtUrl:r,issuerName:a,selected:s=!1,onClick:o,isLast:i=!1})=>(0,l.jsxs)("div",{onClick:o,className:`\n w-full p-4 flex items-center justify-between bg-white\n ${i?"":"border-b border-gray-100"}\n ${o?"hover:bg-gray-50 cursor-pointer active:bg-gray-100 transition-colors":""}\n `,role:o?"button":void 0,tabIndex:o?0:void 0,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[r?(0,l.jsx)("img",{src:r,alt:`${t} card`,className:"w-10 h-6 object-cover rounded-md flex-shrink-0"}):(0,l.jsx)(Mt,{brand:t,className:"flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:[a&&a.toLowerCase()!==t.toLowerCase()?`${a} `:"",t.charAt(0).toUpperCase()+t.slice(1)," •••• ",e]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Expires ",n]})]})]}),s&&(0,l.jsx)(zt,{className:"w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0"})]});Ft.displayName="PaymentMethodRow";const Vt=({card:e,cvc:t,onCvcChange:n,onChangeClick:r,error:a,disabled:s=!1,hideSecurityCode:o=!1})=>{const i="amex"===e.brand?4:3,d=function(e,t){const n=e.replace(/\D/g,"");return"amex"===t?4===n.length:3===n.length}(t);return(0,l.jsxs)("div",{className:"w-full bg-white border border-gray-200 dark:border-slate-700 rounded-xl overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"p-4 flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[e.cardArtUrl?(0,l.jsx)("img",{src:e.cardArtUrl,alt:`${e.brand} card`,className:"w-10 h-6 object-contain rounded flex-shrink-0"}):(0,l.jsx)(Mt,{brand:e.brand,className:"flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:[e.brand.charAt(0).toUpperCase()+e.brand.slice(1)," •••• ",e.last4]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Expires ",e.expiryMonth,"/",e.expiryYear]})]})]}),(0,l.jsx)("button",{type:"button",onClick:r,disabled:s,className:"text-sm font-medium text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50 disabled:no-underline",children:"Change"})]}),!o&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"border-b border-gray-100 dark:border-slate-700"}),(0,l.jsxs)("div",{className:"p-4 bg-gray-50/50 dark:bg-slate-800/50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{htmlFor:"cvc-input",className:"text-sm font-medium text-slate-900 dark:text-white",children:"Security Code"}),(0,l.jsx)("input",{id:"cvc-input",type:"text",inputMode:"numeric",value:t,onChange:t=>{const r=t.target.value.replace(/\D/g,""),a="amex"===e.brand?4:3;r.length<=a&&n(r)},disabled:s,placeholder:4===i?"1234":"123",maxLength:i,className:`\n w-16 h-10 bg-white dark:bg-slate-900\n border rounded text-center font-bold text-base\n text-slate-900 dark:text-white\n placeholder-gray-400 dark:placeholder-slate-500\n outline-none transition-all shadow-sm\n disabled:opacity-50 disabled:cursor-not-allowed\n ${a?"border-red-500 dark:border-red-400":d?"border-green-500 dark:border-green-400":"border-gray-300 dark:border-slate-600 focus:border-black dark:focus:border-white"}\n `,"aria-label":"Card security code","aria-invalid":!!a,"aria-describedby":a?"cvc-error":void 0})]}),a&&(0,l.jsx)("p",{id:"cvc-error",className:"text-xs text-red-600 dark:text-red-400 mt-2 text-right",children:a}),!a&&(0,l.jsxs)("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2 text-right",children:[i,"-digit code on back of card"]})]})]})]})};Vt.displayName="ActiveCardWidget";const Ht=D("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),$t=({title:e,onBack:t,action:n})=>(0,l.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-gray-200 dark:border-slate-700 mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,l.jsx)("button",{onClick:t,className:"p-2 hover:bg-gray-100 dark:hover:bg-slate-800 rounded-lg active:scale-95 transition-all","aria-label":"Go back",children:(0,l.jsx)(Ht,{className:"w-5 h-5 text-gray-900 dark:text-white"})}),(0,l.jsx)("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),n&&(0,l.jsx)("div",{className:"flex-shrink-0",children:n})]});$t.displayName="ViewHeader";const Bt=d.forwardRef(({total:e,items:t=[],isAgentMode:n=!1,agentFee:r,defaultExpanded:a=!1,className:s},o)=>{const[i,c]=d.useState(a);return(0,l.jsxs)(Qe,{ref:o,variant:"default",className:We("p-4 cursor-pointer select-none transition-all duration-200",n&&"border-indigo-100 dark:border-indigo-900 bg-indigo-50/50 dark:bg-indigo-950/30",s),onClick:()=>c(!i),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 dark:text-white",children:"Order Total"}),n&&(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-violet-100 text-violet-700 text-xs font-medium dark:bg-violet-900/30 dark:text-violet-300",children:[(0,l.jsx)(Et,{className:"h-3 w-3"}),"Agent"]})]}),n&&r&&(0,l.jsxs)("p",{className:"text-xs text-indigo-700 dark:text-indigo-400",children:["Agent Fee: ",r," • Standard Processing"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e}),(0,l.jsx)(gt,{className:We("w-5 h-5 text-gray-500 dark:text-slate-400 transition-transform duration-200",i&&"rotate-180")})]})]}),i&&t.length>0&&(0,l.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-slate-700 space-y-2",children:t.map((e,t)=>(0,l.jsxs)("div",{className:"flex justify-between items-start text-sm",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("span",{className:"text-gray-700 dark:text-slate-300",children:e.label}),e.description&&(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-500 mt-0.5",children:e.description})]}),(0,l.jsx)("span",{className:"font-medium text-gray-900 dark:text-white ml-4",children:e.value})]},t))})]})});Bt.displayName="OrderSummary";const qt=({phoneNumber:e,otp:t,onOtpChange:n,onSubmit:r,onEdit:a,onResend:s,isLoading:o=!1,isResending:i=!1,error:d,resendCooldown:c=0,retryCount:p=0,maxRetries:u=3})=>{const m=p>=u,h=0===c&&!m,g=function(e){const t=e.replace(/\D/g,"");if(11===t.length&&t.startsWith("1"))return`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7,11)}`;if(10===t.length)return`+1 (${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6,10)}`;return e}(e);return(0,l.jsx)("form",{onSubmit:e=>{e.preventDefault(),r()},className:"space-y-4",children:(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center mb-2",children:"Enter verification code"}),(0,l.jsxs)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center mb-8",children:["Sent to"," ",(0,l.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:g}),a&&(0,l.jsxs)(l.Fragment,{children:[" ","•"," ",(0,l.jsx)("button",{type:"button",onClick:a,className:"text-blue-600 dark:text-blue-400 hover:underline",children:"Edit"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(xt,{value:t,onChange:n,onComplete:e=>{n(e),setTimeout(()=>{r(e)},100)}}),d&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 mt-4 text-center",children:d})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full mt-8",disabled:6!==t.length||o,isLoading:o,loadingText:"Verifying...",children:"Verify"}),s&&(0,l.jsx)("div",{className:"text-center mt-4",children:(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:m?(0,l.jsx)("span",{className:"text-red-600 dark:text-red-400",children:"Too many attempts. Please try again later."}):i?"Sending...":c>0?(0,l.jsxs)(l.Fragment,{children:["Resend in"," ",(0,l.jsxs)("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:[c,"s"]})]}):(0,l.jsxs)(l.Fragment,{children:["Didn't receive a code?"," ",(0,l.jsx)("button",{type:"button",onClick:s,disabled:!h||o,className:"font-bold text-slate-900 dark:text-white hover:underline cursor-pointer disabled:opacity-50",children:"Resend"})]})})})]})})};qt.displayName="OTPView";const Kt=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e/100),Gt=({selectedCard:e,cvc:t,onCvcChange:n,onChangeCard:r,paymentIntent:a,total:s,isAgentMode:o,onSubmit:i,isLoading:d=!1,error:c})=>{const p="amex"===e.brand?4:3,u=t.length===p,m=a?Kt(a.totalAmount+(a.facilitationFee?.amount||0),a.currency):s||"$0.00",h=a?"pay_on_behalf"===(g=a.type)||"agent_to_agent"===g||"agentic_multi"===g:o||!1;var g;const b=!!h||u,f=h?`Authorize ${m}`:`Pay ${m}`;return(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),i()},className:"space-y-6",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white px-1 mt-6",children:"Payment Method"}),(0,l.jsx)(Vt,{card:e,cvc:t,onCvcChange:n,onChangeClick:r,disabled:d,error:c,hideSecurityCode:h})]}),h&&a?.facilitationFee&&(0,l.jsx)("div",{className:"p-3 bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-700 rounded-lg",children:(0,l.jsxs)("p",{className:"text-sm text-purple-800 dark:text-purple-200",children:["This is an agent-assisted transaction. A ",Kt(a.facilitationFee.amount,a.facilitationFee.currency)," facilitation fee applies."]})}),(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!b||d,isLoading:d,loadingText:"Processing...",children:f})]})};Gt.displayName="CheckoutView";const Wt=D("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Yt=D("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Jt=({isOpen:e,title:t,message:n,confirmText:r="Confirm",cancelText:a="Cancel",onConfirm:s,onCancel:o,isLoading:i=!1,variant:d="default"})=>{if(!e)return null;return(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e=>{e.target!==e.currentTarget||i||o()},children:(0,l.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-xl max-w-sm w-full mx-4 overflow-hidden animate-in fade-in zoom-in-95 duration-200",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{className:"px-6 pt-6 pb-2",children:(0,l.jsx)("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:t})}),(0,l.jsx)("div",{className:"px-6 pb-6",children:(0,l.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:n})}),(0,l.jsxs)("div",{className:"px-6 pb-6 flex gap-3",children:[(0,l.jsx)(Je,{variant:"outline",className:"flex-1",onClick:o,disabled:i,children:a}),(0,l.jsx)(Je,{variant:"danger"===d?"destructive":"default",className:"flex-1",onClick:s,disabled:i,children:i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(_,{className:"w-4 h-4 mr-2 animate-spin"}),r]}):r})]})]})})};Jt.displayName="ConfirmDialog";const Xt=({cards:e,selectedCardId:t,onSelectCard:n,onAddNewCard:r,onBack:a,onDeleteCard:s})=>{const[o,i]=d.useState(null),[c,p]=d.useState(null),u=c?e.find(e=>e.id===c)?.last4:"";return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:"Payment Methods",onBack:a}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-xl overflow-hidden",children:[e.map(e=>(0,l.jsxs)("div",{className:"relative flex items-center",children:[(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(Ft,{last4:e.last4,brand:e.brand,expiry:`${e.expiryMonth}/${e.expiryYear}`,cardArtUrl:e.cardArtUrl,issuerName:e.issuerName,selected:t===e.id,onClick:()=>n(e.id),isLast:!1})}),s&&(0,l.jsx)("button",{onClick:t=>((e,t)=>{e.stopPropagation(),s&&p(t)})(t,e.id),disabled:o===e.id,className:"absolute right-4 p-2 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors disabled:opacity-50","aria-label":"Delete card",children:(0,l.jsx)(Wt,{className:"w-4 h-4 "+(o===e.id?"animate-pulse":"")})})]},e.id)),0===e.length&&(0,l.jsx)("div",{className:"p-4 text-center border-b border-gray-100 dark:border-slate-700",children:(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No saved cards yet"})}),(0,l.jsxs)("div",{onClick:r,className:"w-full p-4 flex items-center gap-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-800 active:bg-gray-100 dark:active:bg-slate-700 transition-colors",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-lg bg-gray-100 dark:bg-slate-700 flex items-center justify-center flex-shrink-0",children:(0,l.jsx)(Yt,{className:"w-5 h-5 text-gray-600 dark:text-slate-400"})}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:"Add new card"})})]})]}),(0,l.jsx)(Jt,{isOpen:!!c,title:"Delete Card",message:`Are you sure you want to delete the card ending in ${u}? This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel",variant:"danger",onConfirm:async()=>{c&&s&&(i(c),await s(c),i(null),p(null))},onCancel:()=>p(null),isLoading:o===c})]})};Xt.displayName="MethodListView";const Zt=D("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Qt="1.0.0";class en{constructor(e,t){if(this.container=null,this.iframe=null,this.messageListener=null,this.iframeOrigin=null,this.options={environment:"sandbox",height:"720px",...t},this.validateOptions(),"string"==typeof e){if(this.container=document.querySelector(e),!this.container)throw new Error(`Container element not found: ${e}`)}else this.container=e}mount(){if(!this.container)throw new Error("Container element not found");this.unmount(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.height=this.options.height||"720px",this.iframe.style.border="none",this.iframe.style.borderRadius="12px",this.iframe.style.background="transparent",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),this.iframe.allow="payment *";const e=this.buildIframeUrl();this.iframeOrigin=(()=>{try{return new URL(e).origin}catch{return console.warn("[CardElementClient] Invalid iframe URL"),null}})(),this.messageListener=this.handleMessage.bind(this),window.addEventListener("message",this.messageListener),this.options.styles&&(this.iframe.onload=()=>{setTimeout(()=>{this.sendStyles(this.options.styles)},100)}),this.iframe.src=e,this.container.appendChild(this.iframe)}unmount(){this.iframe&&this.iframe.parentNode&&(this.iframe.parentNode.removeChild(this.iframe),this.iframe=null),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}destroy(){this.unmount(),this.container=null,this.options={}}configure(e){if(!this.iframe)return void console.error("[CardElementClient] Cannot configure: iframe not initialized");const t={source:"payos-sdk",type:"configure",data:e,version:Qt},n=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(t,n)}submit(){if(!this.iframe)return void console.error("[CardElementClient] Cannot submit: iframe not initialized");const e={source:"payos-sdk",type:"submit",version:Qt},t=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(e,t)}updateStyles(e){this.iframe?this.sendStyles(e):console.error("[CardElementClient] Cannot update styles: iframe not initialized")}sendStyles(e){if(!this.iframe)return;const t={source:"payos-sdk",type:"styles",data:e,version:Qt},n=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(t,n)}handleMessage(e){if(!this.isAllowedOrigin(e.origin))return;const{data:t}=e;if(!t||"object"!=typeof t)return;if("payos-card"!==t.source)return;const n=t;switch(n.type){case"ready":this.options.onReady?.();break;case"complete":n.data&&this.options.onTokenized&&this.options.onTokenized(n.data);break;case"change":n.data&&this.options.onChange&&this.options.onChange(n.data);break;case"cancel":this.options.onCancel?.();break;case"error":if(this.options.onError){const e=new Error(n.error||"Unknown error");this.options.onError(e)}}}isAllowedOrigin(e){return this.getAllowedOrigins().some(t=>t===e)}buildIframeUrl(){const e=this.getBaseUrl(),t=new URL(`${e}/card-element`);return t.searchParams.set("token",this.options.token),t.searchParams.set("domain",window.location.origin),t.searchParams.set("env",this.options.environment||"sandbox"),t.searchParams.set("version",Qt),t.searchParams.set("mode","iframe"),this.options.customParams&&Object.entries(this.options.customParams).forEach(([e,n])=>{t.searchParams.set(e,n)}),t.toString()}getBaseUrl(){return this.options.customBaseUrl?this.options.customBaseUrl.replace(/\/$/,""):"https://wallet-onboard.payos.ai"}getAllowedOrigins(){const e=new Set;this.iframeOrigin&&e.add(this.iframeOrigin);try{const t=this.getBaseUrl(),n=new URL(t).origin;e.add(n)}catch{}return e.add("https://wallet-onboard.payos.ai"),e.add("https://wallet-onboard-sandbox.payos.ai"),e.add("http://localhost:3000"),Array.from(e)}validateOptions(){if(!this.options.token)throw new Error("Token is required");if(this.options.environment&&!["sandbox","production"].includes(this.options.environment))throw new Error('Environment must be either "sandbox" or "production"')}}const tn=({linkToken:e,walletUserId:t,onSubmit:n,onBack:r,isLoading:a=!1,error:s,isFirstCard:o=!1,environment:i="sandbox",customBaseUrl:c,devApiUrl:p,shippingAddress:u})=>{const[m,h]=d.useState(null),[g,b]=d.useState(!1),[f,w]=d.useState(!1),y=u&&(u.line1||u.city||u.postalCode),x=d.useCallback(e=>{b(!1);const t={number:"",expiry:"",cvc:"",cardholderName:e.cardholderName||e.card?.cardholderName||"",brand:e.card?.brand,last4:e.card?.last4,cardArtUrl:e.card?.artwork,cardId:e.card?.id},r={line1:e.billingAddress?.street||"",line2:e.billingAddress?.street2||"",city:e.billingAddress?.city||"",state:e.billingAddress?.state||"",zip:e.billingAddress?.postalCode||"",country:e.billingAddress?.country||"US"};n(t,r)},[n]),v=d.useCallback(e=>{b(!1),h(e.message)},[]),{containerRef:k,isReady:C,isComplete:S,submit:N,configure:I}=function(e){const t=(0,d.useRef)(null),n=(0,d.useRef)(null),[r,a]=(0,d.useState)(!1),[s,o]=(0,d.useState)(!1),[i,l]=(0,d.useState)(!0),[c,p]=(0,d.useState)(void 0),u=(0,d.useRef)(e.onTokenized),m=(0,d.useRef)(e.onReady),h=(0,d.useRef)(e.onError),g=(0,d.useRef)(e.onChange),b=(0,d.useRef)(e.onCancel);(0,d.useEffect)(()=>{u.current=e.onTokenized,m.current=e.onReady,h.current=e.onError,g.current=e.onChange,b.current=e.onCancel},[e.onTokenized,e.onReady,e.onError,e.onChange,e.onCancel]),(0,d.useEffect)(()=>{const r=t.current;if(!r||!e.token)return;a(!1),o(!1),l(!0),p(void 0);const s={token:e.token,environment:e.environment||"sandbox",styles:e.styles,height:e.height,customBaseUrl:e.customBaseUrl,customParams:e.customParams,onReady:()=>{a(!0),m.current?.()},onTokenized:e=>{u.current?.(e)},onChange:e=>{o(e.complete),l(e.empty),p(e.error),g.current?.(e)},onCancel:()=>{b.current?.()},onError:e=>{p(e.message),h.current?.(e)}},i=new en(r,s);return i.mount(),n.current=i,()=>{i.unmount(),n.current=null}},[e.token,e.environment,e.height,e.customBaseUrl]);const f=(0,d.useCallback)(()=>{n.current?n.current.submit():console.warn("[useCardElement] Cannot submit: CardElement not initialized")},[]),w=(0,d.useCallback)(e=>{n.current?n.current.configure(e):console.warn("[useCardElement] Cannot configure: CardElement not initialized")},[]),y=(0,d.useCallback)(e=>{n.current?.updateStyles?n.current.updateStyles(e):console.warn("[useCardElement] Cannot update styles: CardElement not initialized")},[]);return{containerRef:t,isReady:r,isComplete:s,isEmpty:i,error:c,submit:f,configure:w,updateStyles:y}}({token:e,environment:i,customBaseUrl:c,height:"280px",styles:{layout:{padding:"0px",gap:"4px",labelPlacement:"above",showLabels:!1},container:{padding:"16px",margin:"0"}},customParams:p?{devApi:p}:void 0,onTokenized:x,onError:v,onChange:e=>{!e.empty&&m&&h(null)}});d.useEffect(()=>{if(C){const e={};t&&(e.walletUserId=t),y&&u&&(e.shippingAddress=u,e.useShippingAsBilling=f),Object.keys(e).length>0&&(console.log("[CardAddView] Configuring CardElement:",e),I(e))}},[C,t,y,u,f,I]);const A=s||m,j=a||g;return e?(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),!S||a||g||(h(null),b(!0),N())},className:"space-y-4",children:[(0,l.jsx)($t,{title:o?"Secure Checkout":"Add Card",onBack:o?void 0:r}),y&&(0,l.jsx)("div",{className:"w-full max-w-md mx-auto px-4",children:(0,l.jsxs)("button",{type:"button",onClick:()=>w(!f),className:"flex items-center gap-3 w-full text-left py-2",children:[(0,l.jsx)("div",{className:`\n w-5 h-5 rounded border-2 flex items-center justify-center transition-colors\n ${f?"bg-slate-900 border-slate-900 dark:bg-white dark:border-white":"border-gray-300 dark:border-slate-600"}\n `,children:f&&(0,l.jsx)(zt,{className:"w-3 h-3 text-white dark:text-slate-900"})}),(0,l.jsx)("span",{className:"text-sm text-slate-700 dark:text-slate-300",children:"Billing address same as shipping"})]})}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl overflow-hidden",children:[(0,l.jsxs)("div",{className:"relative",children:[!C&&(0,l.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-white dark:bg-slate-900 z-10 min-h-[280px]",children:[(0,l.jsx)(_,{className:"w-8 h-8 text-gray-400 animate-spin"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-3",children:"Loading secure form..."})]}),(0,l.jsx)("div",{ref:k,className:"min-h-[280px] w-full",style:{opacity:C?1:0}})]}),A&&(0,l.jsx)("div",{className:"px-6 pb-4",children:(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 text-center",children:A})}),(0,l.jsx)("div",{className:"px-6 pb-6",children:(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!S||j,isLoading:j,loadingText:"Saving card...",children:"Save card"})})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:o?"Secure Checkout":"Add Card",onBack:o?void 0:r}),(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 space-y-4 text-center",children:[(0,l.jsx)(Zt,{className:"w-12 h-12 text-red-500"}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Error"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Unable to initialize secure card entry. Please try again."}),r&&(0,l.jsx)(Je,{variant:"outline",onClick:r,className:"mt-4",children:"Go Back"})]})})]})};tn.displayName="CardAddView";const nn=e=>"pay_on_behalf"===e||"agent_to_agent"===e||"agentic_multi"===e,rn=({paymentIntent:e,completionResult:t,walletUser:n,type:r,cardNetwork:a,mode:s,onCreatePasskey:o,onDismiss:i,isLoading:d=!1,passkeyEnrolled:c=!1})=>{const p=e?nn(e.type):"agent"===s,u=e?(e=>e&&nn(e.type)?"credential":"payment")(e):r||"payment",m=p?"Credentials Ready!":"payment"===u?"Payment Successful":"Card Added",h=p?t?.credentialId?`Credential ID: ${t.credentialId}`:"Your payment credentials have been generated and are ready for agent use.":t?.transactionId?`Transaction: ${t.transactionId}`:n?.email?`Confirmation sent to ${n.email}`:null,g=!p&&a&&o&&!c;return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-8",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center text-center space-y-4",children:[(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(Nt,{className:"w-16 h-16 text-green-500 dark:text-green-400 animate-in zoom-in duration-300"})}),(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white",children:m}),h&&(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:h})]})}),g&&(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[(0,l.jsx)("h3",{className:"text-lg font-bold text-slate-900 dark:text-white text-center",children:"Checkout faster next time?"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center",children:"Create a Passkey to pay securely with FaceID/TouchID—no codes needed."}),(0,l.jsx)(Je,{onClick:o,className:"w-full",disabled:d,isLoading:d,loadingText:"mastercard"===a?"Creating...":"Verifying...",children:"Create Passkey"}),(0,l.jsx)("button",{type:"button",onClick:i,disabled:d,className:"w-full text-sm text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 disabled:opacity-50 transition-colors",children:"No thanks"})]})]})};rn.displayName="SuccessView";const an=D("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),sn=D("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),on=D("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),ln="#0055BB",dn=({methods:e,onSelectMethod:t,onBack:n,isLoading:r=!1})=>{const a=e=>{switch(e){case"sms":return(0,l.jsx)(an,{className:"w-5 h-5",style:{color:ln}});case"email":return(0,l.jsx)(sn,{className:"w-5 h-5",style:{color:ln}})}},s=(e,t)=>{switch(e){case"sms":return`Text to ${t}`;case"email":return`Email to ${t}`}};return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,l.jsx)(Dt,{className:"w-5 h-5",style:{color:ln}}),(0,l.jsx)("span",{className:"text-sm font-semibold",style:{color:ln},children:"Verified by Visa"})]}),(0,l.jsx)($t,{title:"Verify Your Identity",onBack:n}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:"Your bank requires additional verification. Choose how you'd like to receive your code."}),(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl overflow-hidden",children:e.map((e,n)=>(0,l.jsxs)("button",{onClick:()=>!r&&t(e.id),disabled:r,className:`\n w-full px-6 py-4 flex items-center gap-3\n hover:bg-blue-50 dark:hover:bg-slate-800/50\n active:bg-blue-100 dark:active:bg-slate-800\n transition-colors\n disabled:opacity-50 disabled:cursor-not-allowed\n ${0!==n?"border-t border-gray-200 dark:border-slate-700":""}\n `,children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:a(e.type)}),(0,l.jsx)("div",{className:"flex-1 text-left",children:(0,l.jsx)("p",{className:"text-sm font-medium text-slate-900 dark:text-white",children:s(e.type,e.maskedValue)})}),(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)(on,{className:"w-5 h-5",style:{color:ln}})})]},e.id))})]})};dn.displayName="VisaMethodView";const cn="#0055BB",pn=({methodDescription:e,otp:t,onOtpChange:n,onVerify:r,onBack:a,onResend:s,onVerifyAnotherWay:o,isLoading:i=!1,error:c,canRetry:p=!0})=>{const u=d.useRef(!1);d.useEffect(()=>{t.length<6&&(u.current=!1)},[t]);d.useEffect(()=>{6!==t.length||i||!p||u.current||(u.current=!0,r())},[t,i,r,p]);const m=!p;return(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),6===t.length&&p&&!i&&(u.current=!0,r())},className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,l.jsx)(Dt,{className:"w-5 h-5",style:{color:cn}}),(0,l.jsx)("span",{className:"text-sm font-semibold",style:{color:cn},children:"Verified by Visa"})]}),(0,l.jsx)($t,{title:"Enter Bank Code",onBack:a}),(0,l.jsxs)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:["Code sent to ",e]}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsx)("div",{className:i||m?"opacity-50 pointer-events-none":"",children:(0,l.jsx)(xt,{value:t,onChange:n,length:6})}),c&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 text-center",children:c}),(0,l.jsx)(Je,{type:"submit",className:"w-full",style:{backgroundColor:cn},disabled:6!==t.length||i||m,isLoading:i,loadingText:"Verifying...",children:"Verify"}),m&&o&&(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)("button",{type:"button",onClick:o,className:"text-sm hover:underline",style:{color:cn},children:"Verify another way"})}),s&&!m&&(0,l.jsx)("div",{className:"text-center mt-4",children:(0,l.jsxs)("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Didn't receive a code?"," ",(0,l.jsx)("button",{type:"button",onClick:s,disabled:i,className:"font-bold hover:underline disabled:opacity-50",style:{color:cn},children:"Resend"})]})})]})]})};pn.displayName="VisaOtpView";const un=D("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),mn=D("fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),hn=({cardNetwork:e,onCreatePasskey:t,onSkip:n,onBack:r,isLoading:a=!1,error:s,showSkip:o=!1})=>{const i="visa"===e?"Create Visa Passkey":"Create Mastercard Passkey",d="mastercard"===e?"Creating Passkey...":"Verifying...";return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)("div",{className:"w-12 h-12 bg-indigo-100 dark:bg-indigo-900/30 rounded-full flex items-center justify-center",children:(0,l.jsx)(un,{className:"w-6 h-6 text-indigo-600 dark:text-indigo-400"})})}),(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center",children:"One final step"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400 text-center leading-relaxed",children:"To allow the AI Agent to securely purchase this item for you, you must enable biometric access."})]}),"visa"===e&&(0,l.jsx)("div",{id:"visa-auth-container",className:"w-full max-w-md mx-auto min-h-[10px] bg-gray-50 dark:bg-slate-800 rounded-2xl overflow-hidden"}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[s&&(0,l.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700 rounded-lg",children:[(0,l.jsx)(Zt,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:s})]}),(0,l.jsxs)(Je,{onClick:t,className:"w-full",disabled:a,isLoading:a,loadingText:d,children:[(0,l.jsx)(mn,{className:"w-5 h-5 mr-2"}),i]}),o&&n&&(0,l.jsx)("button",{type:"button",onClick:n,disabled:a,className:"w-full text-sm text-gray-500 dark:text-slate-400 hover:underline disabled:opacity-50",children:"Skip for now"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-400 text-center",children:"This grants the agent permission for this specific transaction."})]}),r&&(0,l.jsx)("div",{className:"text-center px-4 mt-4",children:(0,l.jsx)("button",{type:"button",onClick:r,disabled:a,className:"text-sm text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50",children:"Back to checkout"})})]})};hn.displayName="AgentRegistrationView";class gn extends Error{constructor(e,t,n){super(e),this.name="ApiError",this.status=t,this.details=n}}function bn(e){if(!e)return e;const t=e.startsWith("+"),n=e.replace(/\D/g,"");return t?`+${n}`:10===n.length?`+1${n}`:(11===n.length&&n.startsWith("1"),`+${n}`)}function fn(e){return{id:e.id||e.cardId,brand:e.brand?.toLowerCase()||"unknown",last4:e.last4,expiryMonth:e.expMonth?.toString()||e.expiryMonth||"",expiryYear:e.expYear?.toString()||e.expiryYear||"",cardholderName:e.cardholderName,isDefault:e.isDefault||!1,network:e.brand?.toLowerCase()||"visa",passkeyEnrolled:e.passkeyEnrolled||!1,cardArtUrl:e.cardArt||e.artwork||e.cardArtUrl,issuerName:e.issuerName}}async function wn(e,t,n,r={}){const a=`${e}${t}`,s={"Content-Type":"application/json",Authorization:`Bearer ${n}`,"ngrok-skip-browser-warning":"true"};try{const e=await fetch(a,{...r,headers:{...s,...r.headers}}),t=e.headers.get("content-type");let n;if(t&&t.includes("application/json"))n=await e.json();else{const t=await e.text();try{n=JSON.parse(t)}catch{if(t.includes("<!DOCTYPE")||t.includes("<html"))throw new gn("Received HTML instead of JSON. Ngrok bypass header may not be working.",e.status,"HTML response received");throw new gn("Invalid JSON response from server",e.status,t.substring(0,200))}}if(!e.ok)throw new gn(n.message||"An error occurred",e.status);return n}catch(e){if(e instanceof gn)throw e;throw new gn(e instanceof Error?e.message:"Network error",0)}}async function yn(e,t,n){const r=bn(n);console.log("[ApiService] Sending OTP to:",n,"→",r);const a=await wn(e,"/api/otp/payos-link/generate",t,{method:"POST",body:JSON.stringify({phone:r,channel:"sms"})});if(a.error||!a.data)throw new gn(a.message||"Failed to send verification code",400);return console.log("[ApiService] OTP sent, reference:",a.data.reference),a.data.reference}async function xn(e,t,n,r){console.log("[ApiService] Resending OTP, previous reference:",n);try{const a=await async function(e,t,n){const r=await wn(e,`/api/otp/payos-link/status/${n}`,t,{method:"GET"});if(r.error||!r.data)throw new gn(r.message||"Failed to get verification status",400);return r.data}(e,t,n),s=new Date(a.createdAt),o=Date.now()-s.getTime(),i=3e4;if(o<i&&"pending"===a.status){const e=Math.ceil((i-o)/1e3);return console.log("[ApiService] Rate limited, wait time remaining:",e),{reference:n,waitTimeRemaining:e}}return{reference:await yn(e,t,r)}}catch(e){throw console.error("[ApiService] Failed to resend verification:",e),e}}async function vn(e,t){console.log("[ApiService] Getting current session");const n=await wn(e,"/web/sessions/current",t,{method:"GET"});if(n.error||!n.data)throw new gn(n.message||"Failed to get session",400);return n.data}async function kn(e,t,n){console.log("[ApiService] Updating session payment intent:",n);const r=await wn(e,"/web/sessions/current/payment-intent",t,{method:"PATCH",body:JSON.stringify(n)});if(r.error||!r.data)throw new gn(r.message||"Failed to update payment intent",400);return console.log("[ApiService] Session payment intent updated"),r.data}const Cn="payos_device_id",Sn="payos_device_created";function Nn(){const e=[];e.push(`${screen.width}x${screen.height}`),e.push(`${screen.colorDepth}`),e.push(Intl.DateTimeFormat().resolvedOptions().timeZone),e.push(navigator.language),e.push(navigator.platform),e.push(navigator.userAgent),e.push(String(navigator.hardwareConcurrency||0));const t=navigator;e.push(String(t.deviceMemory||0));return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}(e.join("|"))}function In(){const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}function An(){try{const e=localStorage.getItem(Cn);if(e)return e;const t=Nn(),n=`${t}-${In().substring(0,8)}`;return localStorage.setItem(Cn,n),localStorage.setItem(Sn,(new Date).toISOString()),n}catch{return In()}}function jn(e,t){const{apiBaseUrl:n}=t,[r,a]=(0,d.useState)(null),[s,o]=(0,d.useState)("LOADING"),[i,l]=(0,d.useState)(!0),[c,p]=(0,d.useState)(null),[u,m]=(0,d.useState)("checkout"),[h,g]=(0,d.useState)(""),[b,f]=(0,d.useState)("initial"),[w,y]=(0,d.useState)(null),[x,v]=(0,d.useState)(null),k=(0,d.useRef)(!0),C=(0,d.useRef)(e),S=(0,d.useRef)(!1);(0,d.useEffect)(()=>{C.current!==e&&(S.current=!1),C.current=e},[e]);const N=(0,d.useCallback)((e,t)=>{const{session:n,paymentIntent:r}=e,a=r?{id:r.id,type:r.type,currency:r.currency,organizationId:r.organizationId,status:r.status,totalAmount:r.totalAmount,totalSubtotal:r.totalSubtotal??r.totalAmount,totalTax:r.totalTax,totalShipping:r.totalShipping,payments:r.payments.map(e=>({id:e.id,merchantName:e.merchantName,merchantUrl:e.merchantUrl,amount:e.amount,subtotal:e.subtotal||e.amount,tax:e.tax,shipping:e.shipping,description:e.description,quantity:e.quantity,credentialStatus:e.credentialStatus,status:e.status,createdAt:e.createdAt,updatedAt:e.updatedAt})),intentType:r.intentType||"standard",walletUserId:r.walletUserId,selectedCardId:r.selectedCardId,requireHitl:r.requireHitl??!1,hitlAttemptCount:r.hitlAttemptCount??0,hitlApproved:r.hitlApproved??!1,networkAuthRequired:r.networkAuthRequired??!1,networkAuthCompleted:r.networkAuthCompleted??!1,authValid:r.authValid??!1,credentialType:r.credentialType||"pci_vault_token",createdAt:r.createdAt,updatedAt:r.updatedAt,facilitationFee:void 0}:t?.paymentIntent;if(!a)throw new Error("No payment intent available");let s="initialized";return"complete"===n.status?s="completed":"expired"===n.status?s="expired":"abandoned"===n.status?s="abandoned":t?.deviceVerified&&(s="verified"),{id:n.id,status:s,organizationId:n.organizationId,paymentIntent:a,linkToken:C.current,walletUser:t?.walletUser,savedCards:t?.savedCards||[],selectedCard:t?.selectedCard,deviceVerified:t?.deviceVerified||!1,verificationMethod:"phone",verificationReference:w||"",verificationPhone:x||"",expiresAt:n.expiresAt,createdAt:n.createdAt,updatedAt:n.updatedAt}},[w,x]),I=(0,d.useCallback)(e=>{if(!e)return"LOADING";switch(e.status){case"initialized":return e.deviceVerified?"PAYMENT":"IDENTITY";case"otp_pending":return"OTP_VERIFY";case"verified":case"payment_pending":return"PAYMENT";case"completed":return"SUCCESS";case"expired":return"EXPIRED";case"abandoned":return"ERROR";default:return"IDENTITY"}},[]);(0,d.useEffect)(()=>{if(k.current=!0,S.current)return;return(async()=>{S.current=!0,l(!0),p(null);try{const t=await vn(n,e),r=t.paymentIntent?.status;if(r&&["approved","credentials_ready","completed","awaiting_payment"].includes(r))return void(k.current&&(p({code:"PAYMENT_INTENT_ALREADY_PROCESSED",message:"completed"===r?"This payment has already been completed.":"awaiting_payment"===r?"This payment is already in progress.":"This payment has already been approved. Use the credentials API to retrieve or regenerate.",sessionId:t.session.id}),o("ERROR")));await async function(e,t){console.log("[ApiService] Starting session");const n=await wn(e,"/web/sessions/current/start",t,{method:"PATCH"});if(n.error||!n.data)throw new gn(n.message||"Failed to start session",400);return console.log("[ApiService] Session started:",n.data.id),n.data}(n,e);const s=N(t),i=t.paymentIntent?.walletUserId;if(i)try{const t=An(),r=await async function(e,t,n,r){console.log("[ApiService] Checking device trust:",{deviceId:n,walletUserId:r});const a=new URLSearchParams({deviceId:n});r&&a.set("walletUserId",r);const s=await wn(e,`/web/device-trust?${a}`,t,{method:"GET"});return s.error?(console.warn("[ApiService] Device trust check failed, defaulting to untrusted"),{isTrusted:!1}):(console.log("[ApiService] Device trust result:",s.data),{isTrusted:s.data?.isTrusted??!1,expiresAt:s.data?.expiresAt,walletUserId:s.data?.walletUserId})}(n,e,t,i);if(r.isTrusted){console.log("[useSession] Device is trusted, skipping OTP verification"),s.deviceVerified=!0,s.status="verified";const t=await async function(e,t,n){console.log("[ApiService] Getting cards for wallet user:",n);const r=await wn(e,`/api/wallet-users/${n}/cards`,t,{method:"GET"});if(r.error)throw new gn(r.message||"Failed to get wallet user cards",400);return(r.data||[]).map(fn)}(n,e,i);if(s.walletUser={id:i},s.savedCards=t||[],s.savedCards.length>0){const e=s.savedCards.find(e=>e.isDefault)||s.savedCards[0];s.selectedCard=e}}}catch(e){console.log("[useSession] Device trust check failed, requiring OTP")}k.current&&(a(s),o(I(s)))}catch(t){if(k.current){const n=t,r=410===n.status||n.message?.toLowerCase().includes("expired");p({code:r?"SESSION_EXPIRED":"LOAD_FAILED",message:n.message||"Failed to load session",sessionId:e}),o(r?"EXPIRED":"ERROR")}}finally{k.current&&l(!1)}})(),()=>{k.current=!1}},[e,I,N,n]);const A="pay_on_behalf"===r?.paymentIntent.type||"agent_to_agent"===r?.paymentIntent.type||"agentic_multi"===r?.paymentIntent.type,j=!!r?.selectedCard,E=(r?.savedCards?.length??0)>0;(0,d.useEffect)(()=>{"PAYMENT"===s&&m(j?"checkout":E?"methods":"add")},[s,j,E]);const T=(0,d.useCallback)(()=>{m("methods")},[]),D=(0,d.useCallback)(()=>{m("add")},[]),_=(0,d.useCallback)(()=>{m(j?"checkout":E?"methods":"add")},[j,E]),R=(0,d.useCallback)(()=>{o("IDENTITY")},[]),P=(0,d.useCallback)(async e=>{if(!r||!e.phone)return!1;l(!0);try{const t=await yn(n,C.current,e.phone);return k.current&&(y(t),v(e.phone),a(n=>n?{...n,status:"otp_pending",verificationReference:t,verificationPhone:e.phone}:null),o("OTP_VERIFY")),!0}catch(e){const t=e;return k.current&&p({code:"VERIFICATION_FAILED",message:t.message||"Failed to send verification",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),L=(0,d.useCallback)(async e=>{if(!r||!w||!x)return{success:!1,error:{code:"SESSION_NOT_FOUND",message:"No session or verification context"}};l(!0);try{const t=await async function(e,t,n,r){console.log("[ApiService] Verifying OTP, reference:",n);const a=await wn(e,"/api/otp/payos-link/verify",t,{method:"POST",body:JSON.stringify({reference:n,code:r})});if(a.error||!a.data)throw new gn(a.message||"Invalid verification code",400);return console.log("[ApiService] OTP verified for phone:",a.data.phone),a.data}(n,C.current,w,e),s=await async function(e,t,n,r){const a=bn(n);console.log("[ApiService] Processing verified wallet user, phone:",n,"→",a);const s=await wn(e,"/api/wallet-users/process-verified-wallet-user",t,{method:"POST",body:JSON.stringify({phone:a,verificationId:r})});if(s.error||!s.data)throw new gn(s.message||"Failed to process wallet user",400);const o=(s.data.savedCards||[]).map(fn);return console.log("[ApiService] Wallet user processed:",{walletUserId:s.data.walletUserId,isNewUser:s.data.isNewUser,savedCardsCount:o.length}),{...s.data,savedCards:o}}(n,C.current,t.phone,t.reference);if(k.current){let e,i;if(r.paymentIntent.selectedCardId?e=s.savedCards.find(e=>e.id===r.paymentIntent.selectedCardId):s.savedCards.length>0&&(e=s.savedCards.find(e=>e.isDefault)||s.savedCards[0],i=e?.id),i)try{await kn(n,C.current,{selectedCardId:i})}catch(e){console.warn("[useSession] Failed to auto-select card on backend:",e)}a(n=>n?{...n,status:"verified",deviceVerified:!0,walletUser:{id:s.walletUserId,phone:t.phone},savedCards:s.savedCards,selectedCard:e,paymentIntent:{...n.paymentIntent,walletUserId:s.walletUserId,...i&&{selectedCardId:i}}}:null),o("PAYMENT");try{const e=An();await async function(e,t,n,r){return console.log("[ApiService] Registering trusted device:",{deviceId:n,walletUserId:r}),(await wn(e,"/web/device-trust",t,{method:"POST",body:JSON.stringify({deviceId:n,walletUserId:r})})).error?(console.warn("[ApiService] Device trust registration failed"),{success:!1}):(console.log("[ApiService] Device registered as trusted"),{success:!0})}(n,C.current,e,s.walletUserId),console.log("[useSession] Device registered as trusted for 90 days")}catch(e){console.warn("[useSession] Failed to register device trust:",e)}}return{success:!0,walletUserId:s.walletUserId}}catch(e){const t={success:!1,error:{code:"INVALID_OTP",message:e.message||"Invalid verification code"}};return k.current&&p({code:t.error.code,message:t.error.message,sessionId:r.id}),t}finally{k.current&&l(!1)}},[r,w,x,n]),U=(0,d.useCallback)(async()=>{if(!r||!w||!x)return!1;l(!0);try{const e=await xn(n,C.current,w,x);return!e.waitTimeRemaining&&(k.current&&e.reference!==w&&y(e.reference),!0)}catch{return!1}finally{k.current&&l(!1)}},[r,w,x,n]),O=(0,d.useCallback)(async e=>{if(!r)return!1;l(!0);try{await kn(n,C.current,{selectedCardId:e});const t=r.savedCards.find(t=>t.id===e);return k.current&&(a(n=>n?{...n,selectedCard:t,paymentIntent:{...n.paymentIntent,selectedCardId:e}}:null),m("checkout")),!0}catch(e){const t=e;return k.current&&p({code:"CARD_SELECT_FAILED",message:t.message||"Failed to select card",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),z=(0,d.useCallback)(async e=>{if(!r)return{success:!1};l(!0);try{const t={id:e.cardId,brand:e.brand?.toLowerCase()||"unknown",last4:e.last4,expiryMonth:e.expiryMonth||"",expiryYear:e.expiryYear||"",cardholderName:e.cardholderName,isDefault:!1,network:e.network?.toLowerCase()||"visa",cardArtUrl:e.cardArtUrl};if(await kn(n,C.current,{selectedCardId:t.id}),k.current){a(e=>e?{...e,savedCards:[...e.savedCards,t],selectedCard:t,paymentIntent:{...e.paymentIntent,selectedCardId:t.id}}:null);const e=r.paymentIntent.type;"pay_on_behalf"===e||"agent_to_agent"===e||"agentic_multi"===e?(f("initial"),o("AGENT_REGISTRATION")):m("checkout")}return{success:!0,card:t}}catch(e){const t=e;return k.current&&p({code:"CARD_ADD_FAILED",message:t.message||"Failed to add card",sessionId:r.id}),{success:!1}}finally{k.current&&l(!1)}},[r,n]),M=(0,d.useCallback)(async e=>{if(!r||!r.walletUser?.id)return console.warn("[useSession] Cannot delete card: no wallet user"),!1;l(!0);try{if(await async function(e,t,n,r){console.log("[ApiService] Deleting card:",{walletUserId:n,cardId:r});const a=await wn(e,`/api/wallet-users/${n}/cards/${r}`,t,{method:"DELETE"});if(a.error)throw new gn(a.message||"Failed to delete card",400);return console.log("[ApiService] Card deleted successfully"),{success:!0}}(n,C.current,r.walletUser.id,e),k.current){const t=r.savedCards.filter(t=>t.id!==e),n=r.selectedCard?.id===e;a(e=>e?{...e,savedCards:t,selectedCard:n?void 0:e.selectedCard,paymentIntent:{...e.paymentIntent,selectedCardId:n?void 0:e.paymentIntent.selectedCardId}}:null),0===t.length&&m("add")}return!0}catch(e){const t=e;return k.current&&p({code:"CARD_DELETE_FAILED",message:t.message||"Failed to delete card",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),F=(0,d.useCallback)(async()=>{if(r)try{await kn(n,C.current,{selectedCardId:void 0}),k.current&&a(e=>e?{...e,selectedCard:void 0,paymentIntent:{...e.paymentIntent,selectedCardId:void 0}}:null)}catch{}},[r,n]),V=(0,d.useCallback)(()=>{f("initial"),o("PAYMENT"),m("checkout")},[]),H=(0,d.useCallback)(()=>{f("initial"),o("PAYMENT"),m("checkout")},[]),$=(0,d.useCallback)(async e=>{if(!r)return{success:!1,error:{code:"SESSION_NOT_FOUND",message:"No session"}};o("PROCESSING"),l(!0);try{return A&&e?.passkeyAuthenticated&&(console.log("[useSession] Generating credentials for agent mode passkey authentication"),await async function(e,t,n){console.log("[ApiService] Generating credentials for payment intent:",n);const r=`${e}/api/payment-credentials/generate`,a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,"ngrok-skip-browser-warning":"true"},body:JSON.stringify({paymentIntentId:n})}),s=a.headers.get("content-type");let o;if(s&&s.includes("application/json"))o=await a.json();else{const e=await a.text();try{o=JSON.parse(e)}catch{throw new gn("Invalid response from credential generation",a.status,e.substring(0,200))}}if(!a.ok)throw new gn(o.message||"Failed to generate credentials",a.status,o.data?.status);return console.log("[ApiService] Credential generation result:",o.data?.status||o.message),{status:o.data?.status||"success",message:o.message,retrievalToken:o.data?.retrievalToken,approvalId:o.data?.approvalId}}(n,C.current,r.paymentIntent.id),console.log("[useSession] Credentials generated successfully")),await async function(e,t){console.log("[ApiService] Completing session");const n=await wn(e,"/web/sessions/current/complete",t,{method:"POST"});if(n.error||!n.data)throw new gn(n.message||"Failed to complete session",400);return console.log("[ApiService] Session completed:",n.data.id),n.data}(n,C.current),k.current&&(a(e=>e?{...e,status:"completed"}:null),o("SUCCESS")),{success:!0,walletUserId:r.walletUser?.id,paymentIntentId:r.paymentIntent.id,credentialGenerated:A&&e?.passkeyAuthenticated}}catch(e){const t=e,n={success:!1,error:{code:t.message?.includes("credential")||t.message?.includes("generate")?"CREDENTIAL_GENERATION_FAILED":"PAYMENT_FAILED",message:t.message||"Payment failed"}};return k.current&&(p({code:n.error.code,message:n.error.message,sessionId:r.id}),o("PAYMENT")),n}finally{k.current&&l(!1)}},[r,A,n]),B=(0,d.useCallback)(async()=>{if(r)try{await async function(e,t){console.log("[ApiService] Abandoning session");const n=await wn(e,"/web/sessions/current/abandon",t,{method:"POST"});if(n.error||!n.data)throw new gn(n.message||"Failed to abandon session",400);return console.log("[ApiService] Session abandoned:",n.data.id),n.data}(n,C.current)}catch{}},[r,n]),q=(0,d.useCallback)(()=>{p(null)},[]),K=(0,d.useCallback)(async()=>{if(r){l(!0);try{const e=await vn(n,C.current),t=N(e,r);k.current&&(a(t),o(I(t)))}catch(e){const t=e;k.current&&p({code:"LOAD_FAILED",message:t.message||"Failed to refresh session",sessionId:r.id})}finally{k.current&&l(!1)}}},[r,I,N,n]);return{session:r,phase:s,loading:i,error:c,isAgentMode:A,hasSelectedCard:j,hasSavedCards:E,paymentView:u,cvc:h,setCvc:g,showMethodList:T,showAddCard:D,returnToCheckout:_,submitIdentity:P,goBackToIdentity:R,submitOTP:L,resendCode:U,selectPaymentCard:O,addPaymentCard:z,deletePaymentCard:M,clearCard:F,registrationSubPhase:b,setRegistrationSubPhase:f,skipRegistration:V,completeAgentRegistration:H,setPhase:o,setPaymentView:m,complete:$,abandon:B,clearError:q,refresh:K}}var En=class extends Error{constructor(e,t,n){super(t),this.code=e,this.details=n,this.name="PasskeyError"}},Tn=class{constructor(e,t,n){this.linkToken=e,this.baseUrl=n?n.endsWith("/api")?n:`${n}/api`:t?"https://sandbox.api.payos.ai/api":"https://api.payos.ai/api"}async get(e){return this.request("GET",e)}async post(e,t){return this.request("POST",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e){return this.request("DELETE",e)}async request(e,t,n){let r=`${this.baseUrl}${t}`,a={method:e,headers:{Authorization:`Bearer ${this.linkToken}`,"Content-Type":"application/json","X-SDK-Version":"1.0.0","X-SDK-Platform":"browser"},credentials:"include"};n&&("POST"===e||"PUT"===e)&&(a.body=JSON.stringify(n));try{let e=await fetch(r,a);if(!e.ok){let t=await this.parseResponse(e);throw new Dn(e.status,t?.message||`HTTP ${e.status}`,t)}return await this.parseResponse(e)}catch(e){throw e instanceof TypeError&&"Failed to fetch"===e.message?new Dn(0,"Network error - unable to reach server",{originalError:e}):e instanceof Dn?e:new Dn(0,"Request failed",{originalError:e})}}async parseResponse(e){return e.headers.get("content-type")?.includes("application/json")?e.json():await e.text()}setBaseUrl(e){this.baseUrl=e}setLinkToken(e){this.linkToken=e}},Dn=class extends Error{constructor(e,t,n){super(t),this.status=e,this.data=n,this.name="ApiError"}},_n=class{constructor(){this.initialized=!1,this.initPromise=null,this.sessionData=null,this.sdkUrl=null,this.iframe=null,this.containerId=null,this.vtsRequestId=null,this.messageHandlers=new Map,this.messageListener=null,this.messageListener=this.handleMessage.bind(this),window.addEventListener("message",this.messageListener)}setSDKUrl(e){this.sdkUrl=e}setContainerId(e){this.containerId=e}async loadSDK(e){if(this.initialized&&this.sessionData)return;if(this.initPromise)return void await this.initPromise;let t=e||this.sdkUrl;if(!t)throw new Error("Visa SDK URL not provided. Call setSDKUrl or provide URL to loadSDK");this.initPromise=this.initializeSDK(t),await this.initPromise,this.initialized=!0}async initializeSDK(e){return new Promise((t,n)=>{try{this.createIframe(e),this.messageHandlers.set("AUTH_READY",e=>{this.vtsRequestId=e.requestID,this.sendCreateAuthSession()}),this.messageHandlers.set("AUTH_SESSION_CREATED",e=>{let n={userAgent:navigator.userAgent,browserLanguage:navigator.language,browserColorDepth:String(screen.colorDepth),browserScreenHeight:String(screen.height),browserScreenWidth:String(screen.width),browserTimeZone:String((new Date).getTimezoneOffset()),browserJavaEnabled:!1,browserJavascriptEnabled:!0,browserHeader:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};this.sessionData={sessionContext:e.sessionContext,browserData:n,requestID:this.vtsRequestId},this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),t(this.sessionData)}),this.messageHandlers.set("ERROR",e=>{this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),n(new Error(e.message||"VTS SDK initialization failed"))}),setTimeout(()=>{this.initialized||(this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),n(new Error("VTS SDK initialization timeout")))},3e4)}catch(e){n(e)}})}createIframe(e){this.iframe&&this.iframe.remove(),this.iframe=document.createElement("iframe"),this.iframe.id="vts-sdk-iframe",this.iframe.title="VTS SDK",this.iframe.setAttribute("aria-hidden","true"),this.iframe.src=e,this.iframe.style.cssText="\n position: fixed;\n left: -9999px;\n opacity: 0;\n pointer-events: none;\n ",document.body.appendChild(this.iframe)}handleMessage(e){if(!["https://vts.auth.visa.com","https://sbx.vts.auth.visa.com"].some(t=>e.origin.includes(t)))return;let{type:t}=e.data||{};if(!t)return;let n=this.messageHandlers.get(t);n&&n(e.data)}sendCreateAuthSession(){if(!this.iframe?.contentWindow||!this.vtsRequestId)return;let e=new URL(this.sdkUrl),t=e.searchParams.get("apikey"),n=e.searchParams.get("profileId");if(!t||!n)return;let r={requestID:this.vtsRequestId,type:"CREATE_AUTH_SESSION",version:"1",client:{id:t,profileId:n}},a=this.sdkUrl?.includes("sbx.")?"https://sbx.vts.auth.visa.com":"https://vts.auth.visa.com";this.iframe.contentWindow.postMessage(JSON.stringify(r),a)}async getSessionContext(){if(!this.initialized||!this.sessionData)throw new Error("Visa SDK not initialized. Call loadSDK first.");return this.sessionData}async authenticate(e){if(!this.initialized||!this.sessionData)throw new Error("VTS SDK not initialized");return new Promise((t,n)=>{this.messageHandlers.set("AUTH_COMPLETE",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),t({type:"AUTH_COMPLETE",assuranceData:e.assuranceData,sessionId:e.sessionId,requestID:e.requestID})}),this.messageHandlers.set("AUTH_FAILED",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),n(new Error(e.message||"Authentication failed"))}),this.messageHandlers.set("AUTH_CANCELLED",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),t({type:"AUTH_CANCELLED",error:"User cancelled authentication"})});let r={requestID:this.vtsRequestId,type:"AUTHENTICATE",version:"1",contentType:"application/json",authenticationContext:e},a=this.sdkUrl?.includes("sbx.")?"https://sbx.vts.auth.visa.com":"https://vts.auth.visa.com";this.iframe?.contentWindow?(this.iframe.contentWindow.postMessage(JSON.stringify(r),a),setTimeout(()=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),n(new Error("Authentication timeout"))},12e4)):n(new Error("VTS SDK iframe not ready"))})}isLoaded(){return this.initialized&&!!this.sessionData}showIframe(e){if(!this.iframe)return;let t=e||this.containerId;if(t){let e=document.getElementById(t);if(e){let t=e.getBoundingClientRect(),n=window.innerWidth,r=450,a=16,s=n<480,o=s?n-2*a:Math.min(r,t.width),i=s?a:t.left+(t.width-o)/2;this.iframe.style.position="fixed",this.iframe.style.top=`${t.top}px`,this.iframe.style.left=`${i}px`,this.iframe.style.width=`${o}px`,this.iframe.style.height="300px",this.iframe.style.opacity="1",this.iframe.style.pointerEvents="auto",this.iframe.style.border="0",this.iframe.style.display="block",this.iframe.style.zIndex="10000",this.iframe.removeAttribute("aria-hidden")}}}hideIframe(){this.iframe&&(this.iframe.style.position="fixed",this.iframe.style.left="-9999px",this.iframe.style.top="0",this.iframe.style.opacity="0",this.iframe.style.pointerEvents="none",this.iframe.style.display="none")}getIframe(){return this.iframe}cleanup(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null),this.messageHandlers.clear(),this.iframe&&(this.iframe.remove(),this.iframe=null),this.sessionData=null,this.initialized=!1,this.initPromise=null}},Rn=class{constructor(){this.sdkLoaded=!1,this.sdkLoadPromise=null,this.sdkUrl=null,this.authWindow=null,this.popupWidth=550,this.popupHeight=760}setSDKUrl(e){this.sdkUrl=e}async loadSDK(e){if(this.sdkLoaded&&window.AUTHSDK_MASTERCARD)return;if(this.sdkLoadPromise)return this.sdkLoadPromise;let t=e||this.sdkUrl;if(!t)throw new Error("Mastercard SDK URL not provided. Call setSDKUrl or provide URL to loadSDK");this.sdkLoadPromise=this.loadSDKInternal(t);try{await this.sdkLoadPromise,this.sdkLoaded=!0}catch(e){throw this.sdkLoadPromise=null,e}}async loadSDKInternal(e){return new Promise((t,n)=>{if(window.AUTHSDK_MASTERCARD)return void t();let r=document.getElementById("mastercard-sdk-script");r&&r.remove();let a=document.createElement("script");a.src=e,a.async=!0,a.id="mastercard-sdk-script",a.onload=()=>{window.AUTHSDK_MASTERCARD?t():n(new Error("Mastercard SDK loaded but AUTHSDK_MASTERCARD not found"))},a.onerror=()=>{n(new Error("Failed to load Mastercard SDK script"))},document.head.appendChild(a)})}setPopupDimensions(e,t){this.popupWidth=e,this.popupHeight=t}async authenticate(e,t){if(!this.sdkLoaded||!window.AUTHSDK_MASTERCARD)throw new Error("Mastercard SDK not loaded. Call loadSDK first.");let n=t?.width||this.popupWidth,r=t?.height||this.popupHeight;if(this.authWindow=window.open("","mc-auth",`width=${n},height=${r},toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes`),!this.authWindow)throw new Error("Failed to open authentication window. Please check popup settings.");try{let t=await window.AUTHSDK_MASTERCARD.authenticate({...e,windowRef:this.authWindow});return t.assuranceData?.verificationData&&t.assuranceData.verificationData.forEach((e,t)=>{}),t.methodAttributes,this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),t}catch(e){throw this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),new Error(`Mastercard authentication failed: ${e}`)}finally{this.authWindow=null}}getAuthWindow(){return this.authWindow}closeAuthWindow(){this.authWindow&&!this.authWindow.closed&&(this.authWindow.close(),this.authWindow=null)}isLoaded(){return this.sdkLoaded&&!!window.AUTHSDK_MASTERCARD}cleanup(){window.AUTHSDK_MASTERCARD?.cleanup&&window.AUTHSDK_MASTERCARD.cleanup()}},Pn=class{constructor(e=!1){this.prefix="[PayOS Passkey]",this.enabled=e}log(e,t){this.enabled}warn(e,t){this.enabled}error(e,t){this.enabled}debug(e,t){this.enabled}enable(){this.enabled=!0}disable(){this.enabled=!1}isEnabled(){return this.enabled}},Ln=class{constructor(e,t){this.sdkConfig=null,this.isInitialized=!1,this.initPromise=null,this.apiClient=new Tn(e,t?.sandbox,t?.apiBaseUrl),this.visaService=new _n,this.mastercardService=new Rn,this.logger=new Pn(t?.debug||!1),t?.visaContainerId&&this.visaService.setContainerId(t.visaContainerId),t?.mastercardPopupDimensions&&this.mastercardService.setPopupDimensions(t.mastercardPopupDimensions.width,t.mastercardPopupDimensions.height),this.initialize()}async initialize(){if(!this.isInitialized){if(this.initPromise)return this.initPromise;this.initPromise=this.performInitialization(),await this.initPromise,this.isInitialized=!0}}async performInitialization(){try{this.logger.log("Initializing PayOS Passkey SDK");let e=await this.apiClient.get("/passkeys/configs");if(this.sdkConfig=e.data?.configs,!this.sdkConfig)throw new Error("Failed to fetch SDK configuration");this.logger.log("SDK config loaded",this.sdkConfig);let t=[];this.sdkConfig.visa?.sdkUrl&&(this.visaService.setSDKUrl(this.sdkConfig.visa.sdkUrl),t.push(this.visaService.loadSDK().catch(e=>{this.logger.warn("Failed to load Visa SDK",e)}))),this.sdkConfig.mastercard?.sdkUrl&&(this.mastercardService.setSDKUrl(this.sdkConfig.mastercard.sdkUrl),t.push(this.mastercardService.loadSDK().catch(e=>{this.logger.warn("Failed to load Mastercard SDK",e)}))),await Promise.all(t),this.logger.log("SDKs loaded successfully")}catch(e){throw this.logger.error("Failed to initialize SDK",e),new En("SDK_LOAD_FAILED","Failed to initialize PayOS Passkey SDK",e)}}async authenticate(e,t){await this.initialize(),this.logger.log("Starting authentication",{paymentIntentId:e,paymentId:t});try{let n={};if(this.visaService.isLoaded())try{let e=await this.visaService.getSessionContext();n={sessionContext:e.sessionContext,browserData:e.browserData},this.logger.log("Visa session context obtained",{hasSessionContext:!!e.sessionContext})}catch(e){this.logger.warn("Failed to get Visa session context",e)}let r=(await this.apiClient.post("/passkeys/authenticate",{paymentIntentId:e,paymentId:t,sessionContext:n})).data||{},a=r.network||r.cardBrand?.toLowerCase();this.logger.log("Authentication response received",{enrollmentId:r.enrollmentId,network:a,passkeyAction:r.passkeyAction});let s=null,o=r.passkeyFlow;if("REGISTER"===o?.passkeyAction||o?.deviceStatus?.requiresRegistration)return this.logger.log("Device needs passkey registration before authentication"),{success:!1,message:"This device needs passkey registration",requiresRegistration:!0,network:a||o?.network,stepUpMethods:o?.actionData?.stepUpMethods,enrollmentId:r.enrollmentId,error:{code:"DEVICE_NOT_REGISTERED",message:"Passkey not registered on this device"}};if("visa"===a){if(!this.visaService.isLoaded())throw new En("SDK_LOAD_FAILED","Visa SDK not available. Please ensure Visa is enabled for this environment.");document.getElementById("visa-auth-container")&&this.visaService.showIframe("visa-auth-container");try{let e=await this.visaService.authenticate(r.passkeyFlow?.actionData?.authenticationContext);if("AUTH_COMPLETE"===e.type)s=e.assuranceData;else if("AUTH_CANCELLED"===e.type)return{success:!1,message:"Authentication cancelled by user"}}finally{this.visaService.hideIframe()}}else if("mastercard"===a&&r.passkeyFlow?.authenticationData?.authenticationData?.authRequest){if(!this.mastercardService.isLoaded())throw new En("SDK_LOAD_FAILED","Mastercard SDK not available. Please ensure Mastercard is configured for this environment.");try{let e=await this.mastercardService.authenticate(r.passkeyFlow.authenticationData.authenticationData.authRequest),t=this.getMastercardStatusFailure(e?.authenticationStatus,"authentication");if(t)return t;if("AUTHENTICATED"!==e?.authenticationResult)return{success:!1,message:"Authentication verification failed. Please try again.",error:{code:"AUTH_FAILED",message:"NOT_AUTHENTICATED"===e?.authenticationResult?`Authentication verification failed (result: ${e.authenticationResult})`:"Authentication result was not provided by Mastercard"}};s=e,s.enrollmentId=r.enrollmentId}catch(e){return this.logger.error("Mastercard authentication failed",e),{success:!1,message:"Authentication failed",error:{code:"AUTH_FAILED",message:e.message||"Mastercard authentication failed"}}}}return s?await this.completeAuthenticationInternal(e,s,a,t):{success:!1,message:"Failed to get authentication data from SDK"}}catch(e){throw this.logger.error("Authentication failed",e),new En("AUTH_FAILED","Failed to authenticate payment",e)}}async register(e){await this.initialize(),this.logger.log("Starting registration",{cardId:e});try{let t={};if(this.visaService.isLoaded())try{let e=await this.visaService.getSessionContext();t={sessionContext:e.sessionContext,browserData:e.browserData},this.logger.log("Visa session context obtained",{hasSessionContext:!!e.sessionContext})}catch(e){this.logger.warn("Failed to get Visa session context",e)}let n=(await this.apiClient.post("/passkeys/authenticate",{cardId:e,sessionContext:t})).data||{},r=n.network||n.cardBrand?.toLowerCase();if(this.logger.log("Registration response received",{enrollmentId:n.enrollmentId,network:r,passkeyAction:n.passkeyAction,requiresStepUp:n.passkeyFlow?.actionData?.requiresStepUp}),"visa"===r&&n.passkeyFlow?.actionData?.requiresStepUp)return{success:!1,network:"visa",requiresStepUp:!0,enrollmentId:n.enrollmentId,stepUpMethods:n.passkeyFlow?.actionData?.stepUpMethods||[],message:"Step-up authentication required"};if("visa"===r&&n.passkeyFlow?.deviceStatus?.hasPasskey)return n.vicEnrolled?{success:!0,network:"visa",message:"Passkey already registered for this card",enrollmentId:n.enrollmentId,alreadyRegistered:!0}:{success:!1,network:"visa",requiresVicEnrollment:!0,enrollmentId:n.enrollmentId,authenticationContext:n.passkeyFlow?.actionData?.authenticationContext,message:"Passkey exists but VIC enrollment required. Please authenticate."};let a=n.passkeyFlow?.authenticationData?.authenticationData?.authRequest;if("mastercard"===r&&a)try{this.mastercardService.isLoaded()||await this.mastercardService.loadSDK();let e=await this.mastercardService.authenticate(a),t=this.getMastercardStatusFailure(e?.authenticationStatus,"registration");if(t)return t;if("AUTHENTICATED"!==e?.authenticationResult)return{success:!1,network:"mastercard",message:"Registration verification failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:"NOT_AUTHENTICATED"===e?.authenticationResult?`Registration verification failed (result: ${e.authenticationResult})`:"Registration result was not provided by Mastercard"}};let r=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:n.enrollmentId,assuranceData:e});return{success:!r.error,network:"mastercard",message:r.data?.message||"Registration completed successfully"}}catch(e){return this.logger.error("Mastercard registration failed",e),{success:!1,network:"mastercard",message:"Registration failed",error:{code:"REGISTRATION_FAILED",message:e.message||"Failed to complete Mastercard registration"}}}return{success:!1,message:"Invalid registration response from backend",error:{code:"INVALID_RESPONSE",message:"Backend returned unexpected response"}}}catch(e){throw this.logger.error("Registration failed",e),new En("API_ERROR","Failed to register card",e)}}async completeVicEnrollment(e,t){this.logger.log("Completing VIC enrollment",{enrollmentId:e});try{let n=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:e,assuranceData:t});return{success:!n.error,network:"visa",message:n.data?.message||"VIC enrollment completed"}}catch(e){throw this.logger.error("Failed to complete VIC enrollment",e),new En("API_ERROR","Failed to complete VIC enrollment",e)}}async submitStepUpMethod(e,t){this.logger.log("Submitting step-up method",{enrollmentId:e,methodIndex:t});try{let n=await this.apiClient.post("/passkeys/submit-stepup-method",{enrollmentId:e,methodIndex:t});return{success:!n.error,requiresRetry:!1,attemptsRemaining:n.data?.otpConfig?.maxOTPVerificationAllowed}}catch(e){throw this.logger.error("Failed to submit step-up method",e),new En("API_ERROR","Failed to submit step-up method",e)}}async validateStepUpOTP(e,t){this.logger.log("Validating OTP",{enrollmentId:e});try{let n=await this.apiClient.post("/passkeys/validate-stepup-otp",{enrollmentId:e,otpValue:t}),r=n.data?.otpValid||!1,a=n.data?.actionData?.registrationContext||n.data?.passkeyOptions?.authenticationContext,s=n.data?.canRetry??!0,o=n.data?.attemptsRemaining;return r?(this.logger.log("OTP validated successfully, returning registrationContext for caller"),{success:!0,otpValid:!0,registrationContext:a,message:"OTP validated, ready for passkey registration"}):{success:!1,message:s?"Invalid OTP"+(void 0!==o?`. ${o} attempts remaining.`:""):"Too many failed attempts. Please try a different verification method.",canRetry:s,attemptsRemaining:o,error:{code:s?"INVALID_OTP":"OTP_LOCKED",message:n.data?.error||"OTP validation failed"}}}catch(e){throw this.logger.error("Failed to validate OTP",e),new En("API_ERROR","Failed to validate OTP",e)}}async completeVisaRegistration(e,t){this.logger.log("Completing Visa registration",{enrollmentId:e});let n=null;try{this.visaService.showIframe();let e=await this.visaService.authenticate(t||{});if("AUTH_COMPLETE"===e.type)n=e.assuranceData;else if("AUTH_CANCELLED"===e.type)return{success:!1,message:"Registration cancelled by user"}}catch(e){return this.logger.error("Failed to get assurance data from Visa SDK",e),{success:!1,message:"Failed to complete device registration",error:{code:"SDK_ERROR",message:"Failed to interact with Visa SDK"}}}finally{this.visaService.hideIframe()}if(!n)return{success:!1,message:"Failed to get registration data from SDK"};try{let t=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:e,assuranceData:n});return{success:!t.error,message:t.data?.message||"Registration completed successfully"}}catch(e){return this.logger.error("Failed to complete device binding",e),{success:!1,message:"Failed to complete device binding",error:{code:"BINDING_FAILED",message:"Device binding failed after SDK registration"}}}}getMastercardStatusFailure(e,t){if("authentication"===t){let t={success:!1};switch(e){case"COMPLETE":return null;case"CANCELLED":return{...t,message:"Authentication cancelled by user"};case"EXPIRED":return{...t,message:"Authentication expired. Please try again.",error:{code:"AUTH_FAILED",message:`Authentication expired before completion (status: ${e})`}};case"NOT_SUPPORTED":return{...t,message:"Mastercard authentication is not supported on this device or browser. Please try a different device.",error:{code:"AUTH_FAILED",message:`Authentication not supported (status: ${e})`}};case"PENDING":case"PENDING_CHALLENGE":return{...t,message:"PENDING_CHALLENGE"===e?"Authentication challenge was not completed. Please try again.":"Authentication did not complete. Please try again.",error:{code:"AUTH_FAILED",message:`Authentication incomplete (status: ${e})`}};case void 0:return{...t,message:"Authentication failed. Please try again.",error:{code:"AUTH_FAILED",message:"Authentication status was not provided by Mastercard"}};default:return{...t,message:"Authentication failed. Please try again.",error:{code:"AUTH_FAILED",message:`Unknown authentication status received: ${e}`}}}}let n={success:!1,network:"mastercard"};switch(e){case"COMPLETE":return null;case"CANCELLED":return{...n,message:"Registration cancelled by user"};case"EXPIRED":return{...n,message:"Registration expired. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Registration expired before completion (status: ${e})`}};case"NOT_SUPPORTED":return{...n,message:"Mastercard registration is not supported on this device or browser. Please try a different device.",error:{code:"REGISTRATION_FAILED",message:`Registration not supported (status: ${e})`}};case"PENDING":case"PENDING_CHALLENGE":return{...n,message:"PENDING_CHALLENGE"===e?"Registration challenge was not completed. Please try again.":"Registration did not complete. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Registration incomplete (status: ${e})`}};case void 0:return{...n,message:"Registration failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:"Registration status was not provided by Mastercard"}};default:return{...n,message:"Registration failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Unknown registration status received: ${e}`}}}}async completeAuthenticationInternal(e,t,n,r){this.logger.log("Completing authentication",{paymentIntentId:e,network:n,paymentId:r,hasAssuranceData:!!t});try{let a=await this.apiClient.post("/passkeys/complete-authentication",{paymentIntentId:e,paymentId:r,network:n,assuranceData:t});return{success:!a.error,message:a.data?.message||"Authentication completed"}}catch(e){throw this.logger.error("Failed to complete authentication",e),new En("AUTH_FAILED","Failed to complete authentication",e)}}showVisaIframe(e){this.visaService.showIframe(e)}hideVisaIframe(){this.visaService.hideIframe()}getVisaIframe(){return this.visaService.getIframe()}setMastercardPopupDimensions(e,t){this.mastercardService.setPopupDimensions(e,t)}closeMastercardWindow(){this.mastercardService.closeAuthWindow()}getMastercardWindow(){return this.mastercardService.getAuthWindow()}isSDKLoaded(e){return"visa"===e?this.visaService.isLoaded():this.mastercardService.isLoaded()}cleanup(){this.visaService.cleanup(),this.mastercardService.cleanup(),this.sdkConfig=null,this.isInitialized=!1,this.initPromise=null}};const Un={enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,isLoading:!1,error:null,canRetry:!0,attemptsRemaining:void 0};const On=({onCancel:e})=>(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:"Complete Passkey Setup",onBack:e}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:"Follow the instructions below to create your passkey"}),(0,l.jsx)("div",{id:"visa-auth-container",className:"w-full max-w-sm mx-auto min-h-[300px] bg-gray-50 dark:bg-slate-800 rounded-2xl overflow-hidden"})]});function zn(e,t="USD"){const n=e/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(n)}On.displayName="VisaIframeView";const Mn={apiBaseUrl:"https://eudiometrical-superscientifically-roselle.ngrok-free.dev",orgId:"org_9f9a90da05fa4db0916e9b2effefdba8",apiKey:"sk_test_760d15ae78084a449e550157535de125a183dd39b6a947baa50e65f84abd7ba1"};const Fn="https://purple-grass-0eb0a1b1e.1.azurestaticapps.net";var Vn=o(72),Hn=o.n(Vn),$n=o(825),Bn=o.n($n),qn=o(659),Kn=o.n(qn),Gn=o(56),Wn=o.n(Gn),Yn=o(540),Jn=o.n(Yn),Xn=o(113),Zn=o.n(Xn),Qn=o(61),er={};er.styleTagTransform=Zn(),er.setAttributes=Wn(),er.insert=Kn().bind(null,"head"),er.domAPI=Bn(),er.insertStyleElement=Jn();Hn()(Qn.A,er);Qn.A&&Qn.A.locals&&Qn.A.locals;const tr=({sessionSecret:e,open:t,onClose:n,onSuccess:r,onError:a,onCancel:s,title:o,environment:i="sandbox",developmentApiUrl:c,cardElementApiUrl:p,cardElementUrl:u,debug:m=!1})=>{const h=function(e,t){return t||("sandbox"===e?"https://sandbox.api.payos.ai":"https://api.payos.ai")}(i,c),{session:g,phase:b,loading:f,error:w,isAgentMode:y,hasSelectedCard:x,hasSavedCards:v,paymentView:k,cvc:C,setCvc:S,showMethodList:N,showAddCard:I,returnToCheckout:A,submitIdentity:j,goBackToIdentity:E,submitOTP:T,resendCode:D,selectPaymentCard:R,addPaymentCard:P,deletePaymentCard:L,registrationSubPhase:U,setRegistrationSubPhase:O,skipRegistration:z,completeAgentRegistration:M,setPhase:F,complete:V,abandon:H,clearError:$}=jn(e,{apiBaseUrl:h}),B=function(e){const t=(0,d.useRef)(null),[n,r]=(0,d.useState)(!1),[a,s]=(0,d.useState)(Un);(0,d.useEffect)(()=>{if(e.sessionSecret){try{t.current=new Ln(e.sessionSecret,{sandbox:e.sandbox,debug:e.debug,visaContainerId:e.visaContainerId,apiBaseUrl:e.apiBaseUrl}),r(!0)}catch(e){console.error("[usePasskeySDK] Failed to initialize SDK:",e),s(t=>({...t,error:e?.message||"Failed to initialize passkey SDK"})),r(!1)}return()=>{t.current?.cleanup(),t.current=null,r(!1)}}r(!1)},[e.sessionSecret,e.sandbox,e.debug,e.visaContainerId,e.apiBaseUrl]);const o=(0,d.useCallback)(async e=>{if(!t.current)return{success:!1,message:"SDK not initialized",error:{code:"SDK_NOT_READY",message:"Passkey SDK is not ready"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.register(e);if(n.requiresStepUp){const e=(n.stepUpMethods||[]).map((e,t)=>({id:String(t),type:"email"===e.type?.toLowerCase()?"email":"sms",maskedValue:e.maskedValue||e.value||`Method ${t+1}`}));s(t=>({...t,isLoading:!1,enrollmentId:n.enrollmentId||null,stepUpMethods:e}))}else s(e=>({...e,isLoading:!1}));return n}catch(e){const t=e?.message||"Registration failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"REGISTRATION_ERROR",message:t}}}},[]),i=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.submitStepUpMethod(a.enrollmentId,e),r=a.stepUpMethods[e];return s(e=>({...e,isLoading:!1,selectedMethodDescription:r?.maskedValue||null})),n}catch(e){const t=e?.message||"Failed to send OTP";return s(e=>({...e,isLoading:!1,error:t})),{success:!1}}},[a.enrollmentId,a.stepUpMethods]),l=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1,message:"No enrollment in progress",error:{code:"NO_ENROLLMENT",message:"No active enrollment"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.validateStepUpOTP(a.enrollmentId,e);return n.success?s(e=>({...e,isLoading:!1,canRetry:!0,attemptsRemaining:void 0})):s(e=>({...e,isLoading:!1,error:n.message||"OTP validation failed",canRetry:n.canRetry??!0,attemptsRemaining:n.attemptsRemaining})),n}catch(e){const t=e?.message||"OTP validation failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"OTP_ERROR",message:t}}}},[a.enrollmentId]),c=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1,message:"No enrollment in progress",error:{code:"NO_ENROLLMENT",message:"No active enrollment"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.completeVisaRegistration(a.enrollmentId,e);return s(e=>({...e,isLoading:!1,enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,error:n.success?null:n.message||"Registration failed"})),n}catch(e){const t=e?.message||"Registration failed";return s(e=>({...e,isLoading:!1,enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,error:t})),{success:!1,message:t,error:{code:"REGISTRATION_ERROR",message:t}}}},[a.enrollmentId]),p=(0,d.useCallback)(async(e,n)=>{if(!t.current)return{success:!1,message:"SDK not initialized",error:{code:"SDK_NOT_READY",message:"Passkey SDK is not ready"}};s(e=>({...e,isLoading:!0,error:null}));try{const r=await t.current.authenticate(e,n);return s(e=>({...e,isLoading:!1})),r}catch(e){const t=e?.message||"Authentication failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"AUTH_ERROR",message:t}}}},[]),u=(0,d.useCallback)(()=>{s(e=>({...e,error:null}))},[]),m=(0,d.useCallback)(()=>{s(Un)},[]),h=(0,d.useCallback)(()=>{t.current?.cleanup(),s(Un)},[]);return{sdk:t.current,isReady:n,state:a,startRegistration:o,selectStepUpMethod:i,submitVisaOtp:l,completeVisaRegistration:c,authenticate:p,clearError:u,resetState:m,cleanup:h}}({sessionSecret:e,sandbox:"sandbox"===i,debug:m,apiBaseUrl:h,visaContainerId:"visa-auth-container"}),[q,K]=(0,d.useState)(""),[G,W]=(0,d.useState)("US"),[Y,J]=(0,d.useState)(""),[X,Z]=(0,d.useState)(null),[Q,ee]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(0),[re,ae]=(0,d.useState)(0),[se,oe]=(0,d.useState)(""),[ie,le]=(0,d.useState)(null),de=(0,d.useRef)(!1);(0,d.useEffect)(()=>{w&&a(w)},[w,a]),(0,d.useEffect)(()=>{if("SUCCESS"===b&&g){const e=setTimeout(()=>{r({success:!0,sessionId:g.id,paymentIntent:g.paymentIntent,walletUserId:g.walletUser?.id,paymentIntentId:g.paymentIntent.id,credentialGenerated:y})},3e3);return()=>clearTimeout(e)}},[b,g,r,y]),(0,d.useEffect)(()=>{if(g?.walletUser?.phone&&!q){const e=wt(g.walletUser.phone,G);K(e)}},[g?.walletUser?.phone,q,G]),(0,d.useEffect)(()=>{if(te<=0)return;const e=setTimeout(()=>ne(e=>e-1),1e3);return()=>clearTimeout(e)},[te]),(0,d.useEffect)(()=>{"IDENTITY"===b&&(ne(0),ae(0),J(""))},[b]),(0,d.useEffect)(()=>{Z(null),B.clearError()},[U]),(0,d.useEffect)(()=>{if("visa_iframe"===U&&ie&&!de.current){de.current=!0;const e=setTimeout(async()=>{try{const e=await B.completeVisaRegistration(ie);le(null),e.success?z():(Z(e.message||"Registration failed"),O("initial"))}finally{de.current=!1}},100);return()=>clearTimeout(e)}},[U,ie]);const ce=(0,d.useCallback)(()=>{"PROCESSING"!==b&&(H(),s?.(),n())},[b,H,s,n]),pe=async()=>{if(Z(null),!kt(q,G))return void Z("Please enter a valid phone number");await j({phone:q})&&J("")},ue=async e=>{const t=e||Y;Z(null),console.log("[PaymentSheet] Submitting OTP:",{otpCode:t,length:t.length});const n=await T(t);console.log("[PaymentSheet] OTP result:",n),!n.success&&n.error&&(ae(e=>e+1),Z(n.error.message))},me=(0,d.useCallback)(async()=>{Z(null),J(""),ee(!0),ne(30);try{await D()}finally{ee(!1)}},[D]),he=async e=>{await R(e)},ge=async(e,t)=>{(await P({cardId:e.cardId||`card_${Date.now()}`,last4:e.last4||"",brand:e.brand||"unknown",network:e.brand||"unknown",cardholderName:e.cardholderName,cardArtUrl:e.cardArtUrl})).success||Z("Failed to add card. Please try again.")},be=async()=>{if(g?.selectedCard){if(Z(null),!y){const e=await V();return void(!e.success&&e.error&&Z(e.error.message))}try{const e=await B.authenticate(g.paymentIntent.id,g.paymentIntent.payments?.[0]?.id);if(e.success){const e=await V({passkeyAuthenticated:!0});return void(!e.success&&e.error&&Z(e.error.message))}if(e.requiresRegistration||"NOT_ENROLLED"===e.error?.code||"DEVICE_NOT_REGISTERED"===e.error?.code||e.message?.toLowerCase().includes("not enrolled")||e.message?.toLowerCase().includes("no enrollment")){const e=await B.startRegistration(g.selectedCard.id);if(e.requiresStepUp&&"visa"===e.network)return F("AGENT_REGISTRATION"),void O("visa_method_select");if(e.success){const e=await B.authenticate(g.paymentIntent.id,g.paymentIntent.payments?.[0]?.id);if(e.success){const e=await V({passkeyAuthenticated:!0});!e.success&&e.error&&Z(e.error.message)}else Z(e.message||"Authentication failed after registration");return}return void Z(e.message||"Registration failed")}Z(e.message||"Authentication failed")}catch(e){const t=e instanceof Error?e.message:"Passkey authentication failed";Z(t)}}else Z("Please select a card")},fe=async()=>{if(!g?.selectedCard?.id)return;Z(null);const e=await B.startRegistration(g.selectedCard.id);e.requiresStepUp&&"visa"===e.network?O("visa_method_select"):e.success?M():Z(e.message||"Registration failed")},we=async e=>{Z(null);const t=parseInt(e,10);(await B.selectStepUpMethod(t)).success?(oe(""),O("visa_otp_entry")):Z("Failed to send verification code")},ye=async()=>{if(!se)return;Z(null);const e=await B.submitVisaOtp(se);e.success&&e.registrationContext?(oe(""),le(e.registrationContext),O("visa_iframe")):e.success||(oe(""),Z(e.message||"Invalid verification code"))},xe=()=>{Z(null),B.resetState(),z()},ve=g?.paymentIntent.payments.map(e=>({label:e.description||e.merchantName,value:zn(e.subtotal,g.paymentIntent.currency),quantity:e.quantity})),ke=g?.paymentIntent.totalSubtotal?zn(g.paymentIntent.totalSubtotal,g.paymentIntent.currency):void 0,Ce=g?.paymentIntent.totalTax?zn(g.paymentIntent.totalTax,g.paymentIntent.currency):void 0,Se=g?.paymentIntent.totalShipping?zn(g.paymentIntent.totalShipping,g.paymentIntent.currency):void 0,Ne=g?.paymentIntent.facilitationFee?zn(g.paymentIntent.facilitationFee.amount,g.paymentIntent.currency):void 0,Ie=g?zn(g.paymentIntent.totalAmount+(g.paymentIntent.facilitationFee?.amount||0),g.paymentIntent.currency):void 0,Ae=X||w?.message;return t?(0,l.jsx)(Ot,{open:t,onClose:ce,title:(()=>{if("PAYMENT"===b){if("methods"===k)return"Payment Methods";if("add"===k)return v?"Add Card":"Secure Checkout"}return"AGENT_REGISTRATION"===b?"Authorization Required":o||"Checkout"})(),amount:Ie,orderItems:ve,subtotal:ke,shipping:Se,tax:Ce,orderAgentFee:Ne,mode:y?"agent":"standard",children:(()=>{if("LOADING"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,l.jsx)(_,{className:"w-12 h-12 text-gray-400 animate-spin"}),(0,l.jsx)("p",{className:"text-gray-600 dark:text-slate-400",children:"Loading checkout..."})]});if("ERROR"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4 text-center",children:[(0,l.jsx)(Zt,{className:"w-16 h-16 text-red-500"}),(0,l.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Something went wrong"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:w?.message||"Unable to load checkout session"}),(0,l.jsx)("button",{onClick:ce,className:"mt-4 px-6 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100",children:"Close"})]});if("EXPIRED"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4 text-center",children:[(0,l.jsx)(Zt,{className:"w-16 h-16 text-amber-500"}),(0,l.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Session Expired"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"This checkout session has expired. Please start a new checkout."}),(0,l.jsx)("button",{onClick:ce,className:"mt-4 px-6 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100",children:"Close"})]});if("IDENTITY"===b)return(0,l.jsx)(Ct,{phone:q,onPhoneChange:e=>{K(e),Z(null),$()},countryCode:G,onCountryChange:W,onSubmit:pe,isLoading:f,error:Ae||void 0});if("OTP_VERIFY"===b)return(0,l.jsx)(qt,{phoneNumber:q,otp:Y,onOtpChange:J,onSubmit:ue,onEdit:E,onResend:me,isLoading:f,isResending:Q,error:Ae||void 0,resendCooldown:te,retryCount:re,maxRetries:3});if("AGENT_REGISTRATION"===b&&g){const e=g.selectedCard?.network||"visa";return"visa_method_select"===U?(0,l.jsx)(dn,{methods:B.state.stepUpMethods.map((e,t)=>({id:String(t),type:e.type,maskedValue:e.maskedValue})),onSelectMethod:we,onBack:()=>O("initial"),isLoading:B.state.isLoading}):"visa_otp_entry"===U?(0,l.jsx)(pn,{methodDescription:B.state.selectedMethodDescription||"your phone",otp:se,onOtpChange:e=>{oe(e),X&&Z(null),B.state.error&&B.clearError()},onVerify:ye,onBack:()=>O("visa_method_select"),onResend:async()=>{oe(""),Z(null),B.clearError()},onVerifyAnotherWay:()=>{oe(""),Z(null),B.clearError(),B.resetState(),O("visa_method_select")},isLoading:B.state.isLoading,error:X||B.state.error||void 0,canRetry:B.state.canRetry}):"visa_iframe"===U?(0,l.jsx)(On,{onCancel:()=>O("initial")}):(0,l.jsx)(hn,{cardNetwork:e,onCreatePasskey:fe,onSkip:X?xe:void 0,onBack:A,isLoading:B.state.isLoading,error:X||void 0,showSkip:!!X,paymentIntent:g.paymentIntent,merchantName:g.paymentIntent.payments[0]?.merchantName||"Merchant"})}if("PAYMENT"===b&&g){if("checkout"===k&&x&&g.selectedCard){const e=f||B.state.isLoading;return(0,l.jsx)(Gt,{selectedCard:g.selectedCard,cvc:C,onCvcChange:S,onChangeCard:N,paymentIntent:g.paymentIntent,onSubmit:be,isLoading:e,error:Ae||void 0})}if("methods"===k)return(0,l.jsx)(Xt,{cards:g.savedCards||[],selectedCardId:g.selectedCard?.id||null,onSelectCard:he,onAddNewCard:I,onBack:x?A:ce,onDeleteCard:L});if("add"===k)return(0,l.jsx)(tn,{linkToken:g.linkToken,walletUserId:g.paymentIntent.walletUserId,onSubmit:ge,onBack:v?N:void 0,isLoading:f,error:Ae||void 0,isFirstCard:!v,customBaseUrl:u||Fn,environment:i,devApiUrl:p})}return"PROCESSING"===b?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,l.jsx)("div",{className:"w-16 h-16 border-4 border-gray-200 dark:border-slate-700 border-t-black dark:border-t-white rounded-full animate-spin"}),(0,l.jsx)("p",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:y?"Generating Credentials...":"Processing Payment..."}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Please wait while we process your request"})]}):"SUCCESS"===b&&g?(0,l.jsx)(rn,{paymentIntent:g.paymentIntent,walletUser:g.walletUser,cardNetwork:g.selectedCard?.network,onDismiss:ce,passkeyEnrolled:g.selectedCard?.passkeyEnrolled}):null})()}):null},nr=e=>new Promise(t=>setTimeout(t,e)),rr=async e=>{console.log("[Mock] Sending OTP to:",e),await nr(800),console.log("[Mock] OTP sent successfully")},ar=async e=>{console.log("[Mock] Verifying OTP:",e),await nr(500);const t="123456"===e||6===e.length;return console.log("[Mock] OTP verification result:",t),t},sr=async e=>{console.log("[Mock] Processing payment:",e),await nr(2e3);const t={success:!0,transactionId:`txn_mock_${Date.now()}`,amount:e.amount,cardLast4:e.cardData.last4,timestamp:Date.now()};return console.log("[Mock] Payment processed successfully:",t),t};function or({mode:e,amount:t,savedCards:n,onSuccess:r,onError:a}){const[s,o]=(0,d.useState)({phase:"PHONE_INPUT",phoneNumber:"",email:"",cardData:null,billingAddress:null,error:null,isLoading:!1}),[i,l]=(0,d.useState)(n&&n.length>0?n.find(e=>e.isDefault)?.id||n[0].id:null),[c,p]=(0,d.useState)(n&&n.length>0?"checkout":"add"),[u,m]=(0,d.useState)(""),h=(0,d.useCallback)(e=>{o(t=>({...t,error:e,isLoading:!1}))},[]),g=(0,d.useCallback)(e=>{o(t=>({...t,isLoading:e}))},[]),b=(0,d.useCallback)(async e=>{g(!0),h(null);try{await rr(e),o(t=>({...t,phoneNumber:e,phase:"OTP_VERIFY",isLoading:!1}))}catch(e){h("Failed to send OTP. Please try again."),a?.(e)}},[g,h,a]),f=(0,d.useCallback)(async e=>{g(!0),h(null);try{if(await ar(e))if(o(e=>({...e,phase:"PAYMENT",isLoading:!1})),n&&n.length>0){p("checkout");const e=n.find(e=>e.isDefault)||n[0];l(e.id)}else p("add"),l(null);else h("Invalid code. Please try again.")}catch(e){h("Failed to verify OTP. Please try again."),a?.(e)}},[g,h,a,n]),w=(0,d.useCallback)(async(n,i,l)=>{g(!0),h(null),o(e=>({...e,phase:"PROCESSING"}));try{const a=await sr({phoneNumber:s.phoneNumber,email:n,cardData:i,amount:t,mode:e});o(e=>({...e,email:n,cardData:i,billingAddress:l,phase:"SUCCESS",isLoading:!1})),setTimeout(()=>{r?.(a)},3e3)}catch(e){h("Payment failed. Please try again."),o(e=>({...e,phase:"PAYMENT"})),a?.(e)}},[s.phoneNumber,t,e,h,r,a]),y=(0,d.useCallback)(e=>{l(e),p("checkout")},[]),x=(0,d.useCallback)(async t=>{g(!0),h(null);try{await new Promise(e=>setTimeout(e,500)),o(e=>({...e,cardData:t,isLoading:!1})),"agent"===e?o(e=>({...e,phase:"AGENT_REGISTRATION"})):p("checkout")}catch(e){h("Failed to add card. Please try again."),a?.(e)}},[g,h,a,e]),v=(0,d.useCallback)(()=>{if(o({phase:"PHONE_INPUT",phoneNumber:"",email:"",cardData:null,billingAddress:null,error:null,isLoading:!1}),n&&n.length>0){const e=n.find(e=>e.isDefault)||n[0];l(e.id),p("checkout")}else l(null),p("add");m("")},[n]),k=(0,d.useCallback)(()=>{p("methods")},[]),C=(0,d.useCallback)(()=>{p("add")},[]),S=(0,d.useCallback)(()=>{p("checkout")},[]),N=(0,d.useCallback)(()=>{if(o(e=>({...e,phase:"PAYMENT",phoneNumber:"+15551234567",error:null,isLoading:!1})),n&&n.length>0){const e=n.find(e=>e.isDefault)||n[0];l(e.id),p("checkout")}else l(null),p("add");m("")},[n]),I=(0,d.useCallback)(()=>{o(e=>({...e,phase:"PAYMENT"})),p("checkout")},[]);return{state:s,selectedCardId:i,paymentView:c,cvc:u,setCvc:m,submitPhone:b,verifyOTP:f,submitPayment:w,selectCard:y,addCard:x,logout:v,setError:h,showMethodList:k,showAddCard:C,returnToCheckout:S,skipToPayment:N,completeAgentRegistration:I}}const ir=[{id:"card_visa_001",brand:"visa",last4:"4242",expiryMonth:"12",expiryYear:"2027",cardholderName:"John Doe",isDefault:!0,network:"visa",passkeyEnrolled:!0,cardArtUrl:"https://cdn.payos.io/card-art/visa-signature-blue.png"},{id:"card_mc_002",brand:"mastercard",last4:"5555",expiryMonth:"08",expiryYear:"2026",cardholderName:"John Doe",isDefault:!1,network:"mastercard",passkeyEnrolled:!1,cardArtUrl:"https://cdn.payos.io/card-art/mastercard-world-elite.png"},{id:"card_amex_003",brand:"amex",last4:"0005",expiryMonth:"03",expiryYear:"2028",cardholderName:"John Doe",isDefault:!1,network:"amex",passkeyEnrolled:!1,cardArtUrl:"https://cdn.payos.io/card-art/amex-platinum.png"}],lr={id:"wu_mock_001",email:"john.doe@example.com",phone:"+14155551234",firstName:"John",lastName:"Doe",defaultCardId:"card_visa_001"};function dr(e){const t=(new Date).toISOString();return{id:`pay_${Date.now()}_${Math.random().toString(36).substring(7)}`,merchantUrl:void 0,merchantCategory:void 0,merchantCategoryCode:void 0,description:void 0,quantity:1,expiresAt:void 0,selectedCardId:void 0,credentialId:void 0,credentialStatus:"not_created",mandateId:void 0,assignedChildIntentId:void 0,status:"pending",createdAt:t,updatedAt:t,...e}}function cr(e){const t=(new Date).toISOString(),{payments:n,totalAmount:r,...a}=e,s=n.reduce((e,t)=>e+t.subtotal,0),o=n.reduce((e,t)=>e+(t.tax??0),0),i=n.reduce((e,t)=>e+(t.shipping??0),0),l=r??s+o+i;return{id:`payint_${Date.now()}`,type:"online_checkout",currency:"USD",walletUserId:void 0,organizationId:"org_demo_001",status:"created",payments:n,totalAmount:l,totalSubtotal:s,totalTax:o||void 0,totalShipping:i||void 0,consumerPrompt:void 0,intentType:"standard",parentIntentId:void 0,selectedCardId:void 0,networkProvider:void 0,networkInstructionId:void 0,requireHitl:!1,hitlAttemptCount:0,hitlApproved:!1,networkAuthRequired:!0,networkAuthCompleted:!1,authData:void 0,authValid:!1,authSubmittedAt:void 0,authInvalidatedAt:void 0,authInvalidReason:void 0,credentialType:"network_token_long",riskAssessment:void 0,createdAt:t,updatedAt:t,...a}}const pr=cr({id:"payint_online_001",type:"online_checkout",payments:[dr({id:"pay_online_001",merchantName:"Demo Store",merchantUrl:"https://demo-store.example.com",amount:21136,subtotal:19525,tax:1611,description:"Order #12345"})]}),ur=cr({id:"payint_agent_001",type:"pay_on_behalf",facilitationFee:{amount:100,currency:"usd"},payments:[dr({id:"pay_agent_001",merchantName:"Agent Commerce",merchantUrl:"https://agent.example.com",amount:1e3,subtotal:1e3,tax:100,shipping:100,description:"Agent-assisted purchase"})]}),mr=cr({id:"payint_multi_001",type:"agentic_multi",requireHitl:!0,consumerPrompt:"Complete your shopping cart",payments:[dr({id:"pay_multi_001",merchantName:"Amazon",merchantUrl:"https://amazon.com",amount:5911,subtotal:4999,tax:412,shipping:500,description:"Wireless Headphones",quantity:1}),dr({id:"pay_multi_002",merchantName:"Best Buy",merchantUrl:"https://bestbuy.com",amount:14072,subtotal:12999,tax:1073,description:"USB-C Hub",quantity:1}),dr({id:"pay_multi_003",merchantName:"Target",merchantUrl:"https://target.com",amount:2705,subtotal:2499,tax:206,description:"Phone Case",quantity:2})]});cr({id:"payint_small_001",type:"online_checkout",payments:[dr({id:"pay_small_001",merchantName:"Quick Shop",amount:1081,subtotal:999,tax:82,description:"Test purchase"})]});const hr={ses_new_001:{id:"ses_new_001",status:"initialized",paymentIntent:{...pr},organizationId:"org_demo_001",deviceVerified:!1,savedCards:[],linkToken:"link_tok_new_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_return_001:{id:"ses_return_001",status:"verified",paymentIntent:{...pr},walletUser:{...lr},organizationId:"org_demo_001",deviceVerified:!0,savedCards:[...ir],linkToken:"link_tok_return_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_agent_001:{id:"ses_agent_001",status:"initialized",paymentIntent:{...ur},organizationId:"org_agent_001",deviceVerified:!1,savedCards:[],linkToken:"link_tok_agent_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_agent_002:{id:"ses_agent_002",status:"verified",paymentIntent:{...ur},walletUser:{...lr},organizationId:"org_agent_001",deviceVerified:!0,savedCards:[...ir],linkToken:"link_tok_agent_002_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_multi_001:{id:"ses_multi_001",status:"initialized",paymentIntent:{...mr},organizationId:"org_agent_001",deviceVerified:!1,savedCards:[],linkToken:"link_tok_multi_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_multi_002:{id:"ses_multi_002",status:"verified",paymentIntent:{...mr},walletUser:{...lr},organizationId:"org_agent_001",deviceVerified:!0,savedCards:[...ir],linkToken:"link_tok_multi_002_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_otp_001:{id:"ses_otp_001",status:"otp_pending",paymentIntent:{...pr},organizationId:"org_demo_001",deviceVerified:!1,verificationMethod:"phone",savedCards:[],linkToken:"link_tok_otp_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()},ses_payment_001:{id:"ses_payment_001",status:"payment_pending",paymentIntent:{...pr},walletUser:{...lr},organizationId:"org_demo_001",deviceVerified:!0,savedCards:[...ir],selectedCard:{...ir[0]},linkToken:"link_tok_payment_001_mock",expiresAt:new Date(Date.now()+36e5).toISOString(),createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()}},gr="https://sandbox.api.payos.ai",br=new Map;Object.entries(hr).forEach(([e,t])=>{br.set(e,JSON.parse(JSON.stringify(t)))});async function fr(e){console.log("[Mock] Creating test session with REAL payment intent...");const t=await async function(){console.log("[LinkTokenService] Fetching link token from API...");const e=await fetch(`${Mn.apiBaseUrl}/api/auth/payos-link/tokens/link`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":Mn.apiKey,"ngrok-skip-browser-warning":"true"},body:JSON.stringify({domain:"undefined"!=typeof window?window.location.origin:"http://localhost:3000"})});if(!e.ok){const t=await e.text();throw console.error("[LinkTokenService] Failed to fetch link token:",e.status,t),new Error(`Failed to fetch link token: ${e.status}`)}const t=await e.json();return console.log("[LinkTokenService] Link token fetched successfully, expires:",t.data.expiresAt),{token:t.data.token,expiresAt:t.data.expiresAt}}();console.log("[Mock] Link token fetched");const{sessionOptions:n,...r}=e,a=await async function(e,t,n){console.log("[ApiService] Creating payment intent:",n);const r=await wn(e,"/api/payment-intents",t,{method:"POST",body:JSON.stringify(n)});if(r.error||!r.data)throw new gn(r.message||"Failed to create payment intent",400);return console.log("[ApiService] Payment intent created:",r.data.id),r.data}(gr,t.token,r);console.log("[Mock] Real payment intent created:",a.id);const s=`ses_real_${Date.now()}`,o=function(e={}){const{type:t="online_checkout",status:n="initialized",hasWalletUser:r=!1,hasSavedCards:a=!1,deviceVerified:s=!1,amount:o,subtotal:i,tax:l,shipping:d,merchantName:c,payments:p}=e,u=new Date;let m;m=p&&p.length>0?p.map((e,t)=>dr({id:`pay_custom_${Date.now()}_${t}`,merchantName:e.merchantName,amount:e.amount,subtotal:e.subtotal,tax:e.tax,shipping:e.shipping,description:e.description})):[dr({..."pay_on_behalf"===t||"agentic_multi"===t?ur.payments[0]:pr.payments[0],id:`pay_${Date.now()}`,...void 0!==o&&{amount:o},...void 0!==i&&{subtotal:i},...void 0!==l&&{tax:l},...void 0!==d&&{shipping:d},...void 0!==c&&{merchantName:c}})];const h=cr({id:`payint_${Date.now()}`,type:t,payments:m,requireHitl:"pay_on_behalf"===t||"agentic_multi"===t}),g=`ses_${Date.now()}`;return{id:g,status:n,paymentIntent:h,walletUser:r?{...lr}:void 0,organizationId:"org_demo_001",deviceVerified:s,savedCards:a?[...ir]:[],selectedCard:void 0,linkToken:`link_tok_${g}_${Math.random().toString(36).slice(2)}`,expiresAt:new Date(u.getTime()+36e5).toISOString(),createdAt:u.toISOString(),updatedAt:u.toISOString()}}(n||{});var i;return o.id=s,o.paymentIntent={id:(i=a).id,type:i.type,currency:i.currency,walletUserId:i.walletUserId,organizationId:i.organizationId,status:i.status,payments:i.payments.map(e=>({id:e.id,merchantName:e.merchantName,merchantUrl:e.merchantUrl,merchantCategory:e.merchantCategory,merchantCategoryCode:e.merchantCategoryCode,amount:e.amount,subtotal:e.subtotal||e.amount,tax:e.tax,shipping:e.shipping,description:e.description,quantity:e.quantity||1,selectedCardId:e.selectedCardId,credentialId:e.credentialId,credentialStatus:e.credentialStatus||"not_created",status:e.status||"pending",createdAt:e.createdAt,updatedAt:e.updatedAt})),totalAmount:i.totalAmount,totalSubtotal:i.totalSubtotal||i.totalAmount,totalTax:i.totalTax,totalShipping:i.totalShipping,consumerPrompt:i.consumerPrompt,intentType:i.intentType||"standard",selectedCardId:i.selectedCardId,requireHitl:i.requireHitl||!1,hitlAttemptCount:i.hitlAttemptCount||0,hitlApproved:i.hitlApproved||!1,networkAuthRequired:i.networkAuthRequired??!0,networkAuthCompleted:i.networkAuthCompleted||!1,authValid:i.authValid||!1,credentialType:i.credentialType||"network_token_long",createdAt:i.createdAt,updatedAt:i.updatedAt},o.linkToken=t.token,br.set(s,o),console.log("[Mock] Test session created with REAL payment intent:",{sessionId:s,paymentIntentId:a.id,type:a.type,totalAmount:a.totalAmount,paymentsCount:a.payments.length}),s}return i})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.PayOSReact=t(require("react"),require("react-dom")):e.PayOSReact=t(e.React,e.ReactDOM)}(this,(e,t)=>(()=>{"use strict";var n,r,a={3:e=>{e.exports=t},20:(e,t,n)=>{var r=n(442),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,n){var r,s={},d=null,c=null;for(r in void 0!==n&&(d=""+n),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:a,type:e,key:d,ref:c,props:s,_owner:i.current}}t.Fragment=s,t.jsx=d,t.jsxs=d},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},61:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(601),a=n.n(r),s=n(314),o=n.n(s)()(a());o.push([e.id,"*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: var(--payos-font-family, system-ui, -apple-system, sans-serif); /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n.\\!container {\n width: 100% !important;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .\\!container {\n max-width: 640px !important;\n }\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .\\!container {\n max-width: 768px !important;\n }\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .\\!container {\n max-width: 1024px !important;\n }\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .\\!container {\n max-width: 1280px !important;\n }\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .\\!container {\n max-width: 1536px !important;\n }\n\n .container {\n max-width: 1536px;\n }\n}\n.pointer-events-none {\n pointer-events: none;\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.inset-0 {\n inset: 0px;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-full {\n bottom: 100%;\n}\n.left-0 {\n left: 0px;\n}\n.left-1\\/2 {\n left: 50%;\n}\n.right-0 {\n right: 0px;\n}\n.right-4 {\n right: 1rem;\n}\n.top-full {\n top: 100%;\n}\n.z-10 {\n z-index: 10;\n}\n.z-50 {\n z-index: 50;\n}\n.z-\\[9998\\] {\n z-index: 9998;\n}\n.z-\\[9999\\] {\n z-index: 9999;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.-mt-1 {\n margin-top: -0.25rem;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.ml-auto {\n margin-left: auto;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-3 {\n margin-top: 0.75rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.inline-block {\n display: inline-block;\n}\n.inline {\n display: inline;\n}\n.flex {\n display: flex;\n}\n.inline-flex {\n display: inline-flex;\n}\n.grid {\n display: grid;\n}\n.hidden {\n display: none;\n}\n.h-1 {\n height: 0.25rem;\n}\n.h-10 {\n height: 2.5rem;\n}\n.h-11 {\n height: 2.75rem;\n}\n.h-12 {\n height: 3rem;\n}\n.h-14 {\n height: 3.5rem;\n}\n.h-16 {\n height: 4rem;\n}\n.h-3 {\n height: 0.75rem;\n}\n.h-3\\.5 {\n height: 0.875rem;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-9 {\n height: 2.25rem;\n}\n.h-\\[1px\\] {\n height: 1px;\n}\n.h-auto {\n height: auto;\n}\n.h-full {\n height: 100%;\n}\n.h-px {\n height: 1px;\n}\n.max-h-60 {\n max-height: 15rem;\n}\n.max-h-\\[90vh\\] {\n max-height: 90vh;\n}\n.min-h-0 {\n min-height: 0px;\n}\n.min-h-\\[10px\\] {\n min-height: 10px;\n}\n.min-h-\\[280px\\] {\n min-height: 280px;\n}\n.min-h-\\[300px\\] {\n min-height: 300px;\n}\n.w-10 {\n width: 2.5rem;\n}\n.w-12 {\n width: 3rem;\n}\n.w-16 {\n width: 4rem;\n}\n.w-3 {\n width: 0.75rem;\n}\n.w-3\\.5 {\n width: 0.875rem;\n}\n.w-4 {\n width: 1rem;\n}\n.w-48 {\n width: 12rem;\n}\n.w-5 {\n width: 1.25rem;\n}\n.w-6 {\n width: 1.5rem;\n}\n.w-64 {\n width: 16rem;\n}\n.w-8 {\n width: 2rem;\n}\n.w-\\[1px\\] {\n width: 1px;\n}\n.w-full {\n width: 100%;\n}\n.min-w-0 {\n min-width: 0px;\n}\n.max-w-\\[480px\\] {\n max-width: 480px;\n}\n.max-w-md {\n max-width: 28rem;\n}\n.max-w-sm {\n max-width: 24rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.-translate-x-1\\/2 {\n --tw-translate-x: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.rotate-180 {\n --tw-rotate: 180deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes pulse {\n\n 50% {\n opacity: .5;\n }\n}\n.animate-pulse {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n}\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.resize {\n resize: both;\n}\n.appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-start {\n align-items: flex-start;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-1\\.5 {\n gap: 0.375rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.space-y-1 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));\n}\n.space-y-1\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-y-auto {\n overflow-y: auto;\n}\n.overscroll-y-contain {\n overscroll-behavior-y: contain;\n}\n.truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.rounded {\n border-radius: var(--payos-border-radius, 0.75rem);\n}\n.rounded-2xl {\n border-radius: 1rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-t-2xl {\n border-top-left-radius: 1rem;\n border-top-right-radius: 1rem;\n}\n.border {\n border-width: 1px;\n}\n.border-0 {\n border-width: 0px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-4 {\n border-width: 4px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-r {\n border-right-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-100 {\n --tw-border-opacity: 1;\n border-color: rgb(243 244 246 / var(--tw-border-opacity, 1));\n}\n.border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n}\n.border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));\n}\n.border-green-500 {\n --tw-border-opacity: 1;\n border-color: rgb(34 197 94 / var(--tw-border-opacity, 1));\n}\n.border-indigo-100 {\n --tw-border-opacity: 1;\n border-color: rgb(224 231 255 / var(--tw-border-opacity, 1));\n}\n.border-indigo-200 {\n --tw-border-opacity: 1;\n border-color: rgb(199 210 254 / var(--tw-border-opacity, 1));\n}\n.border-purple-200 {\n --tw-border-opacity: 1;\n border-color: rgb(233 213 255 / var(--tw-border-opacity, 1));\n}\n.border-red-200 {\n --tw-border-opacity: 1;\n border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));\n}\n.border-red-500 {\n --tw-border-opacity: 1;\n border-color: rgb(239 68 68 / var(--tw-border-opacity, 1));\n}\n.border-slate-900 {\n --tw-border-opacity: 1;\n border-color: rgb(15 23 42 / var(--tw-border-opacity, 1));\n}\n.border-transparent {\n border-color: transparent;\n}\n.border-t-black {\n --tw-border-opacity: 1;\n border-top-color: rgb(0 0 0 / var(--tw-border-opacity, 1));\n}\n.border-t-gray-900 {\n --tw-border-opacity: 1;\n border-top-color: rgb(17 24 39 / var(--tw-border-opacity, 1));\n}\n.bg-black\\/40 {\n background-color: rgb(0 0 0 / 0.4);\n}\n.bg-black\\/50 {\n background-color: rgb(0 0 0 / 0.5);\n}\n.bg-gray-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));\n}\n.bg-gray-50\\/50 {\n background-color: rgb(249 250 251 / 0.5);\n}\n.bg-gray-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(224 231 255 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(238 242 255 / var(--tw-bg-opacity, 1));\n}\n.bg-indigo-50\\/50 {\n background-color: rgb(238 242 255 / 0.5);\n}\n.bg-primary {\n background-color: var(--payos-color-primary, #0f172a);\n}\n.bg-purple-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(250 245 255 / var(--tw-bg-opacity, 1));\n}\n.bg-red-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-violet-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(237 233 254 / var(--tw-bg-opacity, 1));\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-gradient-to-br {\n background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));\n}\n.from-blue-500 {\n --tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-green-500 {\n --tw-gradient-from: #22c55e var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-indigo-500 {\n --tw-gradient-from: #6366f1 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-orange-500 {\n --tw-gradient-from: #f97316 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-pink-500 {\n --tw-gradient-from: #ec4899 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.from-purple-500 {\n --tw-gradient-from: #a855f7 var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n.to-cyan-500 {\n --tw-gradient-to: #06b6d4 var(--tw-gradient-to-position);\n}\n.to-emerald-500 {\n --tw-gradient-to: #10b981 var(--tw-gradient-to-position);\n}\n.to-pink-500 {\n --tw-gradient-to: #ec4899 var(--tw-gradient-to-position);\n}\n.to-purple-500 {\n --tw-gradient-to: #a855f7 var(--tw-gradient-to-position);\n}\n.to-red-500 {\n --tw-gradient-to: #ef4444 var(--tw-gradient-to-position);\n}\n.to-rose-500 {\n --tw-gradient-to: #f43f5e var(--tw-gradient-to-position);\n}\n.object-contain {\n -o-object-fit: contain;\n object-fit: contain;\n}\n.object-cover {\n -o-object-fit: cover;\n object-fit: cover;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.py-12 {\n padding-top: 3rem;\n padding-bottom: 3rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pt-0 {\n padding-top: 0px;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-\\[10px\\] {\n font-size: 10px;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-semibold {\n font-weight: 600;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.leading-none {\n line-height: 1;\n}\n.leading-relaxed {\n line-height: 1.625;\n}\n.tracking-tight {\n letter-spacing: -0.025em;\n}\n.tracking-wide {\n letter-spacing: 0.025em;\n}\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity, 1));\n}\n.text-blue-600 {\n --tw-text-opacity: 1;\n color: rgb(37 99 235 / var(--tw-text-opacity, 1));\n}\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-700 {\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-500 {\n --tw-text-opacity: 1;\n color: rgb(34 197 94 / var(--tw-text-opacity, 1));\n}\n.text-indigo-600 {\n --tw-text-opacity: 1;\n color: rgb(79 70 229 / var(--tw-text-opacity, 1));\n}\n.text-indigo-700 {\n --tw-text-opacity: 1;\n color: rgb(67 56 202 / var(--tw-text-opacity, 1));\n}\n.text-purple-800 {\n --tw-text-opacity: 1;\n color: rgb(107 33 168 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-red-600 {\n --tw-text-opacity: 1;\n color: rgb(220 38 38 / var(--tw-text-opacity, 1));\n}\n.text-red-700 {\n --tw-text-opacity: 1;\n color: rgb(185 28 28 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-slate-700 {\n --tw-text-opacity: 1;\n color: rgb(51 65 85 / var(--tw-text-opacity, 1));\n}\n.text-slate-900 {\n --tw-text-opacity: 1;\n color: rgb(15 23 42 / var(--tw-text-opacity, 1));\n}\n.text-violet-500 {\n --tw-text-opacity: 1;\n color: rgb(139 92 246 / var(--tw-text-opacity, 1));\n}\n.text-violet-700 {\n --tw-text-opacity: 1;\n color: rgb(109 40 217 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.underline-offset-4 {\n text-underline-offset: 4px;\n}\n.placeholder-gray-400::-moz-placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1));\n}\n.placeholder-gray-400::placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1));\n}\n.opacity-50 {\n opacity: 0.5;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-2xl {\n --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.outline {\n outline-style: solid;\n}\n.ring {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n.ring-offset-white {\n --tw-ring-offset-color: #fff;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.backdrop-blur-sm {\n --tw-backdrop-blur: blur(4px);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-transform {\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-100 {\n transition-duration: 100ms;\n}\n.duration-150 {\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.ease-\\[cubic-bezier\\(0\\.16\\2c 1\\2c 0\\.3\\2c 1\\)\\] {\n transition-timing-function: cubic-bezier(0.16,1,0.3,1);\n}\n\n/* PayOS Elements custom styles */\n.payos-drawer-backdrop {\n backdrop-filter: blur(2px);\n}\n\n.payos-drawer-container {\n box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* Scrollbar styling for drawer body */\n.payos-drawer-body::-webkit-scrollbar {\n width: 6px;\n}\n\n.payos-drawer-body::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.payos-drawer-body::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 3px;\n}\n\n.payos-drawer-body::-webkit-scrollbar-thumb:hover {\n background: #9ca3af;\n}\n\n.placeholder\\:font-light::-moz-placeholder {\n font-weight: 300;\n}\n\n.placeholder\\:font-light::placeholder {\n font-weight: 300;\n}\n\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.focus-within\\:ring-2:focus-within {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus-within\\:ring-slate-900:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(15 23 42 / var(--tw-ring-opacity, 1));\n}\n\n.focus-within\\:ring-offset-0:focus-within {\n --tw-ring-offset-width: 0px;\n}\n\n.hover\\:border-gray-400:hover {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n\n.hover\\:bg-blue-50:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(239 246 255 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-50:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-gray-800:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:bg-red-600:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));\n}\n\n.hover\\:text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-600:hover {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-700:hover {\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-gray-900:hover {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:text-red-500:hover {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n\n.hover\\:underline:hover {\n text-decoration-line: underline;\n}\n\n.hover\\:opacity-90:hover {\n opacity: 0.9;\n}\n\n.focus\\:border-black:focus {\n --tw-border-opacity: 1;\n border-color: rgb(0 0 0 / var(--tw-border-opacity, 1));\n}\n\n.focus\\:border-red-600:focus {\n --tw-border-opacity: 1;\n border-color: rgb(220 38 38 / var(--tw-border-opacity, 1));\n}\n\n.focus\\:border-transparent:focus {\n border-color: transparent;\n}\n\n.focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.focus\\:ring-0:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus\\:ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus\\:ring-black:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity, 1));\n}\n\n.focus\\:ring-gray-100:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(243 244 246 / var(--tw-ring-opacity, 1));\n}\n\n.focus-visible\\:outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.focus-visible\\:ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.focus-visible\\:ring-slate-950:focus-visible {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(2 6 23 / var(--tw-ring-opacity, 1));\n}\n\n.focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n\n.active\\:scale-95:active {\n --tw-scale-x: .95;\n --tw-scale-y: .95;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.active\\:scale-\\[0\\.98\\]:active {\n --tw-scale-x: 0.98;\n --tw-scale-y: 0.98;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.active\\:bg-blue-100:active {\n --tw-bg-opacity: 1;\n background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));\n}\n\n.active\\:bg-gray-100:active {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.disabled\\:pointer-events-none:disabled {\n pointer-events: none;\n}\n\n.disabled\\:cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n\n.disabled\\:bg-gray-100:disabled {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.disabled\\:bg-slate-900\\/20:disabled {\n background-color: rgb(15 23 42 / 0.2);\n}\n\n.disabled\\:text-gray-400:disabled {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n\n.disabled\\:text-slate-900\\/50:disabled {\n color: rgb(15 23 42 / 0.5);\n}\n\n.disabled\\:no-underline:disabled {\n text-decoration-line: none;\n}\n\n.disabled\\:opacity-50:disabled {\n opacity: 0.5;\n}\n\n.peer:disabled ~ .peer-disabled\\:cursor-not-allowed {\n cursor: not-allowed;\n}\n\n.peer:disabled ~ .peer-disabled\\:opacity-70 {\n opacity: 0.7;\n}\n\n.dark\\:border-green-400:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(74 222 128 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-indigo-900:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(49 46 129 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-purple-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(126 34 206 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-red-400:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(248 113 113 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-red-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(185 28 28 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-600:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(71 85 105 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-700:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-slate-800:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(30 41 59 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-white:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:border-t-white:is(.dark *) {\n --tw-border-opacity: 1;\n border-top-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:bg-black\\/60:is(.dark *) {\n background-color: rgb(0 0 0 / 0.6);\n}\n\n.dark\\:bg-indigo-900\\/30:is(.dark *) {\n background-color: rgb(49 46 129 / 0.3);\n}\n\n.dark\\:bg-indigo-950\\/30:is(.dark *) {\n background-color: rgb(30 27 75 / 0.3);\n}\n\n.dark\\:bg-purple-900\\/20:is(.dark *) {\n background-color: rgb(88 28 135 / 0.2);\n}\n\n.dark\\:bg-red-900:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(127 29 29 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-red-900\\/20:is(.dark *) {\n background-color: rgb(127 29 29 / 0.2);\n}\n\n.dark\\:bg-slate-700:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-slate-800:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-slate-800\\/50:is(.dark *) {\n background-color: rgb(30 41 59 / 0.5);\n}\n\n.dark\\:bg-slate-900:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:bg-violet-900\\/30:is(.dark *) {\n background-color: rgb(76 29 149 / 0.3);\n}\n\n.dark\\:bg-white:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:text-blue-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(96 165 250 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-gray-900:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-green-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(74 222 128 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-indigo-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(129 140 248 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-purple-200:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(233 213 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-red-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(252 165 165 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-red-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(248 113 113 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(203 213 225 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-400:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-500:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-slate-900:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(15 23 42 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-violet-300:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(196 181 253 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:text-white:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:placeholder-slate-500:is(.dark *)::-moz-placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(100 116 139 / var(--tw-placeholder-opacity, 1));\n}\n\n.dark\\:placeholder-slate-500:is(.dark *)::placeholder {\n --tw-placeholder-opacity: 1;\n color: rgb(100 116 139 / var(--tw-placeholder-opacity, 1));\n}\n\n.dark\\:ring-offset-slate-950:is(.dark *) {\n --tw-ring-offset-color: #020617;\n}\n\n.dark\\:placeholder\\:text-slate-500:is(.dark *)::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:placeholder\\:text-slate-500:is(.dark *)::placeholder {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:border-slate-500:hover:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(100 116 139 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:hover\\:bg-gray-100:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-red-800:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(153 27 27 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-600:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(71 85 105 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-700:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-800:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:hover\\:bg-slate-800\\/50:hover:is(.dark *) {\n background-color: rgb(30 41 59 / 0.5);\n}\n\n.dark\\:hover\\:text-red-400:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(248 113 113 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:text-slate-300:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(203 213 225 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:hover\\:text-white:hover:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.dark\\:focus\\:border-white:focus:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\n}\n\n.dark\\:focus\\:ring-white:focus:is(.dark *) {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1));\n}\n\n.dark\\:focus-visible\\:ring-slate-300:focus-visible:is(.dark *) {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(203 213 225 / var(--tw-ring-opacity, 1));\n}\n\n.dark\\:active\\:bg-slate-700:active:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));\n}\n\n.dark\\:active\\:bg-slate-800:active:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));\n}\n\n@media (min-width: 768px) {\n\n .md\\:bottom-0 {\n bottom: 0px;\n }\n\n .md\\:left-auto {\n left: auto;\n }\n\n .md\\:right-0 {\n right: 0px;\n }\n\n .md\\:top-0 {\n top: 0px;\n }\n\n .md\\:hidden {\n display: none;\n }\n\n .md\\:h-full {\n height: 100%;\n }\n\n .md\\:max-h-none {\n max-height: none;\n }\n\n .md\\:w-\\[480px\\] {\n width: 480px;\n }\n\n .md\\:max-w-none {\n max-width: none;\n }\n\n .md\\:rounded-none {\n border-radius: 0px;\n }\n\n .md\\:border-l {\n border-left-width: 1px;\n }\n\n .md\\:border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n }\n\n .md\\:dark\\:border-slate-800:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(30 41 59 / var(--tw-border-opacity, 1));\n }\n}\n",""]);const i=o},72:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},o=[],i=0;i<e.length;i++){var l=e[i],d=r.base?l[0]+r.base:l[0],c=s[d]||0,u="".concat(d," ").concat(c);s[d]=c+1;var m=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==m)t[m].references++,t[m].updater(p);else{var h=a(p,r);r.byIndex=i,t.splice(i,0,{identifier:u,updater:h,references:1})}o.push(u)}return o}function a(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,a){var s=r(e=e||[],a=a||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var i=n(s[o]);t[i].references--}for(var l=r(e,a),d=0;d<s.length;d++){var c=n(s[d]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}s=l}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,a,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(o[l]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);r&&o[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),t.push(c))}},t}},442:t=>{t.exports=e},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601:e=>{e.exports=function(e){return e[1]}},659:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var a=void 0!==n.layer;a&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,a&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},848:(e,t,n)=>{e.exports=n(20)}},s={};function o(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,exports:{}};return a[e](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);o.r(a);var s={};n=n||[null,r({}),r([]),r(r)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~n.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(t=>s[t]=()=>e[t]);return s.default=()=>e,o.d(a,s),a},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};o.r(i),o.d(i,{ActiveCardWidget:()=>Vt,AgentRegistrationView:()=>hn,Button:()=>Je,Card:()=>Qe,CardAddView:()=>tn,CardContent:()=>rt,CardDescription:()=>nt,CardFooter:()=>at,CardHeader:()=>et,CardTitle:()=>tt,CheckoutView:()=>qt,IdentityView:()=>Ct,Input:()=>Ze,Label:()=>dt,MethodListView:()=>Zt,OTPInput:()=>xt,OTPView:()=>Gt,OrderSummary:()=>Bt,PayOSDrawer:()=>Mt,PayOSFooter:()=>Dt,PaymentMethodRow:()=>Ft,PaymentSheet:()=>Qn,PhoneInput:()=>yt,PriceTag:()=>At,ReceiptPanel:()=>Tt,Separator:()=>ht,SuccessView:()=>rn,ViewHeader:()=>$t,VisaMethodView:()=>dn,VisaOtpView:()=>un,WelcomeBackView:()=>jt,cn:()=>We,useBodyScrollLock:()=>Pt,useCheckoutFlow:()=>ar,useSession:()=>An,useVisualViewport:()=>Ut,useVisualViewportStyle:()=>Ot});var l=o(848),d=o(442),c=o.t(d,2);function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function m(...e){return t=>{let n=!1;const r=e.map(e=>{const r=u(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():u(e[t],null)}}}}var p=Symbol.for("react.lazy"),h=c[" use ".trim().toString()];function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===p&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function b(e){const t=w(e),n=d.forwardRef((e,n)=>{let{children:r,...a}=e;g(r)&&"function"==typeof h&&(r=h(r._payload));const s=d.Children.toArray(r),o=s.find(x);if(o){const e=o.props.children,r=s.map(t=>t===o?d.Children.count(e)>1?d.Children.only(null):d.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...a,ref:n,children:d.isValidElement(e)?d.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...a,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var f=b("Slot");function w(e){const t=d.forwardRef((e,t)=>{let{children:n,...r}=e;if(g(n)&&"function"==typeof h&&(n=h(n._payload)),d.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...s}:"className"===r&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==d.Fragment&&(a.ref=t?m(t,e):e),d.cloneElement(n,a)}return d.Children.count(n)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y=Symbol("radix.slottable");function x(e){return d.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}function v(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=v(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=v(e))&&(r&&(r+=" "),r+=t);return r}const C=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,N=k,S=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return N(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(e=>{const t=null==n?void 0:n[e],r=null==s?void 0:s[e];if(null===t)return null;const o=C(t)||C(r);return a[e][o]}),i=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...s,...i}[t]):{...s,...i}[t]===n})?[...e,n,r]:e},[]);return N(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},j=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},I=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),A=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var E={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const T=(0,d.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:o,...i},l)=>(0,d.createElement)("svg",{ref:l,...E,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:I("lucide",a),...!s&&!A(i)&&{"aria-hidden":"true"},...i},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(s)?s:[s]])),R=(e,t)=>{const n=(0,d.forwardRef)(({className:n,...r},a)=>{return(0,d.createElement)(T,{ref:a,iconNode:t,className:I(`lucide-${s=j(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var s});return n.displayName=j(e),n},D=R("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),P=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),L="-",U=[],O=e=>{const t=z(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return _(e);const n=e.split(L),r=""===n[0]&&n.length>1?1:0;return M(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],a=n[e];return t?a?((e,t)=>{const n=new Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(a,t):t:a||U}return n[e]||U}}},M=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],a=n.nextPart.get(r);if(a){const n=M(e,t+1,a);if(n)return n}const s=n.validators;if(null===s)return;const o=0===t?e.join(L):e.slice(t).join(L),i=s.length;for(let e=0;e<i;e++){const t=s[e];if(t.validator(o))return t.classGroupId}},_=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),z=e=>{const{theme:t,classGroups:n}=e;return F(n,t)},F=(e,t)=>{const n=P();for(const r in e){const a=e[r];V(a,n,r,t)}return n},V=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];H(a,t,n,r)}},H=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?G(e,t,n,r):B(e,t,n,r):$(e,t,n)},$=(e,t,n)=>{(""===e?t:K(t,e)).classGroupId=n},B=(e,t,n,r)=>{q(e)?V(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},G=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,o]=a[e];V(o,K(t,s),n,r)}},K=(e,t)=>{let n=e;const r=t.split(L),a=r.length;for(let e=0;e<a;e++){const t=r[e];let a=n.nextPart.get(t);a||(a=P(),n.nextPart.set(t,a)),n=a}return n},q=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,W=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in n?n[e]=t:a(e,t)}}},Y=[],J=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),Z=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,a=0,s=0;const o=e.length;for(let i=0;i<o;i++){const o=e[i];if(0===r&&0===a){if(":"===o){t.push(e.slice(s,i)),s=i+1;continue}if("/"===o){n=i;continue}}"["===o?r++:"]"===o?r--:"("===o?a++:")"===o&&a--}const i=0===t.length?e:e.slice(s);let l=i,d=!1;i.endsWith("!")?(l=i.slice(0,-1),d=!0):i.startsWith("!")&&(l=i.slice(1),d=!0);return J(t,d,l,n&&n>s?n-s:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):J(Y,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},X=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let a=0;a<e.length;a++){const s=e[a],o="["===s[0],i=t.has(s);o||i?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(s)):r.push(s)}return r.length>0&&(r.sort(),n.push(...r)),n}},Q=/\s+/,ee=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ee(e[r]))&&(n&&(n+=" "),n+=t);return n},te=(e,...t)=>{let n,r,a,s;const o=e=>{const t=r(e);if(t)return t;const s=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],i=e.trim().split(Q);let l="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:d,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:p}=n(t);if(d){l=t+(l.length>0?" "+l:l);continue}let h=!!p,g=r(h?m.substring(0,p):m);if(!g){if(!h){l=t+(l.length>0?" "+l:l);continue}if(g=r(m),!g){l=t+(l.length>0?" "+l:l);continue}h=!1}const b=0===c.length?"":1===c.length?c[0]:s(c).join(":"),f=u?b+"!":b,w=f+g;if(o.indexOf(w)>-1)continue;o.push(w);const y=a(g,h);for(let e=0;e<y.length;++e){const t=y[e];o.push(f+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return a(e,s),s};return s=i=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:W(e.cacheSize),parseClassName:Z(e),sortModifiers:X(e),...O(e)}))(l),r=n.cache.get,a=n.cache.set,s=o,o(i)},(...e)=>s(((...e)=>{let t,n,r=0,a="";for(;r<e.length;)(t=e[r++])&&(n=ee(t))&&(a&&(a+=" "),a+=n);return a})(...e))},ne=[],re=e=>{const t=t=>t[e]||ne;return t.isThemeGetter=!0,t},ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,se=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oe=/^\d+\/\d+$/,ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,de=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ue=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>oe.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),he=e=>!!e&&Number.isInteger(Number(e)),ge=e=>e.endsWith("%")&&pe(e.slice(0,-1)),be=e=>ie.test(e),fe=()=>!0,we=e=>le.test(e)&&!de.test(e),ye=()=>!1,xe=e=>ce.test(e),ve=e=>ue.test(e),ke=e=>!Ne(e)&&!Te(e),Ce=e=>Me(e,Ve,ye),Ne=e=>ae.test(e),Se=e=>Me(e,He,we),je=e=>Me(e,$e,pe),Ie=e=>Me(e,ze,ye),Ae=e=>Me(e,Fe,ve),Ee=e=>Me(e,Ge,xe),Te=e=>se.test(e),Re=e=>_e(e,He),De=e=>_e(e,Be),Pe=e=>_e(e,ze),Le=e=>_e(e,Ve),Ue=e=>_e(e,Fe),Oe=e=>_e(e,Ge,!0),Me=(e,t,n)=>{const r=ae.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},_e=(e,t,n=!1)=>{const r=se.exec(e);return!!r&&(r[1]?t(r[1]):n)},ze=e=>"position"===e||"percentage"===e,Fe=e=>"image"===e||"url"===e,Ve=e=>"length"===e||"size"===e||"bg-size"===e,He=e=>"length"===e,$e=e=>"number"===e,Be=e=>"family-name"===e,Ge=e=>"shadow"===e,Ke=(Symbol.toStringTag,()=>{const e=re("color"),t=re("font"),n=re("text"),r=re("font-weight"),a=re("tracking"),s=re("leading"),o=re("breakpoint"),i=re("container"),l=re("spacing"),d=re("radius"),c=re("shadow"),u=re("inset-shadow"),m=re("text-shadow"),p=re("drop-shadow"),h=re("blur"),g=re("perspective"),b=re("aspect"),f=re("ease"),w=re("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Te,Ne],x=()=>[Te,Ne,l],v=()=>[me,"full","auto",...x()],k=()=>[he,"none","subgrid",Te,Ne],C=()=>["auto",{span:["full",he,Te,Ne]},he,Te,Ne],N=()=>[he,"auto",Te,Ne],S=()=>["auto","min","max","fr",Te,Ne],j=()=>["auto",...x()],I=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],A=()=>[e,Te,Ne],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Pe,Ie,{position:[Te,Ne]}],T=()=>["auto","cover","contain",Le,Ce,{size:[Te,Ne]}],R=()=>[ge,Re,Se],D=()=>["","none","full",d,Te,Ne],P=()=>["",pe,Re,Se],L=()=>[pe,ge,Pe,Ie],U=()=>["","none",h,Te,Ne],O=()=>["none",pe,Te,Ne],M=()=>["none",pe,Te,Ne],_=()=>[pe,Te,Ne],z=()=>[me,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[be],breakpoint:[be],color:[fe],container:[be],"drop-shadow":[be],ease:["in","out","in-out"],font:[ke],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[be],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[be],shadow:[be],spacing:["px",pe],text:[be],"text-shadow":[be],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,Ne,Te,b]}],container:["container"],columns:[{columns:[pe,Ne,Te,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:v()}],"inset-x":[{"inset-x":v()}],"inset-y":[{"inset-y":v()}],start:[{start:v()}],end:[{end:v()}],top:[{top:v()}],right:[{right:v()}],bottom:[{bottom:v()}],left:[{left:v()}],visibility:["visible","invisible","collapse"],z:[{z:[he,"auto",Te,Ne]}],basis:[{basis:[me,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,me,"auto","initial","none",Ne]}],grow:[{grow:["",pe,Te,Ne]}],shrink:[{shrink:["",pe,Te,Ne]}],order:[{order:[he,"first","last","none",Te,Ne]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":S()}],"auto-rows":[{"auto-rows":S()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[i,"screen",...I()]}],"min-w":[{"min-w":[i,"screen","none",...I()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Re,Se]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Te,je]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ge,Ne]}],"font-family":[{font:[De,Ne,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Te,Ne]}],"line-clamp":[{"line-clamp":[pe,"none",Te,je]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",Te,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",Te,Se]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[pe,"auto",Te,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:E()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},he,Te,Ne],radial:["",Te,Ne],conic:[he,Te,Ne]},Ue,Ae]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[pe,Te,Ne]}],"outline-w":[{outline:["",pe,Re,Se]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",c,Oe,Ee]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",u,Oe,Ee]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[pe,Se]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",m,Oe,Ee]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[pe,Te,Ne]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Te,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:E()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ne]}],filter:[{filter:["","none",Te,Ne]}],blur:[{blur:U()}],brightness:[{brightness:[pe,Te,Ne]}],contrast:[{contrast:[pe,Te,Ne]}],"drop-shadow":[{"drop-shadow":["","none",p,Oe,Ee]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",pe,Te,Ne]}],"hue-rotate":[{"hue-rotate":[pe,Te,Ne]}],invert:[{invert:["",pe,Te,Ne]}],saturate:[{saturate:[pe,Te,Ne]}],sepia:[{sepia:["",pe,Te,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ne]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[pe,Te,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[pe,Te,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,Te,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,Te,Ne]}],"backdrop-invert":[{"backdrop-invert":["",pe,Te,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[pe,Te,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[pe,Te,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,Te,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",Te,Ne]}],ease:[{ease:["linear","initial",f,Te,Ne]}],delay:[{delay:[pe,Te,Ne]}],animate:[{animate:["none",w,Te,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Te,Ne]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:M()}],"scale-x":[{"scale-x":M()}],"scale-y":[{"scale-y":M()}],"scale-z":[{"scale-z":M()}],"scale-3d":["scale-3d"],skew:[{skew:_()}],"skew-x":[{"skew-x":_()}],"skew-y":[{"skew-y":_()}],transform:[{transform:[Te,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te,Ne]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[pe,Re,Se,je]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),qe=te(Ke);function We(...e){return qe(k(e))}const Ye=S("inline-flex items-center justify-center whitespace-nowrap rounded-xl text-base font-semibold ring-offset-white dark:ring-offset-slate-950 transition-all duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 dark:focus-visible:ring-slate-300 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:bg-slate-900/20 disabled:text-slate-900/50 active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-white hover:opacity-90 shadow-lg",destructive:"bg-red-500 text-white hover:bg-red-600 shadow-sm dark:bg-red-900 dark:hover:bg-red-800",outline:"border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 hover:border-gray-400 dark:hover:border-slate-500",secondary:"bg-gray-100 dark:bg-slate-700 text-gray-900 dark:text-white hover:bg-gray-200 dark:hover:bg-slate-600",ghost:"hover:bg-gray-100 dark:hover:bg-slate-800 hover:text-gray-900 dark:hover:text-white",link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline"},size:{default:"h-12 px-4 py-3",sm:"h-9 px-3 text-sm",lg:"h-14 px-6 py-4 text-lg",icon:"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}}),Je=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,isLoading:a,loadingText:s,children:o,disabled:i,...d},c)=>{const u=r?f:"button";return(0,l.jsx)(u,{className:We(Ye({variant:t,size:n,className:e})),ref:c,disabled:i||a,"aria-busy":a,...d,children:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(D,{className:"mr-2 h-4 w-4 animate-spin"}),(0,l.jsx)("span",{children:s||("string"==typeof o?"Loading...":o)})]}):o})});Je.displayName="Button";const Ze=d.forwardRef(({className:e,type:t,...n},r)=>(0,l.jsx)("input",{type:t,className:We("flex h-11 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-base text-gray-900 placeholder:text-gray-400 focus:border-black focus:outline-none focus:ring-2 focus:ring-gray-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 transition-colors","-webkit-appearance-none appearance-none",e),ref:r,...n}));Ze.displayName="Input";const Xe=S("rounded-xl overflow-hidden mb-4",{variants:{variant:{default:"bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 shadow-sm",flat:"bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700",transparent:"bg-transparent border-none shadow-none"}},defaultVariants:{variant:"default"}}),Qe=d.forwardRef(({className:e,variant:t,...n},r)=>(0,l.jsx)("div",{ref:r,className:We(Xe({variant:t}),e),...n}));Qe.displayName="Card";const et=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("flex flex-col space-y-1.5 p-4",e),...t}));et.displayName="CardHeader";const tt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("h3",{ref:n,className:We("text-lg font-semibold leading-none tracking-tight text-gray-900 dark:text-white",e),...t}));tt.displayName="CardTitle";const nt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("p",{ref:n,className:We("text-sm text-gray-500 dark:text-slate-400",e),...t}));nt.displayName="CardDescription";const rt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("p-4 pt-0",e),...t}));rt.displayName="CardContent";const at=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)("div",{ref:n,className:We("flex items-center p-4 pt-0",e),...t}));at.displayName="CardFooter";o(3);var st=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=b(`Primitive.${t}`),r=d.forwardRef((e,r)=>{const{asChild:a,...s}=e,o=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,l.jsx)(o,{...s,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var ot=d.forwardRef((e,t)=>(0,l.jsx)(st.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ot.displayName="Label";var it=ot;const lt=S("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-gray-700"),dt=d.forwardRef(({className:e,...t},n)=>(0,l.jsx)(it,{ref:n,className:We(lt(),e),...t}));dt.displayName=it.displayName;var ct="horizontal",ut=["horizontal","vertical"],mt=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=ct,...a}=e,s=function(e){return ut.includes(e)}(r)?r:ct,o=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return(0,l.jsx)(st.div,{"data-orientation":s,...o,...a,ref:t})});mt.displayName="Separator";var pt=mt;const ht=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>(0,l.jsx)(pt,{ref:a,decorative:n,orientation:t,className:We("shrink-0 bg-gray-200","horizontal"===t?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ht.displayName=pt.displayName;const gt=R("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),bt=R("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ft=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"}];function wt(e,t="US"){const n=e.replace(/\D/g,"");if("US"===t||"CA"===t){const e=n.startsWith("1")&&n.length>10?n.slice(1):n;return 0===e.length?"":e.length<=3?`(${e}`:e.length<=6?`(${e.slice(0,3)}) ${e.slice(3)}`:`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6,10)}`}return n}const yt=d.forwardRef(({className:e,value:t,onChange:n,countryCode:r="US",onCountryChange:a,...s},o)=>{const[i,c]=(0,d.useState)(!1),u=(0,d.useRef)(null),m=ft.find(e=>e.code===r)||ft[0],p=wt(t||"",r);(0,d.useEffect)(()=>{if(!i)return;const e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);const h="US"===r||"CA"===r?"(555) 000-0000":"Phone number";return(0,l.jsxs)("div",{className:"relative",ref:u,children:[(0,l.jsxs)("div",{className:We("flex items-center h-14 bg-white dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-xl overflow-hidden transition-all duration-150","focus-within:ring-2 focus-within:ring-slate-900 focus-within:ring-offset-0",e),children:[(0,l.jsxs)("button",{type:"button",onClick:()=>c(!i),className:"flex items-center gap-1.5 px-3 h-full bg-gray-50 dark:bg-slate-900 border-r border-gray-200 dark:border-slate-700 cursor-pointer hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors","aria-label":"Select country code","aria-expanded":i,children:[(0,l.jsx)("span",{className:"text-xl",children:m.flag}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:m.dial}),(0,l.jsx)(gt,{className:We("w-3.5 h-3.5 text-gray-400 transition-transform",i&&"rotate-180")})]}),(0,l.jsx)("input",{ref:o,type:"tel",inputMode:"tel",autoComplete:"tel",value:p,onChange:e=>{if(n){const t=wt(e.target.value,r);n(t)}},className:We("flex-1 h-full px-3 border-0 outline-none","text-lg font-normal tracking-wide text-gray-900 dark:text-white","placeholder:text-gray-400 dark:placeholder:text-slate-500 placeholder:font-light","bg-transparent"),placeholder:h,...s}),(0,l.jsx)("div",{className:"px-3",children:(0,l.jsx)(bt,{className:"w-4 h-4 text-gray-400 dark:text-slate-500"})})]}),i&&(0,l.jsx)("div",{className:"absolute top-full left-0 mt-1 w-64 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-xl shadow-lg z-50 max-h-60 overflow-y-auto",children:ft.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>{return t=e.code,a?.(t),c(!1),void(t!==r&&n&&n(""));var t},className:We("w-full px-3 py-2.5 flex items-center gap-3 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors text-left",e.code===r&&"bg-gray-50 dark:bg-slate-700"),children:[(0,l.jsx)("span",{className:"text-xl",children:e.flag}),(0,l.jsx)("span",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e.name}),(0,l.jsx)("span",{className:"text-sm text-gray-500 dark:text-slate-400",children:e.dial})]},e.code))})]})});yt.displayName="PhoneInput";const xt=d.forwardRef(({value:e="",onChange:t,onComplete:n,length:r=6,className:a},s)=>{const o=d.useRef([]),[i,c]=d.useState(e.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r));d.useEffect(()=>{const t=e.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r);c(t)},[e,r]);return(0,l.jsx)("div",{ref:s,className:We("flex gap-2 justify-center",a),onPaste:e=>{e.preventDefault();const a=e.clipboardData.getData("text").slice(0,r).replace(/\D/g,"");if(a){const e=a.split("").concat(Array(r).fill("")).slice(0,r);c(e),t?.(a);const s=Math.min(a.length,r-1);o.current[s]?.focus(),a.length===r&&n?.(a)}},children:Array.from({length:r},(e,a)=>(0,l.jsx)("input",{ref:e=>o.current[a]=e,type:"text",inputMode:"numeric",maxLength:1,value:i[a]||"",onChange:e=>((e,a)=>{if(a.length>1&&(a=a.slice(-1)),!/^\d*$/.test(a))return;const s=[...i];s[e]=a,c(s);const l=s.join("");t?.(l),a&&e<r-1&&o.current[e+1]?.focus(),s.every(e=>e)&&l.length===r&&n?.(l)})(a,e.target.value),onKeyDown:e=>((e,n)=>{if("Backspace"===n.key){n.preventDefault();const r=[...i];i[e]?(r[e]="",c(r),t?.(r.join(""))):e>0&&(r[e-1]="",c(r),t?.(r.join("")),o.current[e-1]?.focus())}"ArrowLeft"===n.key&&e>0&&o.current[e-1]?.focus(),"ArrowRight"===n.key&&e<r-1&&o.current[e+1]?.focus()})(a,e),onFocus:()=>(e=>{o.current[e]?.select()})(a),className:We("w-12 h-14 text-center text-2xl font-bold","border-2 border-gray-300 dark:border-slate-600 rounded-md","bg-white dark:bg-slate-800","text-gray-900 dark:text-white","focus:ring-2 focus:ring-black dark:focus:ring-white focus:border-transparent focus:outline-none","transition-all duration-150"),"aria-label":`Digit ${a+1} of ${r}`},a))})});xt.displayName="OTPInput";const vt=R("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function kt(e,t){const n=e.replace(/\D/g,"");return"US"===t||"CA"===t?10===n.length||11===n.length:n.length>=7&&n.length<=15}const Ct=({phone:e,onPhoneChange:t,countryCode:n="US",onCountryChange:r,onSubmit:a,isLoading:s=!1,error:o})=>{const i=kt(e,n);return(0,l.jsx)("form",{onSubmit:e=>{e.preventDefault(),a()},className:"space-y-4",children:(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center tracking-tight mx-auto",children:"Complete your purchase"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center mx-auto",children:"Verify your mobile number to secure this payment."})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(yt,{value:e,onChange:t,countryCode:n,onCountryChange:r,onKeyDown:e=>{"Enter"===e.key&&i&&!s&&a()},autoFocus:!0}),o&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 mt-2",children:o})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!i||s,isLoading:s,loadingText:"Sending code...",children:"Continue"})]})})};Ct.displayName="IdentityView";const Nt=R("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),St=R("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),jt=({phone:e,onContinue:t,onSwitchAccount:n,isLoading:r=!1})=>(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),t()},className:"space-y-4",children:[(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center",children:"Welcome back!"}),(0,l.jsxs)("div",{className:"w-full bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-xl p-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex-shrink-0 bg-gray-100 dark:bg-slate-700 rounded-full p-1",children:(0,l.jsx)(Nt,{className:"w-5 h-5 text-gray-500 dark:text-slate-400"})}),(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)("p",{className:"text-lg font-semibold text-slate-900 dark:text-white truncate",children:e})}),(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)(St,{className:"w-5 h-5 text-green-500 dark:text-green-400"})})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full mt-4",disabled:r,isLoading:r,loadingText:"Sending code...",children:"Send Verification Code"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 dark:text-slate-500 text-center mt-4",children:"We'll send you a verification code to confirm it's you"})]}),(0,l.jsx)("div",{className:"text-center px-4 mt-4",children:(0,l.jsx)("button",{type:"button",onClick:n,disabled:r,className:"text-sm text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50",children:"Not you? Use a different number"})})]});jt.displayName="WelcomeBackView";const It=R("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),At=({amount:e,label:t="Total",onClick:n,isExpanded:r=!1,showChevron:a=!1,showIcon:s=!1,className:o=""})=>{const i=!!n,d=We("border rounded-lg px-3 py-2 flex items-center gap-2 transition-colors","bg-gray-50/50 dark:bg-slate-800/50 border-gray-200 dark:border-slate-700",i&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-slate-700",i&&"text-slate-700 dark:text-slate-300 hover:text-black dark:hover:text-white",!i&&"bg-gray-50 dark:bg-slate-800",o),c=(0,l.jsxs)(l.Fragment,{children:[s&&i&&(0,l.jsx)(It,{className:"w-4 h-4 text-gray-500 dark:text-slate-400"}),(0,l.jsx)("span",{className:"text-xs font-medium text-gray-500 dark:text-slate-400",children:t}),(0,l.jsx)("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:e}),a&&i&&(0,l.jsx)(gt,{className:We("w-4 h-4 text-gray-400 dark:text-slate-500 transition-transform duration-200",r&&"rotate-180")})]});return i?(0,l.jsx)("button",{type:"button",onClick:n,className:d,"aria-expanded":r,"aria-label":(r?"Hide":"Show")+" order details",children:c}):(0,l.jsx)("div",{className:d,children:c})};At.displayName="PriceTag";const Et=R("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),Tt=({items:e,subtotal:t,shipping:n,tax:r,agentFee:a,total:s,isAgentMode:o=!1})=>(0,l.jsx)("div",{className:"bg-gray-50 dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700",children:(0,l.jsxs)("div",{className:"px-6 py-4 space-y-3",children:[o&&(0,l.jsxs)("div",{className:"flex items-center gap-2 pb-2 border-b border-gray-200 dark:border-slate-700",children:[(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-violet-100 text-violet-700 text-xs font-medium dark:bg-violet-900/30 dark:text-violet-300",children:[(0,l.jsx)(Et,{className:"h-3 w-3"}),"Agent"]}),(0,l.jsx)("span",{className:"text-xs text-gray-600 dark:text-slate-400",children:"AI Agent Purchase"})]}),e&&e.length>0&&(0,l.jsxs)("div",{className:"space-y-2",children:[e.map((e,t)=>(0,l.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-sm text-slate-900 dark:text-white truncate",children:e.label}),e.description&&(0,l.jsx)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:e.description})]}),(0,l.jsx)("div",{className:"text-sm font-medium text-slate-900 dark:text-white whitespace-nowrap",children:e.value})]},t)),(0,l.jsx)("div",{className:"h-px bg-gray-200 dark:bg-slate-700"})]}),(0,l.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Subtotal"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:t})]}),n&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Shipping"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:n})]}),r&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-gray-600 dark:text-slate-400",children:"Tax"}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:r})]}),a&&o&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:["Agent Fee",(0,l.jsx)(Et,{className:"h-3 w-3 text-violet-500"})]}),(0,l.jsx)("span",{className:"font-medium text-slate-900 dark:text-white",children:a})]})]}),(0,l.jsx)("div",{className:"pt-2 border-t border-gray-200 dark:border-slate-700",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:"Total"}),(0,l.jsx)("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:s})]})})]})});Tt.displayName="ReceiptPanel";const Rt=R("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Dt=d.forwardRef(({className:e},t)=>(0,l.jsxs)("div",{ref:t,className:We("flex items-center justify-center gap-1.5 text-xs text-gray-500 dark:text-slate-400",e),children:[(0,l.jsx)(Rt,{className:"w-3.5 h-3.5"}),(0,l.jsx)("span",{children:"Powered by PayOS"})]}));function Pt(e,t={}){const{preventTouch:n=!1}=t;d.useEffect(()=>{if(!e)return;const t=document.body.style.overflow,r=document.body.style.position,a=document.body.style.top,s=document.body.style.width,o=document.body.style.touchAction,i=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${i}px`,document.body.style.width="100%",n&&(document.body.style.touchAction="none"),()=>{document.body.style.overflow=t,document.body.style.position=r,document.body.style.top=a,document.body.style.width=s,document.body.style.touchAction=o,window.scrollTo(0,i)}},[e,n])}Dt.displayName="PayOSFooter";const Lt=450;function Ut(){const[e,t]=d.useState(0);return d.useEffect(()=>{if("undefined"==typeof window||!window.visualViewport)return;const e=window.visualViewport,n=()=>{const n=window.innerHeight-e.height;t(Math.max(0,n));const r=e.height;r<Lt?document.documentElement.style.setProperty("--visual-viewport-height",.85*window.innerHeight+"px"):document.documentElement.style.setProperty("--visual-viewport-height",`${r}px`)};return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),document.documentElement.style.removeProperty("--visual-viewport-height")}},[]),e}function Ot(){const e=Ut();return d.useMemo(()=>({bottom:e>0?`${e}px`:void 0}),[e])}const Mt=d.forwardRef(({open:e=!1,onClose:t,title:n,subtitle:r,amount:a,orderItems:s,subtotal:o,shipping:i,tax:c,orderAgentFee:u,mode:m="standard",children:p,className:h,prefill:g,onPhoneSubmit:b,onContinue:f},w)=>{const[y,x]=d.useState(g?.phone?"welcome-back":"identity"),[v,k]=d.useState(""),[C,N]=d.useState(!1),[S,j]=d.useState(!1);Pt(e),Ut(),d.useEffect(()=>{x(g?.phone?"welcome-back":"identity")},[g?.phone]),d.useEffect(()=>{const n=n=>{"Escape"===n.key&&e&&t&&t()};return e&&document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t]);const I=async()=>{if(b){N(!0);try{await b(v)}finally{N(!1)}}},A=async()=>{if(f){N(!0);try{await f()}finally{N(!1)}}},E=()=>{x("identity"),k("")};if(!e)return null;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 bg-black/40 dark:bg-black/60 z-[9998] animate-in fade-in duration-200",onClick:t,"aria-hidden":"true"}),(0,l.jsxs)("div",{ref:w,className:We("fixed z-[9999] flex flex-col shadow-2xl","left-0 right-0 bottom-0 w-full max-w-[480px] mx-auto","h-auto rounded-t-2xl max-h-[90vh]","animate-in slide-in-from-bottom duration-300","md:top-0 md:bottom-0 md:right-0 md:left-auto","md:w-[480px] md:max-w-none md:h-full","md:rounded-none md:border-l md:max-h-none","md:animate-in md:slide-in-from-right","bg-gray-50 dark:bg-slate-900","md:border-gray-200 md:dark:border-slate-800","overscroll-y-contain",h),style:{maxHeight:"var(--visual-viewport-height, 90vh)"},role:"dialog","aria-modal":"true","aria-labelledby":n?"drawer-title":void 0,children:[(0,l.jsx)("div",{className:"flex justify-center pt-3 pb-2 md:hidden",children:(0,l.jsx)("div",{className:"w-10 h-1 bg-gray-300 dark:bg-slate-700 rounded-full"})}),(n||r||a||t)&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-slate-800",children:[n&&(0,l.jsx)("h2",{id:"drawer-title",className:"text-lg font-bold text-gray-900 dark:text-white",children:n}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[a&&s&&(0,l.jsx)(At,{amount:a,onClick:()=>j(!S),isExpanded:S,showChevron:!0,showIcon:!0}),a&&!s&&(0,l.jsx)(At,{amount:a}),!a&&r&&(0,l.jsx)("div",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r}),t&&(0,l.jsx)("button",{onClick:t,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors active:scale-95","aria-label":"Close drawer",children:(0,l.jsx)(vt,{className:"w-5 h-5 text-gray-600 dark:text-slate-400"})})]})]}),S&&a&&s&&(0,l.jsx)(Tt,{items:s,subtotal:o||a,shipping:i,tax:c,agentFee:u,total:a,isAgentMode:"agent"===m}),(0,l.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto overscroll-y-contain px-6 pt-6 pb-8",children:p||("welcome-back"===y&&g?.phone?(0,l.jsx)(jt,{phone:g.phone,onContinue:A,onSwitchAccount:E,isLoading:C}):(0,l.jsx)(Ct,{phone:v,onPhoneChange:k,onSubmit:I,isLoading:C}))}),(0,l.jsx)(Dt,{className:"px-6 pb-6"})]})]})});Mt.displayName="PayOSDrawer";const _t=R("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),zt=({brand:e,size:t="md",className:n=""})=>{const r="sm"===t?"h-4":"h-5";return"visa"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("path",{d:"M18.5 0L15.2 15.8H11.7L15 0H18.5Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M32.5 10.3L34.2 5.4L35.3 10.3H32.5ZM36.8 15.8H40L37.1 0H34.1C33.4 0 32.8 0.4 32.5 1L27 15.8H30.8L31.6 13.5H36.3L36.8 15.8Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M13.2 10.7L13.6 8.3L12.5 7.9C11.7 7.6 10.3 7.2 10.3 6.2C10.3 5.4 11.1 4.6 12.7 4.6C13.9 4.6 14.8 4.9 15.5 5.2L16 2.6C15.3 2.3 14.2 2 12.8 2C9.2 2 6.6 4 6.6 6.8C6.6 8.9 8.4 10 9.7 10.7C11.1 11.4 11.6 11.9 11.6 12.5C11.6 13.5 10.4 14 9.3 14C7.7 14 6.8 13.7 5.6 13.2L5.1 15.9C6 16.3 7.6 16.7 9.3 16.7C13.2 16.7 15.7 14.8 15.7 11.8C15.7 10.2 14.7 9.1 13.2 10.7Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M26 0L22.9 11L22.7 10C21.9 7.8 19.6 5.4 17 4.2L20.1 15.8H24L29.8 0H26Z",fill:"#1434CB"}),(0,l.jsx)("path",{d:"M20.5 0H15.8L15.7 0.3C20.1 1.5 23 4.3 24.2 7.9L22.8 1.2C22.6 0.5 22 0 21.3 0H20.5Z",fill:"#FCA121"})]}):"mastercard"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 32",fill:"none",children:[(0,l.jsx)("circle",{cx:"18",cy:"16",r:"14",fill:"#EB001B"}),(0,l.jsx)("circle",{cx:"30",cy:"16",r:"14",fill:"#F79E1B"}),(0,l.jsx)("path",{d:"M24 6C26.2 7.6 27.7 10.2 28 13H20C20.3 10.2 21.8 7.6 24 6ZM24 26C21.8 24.4 20.3 21.8 20 19H28C27.7 21.8 26.2 24.4 24 26Z",fill:"#FF5F00"})]}):"amex"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"16",rx:"2",fill:"#006FCF"}),(0,l.jsx)("path",{d:"M10 5H8L6 11H8L10 5Z",fill:"white"}),(0,l.jsx)("path",{d:"M15 5L13 8L11 5H9L12 11H14L17 5H15Z",fill:"white"}),(0,l.jsx)("path",{d:"M22 5H18V11H22C23.7 11 25 9.7 25 8C25 6.3 23.7 5 22 5Z",fill:"white"})]}):"discover"===e?(0,l.jsxs)("svg",{className:`${r} ${n}`,viewBox:"0 0 48 16",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"16",rx:"2",fill:"#FF6000"}),(0,l.jsx)("path",{d:"M8 5H6V11H8V5Z",fill:"white"}),(0,l.jsx)("path",{d:"M14 5H10V11H14C15.7 11 17 9.7 17 8C17 6.3 15.7 5 14 5Z",fill:"white"})]}):null},Ft=({last4:e,brand:t,expiry:n,cardArtUrl:r,issuerName:a,selected:s=!1,onClick:o,isLast:i=!1})=>(0,l.jsxs)("div",{onClick:o,className:`\n w-full p-4 flex items-center justify-between bg-white\n ${i?"":"border-b border-gray-100"}\n ${o?"hover:bg-gray-50 cursor-pointer active:bg-gray-100 transition-colors":""}\n `,role:o?"button":void 0,tabIndex:o?0:void 0,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[r?(0,l.jsx)("img",{src:r,alt:`${t} card`,className:"w-10 h-6 object-cover rounded-md flex-shrink-0"}):(0,l.jsx)(zt,{brand:t,className:"flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:[a&&a.toLowerCase()!==t.toLowerCase()?`${a} `:"",t.charAt(0).toUpperCase()+t.slice(1)," •••• ",e]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Expires ",n]})]})]}),s&&(0,l.jsx)(_t,{className:"w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0"})]});Ft.displayName="PaymentMethodRow";const Vt=({card:e,cvc:t,onCvcChange:n,onChangeClick:r,error:a,disabled:s=!1,hideSecurityCode:o=!1})=>{const i="amex"===e.brand?4:3,d=function(e,t){const n=e.replace(/\D/g,"");return"amex"===t?4===n.length:3===n.length}(t);return(0,l.jsxs)("div",{className:"w-full bg-white border border-gray-200 dark:border-slate-700 rounded-xl overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"p-4 flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[e.cardArtUrl?(0,l.jsx)("img",{src:e.cardArtUrl,alt:`${e.brand} card`,className:"w-10 h-6 object-contain rounded flex-shrink-0"}):(0,l.jsx)(zt,{brand:e.brand,className:"flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:[e.brand.charAt(0).toUpperCase()+e.brand.slice(1)," •••• ",e.last4]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Expires ",e.expiryMonth,"/",e.expiryYear]})]})]}),(0,l.jsx)("button",{type:"button",onClick:r,disabled:s,className:"text-sm font-medium text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50 disabled:no-underline",children:"Change"})]}),!o&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"border-b border-gray-100 dark:border-slate-700"}),(0,l.jsxs)("div",{className:"p-4 bg-gray-50/50 dark:bg-slate-800/50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{htmlFor:"cvc-input",className:"text-sm font-medium text-slate-900 dark:text-white",children:"Security Code"}),(0,l.jsx)("input",{id:"cvc-input",type:"text",inputMode:"numeric",value:t,onChange:t=>{const r=t.target.value.replace(/\D/g,""),a="amex"===e.brand?4:3;r.length<=a&&n(r)},disabled:s,placeholder:4===i?"1234":"123",maxLength:i,className:`\n w-16 h-10 bg-white dark:bg-slate-900\n border rounded text-center font-bold text-base\n text-slate-900 dark:text-white\n placeholder-gray-400 dark:placeholder-slate-500\n outline-none transition-all shadow-sm\n disabled:opacity-50 disabled:cursor-not-allowed\n ${a?"border-red-500 dark:border-red-400":d?"border-green-500 dark:border-green-400":"border-gray-300 dark:border-slate-600 focus:border-black dark:focus:border-white"}\n `,"aria-label":"Card security code","aria-invalid":!!a,"aria-describedby":a?"cvc-error":void 0})]}),a&&(0,l.jsx)("p",{id:"cvc-error",className:"text-xs text-red-600 dark:text-red-400 mt-2 text-right",children:a}),!a&&(0,l.jsxs)("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2 text-right",children:[i,"-digit code on back of card"]})]})]})]})};Vt.displayName="ActiveCardWidget";const Ht=R("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),$t=({title:e,onBack:t,action:n})=>(0,l.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-gray-200 dark:border-slate-700 mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[t&&(0,l.jsx)("button",{onClick:t,className:"p-2 hover:bg-gray-100 dark:hover:bg-slate-800 rounded-lg active:scale-95 transition-all","aria-label":"Go back",children:(0,l.jsx)(Ht,{className:"w-5 h-5 text-gray-900 dark:text-white"})}),(0,l.jsx)("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:e})]}),n&&(0,l.jsx)("div",{className:"flex-shrink-0",children:n})]});$t.displayName="ViewHeader";const Bt=d.forwardRef(({total:e,items:t=[],isAgentMode:n=!1,agentFee:r,defaultExpanded:a=!1,className:s},o)=>{const[i,c]=d.useState(a);return(0,l.jsxs)(Qe,{ref:o,variant:"default",className:We("p-4 cursor-pointer select-none transition-all duration-200",n&&"border-indigo-100 dark:border-indigo-900 bg-indigo-50/50 dark:bg-indigo-950/30",s),onClick:()=>c(!i),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 dark:text-white",children:"Order Total"}),n&&(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-violet-100 text-violet-700 text-xs font-medium dark:bg-violet-900/30 dark:text-violet-300",children:[(0,l.jsx)(Et,{className:"h-3 w-3"}),"Agent"]})]}),n&&r&&(0,l.jsxs)("p",{className:"text-xs text-indigo-700 dark:text-indigo-400",children:["Agent Fee: ",r," • Standard Processing"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e}),(0,l.jsx)(gt,{className:We("w-5 h-5 text-gray-500 dark:text-slate-400 transition-transform duration-200",i&&"rotate-180")})]})]}),i&&t.length>0&&(0,l.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-slate-700 space-y-2",children:t.map((e,t)=>(0,l.jsxs)("div",{className:"flex justify-between items-start text-sm",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("span",{className:"text-gray-700 dark:text-slate-300",children:e.label}),e.description&&(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-500 mt-0.5",children:e.description})]}),(0,l.jsx)("span",{className:"font-medium text-gray-900 dark:text-white ml-4",children:e.value})]},t))})]})});Bt.displayName="OrderSummary";const Gt=({phoneNumber:e,otp:t,onOtpChange:n,onSubmit:r,onEdit:a,onResend:s,isLoading:o=!1,isResending:i=!1,error:d,resendCooldown:c=0,retryCount:u=0,maxRetries:m=3})=>{const p=u>=m,h=0===c&&!p,g=function(e){const t=e.replace(/\D/g,"");if(11===t.length&&t.startsWith("1"))return`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7,11)}`;if(10===t.length)return`+1 (${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6,10)}`;return e}(e);return(0,l.jsx)("form",{onSubmit:e=>{e.preventDefault(),r()},className:"space-y-4",children:(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center mb-2",children:"Enter verification code"}),(0,l.jsxs)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center mb-8",children:["Sent to"," ",(0,l.jsx)("span",{className:"font-medium text-gray-900 dark:text-white",children:g}),a&&(0,l.jsxs)(l.Fragment,{children:[" ","•"," ",(0,l.jsx)("button",{type:"button",onClick:a,className:"text-blue-600 dark:text-blue-400 hover:underline",children:"Edit"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(xt,{value:t,onChange:n,onComplete:e=>{n(e),setTimeout(()=>{r(e)},100)}}),d&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 mt-4 text-center",children:d})]}),(0,l.jsx)(Je,{type:"submit",className:"w-full mt-8",disabled:6!==t.length||o,isLoading:o,loadingText:"Verifying...",children:"Verify"}),s&&(0,l.jsx)("div",{className:"text-center mt-4",children:(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:p?(0,l.jsx)("span",{className:"text-red-600 dark:text-red-400",children:"Too many attempts. Please try again later."}):i?"Sending...":c>0?(0,l.jsxs)(l.Fragment,{children:["Resend in"," ",(0,l.jsxs)("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:[c,"s"]})]}):(0,l.jsxs)(l.Fragment,{children:["Didn't receive a code?"," ",(0,l.jsx)("button",{type:"button",onClick:s,disabled:!h||o,className:"font-bold text-slate-900 dark:text-white hover:underline cursor-pointer disabled:opacity-50",children:"Resend"})]})})})]})})};Gt.displayName="OTPView";const Kt=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e/100),qt=({selectedCard:e,cvc:t,onCvcChange:n,onChangeCard:r,paymentIntent:a,total:s,isAgentMode:o,onSubmit:i,isLoading:d=!1,error:c})=>{const u="amex"===e.brand?4:3,m=t.length===u,p=a?Kt(a.totalAmount+(a.facilitationFee?.amount||0),a.currency):s||"$0.00",h=a?"pay_on_behalf"===(g=a.type)||"agent_to_agent"===g||"agentic_multi"===g:o||!1;var g;const b=!!h||m,f=h?`Authorize ${p}`:`Pay ${p}`;return(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),i()},className:"space-y-6",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-slate-900 dark:text-white px-1 mt-6",children:"Payment Method"}),(0,l.jsx)(Vt,{card:e,cvc:t,onCvcChange:n,onChangeClick:r,disabled:d,error:c,hideSecurityCode:h})]}),h&&a?.facilitationFee&&(0,l.jsx)("div",{className:"p-3 bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-700 rounded-lg",children:(0,l.jsxs)("p",{className:"text-sm text-purple-800 dark:text-purple-200",children:["This is an agent-assisted transaction. A ",Kt(a.facilitationFee.amount,a.facilitationFee.currency)," facilitation fee applies."]})}),(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!b||d,isLoading:d,loadingText:"Processing...",children:f})]})};qt.displayName="CheckoutView";const Wt=R("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Yt=R("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Jt=({isOpen:e,title:t,message:n,confirmText:r="Confirm",cancelText:a="Cancel",onConfirm:s,onCancel:o,isLoading:i=!1,variant:d="default"})=>{if(!e)return null;return(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e=>{e.target!==e.currentTarget||i||o()},children:(0,l.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-xl max-w-sm w-full mx-4 overflow-hidden animate-in fade-in zoom-in-95 duration-200",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{className:"px-6 pt-6 pb-2",children:(0,l.jsx)("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:t})}),(0,l.jsx)("div",{className:"px-6 pb-6",children:(0,l.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:n})}),(0,l.jsxs)("div",{className:"px-6 pb-6 flex gap-3",children:[(0,l.jsx)(Je,{variant:"outline",className:"flex-1",onClick:o,disabled:i,children:a}),(0,l.jsx)(Je,{variant:"danger"===d?"destructive":"default",className:"flex-1",onClick:s,disabled:i,children:i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(D,{className:"w-4 h-4 mr-2 animate-spin"}),r]}):r})]})]})})};Jt.displayName="ConfirmDialog";const Zt=({cards:e,selectedCardId:t,onSelectCard:n,onAddNewCard:r,onBack:a,onDeleteCard:s})=>{const[o,i]=d.useState(null),[c,u]=d.useState(null),m=c?e.find(e=>e.id===c)?.last4:"";return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:"Payment Methods",onBack:a}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-xl overflow-hidden",children:[e.map(e=>(0,l.jsxs)("div",{className:"relative flex items-center",children:[(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(Ft,{last4:e.last4,brand:e.brand,expiry:`${e.expiryMonth}/${e.expiryYear}`,cardArtUrl:e.cardArtUrl,issuerName:e.issuerName,selected:t===e.id,onClick:()=>n(e.id),isLast:!1})}),s&&(0,l.jsx)("button",{onClick:t=>((e,t)=>{e.stopPropagation(),s&&u(t)})(t,e.id),disabled:o===e.id,className:"absolute right-4 p-2 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors disabled:opacity-50","aria-label":"Delete card",children:(0,l.jsx)(Wt,{className:"w-4 h-4 "+(o===e.id?"animate-pulse":"")})})]},e.id)),0===e.length&&(0,l.jsx)("div",{className:"p-4 text-center border-b border-gray-100 dark:border-slate-700",children:(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"No saved cards yet"})}),(0,l.jsxs)("div",{onClick:r,className:"w-full p-4 flex items-center gap-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-800 active:bg-gray-100 dark:active:bg-slate-700 transition-colors",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-lg bg-gray-100 dark:bg-slate-700 flex items-center justify-center flex-shrink-0",children:(0,l.jsx)(Yt,{className:"w-5 h-5 text-gray-600 dark:text-slate-400"})}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:"Add new card"})})]})]}),(0,l.jsx)(Jt,{isOpen:!!c,title:"Delete Card",message:`Are you sure you want to delete the card ending in ${m}? This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel",variant:"danger",onConfirm:async()=>{c&&s&&(i(c),await s(c),i(null),u(null))},onCancel:()=>u(null),isLoading:o===c})]})};Zt.displayName="MethodListView";const Xt=R("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Qt="1.0.0";class en{constructor(e,t){if(this.container=null,this.iframe=null,this.messageListener=null,this.iframeOrigin=null,this.options={environment:"sandbox",height:"720px",...t},this.validateOptions(),"string"==typeof e){if(this.container=document.querySelector(e),!this.container)throw new Error(`Container element not found: ${e}`)}else this.container=e}mount(){if(!this.container)throw new Error("Container element not found");this.unmount(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.height=this.options.height||"720px",this.iframe.style.border="none",this.iframe.style.borderRadius="12px",this.iframe.style.background="transparent",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),this.iframe.allow="payment *";const e=this.buildIframeUrl();this.iframeOrigin=(()=>{try{return new URL(e).origin}catch{return console.warn("[CardElementClient] Invalid iframe URL"),null}})(),this.messageListener=this.handleMessage.bind(this),window.addEventListener("message",this.messageListener),this.options.styles&&(this.iframe.onload=()=>{setTimeout(()=>{this.sendStyles(this.options.styles)},100)}),this.iframe.src=e,this.container.appendChild(this.iframe)}unmount(){this.iframe&&this.iframe.parentNode&&(this.iframe.parentNode.removeChild(this.iframe),this.iframe=null),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}destroy(){this.unmount(),this.container=null,this.options={}}configure(e){if(!this.iframe)return void console.error("[CardElementClient] Cannot configure: iframe not initialized");const t={source:"payos-sdk",type:"configure",data:e,version:Qt},n=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(t,n)}submit(){if(!this.iframe)return void console.error("[CardElementClient] Cannot submit: iframe not initialized");const e={source:"payos-sdk",type:"submit",version:Qt},t=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(e,t)}updateStyles(e){this.iframe?this.sendStyles(e):console.error("[CardElementClient] Cannot update styles: iframe not initialized")}sendStyles(e){if(!this.iframe)return;const t={source:"payos-sdk",type:"styles",data:e,version:Qt},n=this.iframeOrigin||new URL(this.getBaseUrl()).origin;this.iframe.contentWindow?.postMessage(t,n)}handleMessage(e){if(!this.isAllowedOrigin(e.origin))return;const{data:t}=e;if(!t||"object"!=typeof t)return;if("payos-card"!==t.source)return;const n=t;switch(n.type){case"ready":this.options.onReady?.();break;case"complete":n.data&&this.options.onTokenized&&this.options.onTokenized(n.data);break;case"change":n.data&&this.options.onChange&&this.options.onChange(n.data);break;case"cancel":this.options.onCancel?.();break;case"error":if(this.options.onError){const e=new Error(n.error||"Unknown error");this.options.onError(e)}}}isAllowedOrigin(e){return this.getAllowedOrigins().some(t=>t===e)}buildIframeUrl(){const e=this.getBaseUrl(),t=new URL(`${e}/card-element`);return t.searchParams.set("token",this.options.token),t.searchParams.set("domain",window.location.origin),t.searchParams.set("env",this.options.environment||"sandbox"),t.searchParams.set("version",Qt),t.searchParams.set("mode","iframe"),this.options.customParams&&Object.entries(this.options.customParams).forEach(([e,n])=>{t.searchParams.set(e,n)}),t.toString()}getBaseUrl(){return this.options.customBaseUrl?this.options.customBaseUrl.replace(/\/$/,""):"https://wallet-onboard.payos.ai"}getAllowedOrigins(){const e=new Set;this.iframeOrigin&&e.add(this.iframeOrigin);try{const t=this.getBaseUrl(),n=new URL(t).origin;e.add(n)}catch{}return e.add("https://wallet-onboard.payos.ai"),e.add("https://wallet-onboard-sandbox.payos.ai"),e.add("http://localhost:3000"),Array.from(e)}validateOptions(){if(!this.options.token)throw new Error("Token is required");if(this.options.environment&&!["sandbox","production"].includes(this.options.environment))throw new Error('Environment must be either "sandbox" or "production"')}}const tn=({linkToken:e,walletUserId:t,onSubmit:n,onBack:r,isLoading:a=!1,error:s,isFirstCard:o=!1,environment:i="sandbox",customBaseUrl:c,devApiUrl:u,shippingAddress:m})=>{const[p,h]=d.useState(null),[g,b]=d.useState(!1),[f,w]=d.useState(!1),y=m&&(m.line1||m.city||m.postalCode),x=d.useCallback(e=>{b(!1);const t={number:"",expiry:"",cvc:"",cardholderName:e.cardholderName||e.card?.cardholderName||"",brand:e.card?.brand,last4:e.card?.last4,cardArtUrl:e.card?.artwork,cardId:e.card?.id},r={line1:e.billingAddress?.street||"",line2:e.billingAddress?.street2||"",city:e.billingAddress?.city||"",state:e.billingAddress?.state||"",zip:e.billingAddress?.postalCode||"",country:e.billingAddress?.country||"US"};n(t,r)},[n]),v=d.useCallback(e=>{b(!1),h(e.message)},[]),{containerRef:k,isReady:C,isComplete:N,submit:S,configure:j}=function(e){const t=(0,d.useRef)(null),n=(0,d.useRef)(null),[r,a]=(0,d.useState)(!1),[s,o]=(0,d.useState)(!1),[i,l]=(0,d.useState)(!0),[c,u]=(0,d.useState)(void 0),m=(0,d.useRef)(e.onTokenized),p=(0,d.useRef)(e.onReady),h=(0,d.useRef)(e.onError),g=(0,d.useRef)(e.onChange),b=(0,d.useRef)(e.onCancel);(0,d.useEffect)(()=>{m.current=e.onTokenized,p.current=e.onReady,h.current=e.onError,g.current=e.onChange,b.current=e.onCancel},[e.onTokenized,e.onReady,e.onError,e.onChange,e.onCancel]),(0,d.useEffect)(()=>{const r=t.current;if(!r||!e.token)return;a(!1),o(!1),l(!0),u(void 0);const s={token:e.token,environment:e.environment||"sandbox",styles:e.styles,height:e.height,customBaseUrl:e.customBaseUrl,customParams:e.customParams,onReady:()=>{a(!0),p.current?.()},onTokenized:e=>{m.current?.(e)},onChange:e=>{o(e.complete),l(e.empty),u(e.error),g.current?.(e)},onCancel:()=>{b.current?.()},onError:e=>{u(e.message),h.current?.(e)}},i=new en(r,s);return i.mount(),n.current=i,()=>{i.unmount(),n.current=null}},[e.token,e.environment,e.height,e.customBaseUrl]);const f=(0,d.useCallback)(()=>{n.current?n.current.submit():console.warn("[useCardElement] Cannot submit: CardElement not initialized")},[]),w=(0,d.useCallback)(e=>{n.current?n.current.configure(e):console.warn("[useCardElement] Cannot configure: CardElement not initialized")},[]),y=(0,d.useCallback)(e=>{n.current?.updateStyles?n.current.updateStyles(e):console.warn("[useCardElement] Cannot update styles: CardElement not initialized")},[]);return{containerRef:t,isReady:r,isComplete:s,isEmpty:i,error:c,submit:f,configure:w,updateStyles:y}}({token:e,environment:i,customBaseUrl:c,height:"280px",styles:{layout:{padding:"0px",gap:"4px",labelPlacement:"above",showLabels:!1},container:{padding:"16px",margin:"0"}},customParams:u?{devApi:u}:void 0,onTokenized:x,onError:v,onChange:e=>{!e.empty&&p&&h(null)}});d.useEffect(()=>{if(C){const e={};t&&(e.walletUserId=t),y&&m&&(e.shippingAddress=m,e.useShippingAsBilling=f),Object.keys(e).length>0&&(console.log("[CardAddView] Configuring CardElement:",e),j(e))}},[C,t,y,m,f,j]);const I=s||p,A=a||g;return e?(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),!N||a||g||(h(null),b(!0),S())},className:"space-y-4",children:[(0,l.jsx)($t,{title:o?"Secure Checkout":"Add Card",onBack:o?void 0:r}),y&&(0,l.jsx)("div",{className:"w-full max-w-md mx-auto px-4",children:(0,l.jsxs)("button",{type:"button",onClick:()=>w(!f),className:"flex items-center gap-3 w-full text-left py-2",children:[(0,l.jsx)("div",{className:`\n w-5 h-5 rounded border-2 flex items-center justify-center transition-colors\n ${f?"bg-slate-900 border-slate-900 dark:bg-white dark:border-white":"border-gray-300 dark:border-slate-600"}\n `,children:f&&(0,l.jsx)(_t,{className:"w-3 h-3 text-white dark:text-slate-900"})}),(0,l.jsx)("span",{className:"text-sm text-slate-700 dark:text-slate-300",children:"Billing address same as shipping"})]})}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl overflow-hidden",children:[(0,l.jsxs)("div",{className:"relative",children:[!C&&(0,l.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-white dark:bg-slate-900 z-10 min-h-[280px]",children:[(0,l.jsx)(D,{className:"w-8 h-8 text-gray-400 animate-spin"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-3",children:"Loading secure form..."})]}),(0,l.jsx)("div",{ref:k,className:"min-h-[280px] w-full",style:{opacity:C?1:0}})]}),I&&(0,l.jsx)("div",{className:"px-6 pb-4",children:(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 text-center",children:I})}),(0,l.jsx)("div",{className:"px-6 pb-6",children:(0,l.jsx)(Je,{type:"submit",className:"w-full",disabled:!N||A,isLoading:A,loadingText:"Saving card...",children:"Save card"})})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:o?"Secure Checkout":"Add Card",onBack:o?void 0:r}),(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 space-y-4 text-center",children:[(0,l.jsx)(Xt,{className:"w-12 h-12 text-red-500"}),(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Session Error"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Unable to initialize secure card entry. Please try again."}),r&&(0,l.jsx)(Je,{variant:"outline",onClick:r,className:"mt-4",children:"Go Back"})]})})]})};tn.displayName="CardAddView";const nn=e=>"pay_on_behalf"===e||"agent_to_agent"===e||"agentic_multi"===e,rn=({paymentIntent:e,completionResult:t,walletUser:n,type:r,cardNetwork:a,mode:s,onCreatePasskey:o,onDismiss:i,isLoading:d=!1,passkeyEnrolled:c=!1})=>{const u=e?nn(e.type):"agent"===s,m=e?(e=>e&&nn(e.type)?"credential":"payment")(e):r||"payment",p=u?"Credentials Ready!":"payment"===m?"Payment Successful":"Card Added",h=u?t?.credentialId?`Credential ID: ${t.credentialId}`:"Your payment credentials have been generated and are ready for agent use.":t?.transactionId?`Transaction: ${t.transactionId}`:n?.email?`Confirmation sent to ${n.email}`:null,g=!u&&a&&o&&!c;return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-8",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center text-center space-y-4",children:[(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)(St,{className:"w-16 h-16 text-green-500 dark:text-green-400 animate-in zoom-in duration-300"})}),(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white",children:p}),h&&(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:h})]})}),g&&(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[(0,l.jsx)("h3",{className:"text-lg font-bold text-slate-900 dark:text-white text-center",children:"Checkout faster next time?"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center",children:"Create a Passkey to pay securely with FaceID/TouchID—no codes needed."}),(0,l.jsx)(Je,{onClick:o,className:"w-full",disabled:d,isLoading:d,loadingText:"mastercard"===a?"Creating...":"Verifying...",children:"Create Passkey"}),(0,l.jsx)("button",{type:"button",onClick:i,disabled:d,className:"w-full text-sm text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 disabled:opacity-50 transition-colors",children:"No thanks"})]})]})};rn.displayName="SuccessView";const an=R("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),sn=R("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),on=R("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),ln="#0055BB",dn=({methods:e,onSelectMethod:t,onBack:n,isLoading:r=!1})=>{const a=e=>{switch(e){case"sms":return(0,l.jsx)(an,{className:"w-5 h-5",style:{color:ln}});case"email":return(0,l.jsx)(sn,{className:"w-5 h-5",style:{color:ln}})}},s=(e,t)=>{switch(e){case"sms":return`Text to ${t}`;case"email":return`Email to ${t}`}};return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,l.jsx)(Rt,{className:"w-5 h-5",style:{color:ln}}),(0,l.jsx)("span",{className:"text-sm font-semibold",style:{color:ln},children:"Verified by Visa"})]}),(0,l.jsx)($t,{title:"Verify Your Identity",onBack:n}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:"Your bank requires additional verification. Choose how you'd like to receive your code."}),(0,l.jsx)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl overflow-hidden",children:e.map((e,n)=>(0,l.jsxs)("button",{onClick:()=>!r&&t(e.id),disabled:r,className:`\n w-full px-6 py-4 flex items-center gap-3\n hover:bg-blue-50 dark:hover:bg-slate-800/50\n active:bg-blue-100 dark:active:bg-slate-800\n transition-colors\n disabled:opacity-50 disabled:cursor-not-allowed\n ${0!==n?"border-t border-gray-200 dark:border-slate-700":""}\n `,children:[(0,l.jsx)("div",{className:"flex-shrink-0",children:a(e.type)}),(0,l.jsx)("div",{className:"flex-1 text-left",children:(0,l.jsx)("p",{className:"text-sm font-medium text-slate-900 dark:text-white",children:s(e.type,e.maskedValue)})}),(0,l.jsx)("div",{className:"flex-shrink-0",children:(0,l.jsx)(on,{className:"w-5 h-5",style:{color:ln}})})]},e.id))})]})};dn.displayName="VisaMethodView";const cn="#0055BB",un=({methodDescription:e,otp:t,onOtpChange:n,onVerify:r,onBack:a,onResend:s,onVerifyAnotherWay:o,isLoading:i=!1,error:c,canRetry:u=!0})=>{const m=d.useRef(!1);d.useEffect(()=>{t.length<6&&(m.current=!1)},[t]);d.useEffect(()=>{6!==t.length||i||!u||m.current||(m.current=!0,r())},[t,i,r,u]);const p=!u;return(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),6===t.length&&u&&!i&&(m.current=!0,r())},className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,l.jsx)(Rt,{className:"w-5 h-5",style:{color:cn}}),(0,l.jsx)("span",{className:"text-sm font-semibold",style:{color:cn},children:"Verified by Visa"})]}),(0,l.jsx)($t,{title:"Enter Bank Code",onBack:a}),(0,l.jsxs)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:["Code sent to ",e]}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-6",children:[(0,l.jsx)("div",{className:i||p?"opacity-50 pointer-events-none":"",children:(0,l.jsx)(xt,{value:t,onChange:n,length:6})}),c&&(0,l.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400 text-center",children:c}),(0,l.jsx)(Je,{type:"submit",className:"w-full",style:{backgroundColor:cn},disabled:6!==t.length||i||p,isLoading:i,loadingText:"Verifying...",children:"Verify"}),p&&o&&(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)("button",{type:"button",onClick:o,className:"text-sm hover:underline",style:{color:cn},children:"Verify another way"})}),s&&!p&&(0,l.jsx)("div",{className:"text-center mt-4",children:(0,l.jsxs)("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:["Didn't receive a code?"," ",(0,l.jsx)("button",{type:"button",onClick:s,disabled:i,className:"font-bold hover:underline disabled:opacity-50",style:{color:cn},children:"Resend"})]})})]})]})};un.displayName="VisaOtpView";const mn=R("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),pn=R("fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),hn=({cardNetwork:e,onCreatePasskey:t,onSkip:n,onBack:r,isLoading:a=!1,error:s,showSkip:o=!1})=>{const i="visa"===e?"Create Visa Passkey":"Create Mastercard Passkey",d="mastercard"===e?"Creating Passkey...":"Verifying...";return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)("div",{className:"w-12 h-12 bg-indigo-100 dark:bg-indigo-900/30 rounded-full flex items-center justify-center",children:(0,l.jsx)(mn,{className:"w-6 h-6 text-indigo-600 dark:text-indigo-400"})})}),(0,l.jsx)("h2",{className:"text-xl font-bold text-slate-900 dark:text-white text-center",children:"One final step"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400 text-center leading-relaxed",children:"To allow the AI Agent to securely purchase this item for you, you must enable biometric access."})]}),"visa"===e&&(0,l.jsx)("div",{id:"visa-auth-container",className:"w-full max-w-md mx-auto min-h-[10px] bg-gray-50 dark:bg-slate-800 rounded-2xl overflow-hidden"}),(0,l.jsxs)(Qe,{className:"w-full max-w-md mx-auto shadow-sm border border-gray-200 dark:border-slate-700 rounded-2xl p-6 space-y-4",children:[s&&(0,l.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700 rounded-lg",children:[(0,l.jsx)(Xt,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),(0,l.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:s})]}),(0,l.jsxs)(Je,{onClick:t,className:"w-full",disabled:a,isLoading:a,loadingText:d,children:[(0,l.jsx)(pn,{className:"w-5 h-5 mr-2"}),i]}),o&&n&&(0,l.jsx)("button",{type:"button",onClick:n,disabled:a,className:"w-full text-sm text-gray-500 dark:text-slate-400 hover:underline disabled:opacity-50",children:"Skip for now"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-400 text-center",children:"This grants the agent permission for this specific transaction."})]}),r&&(0,l.jsx)("div",{className:"text-center px-4 mt-4",children:(0,l.jsx)("button",{type:"button",onClick:r,disabled:a,className:"text-sm text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50",children:"Back to checkout"})})]})};hn.displayName="AgentRegistrationView";class gn extends Error{constructor(e,t,n){super(e),this.name="ApiError",this.status=t,this.details=n}}function bn(e){if(!e)return e;const t=e.startsWith("+"),n=e.replace(/\D/g,"");return t?`+${n}`:10===n.length?`+1${n}`:(11===n.length&&n.startsWith("1"),`+${n}`)}function fn(e){return{id:e.id||e.cardId,brand:e.brand?.toLowerCase()||"unknown",last4:e.last4,expiryMonth:e.expMonth?.toString()||e.expiryMonth||"",expiryYear:e.expYear?.toString()||e.expiryYear||"",cardholderName:e.cardholderName,isDefault:e.isDefault||!1,network:e.brand?.toLowerCase()||"visa",passkeyEnrolled:e.passkeyEnrolled||!1,cardArtUrl:e.cardArt||e.artwork||e.cardArtUrl,issuerName:e.issuerName}}async function wn(e,t,n,r={}){const a=`${e}${t}`,s={"Content-Type":"application/json",Authorization:`Bearer ${n}`,"ngrok-skip-browser-warning":"true"};try{const e=await fetch(a,{...r,headers:{...s,...r.headers}}),t=e.headers.get("content-type");let n;if(t&&t.includes("application/json"))n=await e.json();else{const t=await e.text();try{n=JSON.parse(t)}catch{if(t.includes("<!DOCTYPE")||t.includes("<html"))throw new gn("Received HTML instead of JSON. Ngrok bypass header may not be working.",e.status,"HTML response received");throw new gn("Invalid JSON response from server",e.status,t.substring(0,200))}}if(!e.ok)throw new gn(n.message||"An error occurred",e.status);return n}catch(e){if(e instanceof gn)throw e;throw new gn(e instanceof Error?e.message:"Network error",0)}}async function yn(e,t,n){const r=bn(n);console.log("[ApiService] Sending OTP to:",n,"→",r);const a=await wn(e,"/api/otp/payos-link/generate",t,{method:"POST",body:JSON.stringify({phone:r,channel:"sms"})});if(a.error||!a.data)throw new gn(a.message||"Failed to send verification code",400);return console.log("[ApiService] OTP sent, reference:",a.data.reference),a.data.reference}async function xn(e,t,n,r){console.log("[ApiService] Resending OTP, previous reference:",n);try{const a=await async function(e,t,n){const r=await wn(e,`/api/otp/payos-link/status/${n}`,t,{method:"GET"});if(r.error||!r.data)throw new gn(r.message||"Failed to get verification status",400);return r.data}(e,t,n),s=new Date(a.createdAt),o=Date.now()-s.getTime(),i=3e4;if(o<i&&"pending"===a.status){const e=Math.ceil((i-o)/1e3);return console.log("[ApiService] Rate limited, wait time remaining:",e),{reference:n,waitTimeRemaining:e}}return{reference:await yn(e,t,r)}}catch(e){throw console.error("[ApiService] Failed to resend verification:",e),e}}async function vn(e,t){console.log("[ApiService] Getting current session");const n=await wn(e,"/web/sessions/current",t,{method:"GET"});if(n.error||!n.data)throw new gn(n.message||"Failed to get session",400);return n.data}async function kn(e,t,n){console.log("[ApiService] Updating session payment intent:",n);const r=await wn(e,"/web/sessions/current/payment-intent",t,{method:"PATCH",body:JSON.stringify(n)});if(r.error||!r.data)throw new gn(r.message||"Failed to update payment intent",400);return console.log("[ApiService] Session payment intent updated"),r.data}const Cn="payos_device_id",Nn="payos_device_created";function Sn(){const e=[];e.push(`${screen.width}x${screen.height}`),e.push(`${screen.colorDepth}`),e.push(Intl.DateTimeFormat().resolvedOptions().timeZone),e.push(navigator.language),e.push(navigator.platform),e.push(navigator.userAgent),e.push(String(navigator.hardwareConcurrency||0));const t=navigator;e.push(String(t.deviceMemory||0));return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}(e.join("|"))}function jn(){const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}function In(){try{const e=localStorage.getItem(Cn);if(e)return e;const t=Sn(),n=`${t}-${jn().substring(0,8)}`;return localStorage.setItem(Cn,n),localStorage.setItem(Nn,(new Date).toISOString()),n}catch{return jn()}}function An(e,t){const{apiBaseUrl:n}=t,[r,a]=(0,d.useState)(null),[s,o]=(0,d.useState)("LOADING"),[i,l]=(0,d.useState)(!0),[c,u]=(0,d.useState)(null),[m,p]=(0,d.useState)("checkout"),[h,g]=(0,d.useState)(""),[b,f]=(0,d.useState)("initial"),[w,y]=(0,d.useState)(null),[x,v]=(0,d.useState)(null),k=(0,d.useRef)(!0),C=(0,d.useRef)(e),N=(0,d.useRef)(!1);(0,d.useEffect)(()=>{C.current!==e&&(N.current=!1),C.current=e},[e]);const S=(0,d.useCallback)((e,t)=>{const{session:n,paymentIntent:r}=e,a=r?{id:r.id,type:r.type,currency:r.currency,organizationId:r.organizationId,status:r.status,totalAmount:r.totalAmount,totalSubtotal:r.totalSubtotal??r.totalAmount,totalTax:r.totalTax,totalShipping:r.totalShipping,payments:r.payments.map(e=>({id:e.id,merchantName:e.merchantName,merchantUrl:e.merchantUrl,amount:e.amount,subtotal:e.subtotal||e.amount,tax:e.tax,shipping:e.shipping,description:e.description,quantity:e.quantity,credentialStatus:e.credentialStatus,status:e.status,createdAt:e.createdAt,updatedAt:e.updatedAt})),intentType:r.intentType||"standard",walletUserId:r.walletUserId,selectedCardId:r.selectedCardId,requireHitl:r.requireHitl??!1,hitlAttemptCount:r.hitlAttemptCount??0,hitlApproved:r.hitlApproved??!1,networkAuthRequired:r.networkAuthRequired??!1,networkAuthCompleted:r.networkAuthCompleted??!1,authValid:r.authValid??!1,credentialType:r.credentialType||"pci_vault_token",createdAt:r.createdAt,updatedAt:r.updatedAt,facilitationFee:void 0}:t?.paymentIntent;if(!a)throw new Error("No payment intent available");let s="initialized";return"complete"===n.status?s="completed":"expired"===n.status?s="expired":"abandoned"===n.status?s="abandoned":t?.deviceVerified&&(s="verified"),{id:n.id,status:s,organizationId:n.organizationId,paymentIntent:a,linkToken:C.current,walletUser:t?.walletUser,savedCards:t?.savedCards||[],selectedCard:t?.selectedCard,deviceVerified:t?.deviceVerified||!1,verificationMethod:"phone",verificationReference:w||"",verificationPhone:x||"",expiresAt:n.expiresAt,createdAt:n.createdAt,updatedAt:n.updatedAt}},[w,x]),j=(0,d.useCallback)(e=>{if(!e)return"LOADING";switch(e.status){case"initialized":return e.deviceVerified?"PAYMENT":"IDENTITY";case"otp_pending":return"OTP_VERIFY";case"verified":case"payment_pending":return"PAYMENT";case"completed":return"SUCCESS";case"expired":return"EXPIRED";case"abandoned":return"ERROR";default:return"IDENTITY"}},[]);(0,d.useEffect)(()=>{if(k.current=!0,N.current)return;return(async()=>{N.current=!0,l(!0),u(null);try{const t=await vn(n,e),r=t.paymentIntent?.status;if(r&&["approved","credentials_ready","completed","awaiting_payment"].includes(r))return void(k.current&&(u({code:"PAYMENT_INTENT_ALREADY_PROCESSED",message:"completed"===r?"This payment has already been completed.":"awaiting_payment"===r?"This payment is already in progress.":"This payment has already been approved. Use the credentials API to retrieve or regenerate.",sessionId:t.session.id}),o("ERROR")));await async function(e,t){console.log("[ApiService] Starting session");const n=await wn(e,"/web/sessions/current/start",t,{method:"PATCH"});if(n.error||!n.data)throw new gn(n.message||"Failed to start session",400);return console.log("[ApiService] Session started:",n.data.id),n.data}(n,e);const s=S(t),i=t.paymentIntent?.walletUserId;if(i)try{const t=In(),r=await async function(e,t,n,r){console.log("[ApiService] Checking device trust:",{deviceId:n,walletUserId:r});const a=new URLSearchParams({deviceId:n});r&&a.set("walletUserId",r);const s=await wn(e,`/web/device-trust?${a}`,t,{method:"GET"});return s.error?(console.warn("[ApiService] Device trust check failed, defaulting to untrusted"),{isTrusted:!1}):(console.log("[ApiService] Device trust result:",s.data),{isTrusted:s.data?.isTrusted??!1,expiresAt:s.data?.expiresAt,walletUserId:s.data?.walletUserId})}(n,e,t,i);if(r.isTrusted){console.log("[useSession] Device is trusted, skipping OTP verification"),s.deviceVerified=!0,s.status="verified";const t=await async function(e,t,n){console.log("[ApiService] Getting cards for wallet user:",n);const r=await wn(e,`/api/wallet-users/${n}/cards`,t,{method:"GET"});if(r.error)throw new gn(r.message||"Failed to get wallet user cards",400);return(r.data||[]).map(fn)}(n,e,i);if(s.walletUser={id:i},s.savedCards=t||[],s.savedCards.length>0){const e=s.savedCards.find(e=>e.isDefault)||s.savedCards[0];s.selectedCard=e}}}catch(e){console.log("[useSession] Device trust check failed, requiring OTP")}k.current&&(a(s),o(j(s)))}catch(t){if(k.current){const n=t,r=410===n.status||n.message?.toLowerCase().includes("expired");u({code:r?"SESSION_EXPIRED":"LOAD_FAILED",message:n.message||"Failed to load session",sessionId:e}),o(r?"EXPIRED":"ERROR")}}finally{k.current&&l(!1)}})(),()=>{k.current=!1}},[e,j,S,n]);const I="pay_on_behalf"===r?.paymentIntent.type||"agent_to_agent"===r?.paymentIntent.type||"agentic_multi"===r?.paymentIntent.type,A=!!r?.selectedCard,E=(r?.savedCards?.length??0)>0;(0,d.useEffect)(()=>{"PAYMENT"===s&&p(A?"checkout":E?"methods":"add")},[s,A,E]);const T=(0,d.useCallback)(()=>{p("methods")},[]),R=(0,d.useCallback)(()=>{p("add")},[]),D=(0,d.useCallback)(()=>{p(A?"checkout":E?"methods":"add")},[A,E]),P=(0,d.useCallback)(()=>{o("IDENTITY")},[]),L=(0,d.useCallback)(async e=>{if(!r||!e.phone)return!1;l(!0);try{const t=await yn(n,C.current,e.phone);return k.current&&(y(t),v(e.phone),a(n=>n?{...n,status:"otp_pending",verificationReference:t,verificationPhone:e.phone}:null),o("OTP_VERIFY")),!0}catch(e){const t=e;return k.current&&u({code:"VERIFICATION_FAILED",message:t.message||"Failed to send verification",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),U=(0,d.useCallback)(async e=>{if(!r||!w||!x)return{success:!1,error:{code:"SESSION_NOT_FOUND",message:"No session or verification context"}};l(!0);try{const t=await async function(e,t,n,r){console.log("[ApiService] Verifying OTP, reference:",n);const a=await wn(e,"/api/otp/payos-link/verify",t,{method:"POST",body:JSON.stringify({reference:n,code:r})});if(a.error||!a.data)throw new gn(a.message||"Invalid verification code",400);return console.log("[ApiService] OTP verified for phone:",a.data.phone),a.data}(n,C.current,w,e),s=await async function(e,t,n,r){const a=bn(n);console.log("[ApiService] Processing verified wallet user, phone:",n,"→",a);const s=await wn(e,"/api/wallet-users/process-verified-wallet-user",t,{method:"POST",body:JSON.stringify({phone:a,verificationId:r})});if(s.error||!s.data)throw new gn(s.message||"Failed to process wallet user",400);const o=(s.data.savedCards||[]).map(fn);return console.log("[ApiService] Wallet user processed:",{walletUserId:s.data.walletUserId,isNewUser:s.data.isNewUser,savedCardsCount:o.length}),{...s.data,savedCards:o}}(n,C.current,t.phone,t.reference);if(k.current){let e,i;if(r.paymentIntent.selectedCardId?e=s.savedCards.find(e=>e.id===r.paymentIntent.selectedCardId):s.savedCards.length>0&&(e=s.savedCards.find(e=>e.isDefault)||s.savedCards[0],i=e?.id),i)try{await kn(n,C.current,{selectedCardId:i})}catch(e){console.warn("[useSession] Failed to auto-select card on backend:",e)}a(n=>n?{...n,status:"verified",deviceVerified:!0,walletUser:{id:s.walletUserId,phone:t.phone},savedCards:s.savedCards,selectedCard:e,paymentIntent:{...n.paymentIntent,walletUserId:s.walletUserId,...i&&{selectedCardId:i}}}:null),o("PAYMENT");try{const e=In();await async function(e,t,n,r){return console.log("[ApiService] Registering trusted device:",{deviceId:n,walletUserId:r}),(await wn(e,"/web/device-trust",t,{method:"POST",body:JSON.stringify({deviceId:n,walletUserId:r})})).error?(console.warn("[ApiService] Device trust registration failed"),{success:!1}):(console.log("[ApiService] Device registered as trusted"),{success:!0})}(n,C.current,e,s.walletUserId),console.log("[useSession] Device registered as trusted for 90 days")}catch(e){console.warn("[useSession] Failed to register device trust:",e)}}return{success:!0,walletUserId:s.walletUserId}}catch(e){const t={success:!1,error:{code:"INVALID_OTP",message:e.message||"Invalid verification code"}};return k.current&&u({code:t.error.code,message:t.error.message,sessionId:r.id}),t}finally{k.current&&l(!1)}},[r,w,x,n]),O=(0,d.useCallback)(async()=>{if(!r||!w||!x)return!1;l(!0);try{const e=await xn(n,C.current,w,x);return!e.waitTimeRemaining&&(k.current&&e.reference!==w&&y(e.reference),!0)}catch{return!1}finally{k.current&&l(!1)}},[r,w,x,n]),M=(0,d.useCallback)(async e=>{if(!r)return!1;l(!0);try{await kn(n,C.current,{selectedCardId:e});const t=r.savedCards.find(t=>t.id===e);return k.current&&(a(n=>n?{...n,selectedCard:t,paymentIntent:{...n.paymentIntent,selectedCardId:e}}:null),p("checkout")),!0}catch(e){const t=e;return k.current&&u({code:"CARD_SELECT_FAILED",message:t.message||"Failed to select card",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),_=(0,d.useCallback)(async e=>{if(!r)return{success:!1};l(!0);try{const t={id:e.cardId,brand:e.brand?.toLowerCase()||"unknown",last4:e.last4,expiryMonth:e.expiryMonth||"",expiryYear:e.expiryYear||"",cardholderName:e.cardholderName,isDefault:!1,network:e.network?.toLowerCase()||"visa",cardArtUrl:e.cardArtUrl};if(await kn(n,C.current,{selectedCardId:t.id}),k.current){a(e=>e?{...e,savedCards:[...e.savedCards,t],selectedCard:t,paymentIntent:{...e.paymentIntent,selectedCardId:t.id}}:null);const e=r.paymentIntent.type;"pay_on_behalf"===e||"agent_to_agent"===e||"agentic_multi"===e?(f("initial"),o("AGENT_REGISTRATION")):p("checkout")}return{success:!0,card:t}}catch(e){const t=e;return k.current&&u({code:"CARD_ADD_FAILED",message:t.message||"Failed to add card",sessionId:r.id}),{success:!1}}finally{k.current&&l(!1)}},[r,n]),z=(0,d.useCallback)(async e=>{if(!r||!r.walletUser?.id)return console.warn("[useSession] Cannot delete card: no wallet user"),!1;l(!0);try{if(await async function(e,t,n,r){console.log("[ApiService] Deleting card:",{walletUserId:n,cardId:r});const a=await wn(e,`/api/wallet-users/${n}/cards/${r}`,t,{method:"DELETE"});if(a.error)throw new gn(a.message||"Failed to delete card",400);return console.log("[ApiService] Card deleted successfully"),{success:!0}}(n,C.current,r.walletUser.id,e),k.current){const t=r.savedCards.filter(t=>t.id!==e),n=r.selectedCard?.id===e;a(e=>e?{...e,savedCards:t,selectedCard:n?void 0:e.selectedCard,paymentIntent:{...e.paymentIntent,selectedCardId:n?void 0:e.paymentIntent.selectedCardId}}:null),0===t.length&&p("add")}return!0}catch(e){const t=e;return k.current&&u({code:"CARD_DELETE_FAILED",message:t.message||"Failed to delete card",sessionId:r.id}),!1}finally{k.current&&l(!1)}},[r,n]),F=(0,d.useCallback)(async()=>{if(r)try{await kn(n,C.current,{selectedCardId:void 0}),k.current&&a(e=>e?{...e,selectedCard:void 0,paymentIntent:{...e.paymentIntent,selectedCardId:void 0}}:null)}catch{}},[r,n]),V=(0,d.useCallback)(()=>{f("initial"),o("PAYMENT"),p("checkout")},[]),H=(0,d.useCallback)(()=>{f("initial"),o("PAYMENT"),p("checkout")},[]),$=(0,d.useCallback)(async e=>{if(!r)return{success:!1,error:{code:"SESSION_NOT_FOUND",message:"No session"}};o("PROCESSING"),l(!0);try{return I&&e?.passkeyAuthenticated&&(console.log("[useSession] Generating credentials for agent mode passkey authentication"),await async function(e,t,n){console.log("[ApiService] Generating credentials for payment intent:",n);const r=`${e}/api/payment-credentials/generate`,a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,"ngrok-skip-browser-warning":"true"},body:JSON.stringify({paymentIntentId:n})}),s=a.headers.get("content-type");let o;if(s&&s.includes("application/json"))o=await a.json();else{const e=await a.text();try{o=JSON.parse(e)}catch{throw new gn("Invalid response from credential generation",a.status,e.substring(0,200))}}if(!a.ok)throw new gn(o.message||"Failed to generate credentials",a.status,o.data?.status);return console.log("[ApiService] Credential generation result:",o.data?.status||o.message),{status:o.data?.status||"success",message:o.message,retrievalToken:o.data?.retrievalToken,approvalId:o.data?.approvalId}}(n,C.current,r.paymentIntent.id),console.log("[useSession] Credentials generated successfully")),await async function(e,t){console.log("[ApiService] Completing session");const n=await wn(e,"/web/sessions/current/complete",t,{method:"POST"});if(n.error||!n.data)throw new gn(n.message||"Failed to complete session",400);return console.log("[ApiService] Session completed:",n.data.id),n.data}(n,C.current),k.current&&(a(e=>e?{...e,status:"completed"}:null),o("SUCCESS")),{success:!0,walletUserId:r.walletUser?.id,paymentIntentId:r.paymentIntent.id,credentialGenerated:I&&e?.passkeyAuthenticated}}catch(e){const t=e,n={success:!1,error:{code:t.message?.includes("credential")||t.message?.includes("generate")?"CREDENTIAL_GENERATION_FAILED":"PAYMENT_FAILED",message:t.message||"Payment failed"}};return k.current&&(u({code:n.error.code,message:n.error.message,sessionId:r.id}),o("PAYMENT")),n}finally{k.current&&l(!1)}},[r,I,n]),B=(0,d.useCallback)(async()=>{if(r)try{await async function(e,t){console.log("[ApiService] Abandoning session");const n=await wn(e,"/web/sessions/current/abandon",t,{method:"POST"});if(n.error||!n.data)throw new gn(n.message||"Failed to abandon session",400);return console.log("[ApiService] Session abandoned:",n.data.id),n.data}(n,C.current)}catch{}},[r,n]),G=(0,d.useCallback)(()=>{u(null)},[]),K=(0,d.useCallback)(async()=>{if(r){l(!0);try{const e=await vn(n,C.current),t=S(e,r);k.current&&(a(t),o(j(t)))}catch(e){const t=e;k.current&&u({code:"LOAD_FAILED",message:t.message||"Failed to refresh session",sessionId:r.id})}finally{k.current&&l(!1)}}},[r,j,S,n]);return{session:r,phase:s,loading:i,error:c,isAgentMode:I,hasSelectedCard:A,hasSavedCards:E,paymentView:m,cvc:h,setCvc:g,showMethodList:T,showAddCard:R,returnToCheckout:D,submitIdentity:L,goBackToIdentity:P,submitOTP:U,resendCode:O,selectPaymentCard:M,addPaymentCard:_,deletePaymentCard:z,clearCard:F,registrationSubPhase:b,setRegistrationSubPhase:f,skipRegistration:V,completeAgentRegistration:H,setPhase:o,setPaymentView:p,complete:$,abandon:B,clearError:G,refresh:K}}var En=class extends Error{constructor(e,t,n){super(t),this.code=e,this.details=n,this.name="PasskeyError"}},Tn=class{constructor(e,t,n){this.linkToken=e,this.baseUrl=n?n.endsWith("/api")?n:`${n}/api`:t?"https://sandbox.api.payos.ai/api":"https://api.payos.ai/api"}async get(e){return this.request("GET",e)}async post(e,t){return this.request("POST",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e){return this.request("DELETE",e)}async request(e,t,n){let r=`${this.baseUrl}${t}`,a={method:e,headers:{Authorization:`Bearer ${this.linkToken}`,"Content-Type":"application/json","X-SDK-Version":"1.0.0","X-SDK-Platform":"browser"},credentials:"include"};n&&("POST"===e||"PUT"===e)&&(a.body=JSON.stringify(n));try{let e=await fetch(r,a);if(!e.ok){let t=await this.parseResponse(e);throw new Rn(e.status,t?.message||`HTTP ${e.status}`,t)}return await this.parseResponse(e)}catch(e){throw e instanceof TypeError&&"Failed to fetch"===e.message?new Rn(0,"Network error - unable to reach server",{originalError:e}):e instanceof Rn?e:new Rn(0,"Request failed",{originalError:e})}}async parseResponse(e){return e.headers.get("content-type")?.includes("application/json")?e.json():await e.text()}setBaseUrl(e){this.baseUrl=e}setLinkToken(e){this.linkToken=e}},Rn=class extends Error{constructor(e,t,n){super(t),this.status=e,this.data=n,this.name="ApiError"}},Dn=class{constructor(){this.initialized=!1,this.initPromise=null,this.sessionData=null,this.sdkUrl=null,this.iframe=null,this.containerId=null,this.vtsRequestId=null,this.messageHandlers=new Map,this.messageListener=null,this.messageListener=this.handleMessage.bind(this),window.addEventListener("message",this.messageListener)}setSDKUrl(e){this.sdkUrl=e}setContainerId(e){this.containerId=e}async loadSDK(e){if(this.initialized&&this.sessionData)return;if(this.initPromise)return void await this.initPromise;let t=e||this.sdkUrl;if(!t)throw new Error("Visa SDK URL not provided. Call setSDKUrl or provide URL to loadSDK");this.initPromise=this.initializeSDK(t),await this.initPromise,this.initialized=!0}async initializeSDK(e){return new Promise((t,n)=>{try{this.createIframe(e),this.messageHandlers.set("AUTH_READY",e=>{this.vtsRequestId=e.requestID,this.sendCreateAuthSession()}),this.messageHandlers.set("AUTH_SESSION_CREATED",e=>{let n={userAgent:navigator.userAgent,browserLanguage:navigator.language,browserColorDepth:String(screen.colorDepth),browserScreenHeight:String(screen.height),browserScreenWidth:String(screen.width),browserTimeZone:String((new Date).getTimezoneOffset()),browserJavaEnabled:!1,browserJavascriptEnabled:!0,browserHeader:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};this.sessionData={sessionContext:e.sessionContext,browserData:n,requestID:this.vtsRequestId},this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),t(this.sessionData)}),this.messageHandlers.set("ERROR",e=>{this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),n(new Error(e.message||"VTS SDK initialization failed"))}),setTimeout(()=>{this.initialized||(this.messageHandlers.delete("AUTH_READY"),this.messageHandlers.delete("AUTH_SESSION_CREATED"),n(new Error("VTS SDK initialization timeout")))},3e4)}catch(e){n(e)}})}createIframe(e){this.iframe&&this.iframe.remove(),this.iframe=document.createElement("iframe"),this.iframe.id="vts-sdk-iframe",this.iframe.title="VTS SDK",this.iframe.setAttribute("aria-hidden","true"),this.iframe.src=e,this.iframe.style.cssText="\n position: fixed;\n left: -9999px;\n opacity: 0;\n pointer-events: none;\n ",document.body.appendChild(this.iframe)}handleMessage(e){if(!["https://vts.auth.visa.com","https://sbx.vts.auth.visa.com"].some(t=>e.origin.includes(t)))return;let{type:t}=e.data||{};if(!t)return;let n=this.messageHandlers.get(t);n&&n(e.data)}sendCreateAuthSession(){if(!this.iframe?.contentWindow||!this.vtsRequestId)return;let e=new URL(this.sdkUrl),t=e.searchParams.get("apikey"),n=e.searchParams.get("profileId");if(!t||!n)return;let r={requestID:this.vtsRequestId,type:"CREATE_AUTH_SESSION",version:"1",client:{id:t,profileId:n}},a=this.sdkUrl?.includes("sbx.")?"https://sbx.vts.auth.visa.com":"https://vts.auth.visa.com";this.iframe.contentWindow.postMessage(JSON.stringify(r),a)}async getSessionContext(){if(!this.initialized||!this.sessionData)throw new Error("Visa SDK not initialized. Call loadSDK first.");return this.sessionData}async authenticate(e){if(!this.initialized||!this.sessionData)throw new Error("VTS SDK not initialized");return new Promise((t,n)=>{this.messageHandlers.set("AUTH_COMPLETE",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),t({type:"AUTH_COMPLETE",assuranceData:e.assuranceData,sessionId:e.sessionId,requestID:e.requestID})}),this.messageHandlers.set("AUTH_FAILED",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),n(new Error(e.message||"Authentication failed"))}),this.messageHandlers.set("AUTH_CANCELLED",e=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),t({type:"AUTH_CANCELLED",error:"User cancelled authentication"})});let r={requestID:this.vtsRequestId,type:"AUTHENTICATE",version:"1",contentType:"application/json",authenticationContext:e},a=this.sdkUrl?.includes("sbx.")?"https://sbx.vts.auth.visa.com":"https://vts.auth.visa.com";this.iframe?.contentWindow?(this.iframe.contentWindow.postMessage(JSON.stringify(r),a),setTimeout(()=>{this.messageHandlers.delete("AUTH_COMPLETE"),this.messageHandlers.delete("AUTH_FAILED"),this.messageHandlers.delete("AUTH_CANCELLED"),n(new Error("Authentication timeout"))},12e4)):n(new Error("VTS SDK iframe not ready"))})}isLoaded(){return this.initialized&&!!this.sessionData}showIframe(e){if(!this.iframe)return;let t=e||this.containerId;if(t){let e=document.getElementById(t);if(e){let t=e.getBoundingClientRect(),n=window.innerWidth,r=450,a=16,s=n<480,o=s?n-2*a:Math.min(r,t.width),i=s?a:t.left+(t.width-o)/2;this.iframe.style.position="fixed",this.iframe.style.top=`${t.top}px`,this.iframe.style.left=`${i}px`,this.iframe.style.width=`${o}px`,this.iframe.style.height="300px",this.iframe.style.opacity="1",this.iframe.style.pointerEvents="auto",this.iframe.style.border="0",this.iframe.style.display="block",this.iframe.style.zIndex="10000",this.iframe.removeAttribute("aria-hidden")}}}hideIframe(){this.iframe&&(this.iframe.style.position="fixed",this.iframe.style.left="-9999px",this.iframe.style.top="0",this.iframe.style.opacity="0",this.iframe.style.pointerEvents="none",this.iframe.style.display="none")}getIframe(){return this.iframe}cleanup(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null),this.messageHandlers.clear(),this.iframe&&(this.iframe.remove(),this.iframe=null),this.sessionData=null,this.initialized=!1,this.initPromise=null}},Pn=class{constructor(){this.sdkLoaded=!1,this.sdkLoadPromise=null,this.sdkUrl=null,this.authWindow=null,this.popupWidth=550,this.popupHeight=760}setSDKUrl(e){this.sdkUrl=e}async loadSDK(e){if(this.sdkLoaded&&window.AUTHSDK_MASTERCARD)return;if(this.sdkLoadPromise)return this.sdkLoadPromise;let t=e||this.sdkUrl;if(!t)throw new Error("Mastercard SDK URL not provided. Call setSDKUrl or provide URL to loadSDK");this.sdkLoadPromise=this.loadSDKInternal(t);try{await this.sdkLoadPromise,this.sdkLoaded=!0}catch(e){throw this.sdkLoadPromise=null,e}}async loadSDKInternal(e){return new Promise((t,n)=>{if(window.AUTHSDK_MASTERCARD)return void t();let r=document.getElementById("mastercard-sdk-script");r&&r.remove();let a=document.createElement("script");a.src=e,a.async=!0,a.id="mastercard-sdk-script",a.onload=()=>{window.AUTHSDK_MASTERCARD?t():n(new Error("Mastercard SDK loaded but AUTHSDK_MASTERCARD not found"))},a.onerror=()=>{n(new Error("Failed to load Mastercard SDK script"))},document.head.appendChild(a)})}setPopupDimensions(e,t){this.popupWidth=e,this.popupHeight=t}async authenticate(e,t){if(!this.sdkLoaded||!window.AUTHSDK_MASTERCARD)throw new Error("Mastercard SDK not loaded. Call loadSDK first.");let n=t?.width||this.popupWidth,r=t?.height||this.popupHeight;if(this.authWindow=window.open("","mc-auth",`width=${n},height=${r},toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes`),!this.authWindow)throw new Error("Failed to open authentication window. Please check popup settings.");try{let t=await window.AUTHSDK_MASTERCARD.authenticate({...e,windowRef:this.authWindow});return t.assuranceData?.verificationData&&t.assuranceData.verificationData.forEach((e,t)=>{}),t.methodAttributes,this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),t}catch(e){throw this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),new Error(`Mastercard authentication failed: ${e}`)}finally{this.authWindow=null}}getAuthWindow(){return this.authWindow}closeAuthWindow(){this.authWindow&&!this.authWindow.closed&&(this.authWindow.close(),this.authWindow=null)}isLoaded(){return this.sdkLoaded&&!!window.AUTHSDK_MASTERCARD}cleanup(){window.AUTHSDK_MASTERCARD?.cleanup&&window.AUTHSDK_MASTERCARD.cleanup()}},Ln=class{constructor(e=!1){this.prefix="[PayOS Passkey]",this.enabled=e}log(e,t){this.enabled}warn(e,t){this.enabled}error(e,t){this.enabled}debug(e,t){this.enabled}enable(){this.enabled=!0}disable(){this.enabled=!1}isEnabled(){return this.enabled}},Un=class{constructor(e,t){this.sdkConfig=null,this.isInitialized=!1,this.initPromise=null,this.apiClient=new Tn(e,t?.sandbox,t?.apiBaseUrl),this.visaService=new Dn,this.mastercardService=new Pn,this.logger=new Ln(t?.debug||!1),t?.visaContainerId&&this.visaService.setContainerId(t.visaContainerId),t?.mastercardPopupDimensions&&this.mastercardService.setPopupDimensions(t.mastercardPopupDimensions.width,t.mastercardPopupDimensions.height),this.initialize()}async initialize(){if(!this.isInitialized){if(this.initPromise)return this.initPromise;this.initPromise=this.performInitialization(),await this.initPromise,this.isInitialized=!0}}async performInitialization(){try{this.logger.log("Initializing PayOS Passkey SDK");let e=await this.apiClient.get("/passkeys/configs");if(this.sdkConfig=e.data?.configs,!this.sdkConfig)throw new Error("Failed to fetch SDK configuration");this.logger.log("SDK config loaded",this.sdkConfig);let t=[];this.sdkConfig.visa?.sdkUrl&&(this.visaService.setSDKUrl(this.sdkConfig.visa.sdkUrl),t.push(this.visaService.loadSDK().catch(e=>{this.logger.warn("Failed to load Visa SDK",e)}))),this.sdkConfig.mastercard?.sdkUrl&&(this.mastercardService.setSDKUrl(this.sdkConfig.mastercard.sdkUrl),t.push(this.mastercardService.loadSDK().catch(e=>{this.logger.warn("Failed to load Mastercard SDK",e)}))),await Promise.all(t),this.logger.log("SDKs loaded successfully")}catch(e){throw this.logger.error("Failed to initialize SDK",e),new En("SDK_LOAD_FAILED","Failed to initialize PayOS Passkey SDK",e)}}async authenticate(e,t){await this.initialize(),this.logger.log("Starting authentication",{paymentIntentId:e,paymentId:t});try{let n={};if(this.visaService.isLoaded())try{let e=await this.visaService.getSessionContext();n={sessionContext:e.sessionContext,browserData:e.browserData},this.logger.log("Visa session context obtained",{hasSessionContext:!!e.sessionContext})}catch(e){this.logger.warn("Failed to get Visa session context",e)}let r=(await this.apiClient.post("/passkeys/authenticate",{paymentIntentId:e,paymentId:t,sessionContext:n})).data||{},a=r.network||r.cardBrand?.toLowerCase();this.logger.log("Authentication response received",{enrollmentId:r.enrollmentId,network:a,passkeyAction:r.passkeyAction});let s=null,o=r.passkeyFlow;if("REGISTER"===o?.passkeyAction||o?.deviceStatus?.requiresRegistration)return this.logger.log("Device needs passkey registration before authentication"),{success:!1,message:"This device needs passkey registration",requiresRegistration:!0,network:a||o?.network,stepUpMethods:o?.actionData?.stepUpMethods,enrollmentId:r.enrollmentId,error:{code:"DEVICE_NOT_REGISTERED",message:"Passkey not registered on this device"}};if("visa"===a){if(!this.visaService.isLoaded())throw new En("SDK_LOAD_FAILED","Visa SDK not available. Please ensure Visa is enabled for this environment.");document.getElementById("visa-auth-container")&&this.visaService.showIframe("visa-auth-container");try{let e=await this.visaService.authenticate(r.passkeyFlow?.actionData?.authenticationContext);if("AUTH_COMPLETE"===e.type)s=e.assuranceData;else if("AUTH_CANCELLED"===e.type)return{success:!1,message:"Authentication cancelled by user"}}finally{this.visaService.hideIframe()}}else if("mastercard"===a&&r.passkeyFlow?.authenticationData?.authenticationData?.authRequest){if(!this.mastercardService.isLoaded())throw new En("SDK_LOAD_FAILED","Mastercard SDK not available. Please ensure Mastercard is configured for this environment.");try{let e=await this.mastercardService.authenticate(r.passkeyFlow.authenticationData.authenticationData.authRequest),t=this.getMastercardStatusFailure(e?.authenticationStatus,"authentication");if(t)return t;if("AUTHENTICATED"!==e?.authenticationResult)return{success:!1,message:"Authentication verification failed. Please try again.",error:{code:"AUTH_FAILED",message:"NOT_AUTHENTICATED"===e?.authenticationResult?`Authentication verification failed (result: ${e.authenticationResult})`:"Authentication result was not provided by Mastercard"}};s=e,s.enrollmentId=r.enrollmentId}catch(e){return this.logger.error("Mastercard authentication failed",e),{success:!1,message:"Authentication failed",error:{code:"AUTH_FAILED",message:e.message||"Mastercard authentication failed"}}}}return s?await this.completeAuthenticationInternal(e,s,a,t):{success:!1,message:"Failed to get authentication data from SDK"}}catch(e){throw this.logger.error("Authentication failed",e),new En("AUTH_FAILED","Failed to authenticate payment",e)}}async register(e){await this.initialize(),this.logger.log("Starting registration",{cardId:e});try{let t={};if(this.visaService.isLoaded())try{let e=await this.visaService.getSessionContext();t={sessionContext:e.sessionContext,browserData:e.browserData},this.logger.log("Visa session context obtained",{hasSessionContext:!!e.sessionContext})}catch(e){this.logger.warn("Failed to get Visa session context",e)}let n=(await this.apiClient.post("/passkeys/authenticate",{cardId:e,sessionContext:t})).data||{},r=n.network||n.cardBrand?.toLowerCase();if(this.logger.log("Registration response received",{enrollmentId:n.enrollmentId,network:r,passkeyAction:n.passkeyAction,requiresStepUp:n.passkeyFlow?.actionData?.requiresStepUp}),"visa"===r&&n.passkeyFlow?.actionData?.requiresStepUp)return{success:!1,network:"visa",requiresStepUp:!0,enrollmentId:n.enrollmentId,stepUpMethods:n.passkeyFlow?.actionData?.stepUpMethods||[],message:"Step-up authentication required"};if("visa"===r&&n.passkeyFlow?.deviceStatus?.hasPasskey)return n.vicEnrolled?{success:!0,network:"visa",message:"Passkey already registered for this card",enrollmentId:n.enrollmentId,alreadyRegistered:!0}:{success:!1,network:"visa",requiresVicEnrollment:!0,enrollmentId:n.enrollmentId,authenticationContext:n.passkeyFlow?.actionData?.authenticationContext,message:"Passkey exists but VIC enrollment required. Please authenticate."};let a=n.passkeyFlow?.authenticationData?.authenticationData?.authRequest;if("mastercard"===r&&a)try{this.mastercardService.isLoaded()||await this.mastercardService.loadSDK();let e=await this.mastercardService.authenticate(a),t=this.getMastercardStatusFailure(e?.authenticationStatus,"registration");if(t)return t;if("AUTHENTICATED"!==e?.authenticationResult)return{success:!1,network:"mastercard",message:"Registration verification failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:"NOT_AUTHENTICATED"===e?.authenticationResult?`Registration verification failed (result: ${e.authenticationResult})`:"Registration result was not provided by Mastercard"}};let r=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:n.enrollmentId,assuranceData:e});return{success:!r.error,network:"mastercard",message:r.data?.message||"Registration completed successfully"}}catch(e){return this.logger.error("Mastercard registration failed",e),{success:!1,network:"mastercard",message:"Registration failed",error:{code:"REGISTRATION_FAILED",message:e.message||"Failed to complete Mastercard registration"}}}return{success:!1,message:"Invalid registration response from backend",error:{code:"INVALID_RESPONSE",message:"Backend returned unexpected response"}}}catch(e){throw this.logger.error("Registration failed",e),new En("API_ERROR","Failed to register card",e)}}async completeVicEnrollment(e,t){this.logger.log("Completing VIC enrollment",{enrollmentId:e});try{let n=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:e,assuranceData:t});return{success:!n.error,network:"visa",message:n.data?.message||"VIC enrollment completed"}}catch(e){throw this.logger.error("Failed to complete VIC enrollment",e),new En("API_ERROR","Failed to complete VIC enrollment",e)}}async submitStepUpMethod(e,t){this.logger.log("Submitting step-up method",{enrollmentId:e,methodIndex:t});try{let n=await this.apiClient.post("/passkeys/submit-stepup-method",{enrollmentId:e,methodIndex:t});return{success:!n.error,requiresRetry:!1,attemptsRemaining:n.data?.otpConfig?.maxOTPVerificationAllowed}}catch(e){throw this.logger.error("Failed to submit step-up method",e),new En("API_ERROR","Failed to submit step-up method",e)}}async validateStepUpOTP(e,t){this.logger.log("Validating OTP",{enrollmentId:e});try{let n=await this.apiClient.post("/passkeys/validate-stepup-otp",{enrollmentId:e,otpValue:t}),r=n.data?.otpValid||!1,a=n.data?.actionData?.registrationContext||n.data?.passkeyOptions?.authenticationContext,s=n.data?.canRetry??!0,o=n.data?.attemptsRemaining;return r?(this.logger.log("OTP validated successfully, returning registrationContext for caller"),{success:!0,otpValid:!0,registrationContext:a,message:"OTP validated, ready for passkey registration"}):{success:!1,message:s?"Invalid OTP"+(void 0!==o?`. ${o} attempts remaining.`:""):"Too many failed attempts. Please try a different verification method.",canRetry:s,attemptsRemaining:o,error:{code:s?"INVALID_OTP":"OTP_LOCKED",message:n.data?.error||"OTP validation failed"}}}catch(e){throw this.logger.error("Failed to validate OTP",e),new En("API_ERROR","Failed to validate OTP",e)}}async completeVisaRegistration(e,t){this.logger.log("Completing Visa registration",{enrollmentId:e});let n=null;try{this.visaService.showIframe();let e=await this.visaService.authenticate(t||{});if("AUTH_COMPLETE"===e.type)n=e.assuranceData;else if("AUTH_CANCELLED"===e.type)return{success:!1,message:"Registration cancelled by user"}}catch(e){return this.logger.error("Failed to get assurance data from Visa SDK",e),{success:!1,message:"Failed to complete device registration",error:{code:"SDK_ERROR",message:"Failed to interact with Visa SDK"}}}finally{this.visaService.hideIframe()}if(!n)return{success:!1,message:"Failed to get registration data from SDK"};try{let t=await this.apiClient.post("/passkeys/complete-device-binding",{enrollmentId:e,assuranceData:n});return{success:!t.error,message:t.data?.message||"Registration completed successfully"}}catch(e){return this.logger.error("Failed to complete device binding",e),{success:!1,message:"Failed to complete device binding",error:{code:"BINDING_FAILED",message:"Device binding failed after SDK registration"}}}}getMastercardStatusFailure(e,t){if("authentication"===t){let t={success:!1};switch(e){case"COMPLETE":return null;case"CANCELLED":return{...t,message:"Authentication cancelled by user"};case"EXPIRED":return{...t,message:"Authentication expired. Please try again.",error:{code:"AUTH_FAILED",message:`Authentication expired before completion (status: ${e})`}};case"NOT_SUPPORTED":return{...t,message:"Mastercard authentication is not supported on this device or browser. Please try a different device.",error:{code:"AUTH_FAILED",message:`Authentication not supported (status: ${e})`}};case"PENDING":case"PENDING_CHALLENGE":return{...t,message:"PENDING_CHALLENGE"===e?"Authentication challenge was not completed. Please try again.":"Authentication did not complete. Please try again.",error:{code:"AUTH_FAILED",message:`Authentication incomplete (status: ${e})`}};case void 0:return{...t,message:"Authentication failed. Please try again.",error:{code:"AUTH_FAILED",message:"Authentication status was not provided by Mastercard"}};default:return{...t,message:"Authentication failed. Please try again.",error:{code:"AUTH_FAILED",message:`Unknown authentication status received: ${e}`}}}}let n={success:!1,network:"mastercard"};switch(e){case"COMPLETE":return null;case"CANCELLED":return{...n,message:"Registration cancelled by user"};case"EXPIRED":return{...n,message:"Registration expired. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Registration expired before completion (status: ${e})`}};case"NOT_SUPPORTED":return{...n,message:"Mastercard registration is not supported on this device or browser. Please try a different device.",error:{code:"REGISTRATION_FAILED",message:`Registration not supported (status: ${e})`}};case"PENDING":case"PENDING_CHALLENGE":return{...n,message:"PENDING_CHALLENGE"===e?"Registration challenge was not completed. Please try again.":"Registration did not complete. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Registration incomplete (status: ${e})`}};case void 0:return{...n,message:"Registration failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:"Registration status was not provided by Mastercard"}};default:return{...n,message:"Registration failed. Please try again.",error:{code:"REGISTRATION_FAILED",message:`Unknown registration status received: ${e}`}}}}async completeAuthenticationInternal(e,t,n,r){this.logger.log("Completing authentication",{paymentIntentId:e,network:n,paymentId:r,hasAssuranceData:!!t});try{let a=await this.apiClient.post("/passkeys/complete-authentication",{paymentIntentId:e,paymentId:r,network:n,assuranceData:t});return{success:!a.error,message:a.data?.message||"Authentication completed"}}catch(e){throw this.logger.error("Failed to complete authentication",e),new En("AUTH_FAILED","Failed to complete authentication",e)}}showVisaIframe(e){this.visaService.showIframe(e)}hideVisaIframe(){this.visaService.hideIframe()}getVisaIframe(){return this.visaService.getIframe()}setMastercardPopupDimensions(e,t){this.mastercardService.setPopupDimensions(e,t)}closeMastercardWindow(){this.mastercardService.closeAuthWindow()}getMastercardWindow(){return this.mastercardService.getAuthWindow()}isSDKLoaded(e){return"visa"===e?this.visaService.isLoaded():this.mastercardService.isLoaded()}cleanup(){this.visaService.cleanup(),this.mastercardService.cleanup(),this.sdkConfig=null,this.isInitialized=!1,this.initPromise=null}};const On={enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,isLoading:!1,error:null,canRetry:!0,attemptsRemaining:void 0};const Mn=({onCancel:e})=>(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)($t,{title:"Complete Passkey Setup",onBack:e}),(0,l.jsx)("p",{className:"text-sm text-gray-500 dark:text-slate-400 text-center px-4",children:"Follow the instructions below to create your passkey"}),(0,l.jsx)("div",{id:"visa-auth-container",className:"w-full max-w-sm mx-auto min-h-[300px] bg-gray-50 dark:bg-slate-800 rounded-2xl overflow-hidden"})]});function _n(e,t="USD"){const n=e/100;return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(n)}Mn.displayName="VisaIframeView";var zn=o(72),Fn=o.n(zn),Vn=o(825),Hn=o.n(Vn),$n=o(659),Bn=o.n($n),Gn=o(56),Kn=o.n(Gn),qn=o(540),Wn=o.n(qn),Yn=o(113),Jn=o.n(Yn),Zn=o(61),Xn={};Xn.styleTagTransform=Jn(),Xn.setAttributes=Kn(),Xn.insert=Bn().bind(null,"head"),Xn.domAPI=Hn(),Xn.insertStyleElement=Wn();Fn()(Zn.A,Xn);Zn.A&&Zn.A.locals&&Zn.A.locals;const Qn=({sessionSecret:e,open:t,onClose:n,onSuccess:r,onError:a,onCancel:s,title:o,environment:i="sandbox",developmentApiUrl:c,cardElementApiUrl:u,cardElementUrl:m,debug:p=!1})=>{const h=function(e,t){return t||("sandbox"===e?"https://sandbox.api.payos.ai":"https://api.payos.ai")}(i,c),{session:g,phase:b,loading:f,error:w,isAgentMode:y,hasSelectedCard:x,hasSavedCards:v,paymentView:k,cvc:C,setCvc:N,showMethodList:S,showAddCard:j,returnToCheckout:I,submitIdentity:A,goBackToIdentity:E,submitOTP:T,resendCode:R,selectPaymentCard:P,addPaymentCard:L,deletePaymentCard:U,registrationSubPhase:O,setRegistrationSubPhase:M,skipRegistration:_,completeAgentRegistration:z,setPhase:F,complete:V,abandon:H,clearError:$}=An(e,{apiBaseUrl:h}),B=function(e){const t=(0,d.useRef)(null),[n,r]=(0,d.useState)(!1),[a,s]=(0,d.useState)(On);(0,d.useEffect)(()=>{if(e.sessionSecret){try{t.current=new Un(e.sessionSecret,{sandbox:e.sandbox,debug:e.debug,visaContainerId:e.visaContainerId,apiBaseUrl:e.apiBaseUrl}),r(!0)}catch(e){console.error("[usePasskeySDK] Failed to initialize SDK:",e),s(t=>({...t,error:e?.message||"Failed to initialize passkey SDK"})),r(!1)}return()=>{t.current?.cleanup(),t.current=null,r(!1)}}r(!1)},[e.sessionSecret,e.sandbox,e.debug,e.visaContainerId,e.apiBaseUrl]);const o=(0,d.useCallback)(async e=>{if(!t.current)return{success:!1,message:"SDK not initialized",error:{code:"SDK_NOT_READY",message:"Passkey SDK is not ready"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.register(e);if(n.requiresStepUp){const e=(n.stepUpMethods||[]).map((e,t)=>({id:String(t),type:"email"===e.type?.toLowerCase()?"email":"sms",maskedValue:e.maskedValue||e.value||`Method ${t+1}`}));s(t=>({...t,isLoading:!1,enrollmentId:n.enrollmentId||null,stepUpMethods:e}))}else s(e=>({...e,isLoading:!1}));return n}catch(e){const t=e?.message||"Registration failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"REGISTRATION_ERROR",message:t}}}},[]),i=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.submitStepUpMethod(a.enrollmentId,e),r=a.stepUpMethods[e];return s(e=>({...e,isLoading:!1,selectedMethodDescription:r?.maskedValue||null})),n}catch(e){const t=e?.message||"Failed to send OTP";return s(e=>({...e,isLoading:!1,error:t})),{success:!1}}},[a.enrollmentId,a.stepUpMethods]),l=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1,message:"No enrollment in progress",error:{code:"NO_ENROLLMENT",message:"No active enrollment"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.validateStepUpOTP(a.enrollmentId,e);return n.success?s(e=>({...e,isLoading:!1,canRetry:!0,attemptsRemaining:void 0})):s(e=>({...e,isLoading:!1,error:n.message||"OTP validation failed",canRetry:n.canRetry??!0,attemptsRemaining:n.attemptsRemaining})),n}catch(e){const t=e?.message||"OTP validation failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"OTP_ERROR",message:t}}}},[a.enrollmentId]),c=(0,d.useCallback)(async e=>{if(!t.current||!a.enrollmentId)return{success:!1,message:"No enrollment in progress",error:{code:"NO_ENROLLMENT",message:"No active enrollment"}};s(e=>({...e,isLoading:!0,error:null}));try{const n=await t.current.completeVisaRegistration(a.enrollmentId,e);return s(e=>({...e,isLoading:!1,enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,error:n.success?null:n.message||"Registration failed"})),n}catch(e){const t=e?.message||"Registration failed";return s(e=>({...e,isLoading:!1,enrollmentId:null,stepUpMethods:[],selectedMethodDescription:null,error:t})),{success:!1,message:t,error:{code:"REGISTRATION_ERROR",message:t}}}},[a.enrollmentId]),u=(0,d.useCallback)(async(e,n)=>{if(!t.current)return{success:!1,message:"SDK not initialized",error:{code:"SDK_NOT_READY",message:"Passkey SDK is not ready"}};s(e=>({...e,isLoading:!0,error:null}));try{const r=await t.current.authenticate(e,n);return s(e=>({...e,isLoading:!1})),r}catch(e){const t=e?.message||"Authentication failed";return s(e=>({...e,isLoading:!1,error:t})),{success:!1,message:t,error:{code:"AUTH_ERROR",message:t}}}},[]),m=(0,d.useCallback)(()=>{s(e=>({...e,error:null}))},[]),p=(0,d.useCallback)(()=>{s(On)},[]),h=(0,d.useCallback)(()=>{t.current?.cleanup(),s(On)},[]);return{sdk:t.current,isReady:n,state:a,startRegistration:o,selectStepUpMethod:i,submitVisaOtp:l,completeVisaRegistration:c,authenticate:u,clearError:m,resetState:p,cleanup:h}}({sessionSecret:e,sandbox:"sandbox"===i,debug:p,apiBaseUrl:h,visaContainerId:"visa-auth-container"}),[G,K]=(0,d.useState)(""),[q,W]=(0,d.useState)("US"),[Y,J]=(0,d.useState)(""),[Z,X]=(0,d.useState)(null),[Q,ee]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(0),[re,ae]=(0,d.useState)(0),[se,oe]=(0,d.useState)(""),[ie,le]=(0,d.useState)(null),de=(0,d.useRef)(!1);(0,d.useEffect)(()=>{w&&a(w)},[w,a]),(0,d.useEffect)(()=>{if("SUCCESS"===b&&g){const e=setTimeout(()=>{r({success:!0,sessionId:g.id,paymentIntent:g.paymentIntent,walletUserId:g.walletUser?.id,paymentIntentId:g.paymentIntent.id,credentialGenerated:y})},3e3);return()=>clearTimeout(e)}},[b,g,r,y]),(0,d.useEffect)(()=>{if(g?.walletUser?.phone&&!G){const e=wt(g.walletUser.phone,q);K(e)}},[g?.walletUser?.phone,G,q]),(0,d.useEffect)(()=>{if(te<=0)return;const e=setTimeout(()=>ne(e=>e-1),1e3);return()=>clearTimeout(e)},[te]),(0,d.useEffect)(()=>{"IDENTITY"===b&&(ne(0),ae(0),J(""))},[b]),(0,d.useEffect)(()=>{X(null),B.clearError()},[O]),(0,d.useEffect)(()=>{if("visa_iframe"===O&&ie&&!de.current){de.current=!0;const e=setTimeout(async()=>{try{const e=await B.completeVisaRegistration(ie);le(null),e.success?_():(X(e.message||"Registration failed"),M("initial"))}finally{de.current=!1}},100);return()=>clearTimeout(e)}},[O,ie]);const ce=(0,d.useCallback)(()=>{"PROCESSING"!==b&&(H(),s?.(),n())},[b,H,s,n]),ue=async()=>{if(X(null),!kt(G,q))return void X("Please enter a valid phone number");await A({phone:G})&&J("")},me=async e=>{const t=e||Y;X(null),console.log("[PaymentSheet] Submitting OTP:",{otpCode:t,length:t.length});const n=await T(t);console.log("[PaymentSheet] OTP result:",n),!n.success&&n.error&&(ae(e=>e+1),X(n.error.message))},pe=(0,d.useCallback)(async()=>{X(null),J(""),ee(!0),ne(30);try{await R()}finally{ee(!1)}},[R]),he=async e=>{await P(e)},ge=async(e,t)=>{(await L({cardId:e.cardId||`card_${Date.now()}`,last4:e.last4||"",brand:e.brand||"unknown",network:e.brand||"unknown",cardholderName:e.cardholderName,cardArtUrl:e.cardArtUrl})).success||X("Failed to add card. Please try again.")},be=async()=>{if(g?.selectedCard){if(X(null),!y){const e=await V();return void(!e.success&&e.error&&X(e.error.message))}try{const e=await B.authenticate(g.paymentIntent.id,g.paymentIntent.payments?.[0]?.id);if(e.success){const e=await V({passkeyAuthenticated:!0});return void(!e.success&&e.error&&X(e.error.message))}if(e.requiresRegistration||"NOT_ENROLLED"===e.error?.code||"DEVICE_NOT_REGISTERED"===e.error?.code||e.message?.toLowerCase().includes("not enrolled")||e.message?.toLowerCase().includes("no enrollment")){const e=await B.startRegistration(g.selectedCard.id);if(e.requiresStepUp&&"visa"===e.network)return F("AGENT_REGISTRATION"),void M("visa_method_select");if(e.success){const e=await B.authenticate(g.paymentIntent.id,g.paymentIntent.payments?.[0]?.id);if(e.success){const e=await V({passkeyAuthenticated:!0});!e.success&&e.error&&X(e.error.message)}else X(e.message||"Authentication failed after registration");return}return void X(e.message||"Registration failed")}X(e.message||"Authentication failed")}catch(e){const t=e instanceof Error?e.message:"Passkey authentication failed";X(t)}}else X("Please select a card")},fe=async()=>{if(!g?.selectedCard?.id)return;X(null);const e=await B.startRegistration(g.selectedCard.id);e.requiresStepUp&&"visa"===e.network?M("visa_method_select"):e.success?z():X(e.message||"Registration failed")},we=async e=>{X(null);const t=parseInt(e,10);(await B.selectStepUpMethod(t)).success?(oe(""),M("visa_otp_entry")):X("Failed to send verification code")},ye=async()=>{if(!se)return;X(null);const e=await B.submitVisaOtp(se);e.success&&e.registrationContext?(oe(""),le(e.registrationContext),M("visa_iframe")):e.success||(oe(""),X(e.message||"Invalid verification code"))},xe=()=>{X(null),B.resetState(),_()},ve=g?.paymentIntent.payments.map(e=>({label:e.description||e.merchantName,value:_n(e.subtotal,g.paymentIntent.currency),quantity:e.quantity})),ke=g?.paymentIntent.totalSubtotal?_n(g.paymentIntent.totalSubtotal,g.paymentIntent.currency):void 0,Ce=g?.paymentIntent.totalTax?_n(g.paymentIntent.totalTax,g.paymentIntent.currency):void 0,Ne=g?.paymentIntent.totalShipping?_n(g.paymentIntent.totalShipping,g.paymentIntent.currency):void 0,Se=g?.paymentIntent.facilitationFee?_n(g.paymentIntent.facilitationFee.amount,g.paymentIntent.currency):void 0,je=g?_n(g.paymentIntent.totalAmount+(g.paymentIntent.facilitationFee?.amount||0),g.paymentIntent.currency):void 0,Ie=Z||w?.message;return t?(0,l.jsx)(Mt,{open:t,onClose:ce,title:(()=>{if("PAYMENT"===b){if("methods"===k)return"Payment Methods";if("add"===k)return v?"Add Card":"Secure Checkout"}return"AGENT_REGISTRATION"===b?"Authorization Required":o||"Checkout"})(),amount:je,orderItems:ve,subtotal:ke,shipping:Ne,tax:Ce,orderAgentFee:Se,mode:y?"agent":"standard",children:(()=>{if("LOADING"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,l.jsx)(D,{className:"w-12 h-12 text-gray-400 animate-spin"}),(0,l.jsx)("p",{className:"text-gray-600 dark:text-slate-400",children:"Loading checkout..."})]});if("ERROR"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4 text-center",children:[(0,l.jsx)(Xt,{className:"w-16 h-16 text-red-500"}),(0,l.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Something went wrong"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:w?.message||"Unable to load checkout session"}),(0,l.jsx)("button",{onClick:ce,className:"mt-4 px-6 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100",children:"Close"})]});if("EXPIRED"===b)return(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4 text-center",children:[(0,l.jsx)(Xt,{className:"w-16 h-16 text-amber-500"}),(0,l.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Session Expired"}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"This checkout session has expired. Please start a new checkout."}),(0,l.jsx)("button",{onClick:ce,className:"mt-4 px-6 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100",children:"Close"})]});if("IDENTITY"===b)return(0,l.jsx)(Ct,{phone:G,onPhoneChange:e=>{K(e),X(null),$()},countryCode:q,onCountryChange:W,onSubmit:ue,isLoading:f,error:Ie||void 0});if("OTP_VERIFY"===b)return(0,l.jsx)(Gt,{phoneNumber:G,otp:Y,onOtpChange:J,onSubmit:me,onEdit:E,onResend:pe,isLoading:f,isResending:Q,error:Ie||void 0,resendCooldown:te,retryCount:re,maxRetries:3});if("AGENT_REGISTRATION"===b&&g){const e=g.selectedCard?.network||"visa";return"visa_method_select"===O?(0,l.jsx)(dn,{methods:B.state.stepUpMethods.map((e,t)=>({id:String(t),type:e.type,maskedValue:e.maskedValue})),onSelectMethod:we,onBack:()=>M("initial"),isLoading:B.state.isLoading}):"visa_otp_entry"===O?(0,l.jsx)(un,{methodDescription:B.state.selectedMethodDescription||"your phone",otp:se,onOtpChange:e=>{oe(e),Z&&X(null),B.state.error&&B.clearError()},onVerify:ye,onBack:()=>M("visa_method_select"),onResend:async()=>{oe(""),X(null),B.clearError()},onVerifyAnotherWay:()=>{oe(""),X(null),B.clearError(),B.resetState(),M("visa_method_select")},isLoading:B.state.isLoading,error:Z||B.state.error||void 0,canRetry:B.state.canRetry}):"visa_iframe"===O?(0,l.jsx)(Mn,{onCancel:()=>M("initial")}):(0,l.jsx)(hn,{cardNetwork:e,onCreatePasskey:fe,onSkip:Z?xe:void 0,onBack:I,isLoading:B.state.isLoading,error:Z||void 0,showSkip:!!Z,paymentIntent:g.paymentIntent,merchantName:g.paymentIntent.payments[0]?.merchantName||"Merchant"})}if("PAYMENT"===b&&g){if("checkout"===k&&x&&g.selectedCard){const e=f||B.state.isLoading;return(0,l.jsx)(qt,{selectedCard:g.selectedCard,cvc:C,onCvcChange:N,onChangeCard:S,paymentIntent:g.paymentIntent,onSubmit:be,isLoading:e,error:Ie||void 0})}if("methods"===k)return(0,l.jsx)(Zt,{cards:g.savedCards||[],selectedCardId:g.selectedCard?.id||null,onSelectCard:he,onAddNewCard:j,onBack:x?I:ce,onDeleteCard:U});if("add"===k)return(0,l.jsx)(tn,{linkToken:g.linkToken,walletUserId:g.paymentIntent.walletUserId,onSubmit:ge,onBack:v?S:void 0,isLoading:f,error:Ie||void 0,isFirstCard:!v,customBaseUrl:m||"https://wallet-onboard.payos.ai",environment:i,devApiUrl:u})}return"PROCESSING"===b?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[(0,l.jsx)("div",{className:"w-16 h-16 border-4 border-gray-200 dark:border-slate-700 border-t-black dark:border-t-white rounded-full animate-spin"}),(0,l.jsx)("p",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:y?"Generating Credentials...":"Processing Payment..."}),(0,l.jsx)("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Please wait while we process your request"})]}):"SUCCESS"===b&&g?(0,l.jsx)(rn,{paymentIntent:g.paymentIntent,walletUser:g.walletUser,cardNetwork:g.selectedCard?.network,onDismiss:ce,passkeyEnrolled:g.selectedCard?.passkeyEnrolled}):null})()}):null},er=e=>new Promise(t=>setTimeout(t,e)),tr=async e=>{console.log("[Mock] Sending OTP to:",e),await er(800),console.log("[Mock] OTP sent successfully")},nr=async e=>{console.log("[Mock] Verifying OTP:",e),await er(500);const t="123456"===e||6===e.length;return console.log("[Mock] OTP verification result:",t),t},rr=async e=>{console.log("[Mock] Processing payment:",e),await er(2e3);const t={success:!0,transactionId:`txn_mock_${Date.now()}`,amount:e.amount,cardLast4:e.cardData.last4,timestamp:Date.now()};return console.log("[Mock] Payment processed successfully:",t),t};function ar({mode:e,amount:t,savedCards:n,onSuccess:r,onError:a}){const[s,o]=(0,d.useState)({phase:"PHONE_INPUT",phoneNumber:"",email:"",cardData:null,billingAddress:null,error:null,isLoading:!1}),[i,l]=(0,d.useState)(n&&n.length>0?n.find(e=>e.isDefault)?.id||n[0].id:null),[c,u]=(0,d.useState)(n&&n.length>0?"checkout":"add"),[m,p]=(0,d.useState)(""),h=(0,d.useCallback)(e=>{o(t=>({...t,error:e,isLoading:!1}))},[]),g=(0,d.useCallback)(e=>{o(t=>({...t,isLoading:e}))},[]),b=(0,d.useCallback)(async e=>{g(!0),h(null);try{await tr(e),o(t=>({...t,phoneNumber:e,phase:"OTP_VERIFY",isLoading:!1}))}catch(e){h("Failed to send OTP. Please try again."),a?.(e)}},[g,h,a]),f=(0,d.useCallback)(async e=>{g(!0),h(null);try{if(await nr(e))if(o(e=>({...e,phase:"PAYMENT",isLoading:!1})),n&&n.length>0){u("checkout");const e=n.find(e=>e.isDefault)||n[0];l(e.id)}else u("add"),l(null);else h("Invalid code. Please try again.")}catch(e){h("Failed to verify OTP. Please try again."),a?.(e)}},[g,h,a,n]),w=(0,d.useCallback)(async(n,i,l)=>{g(!0),h(null),o(e=>({...e,phase:"PROCESSING"}));try{const a=await rr({phoneNumber:s.phoneNumber,email:n,cardData:i,amount:t,mode:e});o(e=>({...e,email:n,cardData:i,billingAddress:l,phase:"SUCCESS",isLoading:!1})),setTimeout(()=>{r?.(a)},3e3)}catch(e){h("Payment failed. Please try again."),o(e=>({...e,phase:"PAYMENT"})),a?.(e)}},[s.phoneNumber,t,e,h,r,a]),y=(0,d.useCallback)(e=>{l(e),u("checkout")},[]),x=(0,d.useCallback)(async t=>{g(!0),h(null);try{await new Promise(e=>setTimeout(e,500)),o(e=>({...e,cardData:t,isLoading:!1})),"agent"===e?o(e=>({...e,phase:"AGENT_REGISTRATION"})):u("checkout")}catch(e){h("Failed to add card. Please try again."),a?.(e)}},[g,h,a,e]),v=(0,d.useCallback)(()=>{if(o({phase:"PHONE_INPUT",phoneNumber:"",email:"",cardData:null,billingAddress:null,error:null,isLoading:!1}),n&&n.length>0){const e=n.find(e=>e.isDefault)||n[0];l(e.id),u("checkout")}else l(null),u("add");p("")},[n]),k=(0,d.useCallback)(()=>{u("methods")},[]),C=(0,d.useCallback)(()=>{u("add")},[]),N=(0,d.useCallback)(()=>{u("checkout")},[]),S=(0,d.useCallback)(()=>{if(o(e=>({...e,phase:"PAYMENT",phoneNumber:"+15551234567",error:null,isLoading:!1})),n&&n.length>0){const e=n.find(e=>e.isDefault)||n[0];l(e.id),u("checkout")}else l(null),u("add");p("")},[n]),j=(0,d.useCallback)(()=>{o(e=>({...e,phase:"PAYMENT"})),u("checkout")},[]);return{state:s,selectedCardId:i,paymentView:c,cvc:m,setCvc:p,submitPhone:b,verifyOTP:f,submitPayment:w,selectCard:y,addCard:x,logout:v,setError:h,showMethodList:k,showAddCard:C,returnToCheckout:N,skipToPayment:S,completeAgentRegistration:j}}return i})());