@betterstore/react 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/checkout-embed/checkout-form.d.ts +2 -1
- package/dist/components/checkout-embed/checkout-schema.d.ts +18 -18
- package/dist/components/checkout-embed/steps/summary/discount-code.d.ts +5 -0
- package/dist/components/checkout-embed/steps/summary/index.d.ts +8 -4
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/index.cjs.js +1555 -259
- package/dist/index.mjs +1555 -259
- package/dist/lib/betterstore.d.ts +1 -0
- package/package.json +4 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var sdk = require('@betterstore/sdk');
|
|
5
|
+
var ReactDOM = require('react-dom');
|
|
5
6
|
var reactSlot = require('@radix-ui/react-slot');
|
|
6
7
|
var LabelPrimitive = require('@radix-ui/react-label');
|
|
7
8
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
8
|
-
require('react-dom');
|
|
9
9
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
|
|
@@ -86,7 +86,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
86
86
|
if (str2 === null) {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
|
-
return JSON.parse(str2,
|
|
89
|
+
return JSON.parse(str2, void 0 );
|
|
90
90
|
};
|
|
91
91
|
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
92
92
|
if (str instanceof Promise) {
|
|
@@ -96,7 +96,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
96
96
|
},
|
|
97
97
|
setItem: (name, newValue) => storage.setItem(
|
|
98
98
|
name,
|
|
99
|
-
JSON.stringify(newValue,
|
|
99
|
+
JSON.stringify(newValue, void 0 )
|
|
100
100
|
),
|
|
101
101
|
removeItem: (name) => storage.removeItem(name)
|
|
102
102
|
};
|
|
@@ -184,7 +184,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
184
184
|
var _a2;
|
|
185
185
|
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
186
186
|
});
|
|
187
|
-
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ?
|
|
187
|
+
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
188
188
|
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
189
189
|
if (deserializedStorageValue) {
|
|
190
190
|
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
@@ -205,7 +205,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
205
205
|
return [false, deserializedStorageValue.state];
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
return [false,
|
|
208
|
+
return [false, void 0];
|
|
209
209
|
}).then((migrationResult) => {
|
|
210
210
|
var _a2;
|
|
211
211
|
const [migrated, migratedState] = migrationResult;
|
|
@@ -218,12 +218,12 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
218
218
|
return setItem();
|
|
219
219
|
}
|
|
220
220
|
}).then(() => {
|
|
221
|
-
postRehydrationCallback == null ?
|
|
221
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
222
222
|
stateFromStorage = get();
|
|
223
223
|
hasHydrated = true;
|
|
224
224
|
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
225
225
|
}).catch((e) => {
|
|
226
|
-
postRehydrationCallback == null ?
|
|
226
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
api.persist = {
|
|
@@ -237,7 +237,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
239
|
clearStorage: () => {
|
|
240
|
-
storage == null ?
|
|
240
|
+
storage == null ? void 0 : storage.removeItem(options.name);
|
|
241
241
|
},
|
|
242
242
|
getOptions: () => options,
|
|
243
243
|
rehydrate: () => hydrate(),
|
|
@@ -3039,7 +3039,7 @@ const hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
|
3039
3039
|
});
|
|
3040
3040
|
};
|
|
3041
3041
|
const isString$1 = obj => typeof obj === 'string';
|
|
3042
|
-
const isObject$
|
|
3042
|
+
const isObject$2 = obj => typeof obj === 'object' && obj !== null;
|
|
3043
3043
|
|
|
3044
3044
|
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3045
3045
|
const htmlEntities = {
|
|
@@ -3137,7 +3137,7 @@ const useTranslation = (ns, props = {}) => {
|
|
|
3137
3137
|
warnOnce$1(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');
|
|
3138
3138
|
const notReadyT = (k, optsOrDefaultValue) => {
|
|
3139
3139
|
if (isString$1(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
3140
|
-
if (isObject$
|
|
3140
|
+
if (isObject$2(optsOrDefaultValue) && isString$1(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
3141
3141
|
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
3142
3142
|
};
|
|
3143
3143
|
const retNotReady = [notReadyT, {}, false];
|
|
@@ -3258,7 +3258,12 @@ const CheckoutEmbed$2 = {
|
|
|
3258
3258
|
subtotal: "Mezisoučet",
|
|
3259
3259
|
tax: "Daň",
|
|
3260
3260
|
title: "Shrnutí",
|
|
3261
|
-
total: "Celkem"
|
|
3261
|
+
total: "Celkem",
|
|
3262
|
+
discountCodeApply: "Aplikovat",
|
|
3263
|
+
discountCodePlaceholder: "Slevový kód nebo dárková karta",
|
|
3264
|
+
discountCodeError: "Už dostáváte nejlepší nabídku!",
|
|
3265
|
+
free: "Zdarma",
|
|
3266
|
+
discountCodeSuccess: "Slevový kód byl úspěšně použit."
|
|
3262
3267
|
},
|
|
3263
3268
|
loading: "Načítání ...",
|
|
3264
3269
|
Payment: {
|
|
@@ -3305,7 +3310,12 @@ const CheckoutEmbed$1 = {
|
|
|
3305
3310
|
subtotal: "Subtotal",
|
|
3306
3311
|
shipping: "Shipping",
|
|
3307
3312
|
calculatedAtNextStep: "Calculated at next step",
|
|
3308
|
-
tax: "Tax"
|
|
3313
|
+
tax: "Tax",
|
|
3314
|
+
discountCodePlaceholder: "Discount code or gift card",
|
|
3315
|
+
discountCodeApply: "Apply",
|
|
3316
|
+
discountCodeError: "You're already getting the best offer!",
|
|
3317
|
+
free: "Free",
|
|
3318
|
+
discountCodeSuccess: "Discount code applied successfully."
|
|
3309
3319
|
},
|
|
3310
3320
|
CustomerForm: {
|
|
3311
3321
|
address: {
|
|
@@ -3393,6 +3403,1135 @@ const createI18nInstance = (locale) => __awaiter(void 0, void 0, void 0, functio
|
|
|
3393
3403
|
return instance;
|
|
3394
3404
|
});
|
|
3395
3405
|
|
|
3406
|
+
var M$1=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React__namespace.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z$1=()=>{var e;return (e=React__namespace.useContext(x))!=null?e:U$1};React__namespace.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React__namespace.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M$1.toString()})(${p})`}})});
|
|
3407
|
+
|
|
3408
|
+
function __insertCSS(code) {
|
|
3409
|
+
if (typeof document == 'undefined') return
|
|
3410
|
+
let head = document.head || document.getElementsByTagName('head')[0];
|
|
3411
|
+
let style = document.createElement('style');
|
|
3412
|
+
style.type = 'text/css';
|
|
3413
|
+
head.appendChild(style)
|
|
3414
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
const getAsset = (type)=>{
|
|
3418
|
+
switch(type){
|
|
3419
|
+
case 'success':
|
|
3420
|
+
return SuccessIcon;
|
|
3421
|
+
case 'info':
|
|
3422
|
+
return InfoIcon;
|
|
3423
|
+
case 'warning':
|
|
3424
|
+
return WarningIcon;
|
|
3425
|
+
case 'error':
|
|
3426
|
+
return ErrorIcon;
|
|
3427
|
+
default:
|
|
3428
|
+
return null;
|
|
3429
|
+
}
|
|
3430
|
+
};
|
|
3431
|
+
const bars = Array(12).fill(0);
|
|
3432
|
+
const Loader$1 = ({ visible, className })=>{
|
|
3433
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
3434
|
+
className: [
|
|
3435
|
+
'sonner-loading-wrapper',
|
|
3436
|
+
className
|
|
3437
|
+
].filter(Boolean).join(' '),
|
|
3438
|
+
"data-visible": visible
|
|
3439
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
3440
|
+
className: "sonner-spinner"
|
|
3441
|
+
}, bars.map((_, i)=>/*#__PURE__*/ React.createElement("div", {
|
|
3442
|
+
className: "sonner-loading-bar",
|
|
3443
|
+
key: `spinner-bar-${i}`
|
|
3444
|
+
}))));
|
|
3445
|
+
};
|
|
3446
|
+
const SuccessIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3447
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3448
|
+
viewBox: "0 0 20 20",
|
|
3449
|
+
fill: "currentColor",
|
|
3450
|
+
height: "20",
|
|
3451
|
+
width: "20"
|
|
3452
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3453
|
+
fillRule: "evenodd",
|
|
3454
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
3455
|
+
clipRule: "evenodd"
|
|
3456
|
+
}));
|
|
3457
|
+
const WarningIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3458
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3459
|
+
viewBox: "0 0 24 24",
|
|
3460
|
+
fill: "currentColor",
|
|
3461
|
+
height: "20",
|
|
3462
|
+
width: "20"
|
|
3463
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3464
|
+
fillRule: "evenodd",
|
|
3465
|
+
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
3466
|
+
clipRule: "evenodd"
|
|
3467
|
+
}));
|
|
3468
|
+
const InfoIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3469
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3470
|
+
viewBox: "0 0 20 20",
|
|
3471
|
+
fill: "currentColor",
|
|
3472
|
+
height: "20",
|
|
3473
|
+
width: "20"
|
|
3474
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3475
|
+
fillRule: "evenodd",
|
|
3476
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
3477
|
+
clipRule: "evenodd"
|
|
3478
|
+
}));
|
|
3479
|
+
const ErrorIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3480
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3481
|
+
viewBox: "0 0 20 20",
|
|
3482
|
+
fill: "currentColor",
|
|
3483
|
+
height: "20",
|
|
3484
|
+
width: "20"
|
|
3485
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
3486
|
+
fillRule: "evenodd",
|
|
3487
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
3488
|
+
clipRule: "evenodd"
|
|
3489
|
+
}));
|
|
3490
|
+
const CloseIcon = /*#__PURE__*/ React.createElement("svg", {
|
|
3491
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3492
|
+
width: "12",
|
|
3493
|
+
height: "12",
|
|
3494
|
+
viewBox: "0 0 24 24",
|
|
3495
|
+
fill: "none",
|
|
3496
|
+
stroke: "currentColor",
|
|
3497
|
+
strokeWidth: "1.5",
|
|
3498
|
+
strokeLinecap: "round",
|
|
3499
|
+
strokeLinejoin: "round"
|
|
3500
|
+
}, /*#__PURE__*/ React.createElement("line", {
|
|
3501
|
+
x1: "18",
|
|
3502
|
+
y1: "6",
|
|
3503
|
+
x2: "6",
|
|
3504
|
+
y2: "18"
|
|
3505
|
+
}), /*#__PURE__*/ React.createElement("line", {
|
|
3506
|
+
x1: "6",
|
|
3507
|
+
y1: "6",
|
|
3508
|
+
x2: "18",
|
|
3509
|
+
y2: "18"
|
|
3510
|
+
}));
|
|
3511
|
+
|
|
3512
|
+
const useIsDocumentHidden = ()=>{
|
|
3513
|
+
const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);
|
|
3514
|
+
React.useEffect(()=>{
|
|
3515
|
+
const callback = ()=>{
|
|
3516
|
+
setIsDocumentHidden(document.hidden);
|
|
3517
|
+
};
|
|
3518
|
+
document.addEventListener('visibilitychange', callback);
|
|
3519
|
+
return ()=>window.removeEventListener('visibilitychange', callback);
|
|
3520
|
+
}, []);
|
|
3521
|
+
return isDocumentHidden;
|
|
3522
|
+
};
|
|
3523
|
+
|
|
3524
|
+
let toastsCounter = 1;
|
|
3525
|
+
class Observer {
|
|
3526
|
+
constructor(){
|
|
3527
|
+
// We use arrow functions to maintain the correct `this` reference
|
|
3528
|
+
this.subscribe = (subscriber)=>{
|
|
3529
|
+
this.subscribers.push(subscriber);
|
|
3530
|
+
return ()=>{
|
|
3531
|
+
const index = this.subscribers.indexOf(subscriber);
|
|
3532
|
+
this.subscribers.splice(index, 1);
|
|
3533
|
+
};
|
|
3534
|
+
};
|
|
3535
|
+
this.publish = (data)=>{
|
|
3536
|
+
this.subscribers.forEach((subscriber)=>subscriber(data));
|
|
3537
|
+
};
|
|
3538
|
+
this.addToast = (data)=>{
|
|
3539
|
+
this.publish(data);
|
|
3540
|
+
this.toasts = [
|
|
3541
|
+
...this.toasts,
|
|
3542
|
+
data
|
|
3543
|
+
];
|
|
3544
|
+
};
|
|
3545
|
+
this.create = (data)=>{
|
|
3546
|
+
var _data_id;
|
|
3547
|
+
const { message, ...rest } = data;
|
|
3548
|
+
const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
3549
|
+
const alreadyExists = this.toasts.find((toast)=>{
|
|
3550
|
+
return toast.id === id;
|
|
3551
|
+
});
|
|
3552
|
+
const dismissible = data.dismissible === undefined ? true : data.dismissible;
|
|
3553
|
+
if (this.dismissedToasts.has(id)) {
|
|
3554
|
+
this.dismissedToasts.delete(id);
|
|
3555
|
+
}
|
|
3556
|
+
if (alreadyExists) {
|
|
3557
|
+
this.toasts = this.toasts.map((toast)=>{
|
|
3558
|
+
if (toast.id === id) {
|
|
3559
|
+
this.publish({
|
|
3560
|
+
...toast,
|
|
3561
|
+
...data,
|
|
3562
|
+
id,
|
|
3563
|
+
title: message
|
|
3564
|
+
});
|
|
3565
|
+
return {
|
|
3566
|
+
...toast,
|
|
3567
|
+
...data,
|
|
3568
|
+
id,
|
|
3569
|
+
dismissible,
|
|
3570
|
+
title: message
|
|
3571
|
+
};
|
|
3572
|
+
}
|
|
3573
|
+
return toast;
|
|
3574
|
+
});
|
|
3575
|
+
} else {
|
|
3576
|
+
this.addToast({
|
|
3577
|
+
title: message,
|
|
3578
|
+
...rest,
|
|
3579
|
+
dismissible,
|
|
3580
|
+
id
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
return id;
|
|
3584
|
+
};
|
|
3585
|
+
this.dismiss = (id)=>{
|
|
3586
|
+
if (id) {
|
|
3587
|
+
this.dismissedToasts.add(id);
|
|
3588
|
+
requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({
|
|
3589
|
+
id,
|
|
3590
|
+
dismiss: true
|
|
3591
|
+
})));
|
|
3592
|
+
} else {
|
|
3593
|
+
this.toasts.forEach((toast)=>{
|
|
3594
|
+
this.subscribers.forEach((subscriber)=>subscriber({
|
|
3595
|
+
id: toast.id,
|
|
3596
|
+
dismiss: true
|
|
3597
|
+
}));
|
|
3598
|
+
});
|
|
3599
|
+
}
|
|
3600
|
+
return id;
|
|
3601
|
+
};
|
|
3602
|
+
this.message = (message, data)=>{
|
|
3603
|
+
return this.create({
|
|
3604
|
+
...data,
|
|
3605
|
+
message
|
|
3606
|
+
});
|
|
3607
|
+
};
|
|
3608
|
+
this.error = (message, data)=>{
|
|
3609
|
+
return this.create({
|
|
3610
|
+
...data,
|
|
3611
|
+
message,
|
|
3612
|
+
type: 'error'
|
|
3613
|
+
});
|
|
3614
|
+
};
|
|
3615
|
+
this.success = (message, data)=>{
|
|
3616
|
+
return this.create({
|
|
3617
|
+
...data,
|
|
3618
|
+
type: 'success',
|
|
3619
|
+
message
|
|
3620
|
+
});
|
|
3621
|
+
};
|
|
3622
|
+
this.info = (message, data)=>{
|
|
3623
|
+
return this.create({
|
|
3624
|
+
...data,
|
|
3625
|
+
type: 'info',
|
|
3626
|
+
message
|
|
3627
|
+
});
|
|
3628
|
+
};
|
|
3629
|
+
this.warning = (message, data)=>{
|
|
3630
|
+
return this.create({
|
|
3631
|
+
...data,
|
|
3632
|
+
type: 'warning',
|
|
3633
|
+
message
|
|
3634
|
+
});
|
|
3635
|
+
};
|
|
3636
|
+
this.loading = (message, data)=>{
|
|
3637
|
+
return this.create({
|
|
3638
|
+
...data,
|
|
3639
|
+
type: 'loading',
|
|
3640
|
+
message
|
|
3641
|
+
});
|
|
3642
|
+
};
|
|
3643
|
+
this.promise = (promise, data)=>{
|
|
3644
|
+
if (!data) {
|
|
3645
|
+
// Nothing to show
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
let id = undefined;
|
|
3649
|
+
if (data.loading !== undefined) {
|
|
3650
|
+
id = this.create({
|
|
3651
|
+
...data,
|
|
3652
|
+
promise,
|
|
3653
|
+
type: 'loading',
|
|
3654
|
+
message: data.loading,
|
|
3655
|
+
description: typeof data.description !== 'function' ? data.description : undefined
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3658
|
+
const p = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
3659
|
+
let shouldDismiss = id !== undefined;
|
|
3660
|
+
let result;
|
|
3661
|
+
const originalPromise = p.then(async (response)=>{
|
|
3662
|
+
result = [
|
|
3663
|
+
'resolve',
|
|
3664
|
+
response
|
|
3665
|
+
];
|
|
3666
|
+
const isReactElementResponse = React.isValidElement(response);
|
|
3667
|
+
if (isReactElementResponse) {
|
|
3668
|
+
shouldDismiss = false;
|
|
3669
|
+
this.create({
|
|
3670
|
+
id,
|
|
3671
|
+
type: 'default',
|
|
3672
|
+
message: response
|
|
3673
|
+
});
|
|
3674
|
+
} else if (isHttpResponse(response) && !response.ok) {
|
|
3675
|
+
shouldDismiss = false;
|
|
3676
|
+
const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
3677
|
+
const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
3678
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3679
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3680
|
+
message: promiseData
|
|
3681
|
+
};
|
|
3682
|
+
this.create({
|
|
3683
|
+
id,
|
|
3684
|
+
type: 'error',
|
|
3685
|
+
description,
|
|
3686
|
+
...toastSettings
|
|
3687
|
+
});
|
|
3688
|
+
} else if (response instanceof Error) {
|
|
3689
|
+
shouldDismiss = false;
|
|
3690
|
+
const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;
|
|
3691
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3692
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3693
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3694
|
+
message: promiseData
|
|
3695
|
+
};
|
|
3696
|
+
this.create({
|
|
3697
|
+
id,
|
|
3698
|
+
type: 'error',
|
|
3699
|
+
description,
|
|
3700
|
+
...toastSettings
|
|
3701
|
+
});
|
|
3702
|
+
} else if (data.success !== undefined) {
|
|
3703
|
+
shouldDismiss = false;
|
|
3704
|
+
const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;
|
|
3705
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3706
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3707
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3708
|
+
message: promiseData
|
|
3709
|
+
};
|
|
3710
|
+
this.create({
|
|
3711
|
+
id,
|
|
3712
|
+
type: 'success',
|
|
3713
|
+
description,
|
|
3714
|
+
...toastSettings
|
|
3715
|
+
});
|
|
3716
|
+
}
|
|
3717
|
+
}).catch(async (error)=>{
|
|
3718
|
+
result = [
|
|
3719
|
+
'reject',
|
|
3720
|
+
error
|
|
3721
|
+
];
|
|
3722
|
+
if (data.error !== undefined) {
|
|
3723
|
+
shouldDismiss = false;
|
|
3724
|
+
const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;
|
|
3725
|
+
const description = typeof data.description === 'function' ? await data.description(error) : data.description;
|
|
3726
|
+
const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData);
|
|
3727
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3728
|
+
message: promiseData
|
|
3729
|
+
};
|
|
3730
|
+
this.create({
|
|
3731
|
+
id,
|
|
3732
|
+
type: 'error',
|
|
3733
|
+
description,
|
|
3734
|
+
...toastSettings
|
|
3735
|
+
});
|
|
3736
|
+
}
|
|
3737
|
+
}).finally(()=>{
|
|
3738
|
+
if (shouldDismiss) {
|
|
3739
|
+
// Toast is still in load state (and will be indefinitely — dismiss it)
|
|
3740
|
+
this.dismiss(id);
|
|
3741
|
+
id = undefined;
|
|
3742
|
+
}
|
|
3743
|
+
data.finally == null ? void 0 : data.finally.call(data);
|
|
3744
|
+
});
|
|
3745
|
+
const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
3746
|
+
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
3747
|
+
// cannot Object.assign on undefined
|
|
3748
|
+
return {
|
|
3749
|
+
unwrap
|
|
3750
|
+
};
|
|
3751
|
+
} else {
|
|
3752
|
+
return Object.assign(id, {
|
|
3753
|
+
unwrap
|
|
3754
|
+
});
|
|
3755
|
+
}
|
|
3756
|
+
};
|
|
3757
|
+
this.custom = (jsx, data)=>{
|
|
3758
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3759
|
+
this.create({
|
|
3760
|
+
jsx: jsx(id),
|
|
3761
|
+
id,
|
|
3762
|
+
...data
|
|
3763
|
+
});
|
|
3764
|
+
return id;
|
|
3765
|
+
};
|
|
3766
|
+
this.getActiveToasts = ()=>{
|
|
3767
|
+
return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));
|
|
3768
|
+
};
|
|
3769
|
+
this.subscribers = [];
|
|
3770
|
+
this.toasts = [];
|
|
3771
|
+
this.dismissedToasts = new Set();
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
const ToastState = new Observer();
|
|
3775
|
+
// bind this to the toast function
|
|
3776
|
+
const toastFunction = (message, data)=>{
|
|
3777
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3778
|
+
ToastState.addToast({
|
|
3779
|
+
title: message,
|
|
3780
|
+
...data,
|
|
3781
|
+
id
|
|
3782
|
+
});
|
|
3783
|
+
return id;
|
|
3784
|
+
};
|
|
3785
|
+
const isHttpResponse = (data)=>{
|
|
3786
|
+
return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';
|
|
3787
|
+
};
|
|
3788
|
+
const basicToast = toastFunction;
|
|
3789
|
+
const getHistory = ()=>ToastState.toasts;
|
|
3790
|
+
const getToasts = ()=>ToastState.getActiveToasts();
|
|
3791
|
+
// We use `Object.assign` to maintain the correct types as we would lose them otherwise
|
|
3792
|
+
const toast = Object.assign(basicToast, {
|
|
3793
|
+
success: ToastState.success,
|
|
3794
|
+
info: ToastState.info,
|
|
3795
|
+
warning: ToastState.warning,
|
|
3796
|
+
error: ToastState.error,
|
|
3797
|
+
custom: ToastState.custom,
|
|
3798
|
+
message: ToastState.message,
|
|
3799
|
+
promise: ToastState.promise,
|
|
3800
|
+
dismiss: ToastState.dismiss,
|
|
3801
|
+
loading: ToastState.loading
|
|
3802
|
+
}, {
|
|
3803
|
+
getHistory,
|
|
3804
|
+
getToasts
|
|
3805
|
+
});
|
|
3806
|
+
|
|
3807
|
+
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
3808
|
+
|
|
3809
|
+
function isAction(action) {
|
|
3810
|
+
return action.label !== undefined;
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
// Visible toasts amount
|
|
3814
|
+
const VISIBLE_TOASTS_AMOUNT = 3;
|
|
3815
|
+
// Viewport padding
|
|
3816
|
+
const VIEWPORT_OFFSET = '24px';
|
|
3817
|
+
// Mobile viewport padding
|
|
3818
|
+
const MOBILE_VIEWPORT_OFFSET = '16px';
|
|
3819
|
+
// Default lifetime of a toasts (in ms)
|
|
3820
|
+
const TOAST_LIFETIME = 4000;
|
|
3821
|
+
// Default toast width
|
|
3822
|
+
const TOAST_WIDTH = 356;
|
|
3823
|
+
// Default gap between toasts
|
|
3824
|
+
const GAP = 14;
|
|
3825
|
+
// Threshold to dismiss a toast
|
|
3826
|
+
const SWIPE_THRESHOLD = 45;
|
|
3827
|
+
// Equal to exit animation duration
|
|
3828
|
+
const TIME_BEFORE_UNMOUNT = 200;
|
|
3829
|
+
function cn$1(...classes) {
|
|
3830
|
+
return classes.filter(Boolean).join(' ');
|
|
3831
|
+
}
|
|
3832
|
+
function getDefaultSwipeDirections(position) {
|
|
3833
|
+
const [y, x] = position.split('-');
|
|
3834
|
+
const directions = [];
|
|
3835
|
+
if (y) {
|
|
3836
|
+
directions.push(y);
|
|
3837
|
+
}
|
|
3838
|
+
if (x) {
|
|
3839
|
+
directions.push(x);
|
|
3840
|
+
}
|
|
3841
|
+
return directions;
|
|
3842
|
+
}
|
|
3843
|
+
const Toast = (props)=>{
|
|
3844
|
+
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
3845
|
+
const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = '', descriptionClassName = '', duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = 'Close toast' } = props;
|
|
3846
|
+
const [swipeDirection, setSwipeDirection] = React.useState(null);
|
|
3847
|
+
const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);
|
|
3848
|
+
const [mounted, setMounted] = React.useState(false);
|
|
3849
|
+
const [removed, setRemoved] = React.useState(false);
|
|
3850
|
+
const [swiping, setSwiping] = React.useState(false);
|
|
3851
|
+
const [swipeOut, setSwipeOut] = React.useState(false);
|
|
3852
|
+
const [isSwiped, setIsSwiped] = React.useState(false);
|
|
3853
|
+
const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
|
|
3854
|
+
const [initialHeight, setInitialHeight] = React.useState(0);
|
|
3855
|
+
const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
|
|
3856
|
+
const dragStartTime = React.useRef(null);
|
|
3857
|
+
const toastRef = React.useRef(null);
|
|
3858
|
+
const isFront = index === 0;
|
|
3859
|
+
const isVisible = index + 1 <= visibleToasts;
|
|
3860
|
+
const toastType = toast.type;
|
|
3861
|
+
const dismissible = toast.dismissible !== false;
|
|
3862
|
+
const toastClassname = toast.className || '';
|
|
3863
|
+
const toastDescriptionClassname = toast.descriptionClassName || '';
|
|
3864
|
+
// Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.
|
|
3865
|
+
const heightIndex = React.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [
|
|
3866
|
+
heights,
|
|
3867
|
+
toast.id
|
|
3868
|
+
]);
|
|
3869
|
+
const closeButton = React.useMemo(()=>{
|
|
3870
|
+
var _toast_closeButton;
|
|
3871
|
+
return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
3872
|
+
}, [
|
|
3873
|
+
toast.closeButton,
|
|
3874
|
+
closeButtonFromToaster
|
|
3875
|
+
]);
|
|
3876
|
+
const duration = React.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
3877
|
+
toast.duration,
|
|
3878
|
+
durationFromToaster
|
|
3879
|
+
]);
|
|
3880
|
+
const closeTimerStartTimeRef = React.useRef(0);
|
|
3881
|
+
const offset = React.useRef(0);
|
|
3882
|
+
const lastCloseTimerStartTimeRef = React.useRef(0);
|
|
3883
|
+
const pointerStartRef = React.useRef(null);
|
|
3884
|
+
const [y, x] = position.split('-');
|
|
3885
|
+
const toastsHeightBefore = React.useMemo(()=>{
|
|
3886
|
+
return heights.reduce((prev, curr, reducerIndex)=>{
|
|
3887
|
+
// Calculate offset up until current toast
|
|
3888
|
+
if (reducerIndex >= heightIndex) {
|
|
3889
|
+
return prev;
|
|
3890
|
+
}
|
|
3891
|
+
return prev + curr.height;
|
|
3892
|
+
}, 0);
|
|
3893
|
+
}, [
|
|
3894
|
+
heights,
|
|
3895
|
+
heightIndex
|
|
3896
|
+
]);
|
|
3897
|
+
const isDocumentHidden = useIsDocumentHidden();
|
|
3898
|
+
const invert = toast.invert || ToasterInvert;
|
|
3899
|
+
const disabled = toastType === 'loading';
|
|
3900
|
+
offset.current = React.useMemo(()=>heightIndex * gap + toastsHeightBefore, [
|
|
3901
|
+
heightIndex,
|
|
3902
|
+
toastsHeightBefore
|
|
3903
|
+
]);
|
|
3904
|
+
React.useEffect(()=>{
|
|
3905
|
+
remainingTime.current = duration;
|
|
3906
|
+
}, [
|
|
3907
|
+
duration
|
|
3908
|
+
]);
|
|
3909
|
+
React.useEffect(()=>{
|
|
3910
|
+
// Trigger enter animation without using CSS animation
|
|
3911
|
+
setMounted(true);
|
|
3912
|
+
}, []);
|
|
3913
|
+
React.useEffect(()=>{
|
|
3914
|
+
const toastNode = toastRef.current;
|
|
3915
|
+
if (toastNode) {
|
|
3916
|
+
const height = toastNode.getBoundingClientRect().height;
|
|
3917
|
+
// Add toast height to heights array after the toast is mounted
|
|
3918
|
+
setInitialHeight(height);
|
|
3919
|
+
setHeights((h)=>[
|
|
3920
|
+
{
|
|
3921
|
+
toastId: toast.id,
|
|
3922
|
+
height,
|
|
3923
|
+
position: toast.position
|
|
3924
|
+
},
|
|
3925
|
+
...h
|
|
3926
|
+
]);
|
|
3927
|
+
return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3928
|
+
}
|
|
3929
|
+
}, [
|
|
3930
|
+
setHeights,
|
|
3931
|
+
toast.id
|
|
3932
|
+
]);
|
|
3933
|
+
React.useLayoutEffect(()=>{
|
|
3934
|
+
if (!mounted) return;
|
|
3935
|
+
const toastNode = toastRef.current;
|
|
3936
|
+
const originalHeight = toastNode.style.height;
|
|
3937
|
+
toastNode.style.height = 'auto';
|
|
3938
|
+
const newHeight = toastNode.getBoundingClientRect().height;
|
|
3939
|
+
toastNode.style.height = originalHeight;
|
|
3940
|
+
setInitialHeight(newHeight);
|
|
3941
|
+
setHeights((heights)=>{
|
|
3942
|
+
const alreadyExists = heights.find((height)=>height.toastId === toast.id);
|
|
3943
|
+
if (!alreadyExists) {
|
|
3944
|
+
return [
|
|
3945
|
+
{
|
|
3946
|
+
toastId: toast.id,
|
|
3947
|
+
height: newHeight,
|
|
3948
|
+
position: toast.position
|
|
3949
|
+
},
|
|
3950
|
+
...heights
|
|
3951
|
+
];
|
|
3952
|
+
} else {
|
|
3953
|
+
return heights.map((height)=>height.toastId === toast.id ? {
|
|
3954
|
+
...height,
|
|
3955
|
+
height: newHeight
|
|
3956
|
+
} : height);
|
|
3957
|
+
}
|
|
3958
|
+
});
|
|
3959
|
+
}, [
|
|
3960
|
+
mounted,
|
|
3961
|
+
toast.title,
|
|
3962
|
+
toast.description,
|
|
3963
|
+
setHeights,
|
|
3964
|
+
toast.id
|
|
3965
|
+
]);
|
|
3966
|
+
const deleteToast = React.useCallback(()=>{
|
|
3967
|
+
// Save the offset for the exit swipe animation
|
|
3968
|
+
setRemoved(true);
|
|
3969
|
+
setOffsetBeforeRemove(offset.current);
|
|
3970
|
+
setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3971
|
+
setTimeout(()=>{
|
|
3972
|
+
removeToast(toast);
|
|
3973
|
+
}, TIME_BEFORE_UNMOUNT);
|
|
3974
|
+
}, [
|
|
3975
|
+
toast,
|
|
3976
|
+
removeToast,
|
|
3977
|
+
setHeights,
|
|
3978
|
+
offset
|
|
3979
|
+
]);
|
|
3980
|
+
React.useEffect(()=>{
|
|
3981
|
+
if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return;
|
|
3982
|
+
let timeoutId;
|
|
3983
|
+
// Pause the timer on each hover
|
|
3984
|
+
const pauseTimer = ()=>{
|
|
3985
|
+
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
3986
|
+
// Get the elapsed time since the timer started
|
|
3987
|
+
const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
|
|
3988
|
+
remainingTime.current = remainingTime.current - elapsedTime;
|
|
3989
|
+
}
|
|
3990
|
+
lastCloseTimerStartTimeRef.current = new Date().getTime();
|
|
3991
|
+
};
|
|
3992
|
+
const startTimer = ()=>{
|
|
3993
|
+
// setTimeout(, Infinity) behaves as if the delay is 0.
|
|
3994
|
+
// As a result, the toast would be closed immediately, giving the appearance that it was never rendered.
|
|
3995
|
+
// See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout
|
|
3996
|
+
if (remainingTime.current === Infinity) return;
|
|
3997
|
+
closeTimerStartTimeRef.current = new Date().getTime();
|
|
3998
|
+
// Let the toast know it has started
|
|
3999
|
+
timeoutId = setTimeout(()=>{
|
|
4000
|
+
toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast);
|
|
4001
|
+
deleteToast();
|
|
4002
|
+
}, remainingTime.current);
|
|
4003
|
+
};
|
|
4004
|
+
if (expanded || interacting || isDocumentHidden) {
|
|
4005
|
+
pauseTimer();
|
|
4006
|
+
} else {
|
|
4007
|
+
startTimer();
|
|
4008
|
+
}
|
|
4009
|
+
return ()=>clearTimeout(timeoutId);
|
|
4010
|
+
}, [
|
|
4011
|
+
expanded,
|
|
4012
|
+
interacting,
|
|
4013
|
+
toast,
|
|
4014
|
+
toastType,
|
|
4015
|
+
isDocumentHidden,
|
|
4016
|
+
deleteToast
|
|
4017
|
+
]);
|
|
4018
|
+
React.useEffect(()=>{
|
|
4019
|
+
if (toast.delete) {
|
|
4020
|
+
deleteToast();
|
|
4021
|
+
}
|
|
4022
|
+
}, [
|
|
4023
|
+
deleteToast,
|
|
4024
|
+
toast.delete
|
|
4025
|
+
]);
|
|
4026
|
+
function getLoadingIcon() {
|
|
4027
|
+
var _toast_classNames;
|
|
4028
|
+
if (icons == null ? void 0 : icons.loading) {
|
|
4029
|
+
var _toast_classNames1;
|
|
4030
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
4031
|
+
className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, 'sonner-loader'),
|
|
4032
|
+
"data-visible": toastType === 'loading'
|
|
4033
|
+
}, icons.loading);
|
|
4034
|
+
}
|
|
4035
|
+
return /*#__PURE__*/ React.createElement(Loader$1, {
|
|
4036
|
+
className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),
|
|
4037
|
+
visible: toastType === 'loading'
|
|
4038
|
+
});
|
|
4039
|
+
}
|
|
4040
|
+
const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
|
|
4041
|
+
var _toast_richColors, _icons_close;
|
|
4042
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
4043
|
+
tabIndex: 0,
|
|
4044
|
+
ref: toastRef,
|
|
4045
|
+
className: cn$1(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastType]),
|
|
4046
|
+
"data-sonner-toast": "",
|
|
4047
|
+
"data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
|
|
4048
|
+
"data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
|
|
4049
|
+
"data-mounted": mounted,
|
|
4050
|
+
"data-promise": Boolean(toast.promise),
|
|
4051
|
+
"data-swiped": isSwiped,
|
|
4052
|
+
"data-removed": removed,
|
|
4053
|
+
"data-visible": isVisible,
|
|
4054
|
+
"data-y-position": y,
|
|
4055
|
+
"data-x-position": x,
|
|
4056
|
+
"data-index": index,
|
|
4057
|
+
"data-front": isFront,
|
|
4058
|
+
"data-swiping": swiping,
|
|
4059
|
+
"data-dismissible": dismissible,
|
|
4060
|
+
"data-type": toastType,
|
|
4061
|
+
"data-invert": invert,
|
|
4062
|
+
"data-swipe-out": swipeOut,
|
|
4063
|
+
"data-swipe-direction": swipeOutDirection,
|
|
4064
|
+
"data-expanded": Boolean(expanded || expandByDefault && mounted),
|
|
4065
|
+
style: {
|
|
4066
|
+
'--index': index,
|
|
4067
|
+
'--toasts-before': index,
|
|
4068
|
+
'--z-index': toasts.length - index,
|
|
4069
|
+
'--offset': `${removed ? offsetBeforeRemove : offset.current}px`,
|
|
4070
|
+
'--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,
|
|
4071
|
+
...style,
|
|
4072
|
+
...toast.style
|
|
4073
|
+
},
|
|
4074
|
+
onDragEnd: ()=>{
|
|
4075
|
+
setSwiping(false);
|
|
4076
|
+
setSwipeDirection(null);
|
|
4077
|
+
pointerStartRef.current = null;
|
|
4078
|
+
},
|
|
4079
|
+
onPointerDown: (event)=>{
|
|
4080
|
+
if (disabled || !dismissible) return;
|
|
4081
|
+
dragStartTime.current = new Date();
|
|
4082
|
+
setOffsetBeforeRemove(offset.current);
|
|
4083
|
+
// Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)
|
|
4084
|
+
event.target.setPointerCapture(event.pointerId);
|
|
4085
|
+
if (event.target.tagName === 'BUTTON') return;
|
|
4086
|
+
setSwiping(true);
|
|
4087
|
+
pointerStartRef.current = {
|
|
4088
|
+
x: event.clientX,
|
|
4089
|
+
y: event.clientY
|
|
4090
|
+
};
|
|
4091
|
+
},
|
|
4092
|
+
onPointerUp: ()=>{
|
|
4093
|
+
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
4094
|
+
if (swipeOut || !dismissible) return;
|
|
4095
|
+
pointerStartRef.current = null;
|
|
4096
|
+
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0);
|
|
4097
|
+
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0);
|
|
4098
|
+
const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
|
|
4099
|
+
const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;
|
|
4100
|
+
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
4101
|
+
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
|
4102
|
+
setOffsetBeforeRemove(offset.current);
|
|
4103
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4104
|
+
if (swipeDirection === 'x') {
|
|
4105
|
+
setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');
|
|
4106
|
+
} else {
|
|
4107
|
+
setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');
|
|
4108
|
+
}
|
|
4109
|
+
deleteToast();
|
|
4110
|
+
setSwipeOut(true);
|
|
4111
|
+
return;
|
|
4112
|
+
} else {
|
|
4113
|
+
var _toastRef_current2, _toastRef_current3;
|
|
4114
|
+
(_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`);
|
|
4115
|
+
(_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`);
|
|
4116
|
+
}
|
|
4117
|
+
setIsSwiped(false);
|
|
4118
|
+
setSwiping(false);
|
|
4119
|
+
setSwipeDirection(null);
|
|
4120
|
+
},
|
|
4121
|
+
onPointerMove: (event)=>{
|
|
4122
|
+
var _window_getSelection, // Apply transform using both x and y values
|
|
4123
|
+
_toastRef_current, _toastRef_current1;
|
|
4124
|
+
if (!pointerStartRef.current || !dismissible) return;
|
|
4125
|
+
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
|
|
4126
|
+
if (isHighlighted) return;
|
|
4127
|
+
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
4128
|
+
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
4129
|
+
var _props_swipeDirections;
|
|
4130
|
+
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
|
|
4131
|
+
// Determine swipe direction if not already locked
|
|
4132
|
+
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
4133
|
+
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');
|
|
4134
|
+
}
|
|
4135
|
+
let swipeAmount = {
|
|
4136
|
+
x: 0,
|
|
4137
|
+
y: 0
|
|
4138
|
+
};
|
|
4139
|
+
const getDampening = (delta)=>{
|
|
4140
|
+
const factor = Math.abs(delta) / 20;
|
|
4141
|
+
return 1 / (1.5 + factor);
|
|
4142
|
+
};
|
|
4143
|
+
// Only apply swipe in the locked direction
|
|
4144
|
+
if (swipeDirection === 'y') {
|
|
4145
|
+
// Handle vertical swipes
|
|
4146
|
+
if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {
|
|
4147
|
+
if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) {
|
|
4148
|
+
swipeAmount.y = yDelta;
|
|
4149
|
+
} else {
|
|
4150
|
+
// Smoothly transition to dampened movement
|
|
4151
|
+
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
4152
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4153
|
+
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
} else if (swipeDirection === 'x') {
|
|
4157
|
+
// Handle horizontal swipes
|
|
4158
|
+
if (swipeDirections.includes('left') || swipeDirections.includes('right')) {
|
|
4159
|
+
if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) {
|
|
4160
|
+
swipeAmount.x = xDelta;
|
|
4161
|
+
} else {
|
|
4162
|
+
// Smoothly transition to dampened movement
|
|
4163
|
+
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
4164
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4165
|
+
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
|
|
4170
|
+
setIsSwiped(true);
|
|
4171
|
+
}
|
|
4172
|
+
(_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);
|
|
4173
|
+
(_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);
|
|
4174
|
+
}
|
|
4175
|
+
}, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React.createElement("button", {
|
|
4176
|
+
"aria-label": closeButtonAriaLabel,
|
|
4177
|
+
"data-disabled": disabled,
|
|
4178
|
+
"data-close-button": true,
|
|
4179
|
+
onClick: disabled || !dismissible ? ()=>{} : ()=>{
|
|
4180
|
+
deleteToast();
|
|
4181
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4182
|
+
},
|
|
4183
|
+
className: cn$1(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)
|
|
4184
|
+
}, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ React.createElement("div", {
|
|
4185
|
+
"data-icon": "",
|
|
4186
|
+
className: cn$1(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)
|
|
4187
|
+
}, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React.createElement("div", {
|
|
4188
|
+
"data-content": "",
|
|
4189
|
+
className: cn$1(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)
|
|
4190
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
4191
|
+
"data-title": "",
|
|
4192
|
+
className: cn$1(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)
|
|
4193
|
+
}, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React.createElement("div", {
|
|
4194
|
+
"data-description": "",
|
|
4195
|
+
className: cn$1(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description)
|
|
4196
|
+
}, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React.createElement("button", {
|
|
4197
|
+
"data-button": true,
|
|
4198
|
+
"data-cancel": true,
|
|
4199
|
+
style: toast.cancelButtonStyle || cancelButtonStyle,
|
|
4200
|
+
onClick: (event)=>{
|
|
4201
|
+
// We need to check twice because typescript
|
|
4202
|
+
if (!isAction(toast.cancel)) return;
|
|
4203
|
+
if (!dismissible) return;
|
|
4204
|
+
toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event);
|
|
4205
|
+
deleteToast();
|
|
4206
|
+
},
|
|
4207
|
+
className: cn$1(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
|
|
4208
|
+
}, toast.cancel.label) : null, /*#__PURE__*/ React.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React.createElement("button", {
|
|
4209
|
+
"data-button": true,
|
|
4210
|
+
"data-action": true,
|
|
4211
|
+
style: toast.actionButtonStyle || actionButtonStyle,
|
|
4212
|
+
onClick: (event)=>{
|
|
4213
|
+
// We need to check twice because typescript
|
|
4214
|
+
if (!isAction(toast.action)) return;
|
|
4215
|
+
toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event);
|
|
4216
|
+
if (event.defaultPrevented) return;
|
|
4217
|
+
deleteToast();
|
|
4218
|
+
},
|
|
4219
|
+
className: cn$1(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)
|
|
4220
|
+
}, toast.action.label) : null);
|
|
4221
|
+
};
|
|
4222
|
+
function getDocumentDirection() {
|
|
4223
|
+
if (typeof window === 'undefined') return 'ltr';
|
|
4224
|
+
if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose
|
|
4225
|
+
const dirAttribute = document.documentElement.getAttribute('dir');
|
|
4226
|
+
if (dirAttribute === 'auto' || !dirAttribute) {
|
|
4227
|
+
return window.getComputedStyle(document.documentElement).direction;
|
|
4228
|
+
}
|
|
4229
|
+
return dirAttribute;
|
|
4230
|
+
}
|
|
4231
|
+
function assignOffset(defaultOffset, mobileOffset) {
|
|
4232
|
+
const styles = {};
|
|
4233
|
+
[
|
|
4234
|
+
defaultOffset,
|
|
4235
|
+
mobileOffset
|
|
4236
|
+
].forEach((offset, index)=>{
|
|
4237
|
+
const isMobile = index === 1;
|
|
4238
|
+
const prefix = isMobile ? '--mobile-offset' : '--offset';
|
|
4239
|
+
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
4240
|
+
function assignAll(offset) {
|
|
4241
|
+
[
|
|
4242
|
+
'top',
|
|
4243
|
+
'right',
|
|
4244
|
+
'bottom',
|
|
4245
|
+
'left'
|
|
4246
|
+
].forEach((key)=>{
|
|
4247
|
+
styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;
|
|
4248
|
+
});
|
|
4249
|
+
}
|
|
4250
|
+
if (typeof offset === 'number' || typeof offset === 'string') {
|
|
4251
|
+
assignAll(offset);
|
|
4252
|
+
} else if (typeof offset === 'object') {
|
|
4253
|
+
[
|
|
4254
|
+
'top',
|
|
4255
|
+
'right',
|
|
4256
|
+
'bottom',
|
|
4257
|
+
'left'
|
|
4258
|
+
].forEach((key)=>{
|
|
4259
|
+
if (offset[key] === undefined) {
|
|
4260
|
+
styles[`${prefix}-${key}`] = defaultValue;
|
|
4261
|
+
} else {
|
|
4262
|
+
styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];
|
|
4263
|
+
}
|
|
4264
|
+
});
|
|
4265
|
+
} else {
|
|
4266
|
+
assignAll(defaultValue);
|
|
4267
|
+
}
|
|
4268
|
+
});
|
|
4269
|
+
return styles;
|
|
4270
|
+
}
|
|
4271
|
+
const Toaster$1 = /*#__PURE__*/ React.forwardRef(function Toaster(props, ref) {
|
|
4272
|
+
const { invert, position = 'bottom-right', hotkey = [
|
|
4273
|
+
'altKey',
|
|
4274
|
+
'KeyT'
|
|
4275
|
+
], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props;
|
|
4276
|
+
const [toasts, setToasts] = React.useState([]);
|
|
4277
|
+
const possiblePositions = React.useMemo(()=>{
|
|
4278
|
+
return Array.from(new Set([
|
|
4279
|
+
position
|
|
4280
|
+
].concat(toasts.filter((toast)=>toast.position).map((toast)=>toast.position))));
|
|
4281
|
+
}, [
|
|
4282
|
+
toasts,
|
|
4283
|
+
position
|
|
4284
|
+
]);
|
|
4285
|
+
const [heights, setHeights] = React.useState([]);
|
|
4286
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
4287
|
+
const [interacting, setInteracting] = React.useState(false);
|
|
4288
|
+
const [actualTheme, setActualTheme] = React.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');
|
|
4289
|
+
const listRef = React.useRef(null);
|
|
4290
|
+
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
|
|
4291
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
4292
|
+
const isFocusWithinRef = React.useRef(false);
|
|
4293
|
+
const removeToast = React.useCallback((toastToRemove)=>{
|
|
4294
|
+
setToasts((toasts)=>{
|
|
4295
|
+
var _toasts_find;
|
|
4296
|
+
if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
|
|
4297
|
+
ToastState.dismiss(toastToRemove.id);
|
|
4298
|
+
}
|
|
4299
|
+
return toasts.filter(({ id })=>id !== toastToRemove.id);
|
|
4300
|
+
});
|
|
4301
|
+
}, []);
|
|
4302
|
+
React.useEffect(()=>{
|
|
4303
|
+
return ToastState.subscribe((toast)=>{
|
|
4304
|
+
if (toast.dismiss) {
|
|
4305
|
+
// Prevent batching of other state updates
|
|
4306
|
+
requestAnimationFrame(()=>{
|
|
4307
|
+
setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? {
|
|
4308
|
+
...t,
|
|
4309
|
+
delete: true
|
|
4310
|
+
} : t));
|
|
4311
|
+
});
|
|
4312
|
+
return;
|
|
4313
|
+
}
|
|
4314
|
+
// Prevent batching, temp solution.
|
|
4315
|
+
setTimeout(()=>{
|
|
4316
|
+
ReactDOM.flushSync(()=>{
|
|
4317
|
+
setToasts((toasts)=>{
|
|
4318
|
+
const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);
|
|
4319
|
+
// Update the toast if it already exists
|
|
4320
|
+
if (indexOfExistingToast !== -1) {
|
|
4321
|
+
return [
|
|
4322
|
+
...toasts.slice(0, indexOfExistingToast),
|
|
4323
|
+
{
|
|
4324
|
+
...toasts[indexOfExistingToast],
|
|
4325
|
+
...toast
|
|
4326
|
+
},
|
|
4327
|
+
...toasts.slice(indexOfExistingToast + 1)
|
|
4328
|
+
];
|
|
4329
|
+
}
|
|
4330
|
+
return [
|
|
4331
|
+
toast,
|
|
4332
|
+
...toasts
|
|
4333
|
+
];
|
|
4334
|
+
});
|
|
4335
|
+
});
|
|
4336
|
+
});
|
|
4337
|
+
});
|
|
4338
|
+
}, [
|
|
4339
|
+
toasts
|
|
4340
|
+
]);
|
|
4341
|
+
React.useEffect(()=>{
|
|
4342
|
+
if (theme !== 'system') {
|
|
4343
|
+
setActualTheme(theme);
|
|
4344
|
+
return;
|
|
4345
|
+
}
|
|
4346
|
+
if (theme === 'system') {
|
|
4347
|
+
// check if current preference is dark
|
|
4348
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
4349
|
+
// it's currently dark
|
|
4350
|
+
setActualTheme('dark');
|
|
4351
|
+
} else {
|
|
4352
|
+
// it's not dark
|
|
4353
|
+
setActualTheme('light');
|
|
4354
|
+
}
|
|
4355
|
+
}
|
|
4356
|
+
if (typeof window === 'undefined') return;
|
|
4357
|
+
const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
4358
|
+
try {
|
|
4359
|
+
// Chrome & Firefox
|
|
4360
|
+
darkMediaQuery.addEventListener('change', ({ matches })=>{
|
|
4361
|
+
if (matches) {
|
|
4362
|
+
setActualTheme('dark');
|
|
4363
|
+
} else {
|
|
4364
|
+
setActualTheme('light');
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
} catch (error) {
|
|
4368
|
+
// Safari < 14
|
|
4369
|
+
darkMediaQuery.addListener(({ matches })=>{
|
|
4370
|
+
try {
|
|
4371
|
+
if (matches) {
|
|
4372
|
+
setActualTheme('dark');
|
|
4373
|
+
} else {
|
|
4374
|
+
setActualTheme('light');
|
|
4375
|
+
}
|
|
4376
|
+
} catch (e) {
|
|
4377
|
+
console.error(e);
|
|
4378
|
+
}
|
|
4379
|
+
});
|
|
4380
|
+
}
|
|
4381
|
+
}, [
|
|
4382
|
+
theme
|
|
4383
|
+
]);
|
|
4384
|
+
React.useEffect(()=>{
|
|
4385
|
+
// Ensure expanded is always false when no toasts are present / only one left
|
|
4386
|
+
if (toasts.length <= 1) {
|
|
4387
|
+
setExpanded(false);
|
|
4388
|
+
}
|
|
4389
|
+
}, [
|
|
4390
|
+
toasts
|
|
4391
|
+
]);
|
|
4392
|
+
React.useEffect(()=>{
|
|
4393
|
+
const handleKeyDown = (event)=>{
|
|
4394
|
+
var _listRef_current;
|
|
4395
|
+
const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key);
|
|
4396
|
+
if (isHotkeyPressed) {
|
|
4397
|
+
var _listRef_current1;
|
|
4398
|
+
setExpanded(true);
|
|
4399
|
+
(_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
|
|
4400
|
+
}
|
|
4401
|
+
if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
|
|
4402
|
+
setExpanded(false);
|
|
4403
|
+
}
|
|
4404
|
+
};
|
|
4405
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
4406
|
+
return ()=>document.removeEventListener('keydown', handleKeyDown);
|
|
4407
|
+
}, [
|
|
4408
|
+
hotkey
|
|
4409
|
+
]);
|
|
4410
|
+
React.useEffect(()=>{
|
|
4411
|
+
if (listRef.current) {
|
|
4412
|
+
return ()=>{
|
|
4413
|
+
if (lastFocusedElementRef.current) {
|
|
4414
|
+
lastFocusedElementRef.current.focus({
|
|
4415
|
+
preventScroll: true
|
|
4416
|
+
});
|
|
4417
|
+
lastFocusedElementRef.current = null;
|
|
4418
|
+
isFocusWithinRef.current = false;
|
|
4419
|
+
}
|
|
4420
|
+
};
|
|
4421
|
+
}
|
|
4422
|
+
}, [
|
|
4423
|
+
listRef.current
|
|
4424
|
+
]);
|
|
4425
|
+
return(// Remove item from normal navigation flow, only available via hotkey
|
|
4426
|
+
/*#__PURE__*/ React.createElement("section", {
|
|
4427
|
+
ref: ref,
|
|
4428
|
+
"aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
|
|
4429
|
+
tabIndex: -1,
|
|
4430
|
+
"aria-live": "polite",
|
|
4431
|
+
"aria-relevant": "additions text",
|
|
4432
|
+
"aria-atomic": "false",
|
|
4433
|
+
suppressHydrationWarning: true
|
|
4434
|
+
}, possiblePositions.map((position, index)=>{
|
|
4435
|
+
var _heights_;
|
|
4436
|
+
const [y, x] = position.split('-');
|
|
4437
|
+
if (!toasts.length) return null;
|
|
4438
|
+
return /*#__PURE__*/ React.createElement("ol", {
|
|
4439
|
+
key: position,
|
|
4440
|
+
dir: dir === 'auto' ? getDocumentDirection() : dir,
|
|
4441
|
+
tabIndex: -1,
|
|
4442
|
+
ref: listRef,
|
|
4443
|
+
className: className,
|
|
4444
|
+
"data-sonner-toaster": true,
|
|
4445
|
+
"data-sonner-theme": actualTheme,
|
|
4446
|
+
"data-y-position": y,
|
|
4447
|
+
"data-lifted": expanded && toasts.length > 1 && !expand,
|
|
4448
|
+
"data-x-position": x,
|
|
4449
|
+
style: {
|
|
4450
|
+
'--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
|
|
4451
|
+
'--width': `${TOAST_WIDTH}px`,
|
|
4452
|
+
'--gap': `${gap}px`,
|
|
4453
|
+
...style,
|
|
4454
|
+
...assignOffset(offset, mobileOffset)
|
|
4455
|
+
},
|
|
4456
|
+
onBlur: (event)=>{
|
|
4457
|
+
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
4458
|
+
isFocusWithinRef.current = false;
|
|
4459
|
+
if (lastFocusedElementRef.current) {
|
|
4460
|
+
lastFocusedElementRef.current.focus({
|
|
4461
|
+
preventScroll: true
|
|
4462
|
+
});
|
|
4463
|
+
lastFocusedElementRef.current = null;
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
},
|
|
4467
|
+
onFocus: (event)=>{
|
|
4468
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4469
|
+
if (isNotDismissible) return;
|
|
4470
|
+
if (!isFocusWithinRef.current) {
|
|
4471
|
+
isFocusWithinRef.current = true;
|
|
4472
|
+
lastFocusedElementRef.current = event.relatedTarget;
|
|
4473
|
+
}
|
|
4474
|
+
},
|
|
4475
|
+
onMouseEnter: ()=>setExpanded(true),
|
|
4476
|
+
onMouseMove: ()=>setExpanded(true),
|
|
4477
|
+
onMouseLeave: ()=>{
|
|
4478
|
+
// Avoid setting expanded to false when interacting with a toast, e.g. swiping
|
|
4479
|
+
if (!interacting) {
|
|
4480
|
+
setExpanded(false);
|
|
4481
|
+
}
|
|
4482
|
+
},
|
|
4483
|
+
onDragEnd: ()=>setExpanded(false),
|
|
4484
|
+
onPointerDown: (event)=>{
|
|
4485
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4486
|
+
if (isNotDismissible) return;
|
|
4487
|
+
setInteracting(true);
|
|
4488
|
+
},
|
|
4489
|
+
onPointerUp: ()=>setInteracting(false)
|
|
4490
|
+
}, toasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{
|
|
4491
|
+
var _toastOptions_duration, _toastOptions_closeButton;
|
|
4492
|
+
return /*#__PURE__*/ React.createElement(Toast, {
|
|
4493
|
+
key: toast.id,
|
|
4494
|
+
icons: icons,
|
|
4495
|
+
index: index,
|
|
4496
|
+
toast: toast,
|
|
4497
|
+
defaultRichColors: richColors,
|
|
4498
|
+
duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
|
|
4499
|
+
className: toastOptions == null ? void 0 : toastOptions.className,
|
|
4500
|
+
descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
|
|
4501
|
+
invert: invert,
|
|
4502
|
+
visibleToasts: visibleToasts,
|
|
4503
|
+
closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
4504
|
+
interacting: interacting,
|
|
4505
|
+
position: position,
|
|
4506
|
+
style: toastOptions == null ? void 0 : toastOptions.style,
|
|
4507
|
+
unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
|
|
4508
|
+
classNames: toastOptions == null ? void 0 : toastOptions.classNames,
|
|
4509
|
+
cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
|
|
4510
|
+
actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
|
|
4511
|
+
closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
|
|
4512
|
+
removeToast: removeToast,
|
|
4513
|
+
toasts: toasts.filter((t)=>t.position == toast.position),
|
|
4514
|
+
heights: heights.filter((h)=>h.position == toast.position),
|
|
4515
|
+
setHeights: setHeights,
|
|
4516
|
+
expandByDefault: expand,
|
|
4517
|
+
gap: gap,
|
|
4518
|
+
expanded: expanded,
|
|
4519
|
+
swipeDirections: props.swipeDirections
|
|
4520
|
+
});
|
|
4521
|
+
}));
|
|
4522
|
+
})));
|
|
4523
|
+
});
|
|
4524
|
+
|
|
4525
|
+
const Toaster = (_a) => {
|
|
4526
|
+
var props = __rest(_a, []);
|
|
4527
|
+
const { theme = "system" } = z$1();
|
|
4528
|
+
return (React.createElement(Toaster$1, Object.assign({ theme: theme, className: "toaster group", style: {
|
|
4529
|
+
"--normal-bg": "var(--popover)",
|
|
4530
|
+
"--normal-text": "var(--popover-foreground)",
|
|
4531
|
+
"--normal-border": "var(--border)",
|
|
4532
|
+
} }, props)));
|
|
4533
|
+
};
|
|
4534
|
+
|
|
3396
4535
|
const appearance = {
|
|
3397
4536
|
variables: {
|
|
3398
4537
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Geist", "Gill Sans", sans-serif'}};
|
|
@@ -3607,6 +4746,18 @@ const MotionConfigContext = React.createContext({
|
|
|
3607
4746
|
reducedMotion: "never",
|
|
3608
4747
|
});
|
|
3609
4748
|
|
|
4749
|
+
function isObject$1(value) {
|
|
4750
|
+
return typeof value === "object" && value !== null;
|
|
4751
|
+
}
|
|
4752
|
+
|
|
4753
|
+
/**
|
|
4754
|
+
* Checks if an element is an HTML element in a way
|
|
4755
|
+
* that works across iframes
|
|
4756
|
+
*/
|
|
4757
|
+
function isHTMLElement$1(element) {
|
|
4758
|
+
return isObject$1(element) && "offsetHeight" in element;
|
|
4759
|
+
}
|
|
4760
|
+
|
|
3610
4761
|
/**
|
|
3611
4762
|
* Measurement functionality has to be within a separate component
|
|
3612
4763
|
* to leverage snapshot lifecycle.
|
|
@@ -3616,7 +4767,9 @@ class PopChildMeasure extends React__namespace.Component {
|
|
|
3616
4767
|
const element = this.props.childRef.current;
|
|
3617
4768
|
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
3618
4769
|
const parent = element.offsetParent;
|
|
3619
|
-
const parentWidth = parent
|
|
4770
|
+
const parentWidth = isHTMLElement$1(parent)
|
|
4771
|
+
? parent.offsetWidth || 0
|
|
4772
|
+
: 0;
|
|
3620
4773
|
const size = this.props.sizeRef.current;
|
|
3621
4774
|
size.height = element.offsetHeight || 0;
|
|
3622
4775
|
size.width = element.offsetWidth || 0;
|
|
@@ -3676,7 +4829,9 @@ function PopChild({ children, isPresent, anchorX }) {
|
|
|
3676
4829
|
`);
|
|
3677
4830
|
}
|
|
3678
4831
|
return () => {
|
|
3679
|
-
document.head.
|
|
4832
|
+
if (document.head.contains(style)) {
|
|
4833
|
+
document.head.removeChild(style);
|
|
4834
|
+
}
|
|
3680
4835
|
};
|
|
3681
4836
|
}, [isPresent]);
|
|
3682
4837
|
return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React__namespace.cloneElement(children, { ref }) }));
|
|
@@ -4703,8 +5858,6 @@ function isForcedMotionValue(key, { layout, layoutId }) {
|
|
|
4703
5858
|
(!!scaleCorrectors[key] || key === "opacity")));
|
|
4704
5859
|
}
|
|
4705
5860
|
|
|
4706
|
-
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
4707
|
-
|
|
4708
5861
|
/**
|
|
4709
5862
|
* Provided a value and a ValueType, returns the value as that value type.
|
|
4710
5863
|
*/
|
|
@@ -4951,6 +6104,8 @@ const createHtmlRenderState = () => ({
|
|
|
4951
6104
|
vars: {},
|
|
4952
6105
|
});
|
|
4953
6106
|
|
|
6107
|
+
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
6108
|
+
|
|
4954
6109
|
function copyRawValuesOnly(target, source, props) {
|
|
4955
6110
|
for (const key in source) {
|
|
4956
6111
|
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
|
|
@@ -5001,65 +6156,6 @@ function useHTMLProps(props, visualState) {
|
|
|
5001
6156
|
return htmlProps;
|
|
5002
6157
|
}
|
|
5003
6158
|
|
|
5004
|
-
/**
|
|
5005
|
-
* We keep these listed separately as we use the lowercase tag names as part
|
|
5006
|
-
* of the runtime bundle to detect SVG components
|
|
5007
|
-
*/
|
|
5008
|
-
const lowercaseSVGElements = [
|
|
5009
|
-
"animate",
|
|
5010
|
-
"circle",
|
|
5011
|
-
"defs",
|
|
5012
|
-
"desc",
|
|
5013
|
-
"ellipse",
|
|
5014
|
-
"g",
|
|
5015
|
-
"image",
|
|
5016
|
-
"line",
|
|
5017
|
-
"filter",
|
|
5018
|
-
"marker",
|
|
5019
|
-
"mask",
|
|
5020
|
-
"metadata",
|
|
5021
|
-
"path",
|
|
5022
|
-
"pattern",
|
|
5023
|
-
"polygon",
|
|
5024
|
-
"polyline",
|
|
5025
|
-
"rect",
|
|
5026
|
-
"stop",
|
|
5027
|
-
"switch",
|
|
5028
|
-
"symbol",
|
|
5029
|
-
"svg",
|
|
5030
|
-
"text",
|
|
5031
|
-
"tspan",
|
|
5032
|
-
"use",
|
|
5033
|
-
"view",
|
|
5034
|
-
];
|
|
5035
|
-
|
|
5036
|
-
function isSVGComponent(Component) {
|
|
5037
|
-
if (
|
|
5038
|
-
/**
|
|
5039
|
-
* If it's not a string, it's a custom React component. Currently we only support
|
|
5040
|
-
* HTML custom React components.
|
|
5041
|
-
*/
|
|
5042
|
-
typeof Component !== "string" ||
|
|
5043
|
-
/**
|
|
5044
|
-
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
5045
|
-
*/
|
|
5046
|
-
Component.includes("-")) {
|
|
5047
|
-
return false;
|
|
5048
|
-
}
|
|
5049
|
-
else if (
|
|
5050
|
-
/**
|
|
5051
|
-
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
5052
|
-
*/
|
|
5053
|
-
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
5054
|
-
/**
|
|
5055
|
-
* If it contains a capital letter, it's an SVG component
|
|
5056
|
-
*/
|
|
5057
|
-
/[A-Z]/u.test(Component)) {
|
|
5058
|
-
return true;
|
|
5059
|
-
}
|
|
5060
|
-
return false;
|
|
5061
|
-
}
|
|
5062
|
-
|
|
5063
6159
|
const dashKeys = {
|
|
5064
6160
|
offset: "stroke-dashoffset",
|
|
5065
6161
|
array: "stroke-dasharray",
|
|
@@ -5094,7 +6190,7 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
5094
6190
|
*/
|
|
5095
6191
|
function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0,
|
|
5096
6192
|
// This is object creation, which we try to avoid per-frame.
|
|
5097
|
-
...latest }, isSVGTag, transformTemplate) {
|
|
6193
|
+
...latest }, isSVGTag, transformTemplate, styleProp) {
|
|
5098
6194
|
buildHTMLStyles(state, latest, transformTemplate);
|
|
5099
6195
|
/**
|
|
5100
6196
|
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
|
|
@@ -5126,7 +6222,7 @@ function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing
|
|
|
5126
6222
|
* SVG's element transform-origin uses its own median as a reference.
|
|
5127
6223
|
* Therefore, transformBox becomes a fill-box
|
|
5128
6224
|
*/
|
|
5129
|
-
style.transformBox = "fill-box";
|
|
6225
|
+
style.transformBox = styleProp?.transformBox ?? "fill-box";
|
|
5130
6226
|
delete attrs.transformBox;
|
|
5131
6227
|
}
|
|
5132
6228
|
// Render attrX/attrY/attrScale as attributes
|
|
@@ -5152,7 +6248,7 @@ const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"
|
|
|
5152
6248
|
function useSVGProps(props, visualState, _isStatic, Component) {
|
|
5153
6249
|
const visualProps = React.useMemo(() => {
|
|
5154
6250
|
const state = createSvgRenderState();
|
|
5155
|
-
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
|
|
6251
|
+
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
|
|
5156
6252
|
return {
|
|
5157
6253
|
...state.attrs,
|
|
5158
6254
|
style: { ...state.style },
|
|
@@ -5166,6 +6262,65 @@ function useSVGProps(props, visualState, _isStatic, Component) {
|
|
|
5166
6262
|
return visualProps;
|
|
5167
6263
|
}
|
|
5168
6264
|
|
|
6265
|
+
/**
|
|
6266
|
+
* We keep these listed separately as we use the lowercase tag names as part
|
|
6267
|
+
* of the runtime bundle to detect SVG components
|
|
6268
|
+
*/
|
|
6269
|
+
const lowercaseSVGElements = [
|
|
6270
|
+
"animate",
|
|
6271
|
+
"circle",
|
|
6272
|
+
"defs",
|
|
6273
|
+
"desc",
|
|
6274
|
+
"ellipse",
|
|
6275
|
+
"g",
|
|
6276
|
+
"image",
|
|
6277
|
+
"line",
|
|
6278
|
+
"filter",
|
|
6279
|
+
"marker",
|
|
6280
|
+
"mask",
|
|
6281
|
+
"metadata",
|
|
6282
|
+
"path",
|
|
6283
|
+
"pattern",
|
|
6284
|
+
"polygon",
|
|
6285
|
+
"polyline",
|
|
6286
|
+
"rect",
|
|
6287
|
+
"stop",
|
|
6288
|
+
"switch",
|
|
6289
|
+
"symbol",
|
|
6290
|
+
"svg",
|
|
6291
|
+
"text",
|
|
6292
|
+
"tspan",
|
|
6293
|
+
"use",
|
|
6294
|
+
"view",
|
|
6295
|
+
];
|
|
6296
|
+
|
|
6297
|
+
function isSVGComponent(Component) {
|
|
6298
|
+
if (
|
|
6299
|
+
/**
|
|
6300
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
6301
|
+
* HTML custom React components.
|
|
6302
|
+
*/
|
|
6303
|
+
typeof Component !== "string" ||
|
|
6304
|
+
/**
|
|
6305
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
6306
|
+
*/
|
|
6307
|
+
Component.includes("-")) {
|
|
6308
|
+
return false;
|
|
6309
|
+
}
|
|
6310
|
+
else if (
|
|
6311
|
+
/**
|
|
6312
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
6313
|
+
*/
|
|
6314
|
+
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
6315
|
+
/**
|
|
6316
|
+
* If it contains a capital letter, it's an SVG component
|
|
6317
|
+
*/
|
|
6318
|
+
/[A-Z]/u.test(Component)) {
|
|
6319
|
+
return true;
|
|
6320
|
+
}
|
|
6321
|
+
return false;
|
|
6322
|
+
}
|
|
6323
|
+
|
|
5169
6324
|
function createUseRender(forwardMotionProps = false) {
|
|
5170
6325
|
const useRender = (Component, props, ref, { latestValues }, isStatic) => {
|
|
5171
6326
|
const useVisualProps = isSVGComponent(Component)
|
|
@@ -5477,11 +6632,6 @@ class MotionValue {
|
|
|
5477
6632
|
* - `transformer`: A function to transform incoming values with.
|
|
5478
6633
|
*/
|
|
5479
6634
|
constructor(init, options = {}) {
|
|
5480
|
-
/**
|
|
5481
|
-
* This will be replaced by the build step with the latest version number.
|
|
5482
|
-
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
5483
|
-
*/
|
|
5484
|
-
this.version = "__VERSION__";
|
|
5485
6635
|
/**
|
|
5486
6636
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
5487
6637
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -5509,6 +6659,11 @@ class MotionValue {
|
|
|
5509
6659
|
// Update update subscribers
|
|
5510
6660
|
if (this.current !== this.prev) {
|
|
5511
6661
|
this.events.change?.notify(this.current);
|
|
6662
|
+
if (this.dependents) {
|
|
6663
|
+
for (const dependent of this.dependents) {
|
|
6664
|
+
dependent.dirty();
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
5512
6667
|
}
|
|
5513
6668
|
// Update render subscribers
|
|
5514
6669
|
if (render) {
|
|
@@ -5650,6 +6805,20 @@ class MotionValue {
|
|
|
5650
6805
|
if (this.stopPassiveEffect)
|
|
5651
6806
|
this.stopPassiveEffect();
|
|
5652
6807
|
}
|
|
6808
|
+
dirty() {
|
|
6809
|
+
this.events.change?.notify(this.current);
|
|
6810
|
+
}
|
|
6811
|
+
addDependent(dependent) {
|
|
6812
|
+
if (!this.dependents) {
|
|
6813
|
+
this.dependents = new Set();
|
|
6814
|
+
}
|
|
6815
|
+
this.dependents.add(dependent);
|
|
6816
|
+
}
|
|
6817
|
+
removeDependent(dependent) {
|
|
6818
|
+
if (this.dependents) {
|
|
6819
|
+
this.dependents.delete(dependent);
|
|
6820
|
+
}
|
|
6821
|
+
}
|
|
5653
6822
|
/**
|
|
5654
6823
|
* Returns the latest state of `MotionValue`
|
|
5655
6824
|
*
|
|
@@ -5745,6 +6914,7 @@ class MotionValue {
|
|
|
5745
6914
|
* @public
|
|
5746
6915
|
*/
|
|
5747
6916
|
destroy() {
|
|
6917
|
+
this.dependents?.clear();
|
|
5748
6918
|
this.events.destroy?.notify();
|
|
5749
6919
|
this.clearListeners();
|
|
5750
6920
|
this.stop();
|
|
@@ -6324,7 +7494,7 @@ function mix(from, to, p) {
|
|
|
6324
7494
|
const frameloopDriver = (update) => {
|
|
6325
7495
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
6326
7496
|
return {
|
|
6327
|
-
start: () => frame.update(passTimestamp,
|
|
7497
|
+
start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
|
|
6328
7498
|
stop: () => cancelFrame(passTimestamp),
|
|
6329
7499
|
/**
|
|
6330
7500
|
* If we're processing this frame we can use the
|
|
@@ -6783,7 +7953,7 @@ function createMixers(output, ease, customMixer) {
|
|
|
6783
7953
|
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
|
|
6784
7954
|
* ```
|
|
6785
7955
|
*
|
|
6786
|
-
* TODO
|
|
7956
|
+
* TODO Revisit this approach once we've moved to data models for values,
|
|
6787
7957
|
* probably not needed to pregenerate mixer functions.
|
|
6788
7958
|
*
|
|
6789
7959
|
* @public
|
|
@@ -7018,14 +8188,12 @@ function replaceTransitionType(transition) {
|
|
|
7018
8188
|
|
|
7019
8189
|
class WithPromise {
|
|
7020
8190
|
constructor() {
|
|
7021
|
-
this.count = 0;
|
|
7022
8191
|
this.updateFinished();
|
|
7023
8192
|
}
|
|
7024
8193
|
get finished() {
|
|
7025
8194
|
return this._finished;
|
|
7026
8195
|
}
|
|
7027
8196
|
updateFinished() {
|
|
7028
|
-
this.count++;
|
|
7029
8197
|
this._finished = new Promise((resolve) => {
|
|
7030
8198
|
this.resolve = resolve;
|
|
7031
8199
|
});
|
|
@@ -7066,17 +8234,18 @@ class JSAnimation extends WithPromise {
|
|
|
7066
8234
|
* This method is bound to the instance to fix a pattern where
|
|
7067
8235
|
* animation.stop is returned as a reference from a useEffect.
|
|
7068
8236
|
*/
|
|
7069
|
-
this.stop = () => {
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
8237
|
+
this.stop = (sync = true) => {
|
|
8238
|
+
if (sync) {
|
|
8239
|
+
const { motionValue } = this.options;
|
|
8240
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
8241
|
+
this.tick(time.now());
|
|
8242
|
+
}
|
|
7073
8243
|
}
|
|
7074
8244
|
this.isStopped = true;
|
|
7075
8245
|
if (this.state === "idle")
|
|
7076
8246
|
return;
|
|
7077
8247
|
this.teardown();
|
|
7078
|
-
|
|
7079
|
-
onStop && onStop();
|
|
8248
|
+
this.options.onStop?.();
|
|
7080
8249
|
};
|
|
7081
8250
|
this.options = options;
|
|
7082
8251
|
this.initAnimation();
|
|
@@ -7276,6 +8445,7 @@ class JSAnimation extends WithPromise {
|
|
|
7276
8445
|
else if (this.driver) {
|
|
7277
8446
|
this.startTime = this.driver.now() - newTime / this.playbackSpeed;
|
|
7278
8447
|
}
|
|
8448
|
+
this.driver?.start(false);
|
|
7279
8449
|
}
|
|
7280
8450
|
get speed() {
|
|
7281
8451
|
return this.playbackSpeed;
|
|
@@ -7291,11 +8461,11 @@ class JSAnimation extends WithPromise {
|
|
|
7291
8461
|
play() {
|
|
7292
8462
|
if (this.isStopped)
|
|
7293
8463
|
return;
|
|
7294
|
-
const { driver = frameloopDriver,
|
|
8464
|
+
const { driver = frameloopDriver, startTime } = this.options;
|
|
7295
8465
|
if (!this.driver) {
|
|
7296
8466
|
this.driver = driver((timestamp) => this.tick(timestamp));
|
|
7297
8467
|
}
|
|
7298
|
-
onPlay
|
|
8468
|
+
this.options.onPlay?.();
|
|
7299
8469
|
const now = this.driver.now();
|
|
7300
8470
|
if (this.state === "finished") {
|
|
7301
8471
|
this.updateFinished();
|
|
@@ -7331,19 +8501,19 @@ class JSAnimation extends WithPromise {
|
|
|
7331
8501
|
this.holdTime = null;
|
|
7332
8502
|
}
|
|
7333
8503
|
finish() {
|
|
8504
|
+
this.notifyFinished();
|
|
7334
8505
|
this.teardown();
|
|
7335
8506
|
this.state = "finished";
|
|
7336
|
-
|
|
7337
|
-
onComplete && onComplete();
|
|
8507
|
+
this.options.onComplete?.();
|
|
7338
8508
|
}
|
|
7339
8509
|
cancel() {
|
|
7340
8510
|
this.holdTime = null;
|
|
7341
8511
|
this.startTime = 0;
|
|
7342
8512
|
this.tick(0);
|
|
7343
8513
|
this.teardown();
|
|
8514
|
+
this.options.onCancel?.();
|
|
7344
8515
|
}
|
|
7345
8516
|
teardown() {
|
|
7346
|
-
this.notifyFinished();
|
|
7347
8517
|
this.state = "idle";
|
|
7348
8518
|
this.stopDriver();
|
|
7349
8519
|
this.startTime = this.holdTime = null;
|
|
@@ -7364,6 +8534,7 @@ class JSAnimation extends WithPromise {
|
|
|
7364
8534
|
this.options.ease = "linear";
|
|
7365
8535
|
this.initAnimation();
|
|
7366
8536
|
}
|
|
8537
|
+
this.driver?.stop();
|
|
7367
8538
|
return timeline.observe(this);
|
|
7368
8539
|
}
|
|
7369
8540
|
}
|
|
@@ -7548,11 +8719,7 @@ function flushKeyframeResolvers() {
|
|
|
7548
8719
|
}
|
|
7549
8720
|
class KeyframeResolver {
|
|
7550
8721
|
constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
|
|
7551
|
-
|
|
7552
|
-
* Track whether this resolver has completed. Once complete, it never
|
|
7553
|
-
* needs to attempt keyframe resolution again.
|
|
7554
|
-
*/
|
|
7555
|
-
this.isComplete = false;
|
|
8722
|
+
this.state = "pending";
|
|
7556
8723
|
/**
|
|
7557
8724
|
* Track whether this resolver is async. If it is, it'll be added to the
|
|
7558
8725
|
* resolver queue and flushed in the next frame. Resolvers that aren't going
|
|
@@ -7564,11 +8731,6 @@ class KeyframeResolver {
|
|
|
7564
8731
|
* to resolve its keyframes.
|
|
7565
8732
|
*/
|
|
7566
8733
|
this.needsMeasurement = false;
|
|
7567
|
-
/**
|
|
7568
|
-
* Track whether this resolver is currently scheduled to resolve
|
|
7569
|
-
* to allow it to be cancelled and resumed externally.
|
|
7570
|
-
*/
|
|
7571
|
-
this.isScheduled = false;
|
|
7572
8734
|
this.unresolvedKeyframes = [...unresolvedKeyframes];
|
|
7573
8735
|
this.onComplete = onComplete;
|
|
7574
8736
|
this.name = name;
|
|
@@ -7577,7 +8739,7 @@ class KeyframeResolver {
|
|
|
7577
8739
|
this.isAsync = isAsync;
|
|
7578
8740
|
}
|
|
7579
8741
|
scheduleResolve() {
|
|
7580
|
-
this.
|
|
8742
|
+
this.state = "scheduled";
|
|
7581
8743
|
if (this.isAsync) {
|
|
7582
8744
|
toResolve.add(this);
|
|
7583
8745
|
if (!isScheduled) {
|
|
@@ -7620,19 +8782,19 @@ class KeyframeResolver {
|
|
|
7620
8782
|
measureInitialState() { }
|
|
7621
8783
|
renderEndStyles() { }
|
|
7622
8784
|
measureEndState() { }
|
|
7623
|
-
complete(
|
|
7624
|
-
this.
|
|
7625
|
-
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe,
|
|
8785
|
+
complete(isForcedComplete = false) {
|
|
8786
|
+
this.state = "complete";
|
|
8787
|
+
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);
|
|
7626
8788
|
toResolve.delete(this);
|
|
7627
8789
|
}
|
|
7628
8790
|
cancel() {
|
|
7629
|
-
if (
|
|
7630
|
-
this.isScheduled = false;
|
|
8791
|
+
if (this.state === "scheduled") {
|
|
7631
8792
|
toResolve.delete(this);
|
|
8793
|
+
this.state = "pending";
|
|
7632
8794
|
}
|
|
7633
8795
|
}
|
|
7634
8796
|
resume() {
|
|
7635
|
-
if (
|
|
8797
|
+
if (this.state === "pending")
|
|
7636
8798
|
this.scheduleResolve();
|
|
7637
8799
|
}
|
|
7638
8800
|
}
|
|
@@ -7795,10 +8957,6 @@ class NativeAnimation extends WithPromise {
|
|
|
7795
8957
|
onComplete?.();
|
|
7796
8958
|
this.notifyFinished();
|
|
7797
8959
|
};
|
|
7798
|
-
/**
|
|
7799
|
-
* TODO: In a breaking change, we should replace this with `.notifyCancel()`
|
|
7800
|
-
*/
|
|
7801
|
-
this.animation.oncancel = () => this.notifyFinished();
|
|
7802
8960
|
}
|
|
7803
8961
|
play() {
|
|
7804
8962
|
if (this.isStopped)
|
|
@@ -8052,16 +9210,13 @@ const acceleratedValues = new Set([
|
|
|
8052
9210
|
"clipPath",
|
|
8053
9211
|
"filter",
|
|
8054
9212
|
"transform",
|
|
8055
|
-
// TODO:
|
|
8056
|
-
// or until we implement support for linear() easing.
|
|
9213
|
+
// TODO: Could be re-enabled now we have support for linear() easing
|
|
8057
9214
|
// "background-color"
|
|
8058
9215
|
]);
|
|
8059
9216
|
const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
8060
9217
|
function supportsBrowserAnimation(options) {
|
|
8061
9218
|
const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
|
|
8062
|
-
if (!motionValue
|
|
8063
|
-
!motionValue.owner ||
|
|
8064
|
-
!(motionValue.owner.current instanceof HTMLElement)) {
|
|
9219
|
+
if (!isHTMLElement$1(motionValue?.owner?.current)) {
|
|
8065
9220
|
return false;
|
|
8066
9221
|
}
|
|
8067
9222
|
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
|
|
@@ -8100,9 +9255,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8100
9255
|
this._animation.stop();
|
|
8101
9256
|
this.stopTimeline?.();
|
|
8102
9257
|
}
|
|
8103
|
-
|
|
8104
|
-
this.keyframeResolver?.cancel();
|
|
8105
|
-
}
|
|
9258
|
+
this.keyframeResolver?.cancel();
|
|
8106
9259
|
};
|
|
8107
9260
|
this.createdAt = time.now();
|
|
8108
9261
|
const optionsWithDefaults = {
|
|
@@ -8193,6 +9346,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8193
9346
|
}
|
|
8194
9347
|
get animation() {
|
|
8195
9348
|
if (!this._animation) {
|
|
9349
|
+
this.keyframeResolver?.resume();
|
|
8196
9350
|
flushKeyframeResolvers();
|
|
8197
9351
|
}
|
|
8198
9352
|
return this._animation;
|
|
@@ -8237,7 +9391,10 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8237
9391
|
this.animation.complete();
|
|
8238
9392
|
}
|
|
8239
9393
|
cancel() {
|
|
8240
|
-
this.
|
|
9394
|
+
if (this._animation) {
|
|
9395
|
+
this.animation.cancel();
|
|
9396
|
+
}
|
|
9397
|
+
this.keyframeResolver?.cancel();
|
|
8241
9398
|
}
|
|
8242
9399
|
}
|
|
8243
9400
|
|
|
@@ -8327,7 +9484,9 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
8327
9484
|
return;
|
|
8328
9485
|
}
|
|
8329
9486
|
}
|
|
8330
|
-
return
|
|
9487
|
+
return valueTransition.isSync
|
|
9488
|
+
? new JSAnimation(options)
|
|
9489
|
+
: new AsyncMotionValueAnimation(options);
|
|
8331
9490
|
};
|
|
8332
9491
|
|
|
8333
9492
|
const positionalKeys = new Set([
|
|
@@ -10198,7 +11357,7 @@ class MeasureLayoutWithContext extends React.Component {
|
|
|
10198
11357
|
}
|
|
10199
11358
|
getSnapshotBeforeUpdate(prevProps) {
|
|
10200
11359
|
const { layoutDependency, visualElement, drag, isPresent } = this.props;
|
|
10201
|
-
const projection = visualElement
|
|
11360
|
+
const { projection } = visualElement;
|
|
10202
11361
|
if (!projection)
|
|
10203
11362
|
return null;
|
|
10204
11363
|
/**
|
|
@@ -10296,10 +11455,6 @@ function animateSingleValue(value, keyframes, options) {
|
|
|
10296
11455
|
return motionValue$1.animation;
|
|
10297
11456
|
}
|
|
10298
11457
|
|
|
10299
|
-
function isSVGElement(element) {
|
|
10300
|
-
return element instanceof SVGElement && element.tagName !== "svg";
|
|
10301
|
-
}
|
|
10302
|
-
|
|
10303
11458
|
const compareByDepth = (a, b) => a.depth - b.depth;
|
|
10304
11459
|
|
|
10305
11460
|
class FlatTree {
|
|
@@ -10686,6 +11841,22 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
|
|
|
10686
11841
|
return transform || "none";
|
|
10687
11842
|
}
|
|
10688
11843
|
|
|
11844
|
+
/**
|
|
11845
|
+
* Checks if an element is an SVG element in a way
|
|
11846
|
+
* that works across iframes
|
|
11847
|
+
*/
|
|
11848
|
+
function isSVGElement(element) {
|
|
11849
|
+
return isObject$1(element) && "ownerSVGElement" in element;
|
|
11850
|
+
}
|
|
11851
|
+
|
|
11852
|
+
/**
|
|
11853
|
+
* Checks if an element is specifically an SVGSVGElement (the root SVG element)
|
|
11854
|
+
* in a way that works across iframes
|
|
11855
|
+
*/
|
|
11856
|
+
function isSVGSVGElement(element) {
|
|
11857
|
+
return isSVGElement(element) && element.tagName === "svg";
|
|
11858
|
+
}
|
|
11859
|
+
|
|
10689
11860
|
const transformAxes = ["", "X", "Y", "Z"];
|
|
10690
11861
|
const hiddenVisibility = { visibility: "hidden" };
|
|
10691
11862
|
/**
|
|
@@ -10879,10 +12050,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10879
12050
|
/**
|
|
10880
12051
|
* Lifecycles
|
|
10881
12052
|
*/
|
|
10882
|
-
mount(instance
|
|
12053
|
+
mount(instance) {
|
|
10883
12054
|
if (this.instance)
|
|
10884
12055
|
return;
|
|
10885
|
-
this.isSVG = isSVGElement(instance);
|
|
12056
|
+
this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);
|
|
10886
12057
|
this.instance = instance;
|
|
10887
12058
|
const { layoutId, layout, visualElement } = this.options;
|
|
10888
12059
|
if (visualElement && !visualElement.current) {
|
|
@@ -10890,7 +12061,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10890
12061
|
}
|
|
10891
12062
|
this.root.nodes.add(this);
|
|
10892
12063
|
this.parent && this.parent.children.add(this);
|
|
10893
|
-
if (
|
|
12064
|
+
if (this.root.hasTreeAnimated && (layout || layoutId)) {
|
|
10894
12065
|
this.isLayoutDirty = true;
|
|
10895
12066
|
}
|
|
10896
12067
|
if (attachResizeListener) {
|
|
@@ -11190,7 +12361,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11190
12361
|
this.scroll.phase === phase) {
|
|
11191
12362
|
needsMeasurement = false;
|
|
11192
12363
|
}
|
|
11193
|
-
if (needsMeasurement) {
|
|
12364
|
+
if (needsMeasurement && this.instance) {
|
|
11194
12365
|
const isRoot = checkIsScrollRoot(this.instance);
|
|
11195
12366
|
this.scroll = {
|
|
11196
12367
|
animationId: this.root.animationId,
|
|
@@ -11214,6 +12385,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11214
12385
|
: undefined;
|
|
11215
12386
|
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
|
|
11216
12387
|
if (isResetRequested &&
|
|
12388
|
+
this.instance &&
|
|
11217
12389
|
(hasProjection ||
|
|
11218
12390
|
hasTransform(this.latestValues) ||
|
|
11219
12391
|
transformTemplateHasChanged)) {
|
|
@@ -11685,10 +12857,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11685
12857
|
}
|
|
11686
12858
|
startAnimation(options) {
|
|
11687
12859
|
this.notifyListeners("animationStart");
|
|
11688
|
-
this.currentAnimation
|
|
11689
|
-
|
|
11690
|
-
this.resumingFrom.currentAnimation.stop();
|
|
11691
|
-
}
|
|
12860
|
+
this.currentAnimation?.stop(false);
|
|
12861
|
+
this.resumingFrom?.currentAnimation?.stop(false);
|
|
11692
12862
|
if (this.pendingAnimation) {
|
|
11693
12863
|
cancelFrame(this.pendingAnimation);
|
|
11694
12864
|
this.pendingAnimation = undefined;
|
|
@@ -11700,8 +12870,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11700
12870
|
*/
|
|
11701
12871
|
this.pendingAnimation = frame.update(() => {
|
|
11702
12872
|
globalProjectionState.hasAnimatedSinceResize = true;
|
|
11703
|
-
this.
|
|
12873
|
+
this.motionValue || (this.motionValue = motionValue(0));
|
|
12874
|
+
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {
|
|
11704
12875
|
...options,
|
|
12876
|
+
isSync: true,
|
|
11705
12877
|
onUpdate: (latest) => {
|
|
11706
12878
|
this.mixTargetDelta(latest);
|
|
11707
12879
|
options.onUpdate && options.onUpdate(latest);
|
|
@@ -11735,7 +12907,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11735
12907
|
finishAnimation() {
|
|
11736
12908
|
if (this.currentAnimation) {
|
|
11737
12909
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
11738
|
-
this.currentAnimation.stop();
|
|
12910
|
+
this.currentAnimation.stop(false);
|
|
11739
12911
|
}
|
|
11740
12912
|
this.completeAnimation();
|
|
11741
12913
|
}
|
|
@@ -12000,7 +13172,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12000
13172
|
}
|
|
12001
13173
|
// Only run on root
|
|
12002
13174
|
resetTree() {
|
|
12003
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
13175
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop(false));
|
|
12004
13176
|
this.root.nodes.forEach(clearMeasurements);
|
|
12005
13177
|
this.root.sharedNodes.clear();
|
|
12006
13178
|
}
|
|
@@ -12472,17 +13644,19 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12472
13644
|
const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);
|
|
12473
13645
|
const startPress = (startEvent) => {
|
|
12474
13646
|
const target = startEvent.currentTarget;
|
|
12475
|
-
if (!isValidPressEvent(startEvent)
|
|
13647
|
+
if (!isValidPressEvent(startEvent))
|
|
12476
13648
|
return;
|
|
12477
13649
|
isPressing.add(target);
|
|
12478
13650
|
const onPressEnd = onPressStart(target, startEvent);
|
|
12479
13651
|
const onPointerEnd = (endEvent, success) => {
|
|
12480
13652
|
window.removeEventListener("pointerup", onPointerUp);
|
|
12481
13653
|
window.removeEventListener("pointercancel", onPointerCancel);
|
|
12482
|
-
if (
|
|
13654
|
+
if (isPressing.has(target)) {
|
|
13655
|
+
isPressing.delete(target);
|
|
13656
|
+
}
|
|
13657
|
+
if (!isValidPressEvent(endEvent)) {
|
|
12483
13658
|
return;
|
|
12484
13659
|
}
|
|
12485
|
-
isPressing.delete(target);
|
|
12486
13660
|
if (typeof onPressEnd === "function") {
|
|
12487
13661
|
onPressEnd(endEvent, { success });
|
|
12488
13662
|
}
|
|
@@ -12502,7 +13676,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12502
13676
|
targets.forEach((target) => {
|
|
12503
13677
|
const pointerDownTarget = options.useGlobalTarget ? window : target;
|
|
12504
13678
|
pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
|
|
12505
|
-
if (target
|
|
13679
|
+
if (isHTMLElement$1(target)) {
|
|
12506
13680
|
target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
|
|
12507
13681
|
if (!isElementKeyboardAccessible(target) &&
|
|
12508
13682
|
!target.hasAttribute("tabindex")) {
|
|
@@ -13006,7 +14180,6 @@ class VisualElement {
|
|
|
13006
14180
|
}
|
|
13007
14181
|
unmount() {
|
|
13008
14182
|
this.projection && this.projection.unmount();
|
|
13009
|
-
this.projection = undefined;
|
|
13010
14183
|
cancelFrame(this.notifyUpdate);
|
|
13011
14184
|
cancelFrame(this.render);
|
|
13012
14185
|
this.valueSubscriptions.forEach((remove) => remove());
|
|
@@ -13441,7 +14614,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
13441
14614
|
}
|
|
13442
14615
|
}
|
|
13443
14616
|
}
|
|
13444
|
-
else {
|
|
14617
|
+
else if (positionalValues[name]) {
|
|
13445
14618
|
/**
|
|
13446
14619
|
* Else, the only way to resolve this is by measuring the element.
|
|
13447
14620
|
*/
|
|
@@ -13557,7 +14730,9 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
13557
14730
|
}
|
|
13558
14731
|
readValueFromInstance(instance, key) {
|
|
13559
14732
|
if (transformProps.has(key)) {
|
|
13560
|
-
return
|
|
14733
|
+
return this.projection?.isProjecting
|
|
14734
|
+
? defaultTransformValue(key)
|
|
14735
|
+
: readTransformValue(instance, key);
|
|
13561
14736
|
}
|
|
13562
14737
|
else {
|
|
13563
14738
|
const computedStyle = getComputedStyle$1(instance);
|
|
@@ -13636,7 +14811,7 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
13636
14811
|
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
|
|
13637
14812
|
}
|
|
13638
14813
|
build(renderState, latestValues, props) {
|
|
13639
|
-
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
|
|
14814
|
+
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);
|
|
13640
14815
|
}
|
|
13641
14816
|
renderInstance(instance, renderState, styleProp, projection) {
|
|
13642
14817
|
renderSVG(instance, renderState, styleProp, projection);
|
|
@@ -14624,15 +15799,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
|
|
|
14624
15799
|
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
14625
15800
|
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
14626
15801
|
function timeRegexSource(args) {
|
|
14627
|
-
|
|
14628
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
15802
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
14629
15803
|
if (args.precision) {
|
|
14630
|
-
|
|
15804
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
14631
15805
|
}
|
|
14632
15806
|
else if (args.precision == null) {
|
|
14633
|
-
|
|
15807
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
14634
15808
|
}
|
|
14635
|
-
|
|
15809
|
+
const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
|
|
15810
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
14636
15811
|
}
|
|
14637
15812
|
function timeRegex(args) {
|
|
14638
15813
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -18329,47 +19504,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
18329
19504
|
return result;
|
|
18330
19505
|
};
|
|
18331
19506
|
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
function deepEqual(object1, object2) {
|
|
18335
|
-
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
18336
|
-
return object1 === object2;
|
|
18337
|
-
}
|
|
18338
|
-
if (isDateObject(object1) && isDateObject(object2)) {
|
|
18339
|
-
return object1.getTime() === object2.getTime();
|
|
18340
|
-
}
|
|
18341
|
-
const keys1 = Object.keys(object1);
|
|
18342
|
-
const keys2 = Object.keys(object2);
|
|
18343
|
-
if (keys1.length !== keys2.length) {
|
|
18344
|
-
return false;
|
|
18345
|
-
}
|
|
18346
|
-
for (const key of keys1) {
|
|
18347
|
-
const val1 = object1[key];
|
|
18348
|
-
if (!keys2.includes(key)) {
|
|
18349
|
-
return false;
|
|
18350
|
-
}
|
|
18351
|
-
if (key !== 'ref') {
|
|
18352
|
-
const val2 = object2[key];
|
|
18353
|
-
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
18354
|
-
(isObject(val1) && isObject(val2)) ||
|
|
18355
|
-
(Array.isArray(val1) && Array.isArray(val2))
|
|
18356
|
-
? !deepEqual(val1, val2)
|
|
18357
|
-
: val1 !== val2) {
|
|
18358
|
-
return false;
|
|
18359
|
-
}
|
|
18360
|
-
}
|
|
18361
|
-
}
|
|
18362
|
-
return true;
|
|
18363
|
-
}
|
|
18364
|
-
|
|
18365
|
-
const useDeepEqualEffect = (effect, deps) => {
|
|
18366
|
-
const ref = React__namespace.useRef(deps);
|
|
18367
|
-
if (!deepEqual(deps, ref.current)) {
|
|
18368
|
-
ref.current = deps;
|
|
18369
|
-
}
|
|
18370
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18371
|
-
React__namespace.useEffect(effect, ref.current);
|
|
18372
|
-
};
|
|
19507
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
18373
19508
|
|
|
18374
19509
|
/**
|
|
18375
19510
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
|
@@ -18415,7 +19550,7 @@ function useFormState(props) {
|
|
|
18415
19550
|
isValid: false,
|
|
18416
19551
|
errors: false,
|
|
18417
19552
|
});
|
|
18418
|
-
|
|
19553
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18419
19554
|
name: name,
|
|
18420
19555
|
formState: _localProxyFormState.current,
|
|
18421
19556
|
exact,
|
|
@@ -18466,16 +19601,17 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
|
18466
19601
|
function useWatch(props) {
|
|
18467
19602
|
const methods = useFormContext();
|
|
18468
19603
|
const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
|
|
18469
|
-
const
|
|
18470
|
-
|
|
19604
|
+
const _defaultValue = React.useRef(defaultValue);
|
|
19605
|
+
const [value, updateValue] = React.useState(control._getWatch(name, _defaultValue.current));
|
|
19606
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18471
19607
|
name: name,
|
|
18472
19608
|
formState: {
|
|
18473
19609
|
values: true,
|
|
18474
19610
|
},
|
|
18475
19611
|
exact,
|
|
18476
19612
|
callback: (formState) => !disabled &&
|
|
18477
|
-
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false,
|
|
18478
|
-
}), [name,
|
|
19613
|
+
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current)),
|
|
19614
|
+
}), [name, control, disabled, exact]);
|
|
18479
19615
|
React.useEffect(() => control._removeUnmounted());
|
|
18480
19616
|
return value;
|
|
18481
19617
|
}
|
|
@@ -18710,6 +19846,39 @@ var createSubject = () => {
|
|
|
18710
19846
|
};
|
|
18711
19847
|
};
|
|
18712
19848
|
|
|
19849
|
+
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
19850
|
+
|
|
19851
|
+
function deepEqual(object1, object2) {
|
|
19852
|
+
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
19853
|
+
return object1 === object2;
|
|
19854
|
+
}
|
|
19855
|
+
if (isDateObject(object1) && isDateObject(object2)) {
|
|
19856
|
+
return object1.getTime() === object2.getTime();
|
|
19857
|
+
}
|
|
19858
|
+
const keys1 = Object.keys(object1);
|
|
19859
|
+
const keys2 = Object.keys(object2);
|
|
19860
|
+
if (keys1.length !== keys2.length) {
|
|
19861
|
+
return false;
|
|
19862
|
+
}
|
|
19863
|
+
for (const key of keys1) {
|
|
19864
|
+
const val1 = object1[key];
|
|
19865
|
+
if (!keys2.includes(key)) {
|
|
19866
|
+
return false;
|
|
19867
|
+
}
|
|
19868
|
+
if (key !== 'ref') {
|
|
19869
|
+
const val2 = object2[key];
|
|
19870
|
+
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
19871
|
+
(isObject(val1) && isObject(val2)) ||
|
|
19872
|
+
(Array.isArray(val1) && Array.isArray(val2))
|
|
19873
|
+
? !deepEqual(val1, val2)
|
|
19874
|
+
: val1 !== val2) {
|
|
19875
|
+
return false;
|
|
19876
|
+
}
|
|
19877
|
+
}
|
|
19878
|
+
}
|
|
19879
|
+
return true;
|
|
19880
|
+
}
|
|
19881
|
+
|
|
18713
19882
|
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
18714
19883
|
|
|
18715
19884
|
var isFileInput = (element) => element.type === 'file';
|
|
@@ -19273,7 +20442,7 @@ function createFormControl(props = {}) {
|
|
|
19273
20442
|
};
|
|
19274
20443
|
const _fields = {};
|
|
19275
20444
|
let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
|
|
19276
|
-
? cloneObject(_options.
|
|
20445
|
+
? cloneObject(_options.defaultValues || _options.values) || {}
|
|
19277
20446
|
: {};
|
|
19278
20447
|
let _formValues = _options.shouldUnregister
|
|
19279
20448
|
? {}
|
|
@@ -19308,8 +20477,6 @@ function createFormControl(props = {}) {
|
|
|
19308
20477
|
array: createSubject(),
|
|
19309
20478
|
state: createSubject(),
|
|
19310
20479
|
};
|
|
19311
|
-
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
|
19312
|
-
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
|
19313
20480
|
const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
|
|
19314
20481
|
const debounce = (callback) => (wait) => {
|
|
19315
20482
|
clearTimeout(timer);
|
|
@@ -19580,13 +20747,17 @@ function createFormControl(props = {}) {
|
|
|
19580
20747
|
}
|
|
19581
20748
|
else if (fieldReference.refs) {
|
|
19582
20749
|
if (isCheckBoxInput(fieldReference.ref)) {
|
|
19583
|
-
fieldReference.refs.
|
|
19584
|
-
|
|
19585
|
-
(
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
20750
|
+
fieldReference.refs.forEach((checkboxRef) => {
|
|
20751
|
+
if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
|
|
20752
|
+
if (Array.isArray(fieldValue)) {
|
|
20753
|
+
checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
|
|
20754
|
+
}
|
|
20755
|
+
else {
|
|
20756
|
+
checkboxRef.checked =
|
|
20757
|
+
fieldValue === checkboxRef.value || !!fieldValue;
|
|
20758
|
+
}
|
|
20759
|
+
}
|
|
20760
|
+
});
|
|
19590
20761
|
}
|
|
19591
20762
|
else {
|
|
19592
20763
|
fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));
|
|
@@ -19612,6 +20783,9 @@ function createFormControl(props = {}) {
|
|
|
19612
20783
|
};
|
|
19613
20784
|
const setValues = (name, value, options) => {
|
|
19614
20785
|
for (const fieldKey in value) {
|
|
20786
|
+
if (!value.hasOwnProperty(fieldKey)) {
|
|
20787
|
+
return;
|
|
20788
|
+
}
|
|
19615
20789
|
const fieldValue = value[fieldKey];
|
|
19616
20790
|
const fieldName = `${name}.${fieldKey}`;
|
|
19617
20791
|
const field = get(_fields, fieldName);
|
|
@@ -19668,6 +20842,8 @@ function createFormControl(props = {}) {
|
|
|
19668
20842
|
(isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||
|
|
19669
20843
|
deepEqual(fieldValue, get(_formValues, name, fieldValue));
|
|
19670
20844
|
};
|
|
20845
|
+
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
|
20846
|
+
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
|
19671
20847
|
if (field) {
|
|
19672
20848
|
let error;
|
|
19673
20849
|
let isValid;
|
|
@@ -20278,7 +21454,6 @@ function createFormControl(props = {}) {
|
|
|
20278
21454
|
};
|
|
20279
21455
|
}
|
|
20280
21456
|
|
|
20281
|
-
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
20282
21457
|
/**
|
|
20283
21458
|
* Custom hook to manage the entire form.
|
|
20284
21459
|
*
|
|
@@ -21625,21 +22800,21 @@ const getDefaultConfig = () => {
|
|
|
21625
22800
|
* @see https://tailwindcss.com/docs/height
|
|
21626
22801
|
*/
|
|
21627
22802
|
h: [{
|
|
21628
|
-
h: ['screen', ...scaleSizing()]
|
|
22803
|
+
h: ['screen', 'lh', ...scaleSizing()]
|
|
21629
22804
|
}],
|
|
21630
22805
|
/**
|
|
21631
22806
|
* Min-Height
|
|
21632
22807
|
* @see https://tailwindcss.com/docs/min-height
|
|
21633
22808
|
*/
|
|
21634
22809
|
'min-h': [{
|
|
21635
|
-
'min-h': ['screen', 'none', ...scaleSizing()]
|
|
22810
|
+
'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
|
|
21636
22811
|
}],
|
|
21637
22812
|
/**
|
|
21638
22813
|
* Max-Height
|
|
21639
22814
|
* @see https://tailwindcss.com/docs/max-height
|
|
21640
22815
|
*/
|
|
21641
22816
|
'max-h': [{
|
|
21642
|
-
'max-h': ['screen', ...scaleSizing()]
|
|
22817
|
+
'max-h': ['screen', 'lh', ...scaleSizing()]
|
|
21643
22818
|
}],
|
|
21644
22819
|
// ------------------
|
|
21645
22820
|
// --- Typography ---
|
|
@@ -23438,7 +24613,7 @@ function FormMessage(_a) {
|
|
|
23438
24613
|
|
|
23439
24614
|
function Input(_a) {
|
|
23440
24615
|
var { className, type } = _a, props = __rest(_a, ["className", "type"]);
|
|
23441
|
-
return (React__namespace.createElement("input", Object.assign({ type: type, "data-slot": "input", className: cn("border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-
|
|
24616
|
+
return (React__namespace.createElement("input", Object.assign({ type: type, "data-slot": "input", className: cn("border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "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", className) }, props)));
|
|
23442
24617
|
}
|
|
23443
24618
|
|
|
23444
24619
|
function InputGroup(_a) {
|
|
@@ -23504,9 +24679,9 @@ const buttonVariants = cva("inline-flex cursor-pointer items-center justify-cent
|
|
|
23504
24679
|
},
|
|
23505
24680
|
size: {
|
|
23506
24681
|
link: "p-0 h-auto",
|
|
23507
|
-
default: "h-
|
|
24682
|
+
default: "h-10 px-4 py-2 has-[>svg]:px-3",
|
|
23508
24683
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
23509
|
-
lg: "h-
|
|
24684
|
+
lg: "h-12 rounded-md px-6 has-[>svg]:px-4",
|
|
23510
24685
|
icon: "size-9",
|
|
23511
24686
|
},
|
|
23512
24687
|
},
|
|
@@ -28870,7 +30045,7 @@ function requireCurrencies () {
|
|
|
28870
30045
|
name: 'Lesotho loti',
|
|
28871
30046
|
number: '426'
|
|
28872
30047
|
}, {
|
|
28873
|
-
code: '
|
|
30048
|
+
code: 'LTL',
|
|
28874
30049
|
decimals: 2,
|
|
28875
30050
|
name: 'Lithuanian litas',
|
|
28876
30051
|
number: '440'
|
|
@@ -32970,12 +34145,12 @@ function requireReactStripe_umd () {
|
|
|
32970
34145
|
|
|
32971
34146
|
stripe._registerWrapper({
|
|
32972
34147
|
name: 'react-stripe-js',
|
|
32973
|
-
version: "3.
|
|
34148
|
+
version: "3.7.0"
|
|
32974
34149
|
});
|
|
32975
34150
|
|
|
32976
34151
|
stripe.registerAppInfo({
|
|
32977
34152
|
name: 'react-stripe-js',
|
|
32978
|
-
version: "3.
|
|
34153
|
+
version: "3.7.0",
|
|
32979
34154
|
url: 'https://stripe.com/docs/stripe-js/react'
|
|
32980
34155
|
});
|
|
32981
34156
|
};
|
|
@@ -33218,20 +34393,24 @@ function requireReactStripe_umd () {
|
|
|
33218
34393
|
}, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes
|
|
33219
34394
|
|
|
33220
34395
|
var prevOptions = usePrevious(options);
|
|
34396
|
+
var prevCheckoutSdk = usePrevious(ctx.checkoutSdk);
|
|
33221
34397
|
React.useEffect(function () {
|
|
33222
34398
|
var _prevOptions$elements, _options$elementsOpti;
|
|
33223
34399
|
|
|
34400
|
+
// Ignore changes while checkout sdk is not initialized.
|
|
33224
34401
|
if (!ctx.checkoutSdk) {
|
|
33225
34402
|
return;
|
|
33226
34403
|
}
|
|
33227
34404
|
|
|
33228
34405
|
var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;
|
|
33229
34406
|
var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;
|
|
34407
|
+
var hasAppearanceChanged = !isEqual(currentAppearance, previousAppearance);
|
|
34408
|
+
var hasSdkLoaded = !prevCheckoutSdk && ctx.checkoutSdk;
|
|
33230
34409
|
|
|
33231
|
-
if (currentAppearance &&
|
|
34410
|
+
if (currentAppearance && (hasAppearanceChanged || hasSdkLoaded)) {
|
|
33232
34411
|
ctx.checkoutSdk.changeAppearance(currentAppearance);
|
|
33233
34412
|
}
|
|
33234
|
-
}, [options, prevOptions, ctx.checkoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
34413
|
+
}, [options, prevOptions, ctx.checkoutSdk, prevCheckoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
33235
34414
|
|
|
33236
34415
|
React.useEffect(function () {
|
|
33237
34416
|
registerWithStripeJs(ctx.stripe);
|
|
@@ -34265,7 +35444,7 @@ const motionSettings = {
|
|
|
34265
35444
|
exit: { opacity: 0 },
|
|
34266
35445
|
transition: { duration: 0.2 },
|
|
34267
35446
|
};
|
|
34268
|
-
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, }) {
|
|
35447
|
+
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, setCheckout, }) {
|
|
34269
35448
|
const { formData, setFormData, step, setStep, checkoutId: storedCheckoutId, setCheckoutId, } = useFormStore();
|
|
34270
35449
|
const [paymentSecret, setPaymentSecret] = React.useState(null);
|
|
34271
35450
|
const [publicKey, setPublicKey] = React.useState(null);
|
|
@@ -34401,10 +35580,11 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34401
35580
|
name: data.name,
|
|
34402
35581
|
},
|
|
34403
35582
|
});
|
|
34404
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35583
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34405
35584
|
setPaymentSecret(paymentSecret);
|
|
34406
35585
|
setPublicKey(publicKey);
|
|
34407
35586
|
setShippingCost(data.price);
|
|
35587
|
+
setCheckout(newCheckout);
|
|
34408
35588
|
setStep("payment");
|
|
34409
35589
|
});
|
|
34410
35590
|
// Navigate back to previous step
|
|
@@ -34422,9 +35602,10 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34422
35602
|
};
|
|
34423
35603
|
React.useEffect(() => {
|
|
34424
35604
|
const asyncFunc = () => __awaiter(this, void 0, void 0, function* () {
|
|
34425
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35605
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34426
35606
|
setPaymentSecret(paymentSecret);
|
|
34427
35607
|
setPublicKey(publicKey);
|
|
35608
|
+
setCheckout(newCheckout);
|
|
34428
35609
|
});
|
|
34429
35610
|
if (!paymentSecret && step === "payment") {
|
|
34430
35611
|
asyncFunc();
|
|
@@ -34451,26 +35632,66 @@ function CheckoutFormLoading() {
|
|
|
34451
35632
|
React.createElement(InputGroupLoading, { className: "md:col-span-2" }),
|
|
34452
35633
|
React.createElement(InputGroupLoading, null),
|
|
34453
35634
|
React.createElement("div", { className: "flex md:col-span-2 justify-end pt-2" },
|
|
34454
|
-
React.createElement(Skeleton, { className: "w-32 h-
|
|
35635
|
+
React.createElement(Skeleton, { className: "w-32 h-10" }))));
|
|
34455
35636
|
}
|
|
34456
35637
|
function InputGroupLoading({ className }) {
|
|
34457
35638
|
return (React.createElement("div", { className: clsx("flex flex-col gap-2", className) },
|
|
34458
35639
|
React.createElement(Skeleton, { className: "w-10 h-3" }),
|
|
34459
|
-
React.createElement(Skeleton, { className: "w-full h-
|
|
35640
|
+
React.createElement(Skeleton, { className: "w-full h-10" })));
|
|
34460
35641
|
}
|
|
34461
35642
|
|
|
34462
|
-
function
|
|
34463
|
-
|
|
35643
|
+
function DiscountCode({ applyDiscountCode, revalidateDiscounts, }) {
|
|
35644
|
+
const { t } = useTranslation();
|
|
35645
|
+
const [discountCode, setDiscountCode] = React.useState("");
|
|
35646
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
35647
|
+
const [error, setError] = React.useState(null);
|
|
35648
|
+
const isValid = discountCode.length > 0;
|
|
35649
|
+
const handleSubmit = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
35650
|
+
e.preventDefault();
|
|
35651
|
+
setIsLoading(true);
|
|
35652
|
+
try {
|
|
35653
|
+
yield applyDiscountCode(discountCode);
|
|
35654
|
+
yield revalidateDiscounts();
|
|
35655
|
+
setDiscountCode("");
|
|
35656
|
+
toast.success(t("CheckoutEmbed.Summary.discountCodeSuccess"));
|
|
35657
|
+
}
|
|
35658
|
+
catch (error) {
|
|
35659
|
+
console.error(error);
|
|
35660
|
+
setError(t("CheckoutEmbed.Summary.discountCodeError"));
|
|
35661
|
+
}
|
|
35662
|
+
finally {
|
|
35663
|
+
setIsLoading(false);
|
|
35664
|
+
}
|
|
35665
|
+
});
|
|
35666
|
+
return (React.createElement("form", { className: "pb-1", onSubmit: handleSubmit },
|
|
35667
|
+
React.createElement(Label, { className: "text-sm font-medium mb-2" }, "Discount Code"),
|
|
35668
|
+
React.createElement("div", { className: "flex items-center gap-2" },
|
|
35669
|
+
React.createElement(Input, { "aria-invalid": !!error, value: discountCode, onChange: (e) => {
|
|
35670
|
+
setError("");
|
|
35671
|
+
setDiscountCode(e.target.value);
|
|
35672
|
+
}, name: "discountCode", placeholder: t("CheckoutEmbed.Summary.discountCodePlaceholder") }),
|
|
35673
|
+
React.createElement(SubmitButton, { isSubmitting: isLoading, isValid: isValid, type: "submit" }, t("CheckoutEmbed.Summary.discountCodeApply"))),
|
|
35674
|
+
error && React.createElement("p", { className: "text-red-500 mt-2 text-sm" }, error)));
|
|
35675
|
+
}
|
|
35676
|
+
|
|
35677
|
+
function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency, onCancel, exchangeRate, applyDiscountCode, revalidateDiscounts, removeDiscount, }) {
|
|
35678
|
+
var _a, _b;
|
|
34464
35679
|
const { formData } = useFormStore();
|
|
34465
35680
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
34466
35681
|
const { t } = useTranslation();
|
|
34467
35682
|
const subtotal = lineItems.reduce((acc, item) => {
|
|
34468
|
-
var _a;
|
|
34469
|
-
const productItem = item.
|
|
34470
|
-
return acc + ((
|
|
35683
|
+
var _a, _b;
|
|
35684
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35685
|
+
return acc + ((_b = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _b !== void 0 ? _b : 0) * item.quantity;
|
|
34471
35686
|
}, 0);
|
|
34472
|
-
const shippingPrice = shipping !== null && shipping !== void 0 ? shipping : (_a = formData.shipping) === null || _a === void 0 ? void 0 : _a.price;
|
|
34473
|
-
const total = subtotal + (tax !== null && tax !== void 0 ? tax : 0) +
|
|
35687
|
+
const shippingPrice = (_b = shipping !== null && shipping !== void 0 ? shipping : (_a = formData.shipping) === null || _a === void 0 ? void 0 : _a.price) !== null && _b !== void 0 ? _b : 0;
|
|
35688
|
+
const total = subtotal + (tax !== null && tax !== void 0 ? tax : 0) + shippingPrice;
|
|
35689
|
+
const isShippingFree = subtotal > shippingPrice &&
|
|
35690
|
+
appliedDiscounts.some((discount) => discount.discount.type === "FREE_SHIPPING");
|
|
35691
|
+
const filteredDiscounts = appliedDiscounts.filter((discount) => discount.discount.type !== "FREE_SHIPPING");
|
|
35692
|
+
const totalWithDiscounts = total -
|
|
35693
|
+
filteredDiscounts.reduce((acc, { amount }) => acc + amount, 0) -
|
|
35694
|
+
(isShippingFree ? 0 : shippingPrice);
|
|
34474
35695
|
return (React.createElement("div", { className: "grid gap-5" },
|
|
34475
35696
|
React.createElement("div", { className: "flex justify-between items-center" },
|
|
34476
35697
|
React.createElement("div", { onClick: () => setIsOpen(!isOpen), className: "flex items-center gap-2 cursor-pointer" },
|
|
@@ -34481,7 +35702,7 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34481
35702
|
React.createElement("p", { className: "font-bold text-lg tracking-tight md:hidden" }, storeHelpers.formatPrice(total, currency, exchangeRate)),
|
|
34482
35703
|
React.createElement(Button, { className: "max-sm:hidden", variant: "link", size: "link", onClick: onCancel }, t("CheckoutEmbed.Summary.edit"))),
|
|
34483
35704
|
React.createElement("hr", null),
|
|
34484
|
-
React.createElement("div", { className: clsx("gap-
|
|
35705
|
+
React.createElement("div", { className: clsx("gap-2 order-4 md:order-none", {
|
|
34485
35706
|
"hidden md:grid": !isOpen,
|
|
34486
35707
|
grid: isOpen,
|
|
34487
35708
|
}) },
|
|
@@ -34490,41 +35711,91 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34490
35711
|
React.createElement("p", null, storeHelpers.formatPrice(subtotal, currency, exchangeRate))),
|
|
34491
35712
|
React.createElement("div", { className: "flex justify-between" },
|
|
34492
35713
|
React.createElement("p", null, t("CheckoutEmbed.Summary.shipping")),
|
|
34493
|
-
React.createElement("p", null,
|
|
34494
|
-
?
|
|
34495
|
-
:
|
|
35714
|
+
React.createElement("p", null, isShippingFree
|
|
35715
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35716
|
+
: !!shippingPrice
|
|
35717
|
+
? storeHelpers.formatPrice(shippingPrice, currency, exchangeRate)
|
|
35718
|
+
: t("CheckoutEmbed.Summary.calculatedAtNextStep"))),
|
|
34496
35719
|
!!tax && (React.createElement("div", { className: "flex justify-between" },
|
|
34497
35720
|
React.createElement("p", null, t("CheckoutEmbed.Summary.tax")),
|
|
34498
35721
|
React.createElement("p", null, storeHelpers.formatPrice(tax, currency, exchangeRate)))),
|
|
34499
|
-
|
|
35722
|
+
filteredDiscounts.map(({ discount, amount, id }) => {
|
|
35723
|
+
var _a;
|
|
35724
|
+
return (React.createElement("div", { key: discount.id, className: "flex not-last:-mb-0.5 justify-between text-muted-foreground" },
|
|
35725
|
+
React.createElement(DiscountItem, { id: id, removeDiscount: removeDiscount, label: (_a = ((discount === null || discount === void 0 ? void 0 : discount.code) || (discount === null || discount === void 0 ? void 0 : discount.title))) !== null && _a !== void 0 ? _a : "", canRemove: discount.method === "CODE" }),
|
|
35726
|
+
React.createElement("p", null,
|
|
35727
|
+
"- ",
|
|
35728
|
+
storeHelpers.formatPrice(amount, currency, exchangeRate))));
|
|
35729
|
+
}),
|
|
35730
|
+
React.createElement("div", { className: "flex font-bold justify-between items-center" },
|
|
34500
35731
|
React.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34501
|
-
React.createElement("p", null, storeHelpers.formatPrice(
|
|
35732
|
+
React.createElement("p", null, storeHelpers.formatPrice(totalWithDiscounts, currency, exchangeRate)))),
|
|
35733
|
+
React.createElement("hr", { className: clsx("order-7 md:order-none", {
|
|
35734
|
+
"hidden md:block": !isOpen,
|
|
35735
|
+
block: isOpen,
|
|
35736
|
+
}) }),
|
|
35737
|
+
React.createElement("div", { className: clsx("gap-0 order-6 md:order-none", {
|
|
35738
|
+
"hidden md:grid": !isOpen,
|
|
35739
|
+
grid: isOpen,
|
|
35740
|
+
}) },
|
|
35741
|
+
React.createElement(DiscountCode, { applyDiscountCode: applyDiscountCode, revalidateDiscounts: revalidateDiscounts })),
|
|
34502
35742
|
React.createElement("hr", { className: clsx("order-5 md:order-none", {
|
|
34503
35743
|
"hidden md:block": !isOpen,
|
|
34504
35744
|
block: isOpen,
|
|
34505
35745
|
}) }),
|
|
34506
|
-
React.createElement("div", { className: clsx("gap-
|
|
35746
|
+
React.createElement("div", { className: clsx("gap-0 order-3 md:order-none", {
|
|
34507
35747
|
"hidden md:grid": !isOpen,
|
|
34508
35748
|
grid: isOpen,
|
|
34509
35749
|
}) }, lineItems.map((item, index) => {
|
|
34510
|
-
var _a, _b, _c, _d, _e;
|
|
34511
|
-
const
|
|
35750
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35751
|
+
const productAppliedDiscounts = appliedDiscounts.filter(({ discount }) => discount.allowedProductIDs.includes(item.productData.productId));
|
|
35752
|
+
const discount = productAppliedDiscounts.length > 0
|
|
35753
|
+
? productAppliedDiscounts.reduce((acc, curr) => {
|
|
35754
|
+
return curr.amount > acc.amount ? curr : acc;
|
|
35755
|
+
}, productAppliedDiscounts[0])
|
|
35756
|
+
: null;
|
|
35757
|
+
const isDiscounted = !!discount;
|
|
35758
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35759
|
+
const discountedPrice = productItem.priceInCents - ((_b = discount === null || discount === void 0 ? void 0 : discount.amount) !== null && _b !== void 0 ? _b : 0);
|
|
34512
35760
|
return (React.createElement("div", { key: index, className: "flex items-center" },
|
|
34513
35761
|
React.createElement("div", { className: "relative" },
|
|
34514
35762
|
React.createElement("div", { className: "w-16 h-16 bg-secondary rounded-lg overflow-hidden relative" }, (productItem === null || productItem === void 0 ? void 0 : productItem.images[0]) && (React.createElement("img", { src: productItem.images[0] ||
|
|
34515
|
-
((
|
|
34516
|
-
"/placeholder.svg", alt: ((
|
|
35763
|
+
((_c = item === null || item === void 0 ? void 0 : item.productData) === null || _c === void 0 ? void 0 : _c.images[0]) ||
|
|
35764
|
+
"/placeholder.svg", alt: ((_d = item.productData) === null || _d === void 0 ? void 0 : _d.title) || "", className: "object-cover w-full h-full", sizes: "64px" }))),
|
|
34517
35765
|
React.createElement("div", { className: "absolute -top-2 -right-2 w-6 h-6 bg-primary rounded-full flex items-center text-background justify-center text-sm" }, item.quantity)),
|
|
34518
35766
|
React.createElement("div", { className: "ml-4 flex-1" },
|
|
34519
|
-
React.createElement("h3", { className: "text-lg font-medium" }, (
|
|
35767
|
+
React.createElement("h3", { className: "text-lg font-medium" }, (_e = item.productData) === null || _e === void 0 ? void 0 : _e.title),
|
|
34520
35768
|
React.createElement("p", { className: "text-muted-foreground text-sm" }, item.variantOptions.map((option) => (React.createElement("span", { key: option.name },
|
|
34521
35769
|
option.name,
|
|
34522
35770
|
": ",
|
|
34523
35771
|
option.value))))),
|
|
34524
|
-
React.createElement("div", { className: "text-right" },
|
|
34525
|
-
React.createElement("p", { className: "text-
|
|
35772
|
+
React.createElement("div", { className: "text-right" }, isDiscounted ? (React.createElement("div", { className: "flex flex-col" },
|
|
35773
|
+
React.createElement("p", { className: "text-sm font-medium -mb-0.5 line-through text-muted-foreground" }, storeHelpers.formatPrice((_f = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _f !== void 0 ? _f : 0, currency, exchangeRate)),
|
|
35774
|
+
React.createElement("p", { className: "text-lg font-medium" }, discountedPrice <= 0
|
|
35775
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35776
|
+
: storeHelpers.formatPrice(discountedPrice, currency, exchangeRate)))) : (React.createElement("p", { className: "text-lg font-medium" }, storeHelpers.formatPrice((_g = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _g !== void 0 ? _g : 0, currency, exchangeRate))))));
|
|
34526
35777
|
}))));
|
|
34527
35778
|
}
|
|
35779
|
+
function DiscountItem({ id, removeDiscount, label, canRemove, }) {
|
|
35780
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
35781
|
+
const handleRemove = () => __awaiter(this, void 0, void 0, function* () {
|
|
35782
|
+
setIsLoading(true);
|
|
35783
|
+
try {
|
|
35784
|
+
yield removeDiscount(id);
|
|
35785
|
+
}
|
|
35786
|
+
catch (error) {
|
|
35787
|
+
console.error(error);
|
|
35788
|
+
}
|
|
35789
|
+
finally {
|
|
35790
|
+
setIsLoading(false);
|
|
35791
|
+
}
|
|
35792
|
+
});
|
|
35793
|
+
return (React.createElement("div", { className: "flex items-center gap-0.5" },
|
|
35794
|
+
React.createElement("p", null, isLoading ? "Removing..." : label),
|
|
35795
|
+
!isLoading && canRemove && (React.createElement("div", { onClick: handleRemove, className: "flex items-center z-10 relative -m-0.5 hover:bg-muted p-1 rounded-full justify-center hover:text-foreground cursor-pointer" },
|
|
35796
|
+
React.createElement(X$2, { className: "size-3" }),
|
|
35797
|
+
React.createElement("p", { className: "sr-only" }, "Remove")))));
|
|
35798
|
+
}
|
|
34528
35799
|
|
|
34529
35800
|
function CheckoutSummaryLoading() {
|
|
34530
35801
|
const { t } = useTranslation();
|
|
@@ -34548,7 +35819,11 @@ function CheckoutSummaryLoading() {
|
|
|
34548
35819
|
React.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34549
35820
|
React.createElement(Skeleton, { className: "w-24 h-[18px]" }))),
|
|
34550
35821
|
React.createElement("hr", { className: "hidden md:block" }),
|
|
34551
|
-
|
|
35822
|
+
React.createElement("div", null,
|
|
35823
|
+
React.createElement(Skeleton, { className: "w-24 h-5 mb-2" }),
|
|
35824
|
+
React.createElement(Skeleton, { className: "h-10 w-full mb-1" })),
|
|
35825
|
+
React.createElement("hr", { className: "hidden md:block" }),
|
|
35826
|
+
Array.from({ length: 2 }).map((_, index) => (React.createElement("div", { key: index, className: "hidden md:flex items-center" },
|
|
34552
35827
|
React.createElement(Skeleton, { className: "rounded-lg size-16" }),
|
|
34553
35828
|
React.createElement("div", { className: "ml-4 grid gap-2 flex-1" },
|
|
34554
35829
|
React.createElement(Skeleton, { className: "w-28 h-5" }),
|
|
@@ -34558,11 +35833,11 @@ function CheckoutSummaryLoading() {
|
|
|
34558
35833
|
}
|
|
34559
35834
|
|
|
34560
35835
|
function CheckoutEmbed({ checkoutId, config }) {
|
|
34561
|
-
var _a, _b, _c, _d, _e;
|
|
35836
|
+
var _a, _b, _c, _d, _e, _f;
|
|
34562
35837
|
const { cancelUrl, successUrl, appearance, locale, clientSecret, clientProxy, } = config;
|
|
34563
|
-
const storeClient = sdk.createStoreClient({ proxy: clientProxy });
|
|
35838
|
+
const storeClient = React.useMemo(() => sdk.createStoreClient({ proxy: clientProxy }), [clientProxy]);
|
|
34564
35839
|
React.useMemo(() => createI18nInstance(locale), []);
|
|
34565
|
-
const { formData, setFormData,
|
|
35840
|
+
const { formData, setFormData, setStep } = useFormStore();
|
|
34566
35841
|
const [checkout, setCheckout] = React.useState(null);
|
|
34567
35842
|
const [loading, setLoading] = React.useState(true);
|
|
34568
35843
|
React.useEffect(() => {
|
|
@@ -34613,10 +35888,31 @@ function CheckoutEmbed({ checkoutId, config }) {
|
|
|
34613
35888
|
return;
|
|
34614
35889
|
setCheckout(Object.assign(Object.assign({}, checkout), { shipping: cost }));
|
|
34615
35890
|
};
|
|
35891
|
+
const applyDiscountCode = (code) => __awaiter(this, void 0, void 0, function* () {
|
|
35892
|
+
const newCheckout = yield storeClient.applyDiscountCode(clientSecret, checkoutId, code);
|
|
35893
|
+
setCheckout(newCheckout);
|
|
35894
|
+
});
|
|
35895
|
+
const revalidateDiscounts = () => __awaiter(this, void 0, void 0, function* () {
|
|
35896
|
+
const newCheckout = yield storeClient.revalidateDiscounts(clientSecret, checkoutId);
|
|
35897
|
+
setCheckout(newCheckout);
|
|
35898
|
+
});
|
|
35899
|
+
const removeDiscount = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
35900
|
+
console.log("storeclient method", storeClient);
|
|
35901
|
+
const newCheckout = yield storeClient.removeDiscount(clientSecret, checkoutId, id);
|
|
35902
|
+
setCheckout(newCheckout);
|
|
35903
|
+
});
|
|
35904
|
+
React.useEffect(() => {
|
|
35905
|
+
const interval = setTimeout(() => {
|
|
35906
|
+
revalidateDiscounts();
|
|
35907
|
+
}, 1000 * 5);
|
|
35908
|
+
return () => clearInterval(interval);
|
|
35909
|
+
}, []);
|
|
34616
35910
|
return (React.createElement("div", { className: "checkout-embed scrollbar-hidden mx-auto max-w-[1200px] min-h-screen overflow-x-hidden gap-6 md:gap-0 py-4 md:py-12 flex flex-col md:grid md:grid-cols-7 " },
|
|
34617
35911
|
React.createElement(Appearance, { appearance: appearance }),
|
|
34618
|
-
React.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1 }))),
|
|
34619
|
-
React.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35912
|
+
React.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React.createElement(CheckoutFormLoading, null)) : (React.createElement(CheckoutForm, { locale: locale, setShippingCost: setShippingCost, storeClient: storeClient, fonts: config.fonts, checkoutAppearance: appearance, currency: (_a = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _a !== void 0 ? _a : "", customer: checkout === null || checkout === void 0 ? void 0 : checkout.customer, cancelUrl: cancelUrl, checkoutId: checkoutId, clientSecret: clientSecret, onSuccess: onSuccess, onError: onError, exchangeRate: (_b = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _b !== void 0 ? _b : 1, setCheckout: setCheckout }))),
|
|
35913
|
+
React.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35914
|
+
React.createElement(Toaster, null),
|
|
35915
|
+
loading ? (React.createElement(CheckoutSummaryLoading, null)) : (React.createElement(CheckoutSummary, { currency: (_c = checkout === null || checkout === void 0 ? void 0 : checkout.currency) !== null && _c !== void 0 ? _c : "", lineItems: (_d = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) !== null && _d !== void 0 ? _d : [], shipping: checkout === null || checkout === void 0 ? void 0 : checkout.shipping, tax: checkout === null || checkout === void 0 ? void 0 : checkout.tax, onCancel: onCancel, exchangeRate: (_e = checkout === null || checkout === void 0 ? void 0 : checkout.exchangeRate) !== null && _e !== void 0 ? _e : 1, applyDiscountCode: applyDiscountCode, appliedDiscounts: (_f = checkout === null || checkout === void 0 ? void 0 : checkout.appliedDiscounts) !== null && _f !== void 0 ? _f : [], revalidateDiscounts: revalidateDiscounts, removeDiscount: removeDiscount })))));
|
|
34620
35916
|
}
|
|
34621
35917
|
var index = React.memo(CheckoutEmbed);
|
|
34622
35918
|
|
|
@@ -34647,7 +35943,7 @@ function styleInject(css, ref) {
|
|
|
34647
35943
|
}
|
|
34648
35944
|
}
|
|
34649
35945
|
|
|
34650
|
-
var css_248z = "/*! tailwindcss v4.1.5 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::-moz-placeholder {\n opacity: 1;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::-moz-placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none !important;\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n }\n .absolute {\n position: absolute !important;\n }\n .fixed {\n position: fixed !important;\n }\n .relative {\n position: relative !important;\n }\n .sticky {\n position: sticky !important;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0) !important;\n }\n .-top-2 {\n top: calc(var(--spacing) * -2) !important;\n }\n .top-0 {\n top: calc(var(--spacing) * 0) !important;\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5) !important;\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%) !important;\n }\n .top-4 {\n top: calc(var(--spacing) * 4) !important;\n }\n .top-\\[50\\%\\] {\n top: 50% !important;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2) !important;\n }\n .right-2 {\n right: calc(var(--spacing) * 2) !important;\n }\n .right-4 {\n right: calc(var(--spacing) * 4) !important;\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%) !important;\n }\n .left-2 {\n left: calc(var(--spacing) * 2) !important;\n }\n .left-\\[50\\%\\] {\n left: 50% !important;\n }\n .z-10 {\n z-index: 10 !important;\n }\n .z-50 {\n z-index: 50 !important;\n }\n .order-3 {\n order: 3 !important;\n }\n .order-4 {\n order: 4 !important;\n }\n .order-5 {\n order: 5 !important;\n }\n .order-first {\n order: -9999 !important;\n }\n .col-span-2 {\n grid-column: span 2 / span 2 !important;\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1) !important;\n }\n .mx-auto {\n margin-inline: auto !important;\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1) !important;\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2) !important;\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8) !important;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2) !important;\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6) !important;\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4) !important;\n }\n .ml-auto {\n margin-left: auto !important;\n }\n .block {\n display: block !important;\n }\n .flex {\n display: flex !important;\n }\n .grid {\n display: grid !important;\n }\n .hidden {\n display: none !important;\n }\n .inline-flex {\n display: inline-flex !important;\n }\n .aspect-square {\n aspect-ratio: 1 / 1 !important;\n }\n .size-2 {\n width: calc(var(--spacing) * 2) !important;\n height: calc(var(--spacing) * 2) !important;\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5) !important;\n height: calc(var(--spacing) * 3.5) !important;\n }\n .size-4 {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n .size-5 {\n width: calc(var(--spacing) * 5) !important;\n height: calc(var(--spacing) * 5) !important;\n }\n .size-9 {\n width: calc(var(--spacing) * 9) !important;\n height: calc(var(--spacing) * 9) !important;\n }\n .size-16 {\n width: calc(var(--spacing) * 16) !important;\n height: calc(var(--spacing) * 16) !important;\n }\n .h-3 {\n height: calc(var(--spacing) * 3) !important;\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5) !important;\n }\n .h-4 {\n height: calc(var(--spacing) * 4) !important;\n }\n .h-5 {\n height: calc(var(--spacing) * 5) !important;\n }\n .h-6 {\n height: calc(var(--spacing) * 6) !important;\n }\n .h-8 {\n height: calc(var(--spacing) * 8) !important;\n }\n .h-9 {\n height: calc(var(--spacing) * 9) !important;\n }\n .h-10 {\n height: calc(var(--spacing) * 10) !important;\n }\n .h-16 {\n height: calc(var(--spacing) * 16) !important;\n }\n .h-\\[18px\\] {\n height: 18px !important;\n }\n .h-\\[20px\\] {\n height: 20px !important;\n }\n .h-\\[var\\(--radix-select-trigger-height\\)\\] {\n height: var(--radix-select-trigger-height) !important;\n }\n .h-auto {\n height: auto !important;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100% !important;\n }\n .h-px {\n height: 1px !important;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height) !important;\n }\n .max-h-96 {\n max-height: calc(var(--spacing) * 96) !important;\n }\n .max-h-\\[200px\\] {\n max-height: 200px !important;\n }\n .max-h-\\[300px\\] {\n max-height: 300px !important;\n }\n .min-h-full {\n min-height: 100% !important;\n }\n .min-h-screen {\n min-height: 100vh !important;\n }\n .w-0 {\n width: calc(var(--spacing) * 0) !important;\n }\n .w-4 {\n width: calc(var(--spacing) * 4) !important;\n }\n .w-5 {\n width: calc(var(--spacing) * 5) !important;\n }\n .w-6 {\n width: calc(var(--spacing) * 6) !important;\n }\n .w-10 {\n width: calc(var(--spacing) * 10) !important;\n }\n .w-12 {\n width: calc(var(--spacing) * 12) !important;\n }\n .w-16 {\n width: calc(var(--spacing) * 16) !important;\n }\n .w-20 {\n width: calc(var(--spacing) * 20) !important;\n }\n .w-24 {\n width: calc(var(--spacing) * 24) !important;\n }\n .w-28 {\n width: calc(var(--spacing) * 28) !important;\n }\n .w-32 {\n width: calc(var(--spacing) * 32) !important;\n }\n .w-40 {\n width: calc(var(--spacing) * 40) !important;\n }\n .w-72 {\n width: calc(var(--spacing) * 72) !important;\n }\n .w-fit {\n width: -moz-fit-content !important;\n width: fit-content !important;\n }\n .w-full {\n width: 100% !important;\n }\n .max-w-\\[1200px\\] {\n max-width: 1200px !important;\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem) !important;\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0) !important;\n }\n .min-w-\\[--radix-popper-anchor-width\\] {\n min-width: --radix-popper-anchor-width !important;\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem !important;\n }\n .min-w-\\[var\\(--radix-select-trigger-width\\)\\] {\n min-width: var(--radix-select-trigger-width) !important;\n }\n .flex-1 {\n flex: 1 !important;\n }\n .shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-grow {\n flex-grow: 1 !important;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin) !important;\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin) !important;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .rotate-180 {\n rotate: 180deg !important;\n }\n .transform-none\\! {\n transform: none !important;\n }\n .animate-pulse {\n animation: var(--animate-pulse) !important;\n }\n .animate-spin {\n animation: var(--animate-spin) !important;\n }\n .cursor-default {\n cursor: default !important;\n }\n .cursor-pointer {\n cursor: pointer !important;\n }\n .scroll-my-1 {\n scroll-margin-block: calc(var(--spacing) * 1) !important;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1) !important;\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n .flex-col {\n flex-direction: column !important;\n }\n .flex-col-reverse {\n flex-direction: column-reverse !important;\n }\n .items-center {\n align-items: center !important;\n }\n .justify-between {\n justify-content: space-between !important;\n }\n .justify-center {\n justify-content: center !important;\n }\n .justify-end {\n justify-content: flex-end !important;\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5) !important;\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2) !important;\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3) !important;\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4) !important;\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5) !important;\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6) !important;\n }\n .gap-\\[10px\\] {\n gap: 10px !important;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-x-2 {\n :where(& > :not(:last-child)) {\n --tw-space-x-reverse: 0 !important;\n margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse)) !important;\n margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse))) !important;\n }\n }\n .overflow-hidden {\n overflow: hidden !important;\n }\n .overflow-x-hidden {\n overflow-x: hidden !important;\n }\n .overflow-y-auto {\n overflow-y: auto !important;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px !important;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px) !important;\n }\n .rounded-lg {\n border-radius: var(--bs-radius) !important;\n }\n .rounded-md {\n border-radius: calc(var(--bs-radius) - 2px) !important;\n }\n .rounded-sm {\n border-radius: calc(var(--bs-radius) - 4px) !important;\n }\n .rounded-xs {\n border-radius: var(--radius-xs) !important;\n }\n .border {\n border-style: var(--tw-border-style) !important;\n border-width: 1px !important;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style) !important;\n border-bottom-width: 1px !important;\n }\n .border-input {\n border-color: var(--bs-input) !important;\n }\n .border-primary {\n border-color: var(--bs-primary) !important;\n }\n .bg-accent {\n background-color: var(--bs-accent) !important;\n }\n .bg-background {\n background-color: var(--bs-background) !important;\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent) !important;\n }\n }\n .bg-border {\n background-color: var(--bs-border) !important;\n }\n .bg-destructive {\n background-color: var(--bs-destructive) !important;\n }\n .bg-muted {\n background-color: var(--bs-muted) !important;\n }\n .bg-popover {\n background-color: var(--bs-popover) !important;\n }\n .bg-primary {\n background-color: var(--bs-primary) !important;\n }\n .bg-secondary {\n background-color: var(--bs-secondary) !important;\n }\n .bg-transparent {\n background-color: transparent !important;\n }\n .fill-current {\n fill: currentcolor !important;\n }\n .fill-primary {\n fill: var(--bs-primary) !important;\n }\n .object-cover {\n -o-object-fit: cover !important;\n object-fit: cover !important;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0) !important;\n }\n .p-1 {\n padding: calc(var(--spacing) * 1) !important;\n }\n .p-4 {\n padding: calc(var(--spacing) * 4) !important;\n }\n .p-6 {\n padding: calc(var(--spacing) * 6) !important;\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6) !important;\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1) !important;\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2) !important;\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4) !important;\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6) !important;\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2) !important;\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4) !important;\n }\n .pt-8 {\n padding-top: calc(var(--spacing) * 8) !important;\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2) !important;\n }\n .pr-8 {\n padding-right: calc(var(--spacing) * 8) !important;\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2) !important;\n }\n .pl-2 {\n padding-left: calc(var(--spacing) * 2) !important;\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n .text-center {\n text-align: center !important;\n }\n .text-right {\n text-align: right !important;\n }\n .text-base {\n font-size: var(--text-base) !important;\n line-height: var(--tw-leading, var(--text-base--line-height)) !important;\n }\n .text-lg {\n font-size: var(--text-lg) !important;\n line-height: var(--tw-leading, var(--text-lg--line-height)) !important;\n }\n .text-sm {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n .text-xs {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n .leading-none {\n --tw-leading: 1 !important;\n line-height: 1 !important;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold) !important;\n font-weight: var(--font-weight-semibold) !important;\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest) !important;\n letter-spacing: var(--tracking-widest) !important;\n }\n .text-ellipsis {\n text-overflow: ellipsis !important;\n }\n .whitespace-nowrap {\n white-space: nowrap !important;\n }\n .text-background {\n color: var(--bs-background) !important;\n }\n .text-current {\n color: currentcolor !important;\n }\n .text-destructive {\n color: var(--bs-destructive) !important;\n }\n .text-destructive-foreground {\n color: var(--bs-destructive-foreground) !important;\n }\n .text-foreground {\n color: var(--bs-foreground) !important;\n }\n .text-muted-foreground {\n color: var(--bs-muted-foreground) !important;\n }\n .text-popover-foreground {\n color: var(--bs-popover-foreground) !important;\n }\n .text-primary {\n color: var(--bs-primary) !important;\n }\n .text-primary-foreground {\n color: var(--bs-primary-foreground) !important;\n }\n .text-red-500 {\n color: var(--color-red-500) !important;\n }\n .text-secondary-foreground {\n color: var(--bs-secondary-foreground) !important;\n }\n .text-white {\n color: var(--color-white) !important;\n }\n .underline-offset-4 {\n text-underline-offset: 4px !important;\n }\n .opacity-0 {\n opacity: 0% !important;\n }\n .opacity-50 {\n opacity: 50% !important;\n }\n .opacity-70 {\n opacity: 70% !important;\n }\n .opacity-100 {\n opacity: 100% !important;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-sm {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--bs-background) !important;\n }\n .outline-hidden {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style) !important;\n outline-width: 1px !important;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-opacity {\n transition-property: opacity !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-shadow {\n transition-property: box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-none {\n transition-property: none !important;\n }\n .duration-200 {\n --tw-duration: 200ms !important;\n transition-duration: 200ms !important;\n }\n .outline-none {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n .select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n }\n .duration-200 {\n animation-duration: 200ms !important;\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50% !important;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed !important;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50% !important;\n }\n }\n .selection\\:bg-primary {\n & *::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n & *::selection {\n background-color: var(--bs-primary) !important;\n }\n &::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n &::selection {\n background-color: var(--bs-primary) !important;\n }\n }\n .selection\\:text-primary-foreground {\n & *::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n & *::selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::selection {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex !important;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7) !important;\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style) !important;\n border-width: 0px !important;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent !important;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--bs-foreground) !important;\n }\n }\n .placeholder\\:text-muted-foreground {\n &::-moz-placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n &::placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-accent) !important;\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-primary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-primary) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-secondary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-secondary) 80%, transparent) !important;\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-accent-foreground) !important;\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline !important;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100% !important;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--bs-accent) !important;\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .focus\\:ring-1 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--bs-ring) !important;\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px !important;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--bs-ring) !important;\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none !important;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed !important;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50% !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--bs-destructive) !important;\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50% !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50% !important;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--bs-destructive-foreground) !important;\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n }\n .data-\\[placeholder\\]\\:text-muted-foreground {\n &[data-placeholder] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:translate-y-1 {\n &[data-side=\"bottom\"] {\n --tw-translate-y: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem !important;\n }\n }\n .data-\\[side\\=left\\]\\:-translate-x-1 {\n &[data-side=\"left\"] {\n --tw-translate-x: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem !important;\n }\n }\n .data-\\[side\\=right\\]\\:translate-x-1 {\n &[data-side=\"right\"] {\n --tw-translate-x: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem !important;\n }\n }\n .data-\\[side\\=top\\]\\:-translate-y-1 {\n &[data-side=\"top\"] {\n --tw-translate-y: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem !important;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:flex {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n display: flex !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:items-center {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n align-items: center !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:gap-2 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit !important;\n animation-duration: 150ms !important;\n --tw-exit-opacity: initial !important;\n --tw-exit-scale: initial !important;\n --tw-exit-rotate: initial !important;\n --tw-exit-translate-x: initial !important;\n --tw-exit-translate-y: initial !important;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0 !important;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95 !important;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter !important;\n animation-duration: 150ms !important;\n --tw-enter-opacity: initial !important;\n --tw-enter-scale: initial !important;\n --tw-enter-rotate: initial !important;\n --tw-enter-translate-x: initial !important;\n --tw-enter-translate-y: initial !important;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0 !important;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95 !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--bs-destructive) !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 10%, transparent) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--bs-destructive) !important;\n }\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none !important;\n }\n }\n .sm\\:max-h-\\[270px\\] {\n @media (width >= 40rem) {\n max-height: 270px !important;\n }\n }\n .sm\\:max-w-\\[500px\\] {\n @media (width >= 40rem) {\n max-width: 500px !important;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg) !important;\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row !important;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end !important;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left !important;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999 !important;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0 !important;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2 !important;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3 !important;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4 !important;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block !important;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex !important;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid !important;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none !important;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0) !important;\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8) !important;\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12) !important;\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none !important;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0 !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\*\\:\\[span\\]\\:last\\:flex {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n display: flex !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:items-center {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n align-items: center !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:gap-2 {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--bs-destructive) !important;\n }\n }\n }\n }\n .\\[\\&\\>span\\]\\:line-clamp-1 {\n &>span {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n}\n.checkout-embed {\n :root {\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --destructive-foreground: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --radius: 0.625rem;\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n }\n @layer base {\n * {\n border-color: var(--bs-border) !important;\n outline-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n .checkout-embed {\n background-color: var(--bs-background) !important;\n font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif !important;\n color: var(--bs-foreground) !important;\n }\n h2 {\n font-size: var(--text-2xl) !important;\n line-height: var(--tw-leading, var(--text-2xl--line-height)) !important;\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n p {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n }\n @layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-x-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-space-x-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n }\n }\n}\n";
|
|
35946
|
+
var css_248z = "/*! tailwindcss v4.1.7 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::-moz-placeholder {\n opacity: 1;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::-moz-placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none !important;\n }\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n }\n .absolute {\n position: absolute !important;\n }\n .fixed {\n position: fixed !important;\n }\n .relative {\n position: relative !important;\n }\n .sticky {\n position: sticky !important;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0) !important;\n }\n .-top-2 {\n top: calc(var(--spacing) * -2) !important;\n }\n .top-0 {\n top: calc(var(--spacing) * 0) !important;\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5) !important;\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%) !important;\n }\n .top-4 {\n top: calc(var(--spacing) * 4) !important;\n }\n .top-\\[50\\%\\] {\n top: 50% !important;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2) !important;\n }\n .right-2 {\n right: calc(var(--spacing) * 2) !important;\n }\n .right-4 {\n right: calc(var(--spacing) * 4) !important;\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%) !important;\n }\n .left-2 {\n left: calc(var(--spacing) * 2) !important;\n }\n .left-\\[50\\%\\] {\n left: 50% !important;\n }\n .z-10 {\n z-index: 10 !important;\n }\n .z-50 {\n z-index: 50 !important;\n }\n .order-3 {\n order: 3 !important;\n }\n .order-4 {\n order: 4 !important;\n }\n .order-5 {\n order: 5 !important;\n }\n .order-6 {\n order: 6 !important;\n }\n .order-7 {\n order: 7 !important;\n }\n .order-first {\n order: -9999 !important;\n }\n .col-span-2 {\n grid-column: span 2 / span 2 !important;\n }\n .-m-0\\.5 {\n margin: calc(var(--spacing) * -0.5) !important;\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1) !important;\n }\n .mx-auto {\n margin-inline: auto !important;\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1) !important;\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2) !important;\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2) !important;\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8) !important;\n }\n .-mb-0\\.5 {\n margin-bottom: calc(var(--spacing) * -0.5) !important;\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1) !important;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2) !important;\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4) !important;\n }\n .ml-auto {\n margin-left: auto !important;\n }\n .block {\n display: block !important;\n }\n .flex {\n display: flex !important;\n }\n .grid {\n display: grid !important;\n }\n .hidden {\n display: none !important;\n }\n .inline-flex {\n display: inline-flex !important;\n }\n .aspect-square {\n aspect-ratio: 1 / 1 !important;\n }\n .size-2 {\n width: calc(var(--spacing) * 2) !important;\n height: calc(var(--spacing) * 2) !important;\n }\n .size-3 {\n width: calc(var(--spacing) * 3) !important;\n height: calc(var(--spacing) * 3) !important;\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5) !important;\n height: calc(var(--spacing) * 3.5) !important;\n }\n .size-4 {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n .size-5 {\n width: calc(var(--spacing) * 5) !important;\n height: calc(var(--spacing) * 5) !important;\n }\n .size-9 {\n width: calc(var(--spacing) * 9) !important;\n height: calc(var(--spacing) * 9) !important;\n }\n .size-16 {\n width: calc(var(--spacing) * 16) !important;\n height: calc(var(--spacing) * 16) !important;\n }\n .h-3 {\n height: calc(var(--spacing) * 3) !important;\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5) !important;\n }\n .h-4 {\n height: calc(var(--spacing) * 4) !important;\n }\n .h-5 {\n height: calc(var(--spacing) * 5) !important;\n }\n .h-6 {\n height: calc(var(--spacing) * 6) !important;\n }\n .h-8 {\n height: calc(var(--spacing) * 8) !important;\n }\n .h-9 {\n height: calc(var(--spacing) * 9) !important;\n }\n .h-10 {\n height: calc(var(--spacing) * 10) !important;\n }\n .h-12 {\n height: calc(var(--spacing) * 12) !important;\n }\n .h-16 {\n height: calc(var(--spacing) * 16) !important;\n }\n .h-\\[18px\\] {\n height: 18px !important;\n }\n .h-\\[20px\\] {\n height: 20px !important;\n }\n .h-\\[var\\(--radix-select-trigger-height\\)\\] {\n height: var(--radix-select-trigger-height) !important;\n }\n .h-auto {\n height: auto !important;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100% !important;\n }\n .h-px {\n height: 1px !important;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height) !important;\n }\n .max-h-96 {\n max-height: calc(var(--spacing) * 96) !important;\n }\n .max-h-\\[200px\\] {\n max-height: 200px !important;\n }\n .max-h-\\[300px\\] {\n max-height: 300px !important;\n }\n .min-h-full {\n min-height: 100% !important;\n }\n .min-h-screen {\n min-height: 100vh !important;\n }\n .w-0 {\n width: calc(var(--spacing) * 0) !important;\n }\n .w-4 {\n width: calc(var(--spacing) * 4) !important;\n }\n .w-5 {\n width: calc(var(--spacing) * 5) !important;\n }\n .w-6 {\n width: calc(var(--spacing) * 6) !important;\n }\n .w-10 {\n width: calc(var(--spacing) * 10) !important;\n }\n .w-12 {\n width: calc(var(--spacing) * 12) !important;\n }\n .w-16 {\n width: calc(var(--spacing) * 16) !important;\n }\n .w-20 {\n width: calc(var(--spacing) * 20) !important;\n }\n .w-24 {\n width: calc(var(--spacing) * 24) !important;\n }\n .w-28 {\n width: calc(var(--spacing) * 28) !important;\n }\n .w-32 {\n width: calc(var(--spacing) * 32) !important;\n }\n .w-40 {\n width: calc(var(--spacing) * 40) !important;\n }\n .w-72 {\n width: calc(var(--spacing) * 72) !important;\n }\n .w-fit {\n width: -moz-fit-content !important;\n width: fit-content !important;\n }\n .w-full {\n width: 100% !important;\n }\n .max-w-\\[1200px\\] {\n max-width: 1200px !important;\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem) !important;\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0) !important;\n }\n .min-w-\\[--radix-popper-anchor-width\\] {\n min-width: --radix-popper-anchor-width !important;\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem !important;\n }\n .min-w-\\[var\\(--radix-select-trigger-width\\)\\] {\n min-width: var(--radix-select-trigger-width) !important;\n }\n .flex-1 {\n flex: 1 !important;\n }\n .shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-grow {\n flex-grow: 1 !important;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin) !important;\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin) !important;\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50% !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n .rotate-180 {\n rotate: 180deg !important;\n }\n .transform-none\\! {\n transform: none !important;\n }\n .animate-pulse {\n animation: var(--animate-pulse) !important;\n }\n .animate-spin {\n animation: var(--animate-spin) !important;\n }\n .cursor-default {\n cursor: default !important;\n }\n .cursor-pointer {\n cursor: pointer !important;\n }\n .scroll-my-1 {\n scroll-margin-block: calc(var(--spacing) * 1) !important;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1) !important;\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n .flex-col {\n flex-direction: column !important;\n }\n .flex-col-reverse {\n flex-direction: column-reverse !important;\n }\n .items-center {\n align-items: center !important;\n }\n .justify-between {\n justify-content: space-between !important;\n }\n .justify-center {\n justify-content: center !important;\n }\n .justify-end {\n justify-content: flex-end !important;\n }\n .gap-0 {\n gap: calc(var(--spacing) * 0) !important;\n }\n .gap-0\\.5 {\n gap: calc(var(--spacing) * 0.5) !important;\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5) !important;\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2) !important;\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3) !important;\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4) !important;\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5) !important;\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6) !important;\n }\n .gap-\\[10px\\] {\n gap: 10px !important;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0 !important;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse)) !important;\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse))) !important;\n }\n }\n .space-x-2 {\n :where(& > :not(:last-child)) {\n --tw-space-x-reverse: 0 !important;\n margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse)) !important;\n margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse))) !important;\n }\n }\n .overflow-hidden {\n overflow: hidden !important;\n }\n .overflow-x-hidden {\n overflow-x: hidden !important;\n }\n .overflow-y-auto {\n overflow-y: auto !important;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px !important;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px) !important;\n }\n .rounded-lg {\n border-radius: var(--bs-radius) !important;\n }\n .rounded-md {\n border-radius: calc(var(--bs-radius) - 2px) !important;\n }\n .rounded-sm {\n border-radius: calc(var(--bs-radius) - 4px) !important;\n }\n .rounded-xs {\n border-radius: var(--radius-xs) !important;\n }\n .border {\n border-style: var(--tw-border-style) !important;\n border-width: 1px !important;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style) !important;\n border-bottom-width: 1px !important;\n }\n .border-input {\n border-color: var(--bs-input) !important;\n }\n .border-primary {\n border-color: var(--bs-primary) !important;\n }\n .bg-accent {\n background-color: var(--bs-accent) !important;\n }\n .bg-background {\n background-color: var(--bs-background) !important;\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent) !important;\n }\n }\n .bg-border {\n background-color: var(--bs-border) !important;\n }\n .bg-destructive {\n background-color: var(--bs-destructive) !important;\n }\n .bg-muted {\n background-color: var(--bs-muted) !important;\n }\n .bg-popover {\n background-color: var(--bs-popover) !important;\n }\n .bg-primary {\n background-color: var(--bs-primary) !important;\n }\n .bg-secondary {\n background-color: var(--bs-secondary) !important;\n }\n .bg-transparent {\n background-color: transparent !important;\n }\n .fill-current {\n fill: currentcolor !important;\n }\n .fill-primary {\n fill: var(--bs-primary) !important;\n }\n .object-cover {\n -o-object-fit: cover !important;\n object-fit: cover !important;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0) !important;\n }\n .p-1 {\n padding: calc(var(--spacing) * 1) !important;\n }\n .p-4 {\n padding: calc(var(--spacing) * 4) !important;\n }\n .p-6 {\n padding: calc(var(--spacing) * 6) !important;\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6) !important;\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1) !important;\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2) !important;\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4) !important;\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6) !important;\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2) !important;\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4) !important;\n }\n .pt-8 {\n padding-top: calc(var(--spacing) * 8) !important;\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2) !important;\n }\n .pr-8 {\n padding-right: calc(var(--spacing) * 8) !important;\n }\n .pb-1 {\n padding-bottom: calc(var(--spacing) * 1) !important;\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2) !important;\n }\n .pl-2 {\n padding-left: calc(var(--spacing) * 2) !important;\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n .text-center {\n text-align: center !important;\n }\n .text-right {\n text-align: right !important;\n }\n .text-base {\n font-size: var(--text-base) !important;\n line-height: var(--tw-leading, var(--text-base--line-height)) !important;\n }\n .text-lg {\n font-size: var(--text-lg) !important;\n line-height: var(--tw-leading, var(--text-lg--line-height)) !important;\n }\n .text-sm {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n .text-xs {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n .leading-none {\n --tw-leading: 1 !important;\n line-height: 1 !important;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold) !important;\n font-weight: var(--font-weight-semibold) !important;\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest) !important;\n letter-spacing: var(--tracking-widest) !important;\n }\n .text-ellipsis {\n text-overflow: ellipsis !important;\n }\n .whitespace-nowrap {\n white-space: nowrap !important;\n }\n .text-background {\n color: var(--bs-background) !important;\n }\n .text-current {\n color: currentcolor !important;\n }\n .text-destructive {\n color: var(--bs-destructive) !important;\n }\n .text-destructive-foreground {\n color: var(--bs-destructive-foreground) !important;\n }\n .text-foreground {\n color: var(--bs-foreground) !important;\n }\n .text-muted-foreground {\n color: var(--bs-muted-foreground) !important;\n }\n .text-popover-foreground {\n color: var(--bs-popover-foreground) !important;\n }\n .text-primary {\n color: var(--bs-primary) !important;\n }\n .text-primary-foreground {\n color: var(--bs-primary-foreground) !important;\n }\n .text-red-500 {\n color: var(--color-red-500) !important;\n }\n .text-secondary-foreground {\n color: var(--bs-secondary-foreground) !important;\n }\n .text-white {\n color: var(--color-white) !important;\n }\n .line-through {\n text-decoration-line: line-through !important;\n }\n .underline-offset-4 {\n text-underline-offset: 4px !important;\n }\n .opacity-0 {\n opacity: 0% !important;\n }\n .opacity-50 {\n opacity: 50% !important;\n }\n .opacity-70 {\n opacity: 70% !important;\n }\n .opacity-100 {\n opacity: 100% !important;\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-sm {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--bs-background) !important;\n }\n .outline-hidden {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style) !important;\n outline-width: 1px !important;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-opacity {\n transition-property: opacity !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-shadow {\n transition-property: box-shadow !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate !important;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;\n transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;\n }\n .transition-none {\n transition-property: none !important;\n }\n .duration-200 {\n --tw-duration: 200ms !important;\n transition-duration: 200ms !important;\n }\n .outline-none {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n .select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n }\n .duration-200 {\n animation-duration: 200ms !important;\n }\n .not-last\\:-mb-0\\.5 {\n &:not(*:last-child) {\n margin-bottom: calc(var(--spacing) * -0.5) !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none !important;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50% !important;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed !important;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50% !important;\n }\n }\n .selection\\:bg-primary {\n & *::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n & *::selection {\n background-color: var(--bs-primary) !important;\n }\n &::-moz-selection {\n background-color: var(--bs-primary) !important;\n }\n &::selection {\n background-color: var(--bs-primary) !important;\n }\n }\n .selection\\:text-primary-foreground {\n & *::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n & *::selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::-moz-selection {\n color: var(--bs-primary-foreground) !important;\n }\n &::selection {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex !important;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7) !important;\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style) !important;\n border-width: 0px !important;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent !important;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--bs-foreground) !important;\n }\n }\n .placeholder\\:text-muted-foreground {\n &::-moz-placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n &::placeholder {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-accent) !important;\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-muted {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-muted) !important;\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-primary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-primary) 90%, transparent) !important;\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--bs-secondary) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-secondary) 80%, transparent) !important;\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-accent-foreground) !important;\n }\n }\n }\n .hover\\:text-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--bs-foreground) !important;\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline !important;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100% !important;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--bs-accent) !important;\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .focus\\:ring-1 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--bs-ring) !important;\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px !important;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n @media (forced-colors: active) {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n }\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none !important;\n outline-style: none !important;\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--bs-ring) !important;\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none !important;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed !important;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50% !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3) !important;\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4) !important;\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--bs-destructive) !important;\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50% !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none !important;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50% !important;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--bs-destructive-foreground) !important;\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8) !important;\n }\n }\n .data-\\[placeholder\\]\\:text-muted-foreground {\n &[data-placeholder] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:translate-y-1 {\n &[data-side=\"bottom\"] {\n --tw-translate-y: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem !important;\n }\n }\n .data-\\[side\\=left\\]\\:-translate-x-1 {\n &[data-side=\"left\"] {\n --tw-translate-x: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem !important;\n }\n }\n .data-\\[side\\=right\\]\\:translate-x-1 {\n &[data-side=\"right\"] {\n --tw-translate-x: calc(var(--spacing) * 1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem !important;\n }\n }\n .data-\\[side\\=top\\]\\:-translate-y-1 {\n &[data-side=\"top\"] {\n --tw-translate-y: calc(var(--spacing) * -1) !important;\n translate: var(--tw-translate-x) var(--tw-translate-y) !important;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem !important;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:flex {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n display: flex !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:items-center {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n align-items: center !important;\n }\n }\n }\n .\\*\\:data-\\[slot\\=select-value\\]\\:gap-2 {\n :is(& > *) {\n &[data-slot=\"select-value\"] {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--bs-primary) !important;\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--bs-primary-foreground) !important;\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit !important;\n animation-duration: 150ms !important;\n --tw-exit-opacity: initial !important;\n --tw-exit-scale: initial !important;\n --tw-exit-rotate: initial !important;\n --tw-exit-translate-x: initial !important;\n --tw-exit-translate-y: initial !important;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0 !important;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95 !important;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--bs-accent) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-accent-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter !important;\n animation-duration: 150ms !important;\n --tw-enter-opacity: initial !important;\n --tw-enter-scale: initial !important;\n --tw-enter-rotate: initial !important;\n --tw-enter-translate-x: initial !important;\n --tw-enter-translate-y: initial !important;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0 !important;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95 !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--bs-destructive) !important;\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 10%, transparent) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--bs-destructive) !important;\n }\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none !important;\n }\n }\n .sm\\:max-h-\\[270px\\] {\n @media (width >= 40rem) {\n max-height: 270px !important;\n }\n }\n .sm\\:max-w-\\[500px\\] {\n @media (width >= 40rem) {\n max-width: 500px !important;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg) !important;\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row !important;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end !important;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left !important;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999 !important;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0 !important;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2 !important;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3 !important;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4 !important;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block !important;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex !important;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid !important;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none !important;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0) !important;\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8) !important;\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12) !important;\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm) !important;\n line-height: var(--tw-leading, var(--text-sm--line-height)) !important;\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--bs-destructive) 40%, transparent) !important;\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--bs-destructive) !important;\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--bs-destructive) 20%, transparent) !important;\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs) !important;\n line-height: var(--tw-leading, var(--text-xs--line-height)) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium) !important;\n font-weight: var(--font-weight-medium) !important;\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5) !important;\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none !important;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0 !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4) !important;\n height: calc(var(--spacing) * 4) !important;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--bs-muted-foreground) !important;\n }\n }\n .\\*\\:\\[span\\]\\:last\\:flex {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n display: flex !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:items-center {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n align-items: center !important;\n }\n }\n }\n }\n .\\*\\:\\[span\\]\\:last\\:gap-2 {\n :is(& > *) {\n &:is(span) {\n &:last-child {\n gap: calc(var(--spacing) * 2) !important;\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--bs-destructive) !important;\n }\n }\n }\n }\n .\\[\\&\\>span\\]\\:line-clamp-1 {\n &>span {\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 1 !important;\n }\n }\n}\n.checkout-embed {\n :root {\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(0.205 0 0);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --destructive-foreground: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n --chart-1: oklch(0.646 0.222 41.116);\n --chart-2: oklch(0.6 0.118 184.704);\n --chart-3: oklch(0.398 0.07 227.392);\n --chart-4: oklch(0.828 0.189 84.429);\n --chart-5: oklch(0.769 0.188 70.08);\n --radius: 0.625rem;\n --sidebar: oklch(0.985 0 0);\n --sidebar-foreground: oklch(0.145 0 0);\n --sidebar-primary: oklch(0.205 0 0);\n --sidebar-primary-foreground: oklch(0.985 0 0);\n --sidebar-accent: oklch(0.97 0 0);\n --sidebar-accent-foreground: oklch(0.205 0 0);\n --sidebar-border: oklch(0.922 0 0);\n --sidebar-ring: oklch(0.708 0 0);\n }\n @layer base {\n * {\n border-color: var(--bs-border) !important;\n outline-color: var(--bs-ring) !important;\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--bs-ring) 50%, transparent) !important;\n }\n }\n .checkout-embed {\n background-color: var(--bs-background) !important;\n font-family: var(--bs-font-sans), Helvetica, Arial, apple-system, sans-serif !important;\n color: var(--bs-foreground) !important;\n }\n h2 {\n font-size: var(--text-2xl) !important;\n line-height: var(--tw-leading, var(--text-2xl--line-height)) !important;\n --tw-font-weight: var(--font-weight-bold) !important;\n font-weight: var(--font-weight-bold) !important;\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n p {\n --tw-tracking: var(--tracking-tight) !important;\n letter-spacing: var(--tracking-tight) !important;\n }\n }\n @layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-x-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-space-x-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n }\n }\n}\n";
|
|
34651
35947
|
styleInject(css_248z);
|
|
34652
35948
|
|
|
34653
35949
|
exports.CheckoutEmbed = index;
|