@omnikit-js/ui 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -11
- package/package.json +3 -6
- package/dist/client.esm.js +0 -28
- package/dist/client.esm.js.map +0 -1
- package/dist/client.js +0 -28
- package/dist/client.js.map +0 -1
- package/dist/index.esm.js +0 -28
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/styles.css +0 -553
- package/styles.css +0 -548
package/README.md
CHANGED
|
@@ -19,21 +19,24 @@ A comprehensive SaaS billing component for Next.js applications with Stripe inte
|
|
|
19
19
|
npm install @omnikit-js/ui
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### Setup
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Since your app already uses Tailwind CSS, just add our component to your `tailwind.config.js`:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
```js
|
|
27
|
+
module.exports = {
|
|
28
|
+
content: [
|
|
29
|
+
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
|
30
|
+
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
31
|
+
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
32
|
+
// Add this line
|
|
33
|
+
'./node_modules/@omnikit-js/ui/**/*.{js,ts,jsx,tsx}',
|
|
34
|
+
],
|
|
35
|
+
// ... rest of your config
|
|
36
|
+
}
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
**That's it!**
|
|
39
|
+
**That's it!** No CSS imports needed. The component will use your existing Tailwind configuration.
|
|
37
40
|
|
|
38
41
|
## Prerequisites
|
|
39
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnikit-js/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "A SaaS billing component for Next.js with Stripe integration",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -10,13 +10,10 @@
|
|
|
10
10
|
"types": "./src/index.ts",
|
|
11
11
|
"import": "./src/index.ts",
|
|
12
12
|
"require": "./src/index.ts"
|
|
13
|
-
}
|
|
14
|
-
"./styles.css": "./styles.css"
|
|
13
|
+
}
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
17
|
-
"src"
|
|
18
|
-
"dist",
|
|
19
|
-
"styles.css"
|
|
16
|
+
"src"
|
|
20
17
|
],
|
|
21
18
|
"scripts": {
|
|
22
19
|
"build": "rollup -c",
|
package/dist/client.esm.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import t,{useState as r,forwardRef as n,createElement as o}from"react";import{useRouter as a}from"next/navigation";import{jsx as i,jsxs as s,Fragment as c}from"react/jsx-runtime";import*as l from"react-dom";import u from"react-dom";var d,m="basil",f="https://js.stripe.com",p="".concat(f,"/").concat(m,"/stripe.js"),h=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,v=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,g=function(e){return h.test(e)||v.test(e)},b=function(e){var t=document.createElement("script");t.src="".concat(p).concat("");var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(t),t},y=null,w=null,E=null,x=function(e){return null!==y?y:(y=new Promise(function(t,r){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(f,'"]')),t=0;t<e.length;t++){var r=e[t];if(g(r.src))return r}return null}();if(n&&e);else if(n){if(n&&null!==E&&null!==w){var o;n.removeEventListener("load",E),n.removeEventListener("error",w),null===(o=n.parentNode)||void 0===o||o.removeChild(n),n=b()}}else n=b();E=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(t,r),w=function(e){return function(t){e(new Error("Failed to load Stripe.js",{cause:t}))}}(r),n.addEventListener("load",E),n.addEventListener("error",w)}catch(e){return void r(e)}else t(null)})).catch(function(e){return y=null,Promise.reject(e)})},k=!1,R=function(){return d||(d=x(null).catch(function(e){return d=null,Promise.reject(e)}))};Promise.resolve().then(function(){return R()}).catch(function(e){k||console.warn(e)});function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}};function _(){}function S(){}S.resetWarningCache=_;C.exports=function(){function e(e,t,r,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:S,resetWarningCache:_};return r.PropTypes=r,r}();var P=N(C.exports);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){L(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,o,a=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var j=function(e,r,n){var o=!!n,a=t.useRef(n);t.useEffect(function(){a.current=n},[n]),t.useEffect(function(){if(!o||!e)return function(){};var t=function(){a.current&&a.current.apply(a,arguments)};return e.on(r,t),function(){e.off(r,t)}},[o,r,e,a])},F=function(e){var r=t.useRef(e);return t.useEffect(function(){r.current=e},[e]),r.current},z=function(e){return null!==e&&"object"===A(e)},$="[object Object]",B=function e(t,r){if(!z(t)||!z(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var o=Object.prototype.toString.call(t)===$;if(o!==(Object.prototype.toString.call(r)===$))return!1;if(!o&&!n)return t===r;var a=Object.keys(t),i=Object.keys(r);if(a.length!==i.length)return!1;for(var s={},c=0;c<a.length;c+=1)s[a[c]]=!0;for(var l=0;l<i.length;l+=1)s[i[l]]=!0;var u=Object.keys(s);if(u.length!==a.length)return!1;var d=t,m=r;return u.every(function(t){return e(d[t],m[t])})},W=function(e,t,r){return z(e)?Object.keys(e).reduce(function(n,o){var a=!z(t)||!B(e[o],t[o]);return r.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),n):a?M(M({},n||{}),{},L({},o,e[o])):n},null):null},H="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",U=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;if(null===e||z(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;throw new Error(r)},V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;if(function(e){return z(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return U(e,t)})};var r=U(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},G=t.createContext(null);G.displayName="ElementsContext";var q=function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},K=function(e){var r=e.stripe,n=e.options,o=e.children,a=t.useMemo(function(){return V(r)},[r]),i=I(t.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(n):null}}),2),s=i[0],c=i[1];t.useEffect(function(){var e=!0,t=function(e){c(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return"async"!==a.tag||s.stripe?"sync"!==a.tag||s.stripe||t(a.stripe):a.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[a,s,n]);var l=F(r);t.useEffect(function(){null!==l&&l!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[l,r]);var u=F(n);return t.useEffect(function(){if(s.elements){var e=W(n,u,["clientSecret","fonts"]);e&&s.elements.update(e)}},[n,u,s.elements]),t.useEffect(function(){var e;(e=s.stripe)&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"3.7.0"}),e.registerAppInfo({name:"react-stripe-js",version:"3.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},[s.stripe]),t.createElement(G.Provider,{value:s},o)};K.propTypes={stripe:P.any,options:P.object};var Y=function(){var e,r;return(e="calls useElements()",r=t.useContext(G),q(r,e)).elements};P.func.isRequired;var Z=t.createContext(null);Z.displayName="CheckoutSdkContext";t.createContext(null).displayName="CheckoutContext",P.any,P.shape({fetchClientSecret:P.func.isRequired,elementsOptions:P.object}).isRequired;var X=function(e){var r=t.useContext(Z),n=t.useContext(G);if(r&&n)throw new Error("You cannot wrap the part of your app that ".concat(e," in both <CheckoutProvider> and <Elements> providers."));return r?function(e,t){if(!e)throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(t," in an <CheckoutProvider> provider."));return e}(r,e):q(n,e)},J=["mode"],Q=function(e,r){var n,o="".concat((n=e).charAt(0).toUpperCase()+n.slice(1),"Element"),a=r?function(e){X("mounts <".concat(o,">"));var r=e.id,n=e.className;return t.createElement("div",{id:r,className:n})}:function(r){var n,a=r.id,i=r.className,s=r.options,c=void 0===s?{}:s,l=r.onBlur,u=r.onFocus,d=r.onReady,m=r.onChange,f=r.onEscape,p=r.onClick,h=r.onLoadError,v=r.onLoaderStart,g=r.onNetworksChange,b=r.onConfirm,y=r.onCancel,w=r.onShippingAddressChange,E=r.onShippingRateChange,x=X("mounts <".concat(o,">")),k="elements"in x?x.elements:null,R="checkoutSdk"in x?x.checkoutSdk:null,N=I(t.useState(null),2),C=N[0],_=N[1],S=t.useRef(null),P=t.useRef(null);j(C,"blur",l),j(C,"focus",u),j(C,"escape",f),j(C,"click",p),j(C,"loaderror",h),j(C,"loaderstart",v),j(C,"networkschange",g),j(C,"confirm",b),j(C,"cancel",y),j(C,"shippingaddresschange",w),j(C,"shippingratechange",E),j(C,"change",m),d&&(n="expressCheckout"===e?d:function(){d(C)}),j(C,"ready",n),t.useLayoutEffect(function(){if(null===S.current&&null!==P.current&&(k||R)){var t=null;if(R)switch(e){case"payment":t=R.createPaymentElement(c);break;case"address":if(!("mode"in c))throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");var r=c.mode,n=D(c,J);if("shipping"===r)t=R.createShippingAddressElement(n);else{if("billing"!==r)throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");t=R.createBillingAddressElement(n)}break;case"expressCheckout":t=R.createExpressCheckoutElement(c);break;case"currencySelector":t=R.createCurrencySelectorElement();break;default:throw new Error("Invalid Element type ".concat(o,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else k&&(t=k.create(e,c));S.current=t,_(t),t&&t.mount(P.current)}},[k,R,c]);var O=F(c);return t.useEffect(function(){if(S.current){var e=W(c,O,["paymentRequest"]);e&&"update"in S.current&&S.current.update(e)}},[c,O]),t.useLayoutEffect(function(){return function(){if(S.current&&"function"==typeof S.current.destroy)try{S.current.destroy(),S.current=null}catch(e){}}},[]),t.createElement("div",{id:a,className:i,ref:P})};return a.propTypes={id:P.string,className:P.string,onChange:P.func,onBlur:P.func,onFocus:P.func,onReady:P.func,onEscape:P.func,onClick:P.func,onLoadError:P.func,onLoaderStart:P.func,onNetworksChange:P.func,onConfirm:P.func,onCancel:P.func,onShippingAddressChange:P.func,onShippingRateChange:P.func,options:P.object},a.displayName=o,a.__elementType=e,a},ee="undefined"==typeof window;t.createContext(null).displayName="EmbeddedCheckoutProviderContext";Q("auBankAccount",ee);var te=Q("card",ee);function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},re.apply(null,arguments)}function ne(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function oe(...e){return t=>{let r=!1;const n=e.map(e=>{const n=ne(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():ne(e[t],null)}}}}function ae(...t){return e.useCallback(oe(...t),t)}function ie(t){const r=ce(t),n=e.forwardRef((t,n)=>{const{children:o,...a}=t,s=e.Children.toArray(o),c=s.find(ue);if(c){const t=c.props.children,o=s.map(r=>r===c?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return i(r,{...a,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return i(r,{...a,ref:n,children:o})});return n.displayName=`${t}.Slot`,n}Q("cardNumber",ee),Q("cardExpiry",ee),Q("cardCvc",ee),Q("fpxBank",ee),Q("iban",ee),Q("idealBank",ee),Q("p24Bank",ee),Q("epsBank",ee),Q("payment",ee),Q("expressCheckout",ee),Q("currencySelector",ee),Q("paymentRequestButton",ee),Q("linkAuthentication",ee),Q("address",ee),Q("shippingAddress",ee),Q("paymentMethodMessaging",ee),Q("affirmMessage",ee),Q("afterpayClearpayMessage",ee);var se=ie("Slot");function ce(t){const r=e.forwardRef((t,r)=>{const{children:n,...o}=t;if(e.isValidElement(n)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(o,n.props);return n.type!==e.Fragment&&(a.ref=r?oe(r,t):t),e.cloneElement(n,a)}return e.Children.count(n)>1?e.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var le=Symbol("radix.slottable");function ue(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===le}function de(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=de(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function me(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=de(e))&&(n&&(n+=" "),n+=t);return n}const fe=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,pe=me,he=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return pe(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=fe(t)||fe(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return pe(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},ve=e=>{const t=we(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),ge(r,t)||ye(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},ge=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ge(e.slice(1),n):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},be=/^\[(.+)\]$/,ye=e=>{if(be.test(e)){const t=be.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},we=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)Ee(r[e],n,e,t);return n},Ee=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:xe(t,e)).classGroupId=r)}if("function"==typeof e)return ke(e)?void Ee(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Ee(o,xe(t,e),r,n)})})},xe=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},ke=e=>e.isThemeGetter,Re=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Ne=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===n&&0===o){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){r=i;continue}}"["===s?n++:"]"===s?n--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.substring(a),s=Ce(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:r&&r>a?r-a:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},Ce=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,_e=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},Se=/\s+/;function Pe(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Oe(e))&&(n&&(n+=" "),n+=t);return n}const Oe=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Oe(e[n]))&&(r&&(r+=" "),r+=t);return r};function Me(e,...t){let r,n,o,a=function(s){const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Re(e.cacheSize),parseClassName:Ne(e),sortModifiers:_e(e),...ve(e)}))(c),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Se);let c="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:m,maybePostfixModifierPosition:f}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let p=!!f,h=n(p?m.substring(0,f):m);if(!h){if(!p){c=t+(c.length>0?" "+c:c);continue}if(h=n(m),!h){c=t+(c.length>0?" "+c:c);continue}p=!1}const v=a(u).join(":"),g=d?v+"!":v,b=g+h;if(i.includes(b))continue;i.push(b);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];i.push(g+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return o(e,a),a}return function(){return a(Pe.apply(null,arguments))}}const Ae=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Le=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,De=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ie=/^\d+\/\d+$/,Te=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,je=/\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$/,Fe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ze=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Be=e=>Ie.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),He=e=>!!e&&Number.isInteger(Number(e)),Ue=e=>e.endsWith("%")&&We(e.slice(0,-1)),Ve=e=>Te.test(e),Ge=()=>!0,qe=e=>je.test(e)&&!Fe.test(e),Ke=()=>!1,Ye=e=>ze.test(e),Ze=e=>$e.test(e),Xe=e=>!Qe(e)&&!at(e),Je=e=>mt(e,vt,Ke),Qe=e=>Le.test(e),et=e=>mt(e,gt,qe),tt=e=>mt(e,bt,We),rt=e=>mt(e,pt,Ke),nt=e=>mt(e,ht,Ze),ot=e=>mt(e,wt,Ye),at=e=>De.test(e),it=e=>ft(e,gt),st=e=>ft(e,yt),ct=e=>ft(e,pt),lt=e=>ft(e,vt),ut=e=>ft(e,ht),dt=e=>ft(e,wt,!0),mt=(e,t,r)=>{const n=Le.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},ft=(e,t,r=!1)=>{const n=De.exec(e);return!!n&&(n[1]?t(n[1]):r)},pt=e=>"position"===e||"percentage"===e,ht=e=>"image"===e||"url"===e,vt=e=>"length"===e||"size"===e||"bg-size"===e,gt=e=>"length"===e,bt=e=>"number"===e,yt=e=>"family-name"===e,wt=e=>"shadow"===e,Et=Me(()=>{const e=Ae("color"),t=Ae("font"),r=Ae("text"),n=Ae("font-weight"),o=Ae("tracking"),a=Ae("leading"),i=Ae("breakpoint"),s=Ae("container"),c=Ae("spacing"),l=Ae("radius"),u=Ae("shadow"),d=Ae("inset-shadow"),m=Ae("text-shadow"),f=Ae("drop-shadow"),p=Ae("blur"),h=Ae("perspective"),v=Ae("aspect"),g=Ae("ease"),b=Ae("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",at,Qe],w=()=>[at,Qe,c],E=()=>[Be,"full","auto",...w()],x=()=>[He,"none","subgrid",at,Qe],k=()=>["auto",{span:["full",He,at,Qe]},He,at,Qe],R=()=>[He,"auto",at,Qe],N=()=>["auto","min","max","fr",at,Qe],C=()=>["auto",...w()],_=()=>[Be,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],S=()=>[e,at,Qe],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ct,rt,{position:[at,Qe]}],O=()=>["auto","cover","contain",lt,Je,{size:[at,Qe]}],M=()=>[Ue,it,et],A=()=>["","none","full",l,at,Qe],L=()=>["",We,it,et],D=()=>[We,Ue,ct,rt],I=()=>["","none",p,at,Qe],T=()=>["none",We,at,Qe],j=()=>["none",We,at,Qe],F=()=>[We,at,Qe],z=()=>[Be,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ve],breakpoint:[Ve],color:[Ge],container:[Ve],"drop-shadow":[Ve],ease:["in","out","in-out"],font:[Xe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ve],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ve],shadow:[Ve],spacing:["px",We],text:[Ve],"text-shadow":[Ve],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Be,Qe,at,v]}],container:["container"],columns:[{columns:[We,Qe,at,s]}],"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:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[He,"auto",at,Qe]}],basis:[{basis:[Be,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Be,"auto","initial","none",Qe]}],grow:[{grow:["",We,at,Qe]}],shrink:[{shrink:["",We,at,Qe]}],order:[{order:[He,"first","last","none",at,Qe]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"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:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],w:[{w:[s,"screen",..._()]}],"min-w":[{"min-w":[s,"screen","none",..._()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",r,it,et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,at,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ue,Qe]}],"font-family":[{font:[st,Qe,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:[o,at,Qe]}],"line-clamp":[{"line-clamp":[We,"none",at,tt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",at,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",at,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",at,et]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[We,"auto",at,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",at,Qe]}],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",at,Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},He,at,Qe],radial:["",at,Qe],conic:[He,at,Qe]},ut,nt]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:M()}],"gradient-via-pos":[{via:M()}],"gradient-to-pos":[{to:M()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"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:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[We,at,Qe]}],"outline-w":[{outline:["",We,it,et]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",u,dt,ot]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",d,dt,ot]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[We,et]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",m,dt,ot]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[We,at,Qe]}],"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":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[at,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"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":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",at,Qe]}],filter:[{filter:["","none",at,Qe]}],blur:[{blur:I()}],brightness:[{brightness:[We,at,Qe]}],contrast:[{contrast:[We,at,Qe]}],"drop-shadow":[{"drop-shadow":["","none",f,dt,ot]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",We,at,Qe]}],"hue-rotate":[{"hue-rotate":[We,at,Qe]}],invert:[{invert:["",We,at,Qe]}],saturate:[{saturate:[We,at,Qe]}],sepia:[{sepia:["",We,at,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",at,Qe]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[We,at,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[We,at,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,at,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,at,Qe]}],"backdrop-invert":[{"backdrop-invert":["",We,at,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[We,at,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[We,at,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",We,at,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",at,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",at,Qe]}],ease:[{ease:["linear","initial",g,at,Qe]}],delay:[{delay:[We,at,Qe]}],animate:[{animate:["none",b,at,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,at,Qe]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[at,Qe,"","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:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"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",at,Qe]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",at,Qe]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[We,it,et,tt]}],stroke:[{stroke:["none",...S()]}],"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"]}});function xt(...e){return Et(me(e))}const kt=he("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Rt({className:t,variant:r,size:n,asChild:o=!1,...a}){const i=o?se:"button";return e.createElement(i,re({"data-slot":"button",className:xt(kt({variant:r,size:n,className:t}))},a))}function Nt({className:t,...r}){return e.createElement("div",re({"data-slot":"card",className:xt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t)},r))}function Ct({className:t,...r}){return e.createElement("div",re({"data-slot":"card-header",className:xt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t)},r))}function _t({className:t,...r}){return e.createElement("div",re({"data-slot":"card-title",className:xt("leading-none font-semibold",t)},r))}function St({className:t,...r}){return e.createElement("div",re({"data-slot":"card-description",className:xt("text-muted-foreground text-sm",t)},r))}function Pt({className:t,...r}){return e.createElement("div",re({"data-slot":"card-content",className:xt("px-6",t)},r))}function Ot({className:t,...r}){return e.createElement("div",re({"data-slot":"card-footer",className:xt("flex items-center px-6 [.border-t]:pt-6",t)},r))}const Mt=he("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function At({className:t,variant:r,asChild:n=!1,...o}){const a=n?se:"span";return e.createElement(a,re({"data-slot":"badge",className:xt(Mt({variant:r}),t)},o))}function Lt(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=n?.[t]||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const a=e.createContext(o),s=n.length;n=[...n,o];const c=r=>{const{scope:n,children:o,...c}=r,l=n?.[t]?.[s]||a,u=e.useMemo(()=>c,Object.values(c));return i(l.Provider,{value:u,children:o})};return c.displayName=r+"Provider",[c,function(n,i){const c=i?.[t]?.[s]||a,l=e.useContext(c);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},Dt(o,...r)]}function Dt(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}var It=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ie(`Primitive.${r}`),o=e.forwardRef((e,t)=>{const{asChild:o,...a}=e,s=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),i(s,{...a,ref:t})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var Tt="Progress",jt=100,[Ft,zt]=Lt(Tt),[$t,Bt]=Ft(Tt),Wt=e.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:o,getValueLabel:a=Vt,...s}=e;!o&&0!==o||Kt(o)||console.error(`Invalid prop \`max\` of value \`${`${o}`}\` supplied to \`${"Progress"}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const c=Kt(o)?o:jt;null===n||Yt(n,c)||console.error(function(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}(`${n}`,"Progress"));const l=Yt(n,c)?n:null,u=qt(l)?a(l,c):void 0;return i($t,{scope:r,value:l,max:c,children:i(It.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":qt(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":Gt(l,c),"data-value":l??void 0,"data-max":c,...s,ref:t})})});Wt.displayName=Tt;var Ht="ProgressIndicator",Ut=e.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,o=Bt(Ht,r);return i(It.div,{"data-state":Gt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});function Vt(e,t){return`${Math.round(e/t*100)}%`}function Gt(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function qt(e){return"number"==typeof e}function Kt(e){return qt(e)&&!isNaN(e)&&e>0}function Yt(e,t){return qt(e)&&!isNaN(e)&&e<=t&&e>=0}Ut.displayName=Ht;var Zt=Wt,Xt=Ut;function Jt({className:t,value:r,...n}){return e.createElement(Zt,re({"data-slot":"progress",className:xt("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t)},n),e.createElement(Xt,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}}))}function Qt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}var er=globalThis?.document?e.useLayoutEffect:()=>{},tr=e[" useId ".trim().toString()]||(()=>{}),rr=0;function nr(t){const[r,n]=e.useState(tr());return er(()=>{n(e=>e??String(rr++))},[t]),r?`radix-${r}`:""}function or(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>r.current?.(...e),[])}var ar=e[" useInsertionEffect ".trim().toString()]||er;function ir({prop:t,defaultProp:r,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:t,onChange:r}){const[n,o]=e.useState(t),a=e.useRef(n),i=e.useRef(r);return ar(()=>{i.current=r},[r]),e.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:r,onChange:n}),c=void 0!==t,l=c?t:a;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=c},[c,o])}const u=e.useCallback(e=>{if(c){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&s.current?.(r)}else i(e)},[c,t,i,s]);return[l,u]}var sr=e.createContext(void 0);function cr(t){const r=e.useContext(sr);return t||r||"ltr"}var lr="rovingFocusGroup.onEntryFocus",ur={bubbles:!1,cancelable:!0},dr="RovingFocusGroup",[mr,fr,pr]=function(e){const r=e+"CollectionProvider",[n,o]=Lt(r),[a,s]=n(r,{collectionRef:{current:null},itemMap:new Map}),c=e=>{const{scope:r,children:n}=e,o=t.useRef(null),s=t.useRef(new Map).current;return i(a,{scope:r,itemMap:s,collectionRef:o,children:n})};c.displayName=r;const l=e+"CollectionSlot",u=ie(l),d=t.forwardRef((e,t)=>{const{scope:r,children:n}=e,o=ae(t,s(l,r).collectionRef);return i(u,{ref:o,children:n})});d.displayName=l;const m=e+"CollectionItemSlot",f="data-radix-collection-item",p=ie(m),h=t.forwardRef((e,r)=>{const{scope:n,children:o,...a}=e,c=t.useRef(null),l=ae(r,c),u=s(m,n);return t.useEffect(()=>(u.itemMap.set(c,{ref:c,...a}),()=>{u.itemMap.delete(c)})),i(p,{[f]:"",ref:l,children:o})});return h.displayName=m,[{Provider:c,Slot:d,ItemSlot:h},function(r){const n=s(e+"CollectionConsumer",r);return t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},o]}(dr),[hr,vr]=Lt(dr,[pr]),[gr,br]=hr(dr),yr=e.forwardRef((e,t)=>i(mr.Provider,{scope:e.__scopeRovingFocusGroup,children:i(mr.Slot,{scope:e.__scopeRovingFocusGroup,children:i(wr,{...e,ref:t})})}));yr.displayName=dr;var wr=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...f}=t,p=e.useRef(null),h=ae(r,p),v=cr(s),[g,b]=ir({prop:c,defaultProp:l??null,onChange:u,caller:dr}),[y,w]=e.useState(!1),E=or(d),x=fr(n),k=e.useRef(!1),[R,N]=e.useState(0);return e.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(lr,E),()=>e.removeEventListener(lr,E)},[E]),i(gr,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:g,onItemFocus:e.useCallback(e=>b(e),[b]),onItemShiftTab:e.useCallback(()=>w(!0),[]),onFocusableItemAdd:e.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>N(e=>e-1),[]),children:i(It.div,{tabIndex:y||0===R?-1:0,"data-orientation":o,...f,ref:h,style:{outline:"none",...t.style},onMouseDown:Qt(t.onMouseDown,()=>{k.current=!0}),onFocus:Qt(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(lr,ur);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter(e=>e.focusable);Rr([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),m)}}k.current=!1}),onBlur:Qt(t.onBlur,()=>w(!1))})})}),Er="RovingFocusGroupItem",xr=e.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:s,children:c,...l}=t,u=nr(),d=s||u,m=br(Er,n),f=m.currentTabStopId===d,p=fr(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=m;return e.useEffect(()=>{if(o)return h(),()=>v()},[o,h,v]),i(mr.ItemSlot,{scope:n,id:d,focusable:o,active:a,children:i(It.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...l,ref:r,onMouseDown:Qt(t.onMouseDown,e=>{o?m.onItemFocus(d):e.preventDefault()}),onFocus:Qt(t.onFocus,()=>m.onItemFocus(d)),onKeyDown:Qt(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:kr[n]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const a=o.indexOf(e.currentTarget);o=m.loop?(n=a+1,(r=o).map((e,t)=>r[(n+t)%r.length])):o.slice(a+1)}setTimeout(()=>Rr(o))}var r,n}),children:"function"==typeof c?c({isCurrentTabStop:f,hasTabStop:null!=g}):c})})});xr.displayName=Er;var kr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rr(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Nr=yr,Cr=xr;var _r=t=>{const{present:r,children:n}=t,o=function(t){const[r,n]=e.useState(),o=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Sr(o.current);i.current="mounted"===c?e:"none"},[c]),er(()=>{const e=o.current,r=a.current;if(r!==t){const n=i.current,o=Sr(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(r&&n!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,l]),er(()=>{if(r){let e;const t=r.ownerDocument.defaultView??window,n=n=>{const i=Sr(o.current).includes(n.animationName);if(n.target===r&&i&&(l("ANIMATION_END"),!a.current)){const n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},s=e=>{e.target===r&&(i.current=Sr(o.current))};return r.addEventListener("animationstart",s),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",s),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}l("ANIMATION_END")},[r,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(r),a="function"==typeof n?n({present:o.isPresent}):e.Children.only(n),i=ae(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?e.cloneElement(a,{ref:i}):null};function Sr(e){return e?.animationName||"none"}_r.displayName="Presence";var Pr="Tabs",[Or,Mr]=Lt(Pr,[vr]),Ar=vr(),[Lr,Dr]=Or(Pr),Ir=e.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:c,activationMode:l="automatic",...u}=e,d=cr(c),[m,f]=ir({prop:n,onChange:o,defaultProp:a??"",caller:Pr});return i(Lr,{scope:r,baseId:nr(),value:m,onValueChange:f,orientation:s,dir:d,activationMode:l,children:i(It.div,{dir:d,"data-orientation":s,...u,ref:t})})});Ir.displayName=Pr;var Tr="TabsList",jr=e.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,a=Dr(Tr,r),s=Ar(r);return i(Nr,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:n,children:i(It.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});jr.displayName=Tr;var Fr="TabsTrigger",zr=e.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...a}=e,s=Dr(Fr,r),c=Ar(r),l=Wr(s.baseId,n),u=Hr(s.baseId,n),d=n===s.value;return i(Cr,{asChild:!0,...c,focusable:!o,active:d,children:i(It.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...a,ref:t,onMouseDown:Qt(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(n)}),onKeyDown:Qt(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(n)}),onFocus:Qt(e.onFocus,()=>{const e="manual"!==s.activationMode;d||o||!e||s.onValueChange(n)})})})});zr.displayName=Fr;var $r="TabsContent",Br=e.forwardRef((t,r)=>{const{__scopeTabs:n,value:o,forceMount:a,children:s,...c}=t,l=Dr($r,n),u=Wr(l.baseId,o),d=Hr(l.baseId,o),m=o===l.value,f=e.useRef(m);return e.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),i(_r,{present:a||m,children:({present:e})=>i(It.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!e,id:d,tabIndex:0,...c,ref:r,style:{...t.style,animationDuration:f.current?"0s":void 0},children:e&&s})})});function Wr(e,t){return`${e}-trigger-${t}`}function Hr(e,t){return`${e}-content-${t}`}Br.displayName=$r;var Ur=Ir,Vr=jr,Gr=zr,qr=Br;function Kr({className:t,...r}){return e.createElement(Ur,re({"data-slot":"tabs",className:xt("flex flex-col gap-2",t)},r))}function Yr({className:t,...r}){return e.createElement(Vr,re({"data-slot":"tabs-list",className:xt("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t)},r))}function Zr({className:t,...r}){return e.createElement(Gr,re({"data-slot":"tabs-trigger",className:xt("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t)},r))}function Xr({className:t,...r}){return e.createElement(qr,re({"data-slot":"tabs-content",className:xt("flex-1 outline-none",t)},r))}var Jr,Qr="dismissableLayer.update",en="dismissableLayer.pointerDownOutside",tn="dismissableLayer.focusOutside",rn=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),nn=e.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=t,d=e.useContext(rn),[m,f]=e.useState(null),p=m?.ownerDocument??globalThis?.document,[,h]=e.useState({}),v=ae(r,e=>f(e)),g=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(b),w=m?g.indexOf(m):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,x=w>=y,k=function(t,r=globalThis?.document){const n=or(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){an(en,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));x&&!r&&(a?.(e),c?.(e),e.defaultPrevented||l?.())},p),R=function(t,r=globalThis?.document){const n=or(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){an(tn,n,{originalEvent:e},{discrete:!1})}};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},p);return function(t,r=globalThis?.document){const n=or(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e,{capture:!0}),()=>r.removeEventListener("keydown",e,{capture:!0})},[n,r])}(e=>{w===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(m)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Jr=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),on(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Jr)}},[m,p,n,d]),e.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),on())},[m,d]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Qr,e),()=>document.removeEventListener(Qr,e)},[]),i(It.div,{...u,ref:v,style:{pointerEvents:E?x?"auto":"none":void 0,...t.style},onFocusCapture:Qt(t.onFocusCapture,R.onFocusCapture),onBlurCapture:Qt(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Qt(t.onPointerDownCapture,k.onPointerDownCapture)})});nn.displayName="DismissableLayer";function on(){const e=new CustomEvent(Qr);document.dispatchEvent(e)}function an(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?function(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}e.forwardRef((t,r)=>{const n=e.useContext(rn),o=e.useRef(null),a=ae(r,o);return e.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),i(It.div,{...t,ref:a})}).displayName="DismissableLayerBranch";var sn="focusScope.autoFocusOnMount",cn="focusScope.autoFocusOnUnmount",ln={bubbles:!1,cancelable:!0},un=e.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=t,[l,u]=e.useState(null),d=or(a),m=or(s),f=e.useRef(null),p=ae(r,e=>u(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:pn(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||pn(f.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&pn(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){hn.add(h);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(sn,ln);l.addEventListener(sn,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(pn(n,{select:t}),document.activeElement!==r)return}((e=dn(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&pn(l))}return()=>{l.removeEventListener(sn,d),setTimeout(()=>{const e=new CustomEvent(cn,ln);l.addEventListener(cn,m),l.dispatchEvent(e),e.defaultPrevented||pn(t??document.body,{select:!0}),l.removeEventListener(cn,m),hn.remove(h)},0)}}var e},[l,d,m,h]);const v=e.useCallback(e=>{if(!n&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=dn(e),r=mn(t,e),n=mn(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&pn(a,{select:!0})):(e.preventDefault(),n&&pn(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,h.paused]);return i(It.div,{tabIndex:-1,...c,ref:p,onKeyDown:v})});function dn(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function mn(e,t){for(const r of e)if(!fn(r,{upTo:t}))return r}function fn(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function pn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}un.displayName="FocusScope";var hn=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=vn(e,t),e.unshift(t)},remove(t){e=vn(e,t),e[0]?.resume()}}}();function vn(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var gn=e.forwardRef((t,r)=>{const{container:n,...o}=t,[a,s]=e.useState(!1);er(()=>s(!0),[]);const c=n||a&&globalThis?.document?.body;return c?u.createPortal(i(It.div,{...o,ref:r}),c):null});gn.displayName="Portal";var bn=0;function yn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wn=function(){return wn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wn.apply(this,arguments)};function En(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;var xn="right-scroll-bar-position",kn="width-before-scroll-bar";function Rn(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Nn="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Cn=new WeakMap;function _n(e,t){var n,o,a,i=(n=null,o=function(t){return e.forEach(function(e){return Rn(e,t)})},(a=r(function(){return{value:n,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return Nn(function(){var t=Cn.get(i);if(t){var r=new Set(t),n=new Set(e),o=i.current;r.forEach(function(e){n.has(e)||Rn(e,null)}),n.forEach(function(e){r.has(e)||Rn(e,o)})}Cn.set(i,e)},[e]),i}function Sn(e){return e}var Pn=function(t){var r=t.sideCar,n=En(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=r.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,wn({},n))};Pn.isSideCarExport=!0;var On=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Sn);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=wn({async:!0,ssr:!1},e),t}(),Mn=function(){},An=e.forwardRef(function(t,r){var n=e.useRef(null),o=e.useState({onScrollCapture:Mn,onWheelCapture:Mn,onTouchMoveCapture:Mn}),a=o[0],i=o[1],s=t.forwardProps,c=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,m=t.shards,f=t.sideCar,p=t.noRelative,h=t.noIsolation,v=t.inert,g=t.allowPinchZoom,b=t.as,y=void 0===b?"div":b,w=t.gapMode,E=En(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=f,k=_n([n,r]),R=wn(wn({},E),a);return e.createElement(e.Fragment,null,d&&e.createElement(x,{sideCar:On,removeScrollBar:u,shards:m,noRelative:p,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?e.cloneElement(e.Children.only(c),wn(wn({},R),{ref:k})):e.createElement(y,wn({},R,{className:l,ref:k}),c))});An.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},An.classNames={fullWidth:kn,zeroRight:xn};function Ln(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Dn=function(){var e=0,t=null;return{add:function(r){var n,o;0==e&&(t=Ln())&&(o=r,(n=t).styleSheet?n.styleSheet.cssText=o:n.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},In=function(){var t,r=(t=Dn(),function(r,n){e.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&n])});return function(e){var t=e.styles,n=e.dynamic;return r(t,n),null}},Tn={left:0,top:0,right:0,gap:0},jn=function(e){return parseInt(e||"",10)||0},Fn=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Tn;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[jn(r),jn(n),jn(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},zn=In(),$n="data-scroll-locked",Bn=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat($n,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(xn," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(kn," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(xn," .").concat(xn," {\n right: 0 ").concat(n,";\n }\n \n .").concat(kn," .").concat(kn," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat($n,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Wn=function(){var e=parseInt(document.body.getAttribute($n)||"0",10);return isFinite(e)?e:0},Hn=function(t){var r=t.noRelative,n=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute($n,(Wn()+1).toString()),function(){var e=Wn()-1;e<=0?document.body.removeAttribute($n):document.body.setAttribute($n,e.toString())}},[]);var i=e.useMemo(function(){return Fn(a)},[a]);return e.createElement(zn,{styles:Bn(i,!r,a,n?"":"!important")})},Un=!1;if("undefined"!=typeof window)try{var Vn=Object.defineProperty({},"passive",{get:function(){return Un=!0,!0}});window.addEventListener("test",Vn,Vn),window.removeEventListener("test",Vn,Vn)}catch(e){Un=!1}var Gn=!!Un&&{passive:!1},qn=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Kn=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Yn(e,n)){var o=Zn(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Yn=function(e,t){return"v"===e?function(e){return qn(e,"overflowY")}(t):function(e){return qn(e,"overflowX")}(t)},Zn=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},Xn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jn=function(e){return[e.deltaX,e.deltaY]},Qn=function(e){return e&&"current"in e?e.current:e},eo=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},to=0,ro=[];function no(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oo,ao=(oo=function(t){var r=e.useRef([]),n=e.useRef([0,0]),o=e.useRef(),a=e.useState(to++)[0],i=e.useState(In)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(Qn),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var c=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,a=Xn(e),i=n.current,c="deltaX"in e?e.deltaX:i[0]-a[0],l="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var m=Kn(d,u);if(!m)return!0;if(m?r=d:(r="v"===d?"h":"v",m=Kn(d,u)),!m)return!1;if(!o.current&&"changedTouches"in e&&(c||l)&&(o.current=r),!r)return!0;var f=o.current||r;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),c=!1,l=a>0,u=0,d=0;do{if(!i)break;var m=Zn(e,i),f=m[0],p=m[1]-m[2]-o*f;(f||p)&&Yn(e,i)&&(u+=p,d+=f);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=e.useCallback(function(e){var t=e;if(ro.length&&ro[ro.length-1]===i){var n="deltaY"in t?Jn(t):Xn(t),o=r.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(r=e.delta,o=n,r[0]===o[0]&&r[1]===o[1]);var r,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Qn).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?c(t,a[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,n,o){var a={name:e,delta:t,target:n,should:o,shadowParent:no(n)};r.current.push(a),setTimeout(function(){r.current=r.current.filter(function(e){return e!==a})},1)},[]),d=e.useCallback(function(e){n.current=Xn(e),o.current=void 0},[]),m=e.useCallback(function(e){u(e.type,Jn(e),e.target,c(e,t.lockRef.current))},[]),f=e.useCallback(function(e){u(e.type,Xn(e),e.target,c(e,t.lockRef.current))},[]);e.useEffect(function(){return ro.push(i),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Gn),document.addEventListener("touchmove",l,Gn),document.addEventListener("touchstart",d,Gn),function(){ro=ro.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Gn),document.removeEventListener("touchmove",l,Gn),document.removeEventListener("touchstart",d,Gn)}},[]);var p=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(i,{styles:eo(a)}):null,p?e.createElement(Hn,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},On.useMedium(oo),Pn),io=e.forwardRef(function(t,r){return e.createElement(An,wn({},t,{ref:r,sideCar:ao}))});io.classNames=An.classNames;var so=new WeakMap,co=new WeakMap,lo={},uo=0,mo=function(e){return e&&(e.host||mo(e.parentNode))},fo=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=mo(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);lo[r]||(lo[r]=new WeakMap);var a=lo[r],i=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,c=(so.get(e)||0)+1,l=(a.get(e)||0)+1;so.set(e,c),a.set(e,l),i.push(e),1===c&&o&&co.set(e,!0),1===l&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),uo++,function(){i.forEach(function(e){var t=so.get(e)-1,o=a.get(e)-1;so.set(e,t),a.set(e,o),t||(co.has(e)||e.removeAttribute(n),co.delete(e)),o||e.removeAttribute(r)}),--uo||(so=new WeakMap,so=new WeakMap,co=new WeakMap,lo={})}},po=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),fo(n,o,r,"aria-hidden")):function(){return null}},ho="Dialog",[vo,go]=Lt(ho),[bo,yo]=vo(ho),wo=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:s,modal:c=!0}=t,l=e.useRef(null),u=e.useRef(null),[d,m]=ir({prop:o,defaultProp:a??!1,onChange:s,caller:ho});return i(bo,{scope:r,triggerRef:l,contentRef:u,contentId:nr(),titleId:nr(),descriptionId:nr(),open:d,onOpenChange:m,onOpenToggle:e.useCallback(()=>m(e=>!e),[m]),modal:c,children:n})};wo.displayName=ho;var Eo="DialogTrigger";e.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=yo(Eo,r),a=ae(t,o.triggerRef);return i(It.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bo(o.open),...n,ref:a,onClick:Qt(e.onClick,o.onOpenToggle)})}).displayName=Eo;var xo="DialogPortal",[ko,Ro]=vo(xo,{forceMount:void 0}),No=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=t,s=yo(xo,r);return i(ko,{scope:r,forceMount:n,children:e.Children.map(o,e=>i(_r,{present:n||s.open,children:i(gn,{asChild:!0,container:a,children:e})}))})};No.displayName=xo;var Co="DialogOverlay",_o=e.forwardRef((e,t)=>{const r=Ro(Co,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=yo(Co,e.__scopeDialog);return a.modal?i(_r,{present:n||a.open,children:i(Po,{...o,ref:t})}):null});_o.displayName=Co;var So=ie("DialogOverlay.RemoveScroll"),Po=e.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=yo(Co,r);return i(io,{as:So,allowPinchZoom:!0,shards:[o.contentRef],children:i(It.div,{"data-state":Bo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Oo="DialogContent",Mo=e.forwardRef((e,t)=>{const r=Ro(Oo,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=yo(Oo,e.__scopeDialog);return i(_r,{present:n||a.open,children:a.modal?i(Ao,{...o,ref:t}):i(Lo,{...o,ref:t})})});Mo.displayName=Oo;var Ao=e.forwardRef((t,r)=>{const n=yo(Oo,t.__scopeDialog),o=e.useRef(null),a=ae(r,n.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return po(e)},[]),i(Do,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qt(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Qt(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Qt(t.onFocusOutside,e=>e.preventDefault())})}),Lo=e.forwardRef((t,r)=>{const n=yo(Oo,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return i(Do,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||n.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const r=e.target,i=n.triggerRef.current?.contains(r);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Do=e.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:l,...u}=t,d=yo(Oo,n),m=e.useRef(null),f=ae(r,m);return e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yn()),document.body.insertAdjacentElement("beforeend",e[1]??yn()),bn++,()=>{1===bn&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),bn--}},[]),s(c,{children:[i(un,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,children:i(nn,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Bo(d.open),...u,ref:f,onDismiss:()=>d.onOpenChange(!1)})}),s(c,{children:[i(Vo,{titleId:d.titleId}),i(Go,{contentRef:m,descriptionId:d.descriptionId})]})]})}),Io="DialogTitle",To=e.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=yo(Io,r);return i(It.h2,{id:o.titleId,...n,ref:t})});To.displayName=Io;var jo="DialogDescription",Fo=e.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=yo(jo,r);return i(It.p,{id:o.descriptionId,...n,ref:t})});Fo.displayName=jo;var zo="DialogClose",$o=e.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=yo(zo,r);return i(It.button,{type:"button",...n,ref:t,onClick:Qt(e.onClick,()=>o.onOpenChange(!1))})});function Bo(e){return e?"open":"closed"}$o.displayName=zo;var Wo="DialogTitleWarning",[Ho,Uo]=function(t,r){const n=e.createContext(r),o=t=>{const{children:r,...o}=t,a=e.useMemo(()=>o,Object.values(o));return i(n.Provider,{value:a,children:r})};return o.displayName=t+"Provider",[o,function(o){const a=e.useContext(n);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(Wo,{contentName:Oo,titleName:Io,docsSlug:"dialog"}),Vo=({titleId:t})=>{const r=Uo(Wo),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(n)}},[n,t]),null},Go=({contentRef:t,descriptionId:r})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Uo("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(r&&e){document.getElementById(r)||console.warn(n)}},[n,t,r]),null},qo=wo,Ko=No,Yo=_o,Zo=Mo,Xo=To,Jo=Fo,Qo=$o;
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v0.525.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
const ea=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ta=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),ra=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v0.525.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
var na={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"};
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-react v0.525.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const oa=n(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...c},l)=>o("svg",{ref:l,...na,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:ta("lucide",a),...!i&&!ra(c)&&{"aria-hidden":"true"},...c},[...s.map(([e,t])=>o(e,t)),...Array.isArray(i)?i:[i]])),aa=(e,t)=>{const r=n(({className:r,...n},a)=>{return o(oa,{ref:a,iconNode:t,className:ta(`lucide-${i=ea(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n});var i});return r.displayName=ea(e),r},ia=aa("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),sa=aa("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"}]]),ca=aa("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),la=aa("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ua=aa("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),da=aa("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),ma=aa("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),fa=aa("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pa=qo,ha=Ko,va=e.forwardRef(({className:t,...r},n)=>e.createElement(Yo,re({ref:n,className:xt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},r)));
|
|
22
|
-
/**
|
|
23
|
-
* @license lucide-react v0.525.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/va.displayName=Yo.displayName;const ga=e.forwardRef(({className:t,children:r,...n},o)=>e.createElement(ha,null,e.createElement(va,null),e.createElement(Zo,re({ref:o,className:xt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",t)},n),r,e.createElement(Qo,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},e.createElement(fa,{className:"h-4 w-4"}),e.createElement("span",{className:"sr-only"},"Close")))));ga.displayName=Zo.displayName;const ba=({className:t,...r})=>e.createElement("div",re({className:xt("flex flex-col space-y-1.5 text-center sm:text-left",t)},r));ba.displayName="DialogHeader";const ya=({className:t,...r})=>e.createElement("div",re({className:xt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},r));ya.displayName="DialogFooter";const wa=e.forwardRef(({className:t,...r},n)=>e.createElement(Xo,re({ref:n,className:xt("text-lg font-semibold leading-none tracking-tight",t)},r)));wa.displayName=Xo.displayName;const Ea=e.forwardRef(({className:t,...r},n)=>e.createElement(Jo,re({ref:n,className:xt("text-sm text-muted-foreground",t)},r)));Ea.displayName=Jo.displayName;const xa=he("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ka=e.forwardRef(({className:t,variant:r,...n},o)=>e.createElement("div",re({ref:o,role:"alert",className:xt(xa({variant:r}),t)},n)));ka.displayName="Alert";e.forwardRef(({className:t,...r},n)=>e.createElement("h5",re({ref:n,className:xt("mb-1 font-medium leading-none tracking-tight",t)},r))).displayName="AlertTitle";const Ra=e.forwardRef(({className:t,...r},n)=>e.createElement("div",re({ref:n,className:xt("text-sm [&_p]:leading-relaxed",t)},r)));function Na({userId:e,onSuccess:t,onCancel:n,createSetupIntent:o}){const a=X("calls useStripe()").stripe,i=Y(),[s,c]=r(!1),[l,u]=r(null),[d,m]=r(!1);return d?React.createElement("div",{className:"text-center py-8"},React.createElement(ca,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),React.createElement("p",{className:"text-lg font-medium"},"Payment method added successfully!"),React.createElement("p",{className:"text-sm text-muted-foreground mt-2"},"Redirecting...")):React.createElement("form",{onSubmit:async r=>{if(r.preventDefault(),a&&i){c(!0),u(null);try{const{client_secret:r}=await o(e);if(!r)throw new Error("Failed to create setup intent");const n=await a.confirmCardSetup(r,{payment_method:{card:i.getElement(te)}});n.error?u(n.error.message||"An error occurred"):(m(!0),setTimeout(()=>{t&&t()},2e3))}catch(e){u(e instanceof Error?e.message:"An error occurred")}finally{c(!1)}}},className:"space-y-6"},React.createElement("div",null,React.createElement("label",{className:"block text-sm font-medium mb-2"},"Card Details"),React.createElement("div",{className:"border rounded-md p-3 bg-background"},React.createElement(te,{options:{style:{base:{fontSize:"16px",color:"#fff","::placeholder":{color:"#999"}}}}}))),l&&React.createElement(ka,{variant:"destructive"},React.createElement(Ra,null,l)),React.createElement("div",{className:"flex gap-2"},React.createElement(Rt,{type:"button",variant:"outline",onClick:n,disabled:s,className:"flex-1"},"Cancel"),React.createElement(Rt,{type:"submit",disabled:!a||s,className:"flex-1"},s&&React.createElement(ma,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Processing...":"Add Payment Method")))}Ra.displayName="AlertDescription";var Ca="Radio",[_a,Sa]=Lt(Ca),[Pa,Oa]=_a(Ca),Ma=e.forwardRef((t,r)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:c,disabled:l,value:u="on",onCheck:d,form:m,...f}=t,[p,h]=e.useState(null),v=ae(r,e=>h(e)),g=e.useRef(!1),b=!p||(m||!!p.closest("form"));return s(Pa,{scope:n,checked:a,disabled:l,children:[i(It.button,{type:"button",role:"radio","aria-checked":a,"data-state":Ia(a),"data-disabled":l?"":void 0,disabled:l,value:u,...f,ref:v,onClick:Qt(t.onClick,e=>{a||d?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&i(Da,{control:p,bubbles:!g.current,name:o,value:u,checked:a,required:c,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});Ma.displayName=Ca;var Aa="RadioIndicator",La=e.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...o}=e,a=Oa(Aa,r);return i(_r,{present:n||a.checked,children:i(It.span,{"data-state":Ia(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});La.displayName=Aa;var Da=e.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:o=!0,...a},s)=>{const c=e.useRef(null),l=ae(c,s),u=function(t){const r=e.useRef({value:t,previous:t});return e.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}(n),d=function(t){const[r,n]=e.useState(void 0);return er(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const r=e[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}n(void 0)},[t]),r}(r);return e.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),i(It.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ia(e){return e?"checked":"unchecked"}Da.displayName="RadioBubbleInput";var Ta=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ja="RadioGroup",[Fa,za]=Lt(ja,[vr,Sa]),$a=vr(),Ba=Sa(),[Wa,Ha]=Fa(ja),Ua=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:o,value:a,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:m,...f}=e,p=$a(r),h=cr(u),[v,g]=ir({prop:a,defaultProp:o??null,onChange:m,caller:ja});return i(Wa,{scope:r,name:n,required:s,disabled:c,value:v,onValueChange:g,children:i(Nr,{asChild:!0,...p,orientation:l,dir:h,loop:d,children:i(It.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":c?"":void 0,dir:h,...f,ref:t})})})});Ua.displayName=ja;var Va="RadioGroupItem",Ga=e.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:o,...a}=t,s=Ha(Va,n),c=s.disabled||o,l=$a(n),u=Ba(n),d=e.useRef(null),m=ae(r,d),f=s.value===a.value,p=e.useRef(!1);return e.useEffect(()=>{const e=e=>{Ta.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),i(Cr,{asChild:!0,...l,focusable:!c,active:f,children:i(Ma,{disabled:c,required:s.required,checked:f,...u,...a,name:s.name,ref:m,onCheck:()=>s.onValueChange(a.value),onKeyDown:Qt(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Qt(a.onFocus,()=>{p.current&&d.current?.click()})})})});Ga.displayName=Va;var qa=e.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,o=Ba(r);return i(La,{...o,...n,ref:t})});qa.displayName="RadioGroupIndicator";var Ka=Ua,Ya=Ga,Za=qa;const Xa=e.forwardRef(({className:t,...r},n)=>e.createElement(Ka,re({className:xt("grid gap-2",t)},r,{ref:n})));Xa.displayName=Ka.displayName;const Ja=e.forwardRef(({className:t,...r},n)=>e.createElement(Ya,re({ref:n,className:xt("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t)},r),e.createElement(Za,{className:"flex items-center justify-center"},e.createElement(la,{className:"h-2.5 w-2.5 fill-current text-current"}))));Ja.displayName=Ya.displayName;var Qa=e.forwardRef((e,t)=>i(It.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Qa.displayName="Label";var ei=Qa;function ti({className:t,...r}){return e.createElement(ei,re({"data-slot":"label",className:xt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t)},r))}function ri({brand:e,className:r="w-8 h-5"}){const n=e?.toLowerCase();switch(n){case"visa":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#1A1F71"}),t.createElement("path",{d:"M20.5 22H17.5L19.5 10H22.5L20.5 22Z",fill:"white"}),t.createElement("path",{d:"M31.5 10.5L29 17.5L28.5 15.5L27.5 11C27.5 11 27.5 10 26.5 10H22L22 10.5C22 10.5 23.5 11 25 12L28 22H31L36 10H33L31.5 10.5Z",fill:"white"}),t.createElement("path",{d:"M37 10C36 10 35.5 10.5 35.5 10.5L31.5 19.5L32 22H35L35.5 20.5H39L39.5 22H42L40 10H37ZM36 18L37.5 13.5L38.5 18H36Z",fill:"white"}),t.createElement("path",{d:"M16 11L16.5 10H11.5C10.5 10 10 10.5 10 11L8 20C8 20 8.5 21.5 9.5 22C10.5 22.5 12 22.5 13 22C14 21.5 15 21 15.5 20C16 19 16 18.5 16 18C16 17.5 15.5 17 15 17C14.5 16.5 13.5 16.5 12.5 16.5H11.5L12 14H15L14.5 12H11.5L12 11H16Z",fill:"white"}));case"mastercard":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#1E293B"}),t.createElement("circle",{cx:"19",cy:"16",r:"7",fill:"#EB001B"}),t.createElement("circle",{cx:"29",cy:"16",r:"7",fill:"#F79E1B"}),t.createElement("path",{d:"M24 10.5C25.5 12 26.5 14 26.5 16C26.5 18 25.5 20 24 21.5C22.5 20 21.5 18 21.5 16C21.5 14 22.5 12 24 10.5Z",fill:"#FF5F00"}));case"amex":case"american express":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#2E7BC4"}),t.createElement("path",{d:"M12 12H15L16 14L17 12H20V18H18V14L16 18H16L14 14V18H12V12Z",fill:"white"}),t.createElement("path",{d:"M21 12H27V14H23V15H27V16H23V17H27V18H21V12Z",fill:"white"}),t.createElement("path",{d:"M28 12H31L33 14L35 12H38L35 15L38 18H35L33 16L31 18H28L31 15L28 12Z",fill:"white"}));case"discover":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#F47216"}),t.createElement("circle",{cx:"29",cy:"16",r:"7",fill:"#FCFCFC"}));case"diners":case"diners club":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#0079BE"}),t.createElement("circle",{cx:"24",cy:"16",r:"8",fill:"white"}),t.createElement("circle",{cx:"20",cy:"16",r:"5",fill:"#0079BE"}),t.createElement("circle",{cx:"28",cy:"16",r:"5",fill:"#0079BE"}));case"jcb":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"white"}),t.createElement("rect",{x:"8",y:"8",width:"8",height:"16",rx:"2",fill:"#0E4C96"}),t.createElement("rect",{x:"20",y:"8",width:"8",height:"16",rx:"2",fill:"#EE0005"}),t.createElement("rect",{x:"32",y:"8",width:"8",height:"16",rx:"2",fill:"#00A650"}));case"unionpay":return t.createElement("svg",{className:r,viewBox:"0 0 48 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{width:"48",height:"32",rx:"4",fill:"#005BAC"}),t.createElement("rect",{x:"16",y:"8",width:"16",height:"16",fill:"#E60012"}));default:return t.createElement("div",{className:`${r} bg-slate-200 dark:bg-slate-800 rounded flex items-center justify-center`},t.createElement("span",{className:"text-xs font-bold uppercase"},n||"card"))}}function ni({isOpen:e,onClose:t,plan:n,currentPlan:o,paymentMethods:a,userId:i,onSuccess:s,createSubscription:c}){const[l,u]=r(a?.find(e=>e.is_default)?.stripe_payment_method_id||a?.[0]?.stripe_payment_method_id||""),[d,m]=r(!1),[f,p]=r(null),[h,v]=r(!1),g=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"usd"}).format(e/100);if(!n)return null;const b=n?.prices?.[0],y=b&&0===parseFloat(b.unit_amount),w=o&&b&&parseFloat(b.unit_amount)<parseFloat(o.prices[0].unit_amount);return h?React.createElement(pa,{open:e,onOpenChange:t},React.createElement(ga,null,React.createElement("div",{className:"text-center py-8"},React.createElement(ca,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),React.createElement("h3",{className:"text-lg font-medium"},"Subscription Successful!"),React.createElement("p",{className:"text-sm text-muted-foreground mt-2"},"You have been successfully subscribed to ",n.name)))):React.createElement(pa,{open:e,onOpenChange:t},React.createElement(ga,{className:"sm:max-w-md"},React.createElement(ba,null,React.createElement(wa,null,"Confirm Subscription"),React.createElement(Ea,null,o?"You are about to change your subscription plan":"You are about to subscribe to a new plan")),React.createElement("div",{className:"space-y-4"},React.createElement(Nt,{className:"p-4"},React.createElement("h4",{className:"font-medium mb-2"},n.name),React.createElement("p",{className:"text-2xl font-bold mb-2"},y?"Free":g(100*parseFloat(b.unit_amount)),!y&&React.createElement("span",{className:"text-sm font-normal text-muted-foreground"},"/month")),React.createElement("ul",{className:"space-y-1"},n.features?.map(e=>React.createElement("li",{key:e.id,className:"flex items-start text-sm"},React.createElement(ia,{className:"h-4 w-4 mr-2 text-primary mt-0.5 flex-shrink-0"}),React.createElement("span",null,e.value," ",e.units," - ",e.description))))),!y&&a?.length>0&&React.createElement("div",{className:"space-y-3"},React.createElement(ti,null,"Payment Method"),React.createElement(Xa,{value:l,onValueChange:u},a.map(e=>React.createElement("div",{key:e.id,className:"flex items-center space-x-3"},React.createElement(Ja,{value:e.stripe_payment_method_id,id:e.id.toString()}),React.createElement(ti,{htmlFor:e.id.toString(),className:"flex items-center gap-3 cursor-pointer flex-1"},React.createElement(ri,{brand:e.brand,className:"w-12 h-8"}),React.createElement("span",{className:"font-medium"},"•••• ",e.last4),e.is_default&&React.createElement("span",{className:"text-xs text-muted-foreground"},"(Default)")))))),!y&&React.createElement(ka,null,React.createElement(sa,{className:"h-4 w-4"}),React.createElement(Ra,null,"You will be charged ",g(100*parseFloat(b.unit_amount))," immediately upon confirmation.",w&&" Refunds for downgrades will be prorated and applied to your next invoice.")),f&&React.createElement(ka,{variant:"destructive"},React.createElement(Ra,null,f))),React.createElement(ya,{className:"gap-2"},React.createElement(Rt,{variant:"outline",onClick:t,disabled:d},"Cancel"),React.createElement(Rt,{onClick:async()=>{m(!0),p(null);try{const e=n.prices[0].stripe_price_id,r=0===parseFloat(n.prices[0].unit_amount),o=await c(i,e,r?"":l);o.success?(v(!0),setTimeout(()=>{s(),t()},2e3)):p(o.error||"Failed to create subscription")}catch(e){p(e instanceof Error?e.message:"An error occurred")}finally{m(!1)}},disabled:d||!y&&!l},d&&React.createElement(ma,{className:"mr-2 h-4 w-4 animate-spin"}),d?"Processing...":"Confirm Subscription"))))}const oi=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];k=!0;var n=Date.now();return R().then(function(e){return function(e,t,r){if(null===e)return null;var n=t[0].match(/^pk_test/),o=function(e){return 3===e?"v3":e}(e.version),a=m;n&&o!==a&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("7.4.0"," expected Stripe.js@").concat(a,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var i=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"7.4.0",startTime:t})}(i,r),i}(e,t,n)})}(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY||"");function ai({customerData:e,pricingData:t,paymentMethods:n,apiUrl:o,apiKey:i}){const[s,c]=r(!1),[l,u]=r(!1),[d,m]=r(!1),[f,p]=r(null),[h,v]=r("overview"),g=a(),b=e?.subscriptions?.[0],y=b?.items?.[0],w=e?.usage,E=e?.invoices||[],x=t?.products?.find(e=>e.prices?.some(e=>e.id===y?.price_id)),k=x?.prices?.find(e=>e.id===y?.price_id),R=e=>("string"==typeof e?new Date(e):new Date(1e3*e)).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),N=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"usd"}).format(e/100),C=async e=>{c(!0);try{await async function(e,t,r){const n=await fetch(`${t}/billing/payment-methods/${e}/default`,{method:"POST",headers:{"x-api-key":r,"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to set default payment method");return await n.json()}(e,o,i),g.refresh()}catch(e){console.error("Failed to set default payment method:",e)}finally{c(!1)}},_=async e=>{if(confirm("Are you sure you want to delete this payment method?")){c(!0);try{await async function(e,t,r){const n=await fetch(`${t}/billing/payment-methods/${e}`,{method:"DELETE",headers:{"x-api-key":r,"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to delete payment method");return await n.json()}(e,o,i),g.refresh()}catch(e){console.error("Failed to delete payment method:",e)}finally{c(!1)}}};return React.createElement(React.Fragment,null,React.createElement("div",{className:"space-y-6"},React.createElement("div",null,React.createElement("h3",{className:"text-lg font-medium"},"Billing"),React.createElement("p",{className:"text-sm text-muted-foreground"},"Manage your subscription and billing information.")),React.createElement(Kr,{value:h,onValueChange:v,className:"space-y-4"},React.createElement(Yr,null,React.createElement(Zr,{value:"overview"},"Overview"),React.createElement(Zr,{value:"usage"},"Usage"),React.createElement(Zr,{value:"plans"},"Plans"),React.createElement(Zr,{value:"billing-history"},"Billing History")),React.createElement(Xr,{value:"overview",className:"space-y-4"},React.createElement(Nt,null,React.createElement(Ct,null,React.createElement(_t,null,"Current Plan"),React.createElement(St,null,x?`You are currently on the ${x.name}`:"No active subscription")),React.createElement(Pt,null,b?React.createElement("div",{className:"flex items-center justify-between"},React.createElement("div",null,React.createElement("p",{className:"text-2xl font-bold"},k?N(100*parseFloat(k.unit_amount)):"Active","/month"),React.createElement("p",{className:"text-sm text-muted-foreground"},"Next billing date: ",R(b.current_period_end)),b.cancel_at_period_end&&React.createElement("p",{className:"text-sm text-destructive mt-2"},React.createElement(sa,{className:"inline h-4 w-4 mr-1"}),"Subscription will cancel at the end of the billing period")),React.createElement("div",{className:"space-x-2"},React.createElement(Rt,{variant:"outline",onClick:()=>v("plans")},"Change Plan"),!b.cancel_at_period_end&&React.createElement(Rt,{variant:"outline",onClick:async()=>{if(b?.id&&confirm("Are you sure you want to cancel your subscription? You will continue to have access until the end of your billing period.")){c(!0);try{await async function(e,t,r){const n=await fetch(`${t}/billing/subscriptions/${e}`,{method:"DELETE",headers:{"x-api-key":r,"Content-Type":"application/json"}});if(!n.ok)throw new Error("Failed to cancel subscription");return await n.json()}(b.id,o,i),g.refresh()}catch(e){console.error("Failed to cancel subscription:",e)}finally{c(!1)}}},disabled:s},s&&React.createElement(ma,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancel Subscription"))):React.createElement("div",{className:"text-center py-6"},React.createElement("p",{className:"text-muted-foreground mb-4"},"You don't have an active subscription"),React.createElement(Rt,{onClick:()=>v("plans")},"Choose a Plan")))),React.createElement(Nt,null,React.createElement(Ct,null,React.createElement(_t,null,"Payment Methods"),React.createElement(St,null,"Manage your payment information")),React.createElement(Pt,{className:"space-y-4"},n?.paymentMethods?.length>0?React.createElement("div",{className:"space-y-3"},n.paymentMethods.map(e=>React.createElement("div",{key:e.id,className:"flex items-center justify-between p-4 border rounded-lg"},React.createElement("div",{className:"flex items-center gap-4"},React.createElement(ri,{brand:e.brand,className:"w-16 h-10"}),React.createElement("div",{className:"flex-1"},React.createElement("p",{className:"font-medium"},"•••• •••• •••• ",e.last4),React.createElement("p",{className:"text-sm text-muted-foreground"},"Expires ",e.exp_month,"/",e.exp_year)),e.is_default&&React.createElement(At,{variant:"secondary"},"Default")),React.createElement("div",{className:"flex items-center gap-2 ml-4"},!e.is_default&&React.createElement(Rt,{variant:"outline",size:"sm",onClick:()=>C(e.stripe_payment_method_id),disabled:s},"Set as Default"),React.createElement(Rt,{variant:"outline",size:"sm",onClick:()=>_(e.stripe_payment_method_id),disabled:s},"Remove"))))):React.createElement("div",{className:"text-center py-6"},React.createElement("p",{className:"text-muted-foreground mb-4"},"No payment methods on file"))),React.createElement(Ot,null,React.createElement(Rt,{className:"w-full",onClick:()=>u(!0)},React.createElement(ua,{className:"mr-2 h-4 w-4"}),"Add Payment Method")))),React.createElement(Xr,{value:"usage",className:"space-y-4"},React.createElement(Nt,null,React.createElement(Ct,null,React.createElement(_t,null,"Current Usage"),React.createElement(St,null,"Your resource usage for the current billing period")),React.createElement(Pt,{className:"space-y-6"},w?.data?.map(e=>{const t="number"==typeof e.limit?Math.min(e.current_usage/e.limit*100,100):0;return React.createElement("div",{key:e.feature_key,className:"space-y-3"},React.createElement("div",{className:"flex items-center justify-between text-sm"},React.createElement("span",null,e.feature_details.description),React.createElement("span",{className:"font-medium"},"number"==typeof e.limit?`${e.current_usage.toLocaleString()} / ${e.limit.toLocaleString()}`:e.current_usage,e.feature_details.units&&` ${e.feature_details.units}`)),"number"==typeof e.limit&&React.createElement(React.Fragment,null,React.createElement(Jt,{value:t,className:"h-2 "+(e.within_limit?"":"bg-destructive")}),React.createElement("p",{className:"text-xs text-muted-foreground"},e.within_limit?`${Math.max(0,e.limit-e.current_usage).toLocaleString()} ${e.feature_details.units||""} remaining`:`${(e.current_usage-e.limit).toLocaleString()} ${e.feature_details.units||""} over limit`)))})),React.createElement(Ot,null,React.createElement("p",{className:"text-sm text-muted-foreground"},"Usage resets on ",b?R(b.current_period_end):"N/A",". Need more resources? Consider upgrading your plan.")))),React.createElement(Xr,{value:"plans",className:"space-y-4"},React.createElement("div",{className:"grid gap-4 md:grid-cols-3"},t?.products?.map(e=>{const t=e.prices?.[0],r=e.features||[],o=y?.price_id===t?.id;return React.createElement(Nt,{key:e.id,className:o?"border-primary":""},React.createElement(Ct,null,React.createElement("div",{className:"flex items-center justify-between"},React.createElement(_t,null,e.name),o&&React.createElement(At,null,"Current"),"true"===e.metadata?.popular&&!o&&React.createElement(At,{variant:"secondary"},"Popular")),React.createElement(St,null,e.description)),React.createElement(Pt,null,React.createElement("div",{className:"text-3xl font-bold mb-4"},0===parseFloat(t?.unit_amount)?"Free":N(100*parseFloat(t?.unit_amount)),parseFloat(t?.unit_amount)>0&&React.createElement("span",{className:"text-sm font-normal"},"/month")),React.createElement("ul",{className:"space-y-2"},r.map(e=>React.createElement("li",{key:e.id,className:"flex items-center"},React.createElement(ia,{className:"h-4 w-4 mr-2 text-primary"}),React.createElement("span",{className:"text-sm"},e.value," ",e.units," - ",e.description))))),React.createElement(Ot,null,React.createElement(Rt,{className:"w-full",variant:o?"outline":"default",disabled:o,onClick:()=>!o&&(e=>{const t=e.prices?.[0];if(!(t&&0===parseFloat(t.unit_amount)||n?.paymentMethods&&0!==n.paymentMethods.length))return v("overview"),void u(!0);p(e),m(!0)})(e)},o?"Current Plan":0===parseFloat(t?.unit_amount)?"Get Started":"Upgrade")))}))),React.createElement(Xr,{value:"billing-history",className:"space-y-4"},React.createElement(Nt,null,React.createElement(Ct,null,React.createElement(_t,null,"Billing History"),React.createElement(St,null,"Download your past invoices")),React.createElement(Pt,null,React.createElement("div",{className:"space-y-4"},E.length>0?E.map(e=>React.createElement("div",{key:e.id,className:"flex items-center justify-between p-4 border rounded-lg"},React.createElement("div",{className:"flex items-center space-x-4"},React.createElement(da,{className:"h-8 w-8 text-muted-foreground"}),React.createElement("div",null,React.createElement("p",{className:"font-medium"},"Invoice #",e.id.slice(-8).toUpperCase()),React.createElement("p",{className:"text-sm text-muted-foreground"},R(e.created)))),React.createElement("div",{className:"flex items-center space-x-4"},React.createElement("div",{className:"text-right"},React.createElement("p",{className:"font-medium"},N(e.amount_paid)),React.createElement("p",{className:"text-sm text-muted-foreground capitalize"},e.status)),React.createElement(Rt,{variant:"outline",size:"sm",onClick:()=>window.open(e.invoice_pdf||e.hosted_invoice_url,"_blank")},React.createElement(da,{className:"h-4 w-4 mr-2"}),"Download")))):React.createElement("div",{className:"text-center py-12"},React.createElement(da,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),React.createElement("p",{className:"text-muted-foreground"},"No invoices yet")))))))),React.createElement(pa,{open:l,onOpenChange:u},React.createElement(ga,null,React.createElement(ba,null,React.createElement(wa,null,"Add Payment Method"),React.createElement(Ea,null,"Add a new payment method to your account. Your card information is securely processed by Stripe.")),React.createElement(K,{stripe:oi},React.createElement(Na,{userId:String(e?.id||""),onSuccess:()=>{u(!1),g.refresh()},onCancel:()=>u(!1),createSetupIntent:async e=>await async function(e,t,r){const n=await fetch(`${t}/billing/setup-intent`,{method:"POST",headers:{"x-api-key":r,"Content-Type":"application/json"},body:JSON.stringify({user_id:e})});if(!n.ok)throw new Error("Failed to create setup intent");return await n.json()}(e,o,i)})))),React.createElement(ni,{isOpen:d,onClose:()=>m(!1),plan:f,currentPlan:x,paymentMethods:n?.paymentMethods||[],userId:String(e?.id||""),onSuccess:()=>{m(!1),p(null),g.refresh(),v("overview")},createSubscription:async(e,t,r)=>await async function(e,t,r,n,o){try{const a=await fetch(`${n}/billing/subscriptions`,{method:"POST",headers:{"x-api-key":o,"Content-Type":"application/json"},body:JSON.stringify({user_id:e,price_id:t,payment_method_id:r})});if(!a.ok){const e=await a.json();throw new Error(e.error||"Failed to create subscription")}return{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:"An error occurred"}}}(e,t,r,o,i)}))}export{ai as BillingClient};
|
|
28
|
-
//# sourceMappingURL=client.esm.js.map
|