@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.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { createContext, useContext, useCallback, useState, useRef, useEffect, useLayoutEffect, useId, useInsertionEffect, useMemo, Children, isValidElement, forwardRef, Fragment as Fragment$1, createElement, Component, memo as memo$1 } from 'react';
|
|
3
3
|
import { createStoreHelpers, createStoreClient } from '@betterstore/sdk';
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
4
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
5
6
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
7
|
-
import 'react-dom';
|
|
8
8
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
9
9
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
@@ -63,7 +63,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
63
63
|
if (str2 === null) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
return JSON.parse(str2,
|
|
66
|
+
return JSON.parse(str2, void 0 );
|
|
67
67
|
};
|
|
68
68
|
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
69
69
|
if (str instanceof Promise) {
|
|
@@ -73,7 +73,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
73
73
|
},
|
|
74
74
|
setItem: (name, newValue) => storage.setItem(
|
|
75
75
|
name,
|
|
76
|
-
JSON.stringify(newValue,
|
|
76
|
+
JSON.stringify(newValue, void 0 )
|
|
77
77
|
),
|
|
78
78
|
removeItem: (name) => storage.removeItem(name)
|
|
79
79
|
};
|
|
@@ -161,7 +161,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
161
161
|
var _a2;
|
|
162
162
|
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
163
163
|
});
|
|
164
|
-
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ?
|
|
164
|
+
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
165
165
|
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
166
166
|
if (deserializedStorageValue) {
|
|
167
167
|
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
@@ -182,7 +182,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
182
182
|
return [false, deserializedStorageValue.state];
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
return [false,
|
|
185
|
+
return [false, void 0];
|
|
186
186
|
}).then((migrationResult) => {
|
|
187
187
|
var _a2;
|
|
188
188
|
const [migrated, migratedState] = migrationResult;
|
|
@@ -195,12 +195,12 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
195
195
|
return setItem();
|
|
196
196
|
}
|
|
197
197
|
}).then(() => {
|
|
198
|
-
postRehydrationCallback == null ?
|
|
198
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
199
199
|
stateFromStorage = get();
|
|
200
200
|
hasHydrated = true;
|
|
201
201
|
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
202
202
|
}).catch((e) => {
|
|
203
|
-
postRehydrationCallback == null ?
|
|
203
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
204
204
|
});
|
|
205
205
|
};
|
|
206
206
|
api.persist = {
|
|
@@ -214,7 +214,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
216
|
clearStorage: () => {
|
|
217
|
-
storage == null ?
|
|
217
|
+
storage == null ? void 0 : storage.removeItem(options.name);
|
|
218
218
|
},
|
|
219
219
|
getOptions: () => options,
|
|
220
220
|
rehydrate: () => hydrate(),
|
|
@@ -3016,7 +3016,7 @@ const hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
|
3016
3016
|
});
|
|
3017
3017
|
};
|
|
3018
3018
|
const isString$1 = obj => typeof obj === 'string';
|
|
3019
|
-
const isObject$
|
|
3019
|
+
const isObject$2 = obj => typeof obj === 'object' && obj !== null;
|
|
3020
3020
|
|
|
3021
3021
|
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3022
3022
|
const htmlEntities = {
|
|
@@ -3114,7 +3114,7 @@ const useTranslation = (ns, props = {}) => {
|
|
|
3114
3114
|
warnOnce$1(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');
|
|
3115
3115
|
const notReadyT = (k, optsOrDefaultValue) => {
|
|
3116
3116
|
if (isString$1(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
3117
|
-
if (isObject$
|
|
3117
|
+
if (isObject$2(optsOrDefaultValue) && isString$1(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
3118
3118
|
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
3119
3119
|
};
|
|
3120
3120
|
const retNotReady = [notReadyT, {}, false];
|
|
@@ -3235,7 +3235,12 @@ const CheckoutEmbed$2 = {
|
|
|
3235
3235
|
subtotal: "Mezisoučet",
|
|
3236
3236
|
tax: "Daň",
|
|
3237
3237
|
title: "Shrnutí",
|
|
3238
|
-
total: "Celkem"
|
|
3238
|
+
total: "Celkem",
|
|
3239
|
+
discountCodeApply: "Aplikovat",
|
|
3240
|
+
discountCodePlaceholder: "Slevový kód nebo dárková karta",
|
|
3241
|
+
discountCodeError: "Už dostáváte nejlepší nabídku!",
|
|
3242
|
+
free: "Zdarma",
|
|
3243
|
+
discountCodeSuccess: "Slevový kód byl úspěšně použit."
|
|
3239
3244
|
},
|
|
3240
3245
|
loading: "Načítání ...",
|
|
3241
3246
|
Payment: {
|
|
@@ -3282,7 +3287,12 @@ const CheckoutEmbed$1 = {
|
|
|
3282
3287
|
subtotal: "Subtotal",
|
|
3283
3288
|
shipping: "Shipping",
|
|
3284
3289
|
calculatedAtNextStep: "Calculated at next step",
|
|
3285
|
-
tax: "Tax"
|
|
3290
|
+
tax: "Tax",
|
|
3291
|
+
discountCodePlaceholder: "Discount code or gift card",
|
|
3292
|
+
discountCodeApply: "Apply",
|
|
3293
|
+
discountCodeError: "You're already getting the best offer!",
|
|
3294
|
+
free: "Free",
|
|
3295
|
+
discountCodeSuccess: "Discount code applied successfully."
|
|
3286
3296
|
},
|
|
3287
3297
|
CustomerForm: {
|
|
3288
3298
|
address: {
|
|
@@ -3370,6 +3380,1135 @@ const createI18nInstance = (locale) => __awaiter(void 0, void 0, void 0, functio
|
|
|
3370
3380
|
return instance;
|
|
3371
3381
|
});
|
|
3372
3382
|
|
|
3383
|
+
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.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z$1=()=>{var e;return (e=React.useContext(x))!=null?e:U$1};React.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.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M$1.toString()})(${p})`}})});
|
|
3384
|
+
|
|
3385
|
+
function __insertCSS(code) {
|
|
3386
|
+
if (typeof document == 'undefined') return
|
|
3387
|
+
let head = document.head || document.getElementsByTagName('head')[0];
|
|
3388
|
+
let style = document.createElement('style');
|
|
3389
|
+
style.type = 'text/css';
|
|
3390
|
+
head.appendChild(style)
|
|
3391
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code));
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
const getAsset = (type)=>{
|
|
3395
|
+
switch(type){
|
|
3396
|
+
case 'success':
|
|
3397
|
+
return SuccessIcon;
|
|
3398
|
+
case 'info':
|
|
3399
|
+
return InfoIcon;
|
|
3400
|
+
case 'warning':
|
|
3401
|
+
return WarningIcon;
|
|
3402
|
+
case 'error':
|
|
3403
|
+
return ErrorIcon;
|
|
3404
|
+
default:
|
|
3405
|
+
return null;
|
|
3406
|
+
}
|
|
3407
|
+
};
|
|
3408
|
+
const bars = Array(12).fill(0);
|
|
3409
|
+
const Loader$1 = ({ visible, className })=>{
|
|
3410
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
|
3411
|
+
className: [
|
|
3412
|
+
'sonner-loading-wrapper',
|
|
3413
|
+
className
|
|
3414
|
+
].filter(Boolean).join(' '),
|
|
3415
|
+
"data-visible": visible
|
|
3416
|
+
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
3417
|
+
className: "sonner-spinner"
|
|
3418
|
+
}, bars.map((_, i)=>/*#__PURE__*/ React__default.createElement("div", {
|
|
3419
|
+
className: "sonner-loading-bar",
|
|
3420
|
+
key: `spinner-bar-${i}`
|
|
3421
|
+
}))));
|
|
3422
|
+
};
|
|
3423
|
+
const SuccessIcon = /*#__PURE__*/ React__default.createElement("svg", {
|
|
3424
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3425
|
+
viewBox: "0 0 20 20",
|
|
3426
|
+
fill: "currentColor",
|
|
3427
|
+
height: "20",
|
|
3428
|
+
width: "20"
|
|
3429
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
3430
|
+
fillRule: "evenodd",
|
|
3431
|
+
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",
|
|
3432
|
+
clipRule: "evenodd"
|
|
3433
|
+
}));
|
|
3434
|
+
const WarningIcon = /*#__PURE__*/ React__default.createElement("svg", {
|
|
3435
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3436
|
+
viewBox: "0 0 24 24",
|
|
3437
|
+
fill: "currentColor",
|
|
3438
|
+
height: "20",
|
|
3439
|
+
width: "20"
|
|
3440
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
3441
|
+
fillRule: "evenodd",
|
|
3442
|
+
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",
|
|
3443
|
+
clipRule: "evenodd"
|
|
3444
|
+
}));
|
|
3445
|
+
const InfoIcon = /*#__PURE__*/ React__default.createElement("svg", {
|
|
3446
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3447
|
+
viewBox: "0 0 20 20",
|
|
3448
|
+
fill: "currentColor",
|
|
3449
|
+
height: "20",
|
|
3450
|
+
width: "20"
|
|
3451
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
3452
|
+
fillRule: "evenodd",
|
|
3453
|
+
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",
|
|
3454
|
+
clipRule: "evenodd"
|
|
3455
|
+
}));
|
|
3456
|
+
const ErrorIcon = /*#__PURE__*/ React__default.createElement("svg", {
|
|
3457
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3458
|
+
viewBox: "0 0 20 20",
|
|
3459
|
+
fill: "currentColor",
|
|
3460
|
+
height: "20",
|
|
3461
|
+
width: "20"
|
|
3462
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
3463
|
+
fillRule: "evenodd",
|
|
3464
|
+
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",
|
|
3465
|
+
clipRule: "evenodd"
|
|
3466
|
+
}));
|
|
3467
|
+
const CloseIcon = /*#__PURE__*/ React__default.createElement("svg", {
|
|
3468
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3469
|
+
width: "12",
|
|
3470
|
+
height: "12",
|
|
3471
|
+
viewBox: "0 0 24 24",
|
|
3472
|
+
fill: "none",
|
|
3473
|
+
stroke: "currentColor",
|
|
3474
|
+
strokeWidth: "1.5",
|
|
3475
|
+
strokeLinecap: "round",
|
|
3476
|
+
strokeLinejoin: "round"
|
|
3477
|
+
}, /*#__PURE__*/ React__default.createElement("line", {
|
|
3478
|
+
x1: "18",
|
|
3479
|
+
y1: "6",
|
|
3480
|
+
x2: "6",
|
|
3481
|
+
y2: "18"
|
|
3482
|
+
}), /*#__PURE__*/ React__default.createElement("line", {
|
|
3483
|
+
x1: "6",
|
|
3484
|
+
y1: "6",
|
|
3485
|
+
x2: "18",
|
|
3486
|
+
y2: "18"
|
|
3487
|
+
}));
|
|
3488
|
+
|
|
3489
|
+
const useIsDocumentHidden = ()=>{
|
|
3490
|
+
const [isDocumentHidden, setIsDocumentHidden] = React__default.useState(document.hidden);
|
|
3491
|
+
React__default.useEffect(()=>{
|
|
3492
|
+
const callback = ()=>{
|
|
3493
|
+
setIsDocumentHidden(document.hidden);
|
|
3494
|
+
};
|
|
3495
|
+
document.addEventListener('visibilitychange', callback);
|
|
3496
|
+
return ()=>window.removeEventListener('visibilitychange', callback);
|
|
3497
|
+
}, []);
|
|
3498
|
+
return isDocumentHidden;
|
|
3499
|
+
};
|
|
3500
|
+
|
|
3501
|
+
let toastsCounter = 1;
|
|
3502
|
+
class Observer {
|
|
3503
|
+
constructor(){
|
|
3504
|
+
// We use arrow functions to maintain the correct `this` reference
|
|
3505
|
+
this.subscribe = (subscriber)=>{
|
|
3506
|
+
this.subscribers.push(subscriber);
|
|
3507
|
+
return ()=>{
|
|
3508
|
+
const index = this.subscribers.indexOf(subscriber);
|
|
3509
|
+
this.subscribers.splice(index, 1);
|
|
3510
|
+
};
|
|
3511
|
+
};
|
|
3512
|
+
this.publish = (data)=>{
|
|
3513
|
+
this.subscribers.forEach((subscriber)=>subscriber(data));
|
|
3514
|
+
};
|
|
3515
|
+
this.addToast = (data)=>{
|
|
3516
|
+
this.publish(data);
|
|
3517
|
+
this.toasts = [
|
|
3518
|
+
...this.toasts,
|
|
3519
|
+
data
|
|
3520
|
+
];
|
|
3521
|
+
};
|
|
3522
|
+
this.create = (data)=>{
|
|
3523
|
+
var _data_id;
|
|
3524
|
+
const { message, ...rest } = data;
|
|
3525
|
+
const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
3526
|
+
const alreadyExists = this.toasts.find((toast)=>{
|
|
3527
|
+
return toast.id === id;
|
|
3528
|
+
});
|
|
3529
|
+
const dismissible = data.dismissible === undefined ? true : data.dismissible;
|
|
3530
|
+
if (this.dismissedToasts.has(id)) {
|
|
3531
|
+
this.dismissedToasts.delete(id);
|
|
3532
|
+
}
|
|
3533
|
+
if (alreadyExists) {
|
|
3534
|
+
this.toasts = this.toasts.map((toast)=>{
|
|
3535
|
+
if (toast.id === id) {
|
|
3536
|
+
this.publish({
|
|
3537
|
+
...toast,
|
|
3538
|
+
...data,
|
|
3539
|
+
id,
|
|
3540
|
+
title: message
|
|
3541
|
+
});
|
|
3542
|
+
return {
|
|
3543
|
+
...toast,
|
|
3544
|
+
...data,
|
|
3545
|
+
id,
|
|
3546
|
+
dismissible,
|
|
3547
|
+
title: message
|
|
3548
|
+
};
|
|
3549
|
+
}
|
|
3550
|
+
return toast;
|
|
3551
|
+
});
|
|
3552
|
+
} else {
|
|
3553
|
+
this.addToast({
|
|
3554
|
+
title: message,
|
|
3555
|
+
...rest,
|
|
3556
|
+
dismissible,
|
|
3557
|
+
id
|
|
3558
|
+
});
|
|
3559
|
+
}
|
|
3560
|
+
return id;
|
|
3561
|
+
};
|
|
3562
|
+
this.dismiss = (id)=>{
|
|
3563
|
+
if (id) {
|
|
3564
|
+
this.dismissedToasts.add(id);
|
|
3565
|
+
requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({
|
|
3566
|
+
id,
|
|
3567
|
+
dismiss: true
|
|
3568
|
+
})));
|
|
3569
|
+
} else {
|
|
3570
|
+
this.toasts.forEach((toast)=>{
|
|
3571
|
+
this.subscribers.forEach((subscriber)=>subscriber({
|
|
3572
|
+
id: toast.id,
|
|
3573
|
+
dismiss: true
|
|
3574
|
+
}));
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3577
|
+
return id;
|
|
3578
|
+
};
|
|
3579
|
+
this.message = (message, data)=>{
|
|
3580
|
+
return this.create({
|
|
3581
|
+
...data,
|
|
3582
|
+
message
|
|
3583
|
+
});
|
|
3584
|
+
};
|
|
3585
|
+
this.error = (message, data)=>{
|
|
3586
|
+
return this.create({
|
|
3587
|
+
...data,
|
|
3588
|
+
message,
|
|
3589
|
+
type: 'error'
|
|
3590
|
+
});
|
|
3591
|
+
};
|
|
3592
|
+
this.success = (message, data)=>{
|
|
3593
|
+
return this.create({
|
|
3594
|
+
...data,
|
|
3595
|
+
type: 'success',
|
|
3596
|
+
message
|
|
3597
|
+
});
|
|
3598
|
+
};
|
|
3599
|
+
this.info = (message, data)=>{
|
|
3600
|
+
return this.create({
|
|
3601
|
+
...data,
|
|
3602
|
+
type: 'info',
|
|
3603
|
+
message
|
|
3604
|
+
});
|
|
3605
|
+
};
|
|
3606
|
+
this.warning = (message, data)=>{
|
|
3607
|
+
return this.create({
|
|
3608
|
+
...data,
|
|
3609
|
+
type: 'warning',
|
|
3610
|
+
message
|
|
3611
|
+
});
|
|
3612
|
+
};
|
|
3613
|
+
this.loading = (message, data)=>{
|
|
3614
|
+
return this.create({
|
|
3615
|
+
...data,
|
|
3616
|
+
type: 'loading',
|
|
3617
|
+
message
|
|
3618
|
+
});
|
|
3619
|
+
};
|
|
3620
|
+
this.promise = (promise, data)=>{
|
|
3621
|
+
if (!data) {
|
|
3622
|
+
// Nothing to show
|
|
3623
|
+
return;
|
|
3624
|
+
}
|
|
3625
|
+
let id = undefined;
|
|
3626
|
+
if (data.loading !== undefined) {
|
|
3627
|
+
id = this.create({
|
|
3628
|
+
...data,
|
|
3629
|
+
promise,
|
|
3630
|
+
type: 'loading',
|
|
3631
|
+
message: data.loading,
|
|
3632
|
+
description: typeof data.description !== 'function' ? data.description : undefined
|
|
3633
|
+
});
|
|
3634
|
+
}
|
|
3635
|
+
const p = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
3636
|
+
let shouldDismiss = id !== undefined;
|
|
3637
|
+
let result;
|
|
3638
|
+
const originalPromise = p.then(async (response)=>{
|
|
3639
|
+
result = [
|
|
3640
|
+
'resolve',
|
|
3641
|
+
response
|
|
3642
|
+
];
|
|
3643
|
+
const isReactElementResponse = React__default.isValidElement(response);
|
|
3644
|
+
if (isReactElementResponse) {
|
|
3645
|
+
shouldDismiss = false;
|
|
3646
|
+
this.create({
|
|
3647
|
+
id,
|
|
3648
|
+
type: 'default',
|
|
3649
|
+
message: response
|
|
3650
|
+
});
|
|
3651
|
+
} else if (isHttpResponse(response) && !response.ok) {
|
|
3652
|
+
shouldDismiss = false;
|
|
3653
|
+
const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
3654
|
+
const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
3655
|
+
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
3656
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3657
|
+
message: promiseData
|
|
3658
|
+
};
|
|
3659
|
+
this.create({
|
|
3660
|
+
id,
|
|
3661
|
+
type: 'error',
|
|
3662
|
+
description,
|
|
3663
|
+
...toastSettings
|
|
3664
|
+
});
|
|
3665
|
+
} else if (response instanceof Error) {
|
|
3666
|
+
shouldDismiss = false;
|
|
3667
|
+
const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error;
|
|
3668
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3669
|
+
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
3670
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3671
|
+
message: promiseData
|
|
3672
|
+
};
|
|
3673
|
+
this.create({
|
|
3674
|
+
id,
|
|
3675
|
+
type: 'error',
|
|
3676
|
+
description,
|
|
3677
|
+
...toastSettings
|
|
3678
|
+
});
|
|
3679
|
+
} else if (data.success !== undefined) {
|
|
3680
|
+
shouldDismiss = false;
|
|
3681
|
+
const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success;
|
|
3682
|
+
const description = typeof data.description === 'function' ? await data.description(response) : data.description;
|
|
3683
|
+
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
3684
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3685
|
+
message: promiseData
|
|
3686
|
+
};
|
|
3687
|
+
this.create({
|
|
3688
|
+
id,
|
|
3689
|
+
type: 'success',
|
|
3690
|
+
description,
|
|
3691
|
+
...toastSettings
|
|
3692
|
+
});
|
|
3693
|
+
}
|
|
3694
|
+
}).catch(async (error)=>{
|
|
3695
|
+
result = [
|
|
3696
|
+
'reject',
|
|
3697
|
+
error
|
|
3698
|
+
];
|
|
3699
|
+
if (data.error !== undefined) {
|
|
3700
|
+
shouldDismiss = false;
|
|
3701
|
+
const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error;
|
|
3702
|
+
const description = typeof data.description === 'function' ? await data.description(error) : data.description;
|
|
3703
|
+
const isExtendedResult = typeof promiseData === 'object' && !React__default.isValidElement(promiseData);
|
|
3704
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
3705
|
+
message: promiseData
|
|
3706
|
+
};
|
|
3707
|
+
this.create({
|
|
3708
|
+
id,
|
|
3709
|
+
type: 'error',
|
|
3710
|
+
description,
|
|
3711
|
+
...toastSettings
|
|
3712
|
+
});
|
|
3713
|
+
}
|
|
3714
|
+
}).finally(()=>{
|
|
3715
|
+
if (shouldDismiss) {
|
|
3716
|
+
// Toast is still in load state (and will be indefinitely — dismiss it)
|
|
3717
|
+
this.dismiss(id);
|
|
3718
|
+
id = undefined;
|
|
3719
|
+
}
|
|
3720
|
+
data.finally == null ? void 0 : data.finally.call(data);
|
|
3721
|
+
});
|
|
3722
|
+
const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
3723
|
+
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
3724
|
+
// cannot Object.assign on undefined
|
|
3725
|
+
return {
|
|
3726
|
+
unwrap
|
|
3727
|
+
};
|
|
3728
|
+
} else {
|
|
3729
|
+
return Object.assign(id, {
|
|
3730
|
+
unwrap
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
};
|
|
3734
|
+
this.custom = (jsx, data)=>{
|
|
3735
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3736
|
+
this.create({
|
|
3737
|
+
jsx: jsx(id),
|
|
3738
|
+
id,
|
|
3739
|
+
...data
|
|
3740
|
+
});
|
|
3741
|
+
return id;
|
|
3742
|
+
};
|
|
3743
|
+
this.getActiveToasts = ()=>{
|
|
3744
|
+
return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id));
|
|
3745
|
+
};
|
|
3746
|
+
this.subscribers = [];
|
|
3747
|
+
this.toasts = [];
|
|
3748
|
+
this.dismissedToasts = new Set();
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
const ToastState = new Observer();
|
|
3752
|
+
// bind this to the toast function
|
|
3753
|
+
const toastFunction = (message, data)=>{
|
|
3754
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
3755
|
+
ToastState.addToast({
|
|
3756
|
+
title: message,
|
|
3757
|
+
...data,
|
|
3758
|
+
id
|
|
3759
|
+
});
|
|
3760
|
+
return id;
|
|
3761
|
+
};
|
|
3762
|
+
const isHttpResponse = (data)=>{
|
|
3763
|
+
return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number';
|
|
3764
|
+
};
|
|
3765
|
+
const basicToast = toastFunction;
|
|
3766
|
+
const getHistory = ()=>ToastState.toasts;
|
|
3767
|
+
const getToasts = ()=>ToastState.getActiveToasts();
|
|
3768
|
+
// We use `Object.assign` to maintain the correct types as we would lose them otherwise
|
|
3769
|
+
const toast = Object.assign(basicToast, {
|
|
3770
|
+
success: ToastState.success,
|
|
3771
|
+
info: ToastState.info,
|
|
3772
|
+
warning: ToastState.warning,
|
|
3773
|
+
error: ToastState.error,
|
|
3774
|
+
custom: ToastState.custom,
|
|
3775
|
+
message: ToastState.message,
|
|
3776
|
+
promise: ToastState.promise,
|
|
3777
|
+
dismiss: ToastState.dismiss,
|
|
3778
|
+
loading: ToastState.loading
|
|
3779
|
+
}, {
|
|
3780
|
+
getHistory,
|
|
3781
|
+
getToasts
|
|
3782
|
+
});
|
|
3783
|
+
|
|
3784
|
+
__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%)}");
|
|
3785
|
+
|
|
3786
|
+
function isAction(action) {
|
|
3787
|
+
return action.label !== undefined;
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
// Visible toasts amount
|
|
3791
|
+
const VISIBLE_TOASTS_AMOUNT = 3;
|
|
3792
|
+
// Viewport padding
|
|
3793
|
+
const VIEWPORT_OFFSET = '24px';
|
|
3794
|
+
// Mobile viewport padding
|
|
3795
|
+
const MOBILE_VIEWPORT_OFFSET = '16px';
|
|
3796
|
+
// Default lifetime of a toasts (in ms)
|
|
3797
|
+
const TOAST_LIFETIME = 4000;
|
|
3798
|
+
// Default toast width
|
|
3799
|
+
const TOAST_WIDTH = 356;
|
|
3800
|
+
// Default gap between toasts
|
|
3801
|
+
const GAP = 14;
|
|
3802
|
+
// Threshold to dismiss a toast
|
|
3803
|
+
const SWIPE_THRESHOLD = 45;
|
|
3804
|
+
// Equal to exit animation duration
|
|
3805
|
+
const TIME_BEFORE_UNMOUNT = 200;
|
|
3806
|
+
function cn$1(...classes) {
|
|
3807
|
+
return classes.filter(Boolean).join(' ');
|
|
3808
|
+
}
|
|
3809
|
+
function getDefaultSwipeDirections(position) {
|
|
3810
|
+
const [y, x] = position.split('-');
|
|
3811
|
+
const directions = [];
|
|
3812
|
+
if (y) {
|
|
3813
|
+
directions.push(y);
|
|
3814
|
+
}
|
|
3815
|
+
if (x) {
|
|
3816
|
+
directions.push(x);
|
|
3817
|
+
}
|
|
3818
|
+
return directions;
|
|
3819
|
+
}
|
|
3820
|
+
const Toast = (props)=>{
|
|
3821
|
+
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
3822
|
+
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;
|
|
3823
|
+
const [swipeDirection, setSwipeDirection] = React__default.useState(null);
|
|
3824
|
+
const [swipeOutDirection, setSwipeOutDirection] = React__default.useState(null);
|
|
3825
|
+
const [mounted, setMounted] = React__default.useState(false);
|
|
3826
|
+
const [removed, setRemoved] = React__default.useState(false);
|
|
3827
|
+
const [swiping, setSwiping] = React__default.useState(false);
|
|
3828
|
+
const [swipeOut, setSwipeOut] = React__default.useState(false);
|
|
3829
|
+
const [isSwiped, setIsSwiped] = React__default.useState(false);
|
|
3830
|
+
const [offsetBeforeRemove, setOffsetBeforeRemove] = React__default.useState(0);
|
|
3831
|
+
const [initialHeight, setInitialHeight] = React__default.useState(0);
|
|
3832
|
+
const remainingTime = React__default.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
|
|
3833
|
+
const dragStartTime = React__default.useRef(null);
|
|
3834
|
+
const toastRef = React__default.useRef(null);
|
|
3835
|
+
const isFront = index === 0;
|
|
3836
|
+
const isVisible = index + 1 <= visibleToasts;
|
|
3837
|
+
const toastType = toast.type;
|
|
3838
|
+
const dismissible = toast.dismissible !== false;
|
|
3839
|
+
const toastClassname = toast.className || '';
|
|
3840
|
+
const toastDescriptionClassname = toast.descriptionClassName || '';
|
|
3841
|
+
// 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.
|
|
3842
|
+
const heightIndex = React__default.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [
|
|
3843
|
+
heights,
|
|
3844
|
+
toast.id
|
|
3845
|
+
]);
|
|
3846
|
+
const closeButton = React__default.useMemo(()=>{
|
|
3847
|
+
var _toast_closeButton;
|
|
3848
|
+
return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
3849
|
+
}, [
|
|
3850
|
+
toast.closeButton,
|
|
3851
|
+
closeButtonFromToaster
|
|
3852
|
+
]);
|
|
3853
|
+
const duration = React__default.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
3854
|
+
toast.duration,
|
|
3855
|
+
durationFromToaster
|
|
3856
|
+
]);
|
|
3857
|
+
const closeTimerStartTimeRef = React__default.useRef(0);
|
|
3858
|
+
const offset = React__default.useRef(0);
|
|
3859
|
+
const lastCloseTimerStartTimeRef = React__default.useRef(0);
|
|
3860
|
+
const pointerStartRef = React__default.useRef(null);
|
|
3861
|
+
const [y, x] = position.split('-');
|
|
3862
|
+
const toastsHeightBefore = React__default.useMemo(()=>{
|
|
3863
|
+
return heights.reduce((prev, curr, reducerIndex)=>{
|
|
3864
|
+
// Calculate offset up until current toast
|
|
3865
|
+
if (reducerIndex >= heightIndex) {
|
|
3866
|
+
return prev;
|
|
3867
|
+
}
|
|
3868
|
+
return prev + curr.height;
|
|
3869
|
+
}, 0);
|
|
3870
|
+
}, [
|
|
3871
|
+
heights,
|
|
3872
|
+
heightIndex
|
|
3873
|
+
]);
|
|
3874
|
+
const isDocumentHidden = useIsDocumentHidden();
|
|
3875
|
+
const invert = toast.invert || ToasterInvert;
|
|
3876
|
+
const disabled = toastType === 'loading';
|
|
3877
|
+
offset.current = React__default.useMemo(()=>heightIndex * gap + toastsHeightBefore, [
|
|
3878
|
+
heightIndex,
|
|
3879
|
+
toastsHeightBefore
|
|
3880
|
+
]);
|
|
3881
|
+
React__default.useEffect(()=>{
|
|
3882
|
+
remainingTime.current = duration;
|
|
3883
|
+
}, [
|
|
3884
|
+
duration
|
|
3885
|
+
]);
|
|
3886
|
+
React__default.useEffect(()=>{
|
|
3887
|
+
// Trigger enter animation without using CSS animation
|
|
3888
|
+
setMounted(true);
|
|
3889
|
+
}, []);
|
|
3890
|
+
React__default.useEffect(()=>{
|
|
3891
|
+
const toastNode = toastRef.current;
|
|
3892
|
+
if (toastNode) {
|
|
3893
|
+
const height = toastNode.getBoundingClientRect().height;
|
|
3894
|
+
// Add toast height to heights array after the toast is mounted
|
|
3895
|
+
setInitialHeight(height);
|
|
3896
|
+
setHeights((h)=>[
|
|
3897
|
+
{
|
|
3898
|
+
toastId: toast.id,
|
|
3899
|
+
height,
|
|
3900
|
+
position: toast.position
|
|
3901
|
+
},
|
|
3902
|
+
...h
|
|
3903
|
+
]);
|
|
3904
|
+
return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3905
|
+
}
|
|
3906
|
+
}, [
|
|
3907
|
+
setHeights,
|
|
3908
|
+
toast.id
|
|
3909
|
+
]);
|
|
3910
|
+
React__default.useLayoutEffect(()=>{
|
|
3911
|
+
if (!mounted) return;
|
|
3912
|
+
const toastNode = toastRef.current;
|
|
3913
|
+
const originalHeight = toastNode.style.height;
|
|
3914
|
+
toastNode.style.height = 'auto';
|
|
3915
|
+
const newHeight = toastNode.getBoundingClientRect().height;
|
|
3916
|
+
toastNode.style.height = originalHeight;
|
|
3917
|
+
setInitialHeight(newHeight);
|
|
3918
|
+
setHeights((heights)=>{
|
|
3919
|
+
const alreadyExists = heights.find((height)=>height.toastId === toast.id);
|
|
3920
|
+
if (!alreadyExists) {
|
|
3921
|
+
return [
|
|
3922
|
+
{
|
|
3923
|
+
toastId: toast.id,
|
|
3924
|
+
height: newHeight,
|
|
3925
|
+
position: toast.position
|
|
3926
|
+
},
|
|
3927
|
+
...heights
|
|
3928
|
+
];
|
|
3929
|
+
} else {
|
|
3930
|
+
return heights.map((height)=>height.toastId === toast.id ? {
|
|
3931
|
+
...height,
|
|
3932
|
+
height: newHeight
|
|
3933
|
+
} : height);
|
|
3934
|
+
}
|
|
3935
|
+
});
|
|
3936
|
+
}, [
|
|
3937
|
+
mounted,
|
|
3938
|
+
toast.title,
|
|
3939
|
+
toast.description,
|
|
3940
|
+
setHeights,
|
|
3941
|
+
toast.id
|
|
3942
|
+
]);
|
|
3943
|
+
const deleteToast = React__default.useCallback(()=>{
|
|
3944
|
+
// Save the offset for the exit swipe animation
|
|
3945
|
+
setRemoved(true);
|
|
3946
|
+
setOffsetBeforeRemove(offset.current);
|
|
3947
|
+
setHeights((h)=>h.filter((height)=>height.toastId !== toast.id));
|
|
3948
|
+
setTimeout(()=>{
|
|
3949
|
+
removeToast(toast);
|
|
3950
|
+
}, TIME_BEFORE_UNMOUNT);
|
|
3951
|
+
}, [
|
|
3952
|
+
toast,
|
|
3953
|
+
removeToast,
|
|
3954
|
+
setHeights,
|
|
3955
|
+
offset
|
|
3956
|
+
]);
|
|
3957
|
+
React__default.useEffect(()=>{
|
|
3958
|
+
if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return;
|
|
3959
|
+
let timeoutId;
|
|
3960
|
+
// Pause the timer on each hover
|
|
3961
|
+
const pauseTimer = ()=>{
|
|
3962
|
+
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
3963
|
+
// Get the elapsed time since the timer started
|
|
3964
|
+
const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
|
|
3965
|
+
remainingTime.current = remainingTime.current - elapsedTime;
|
|
3966
|
+
}
|
|
3967
|
+
lastCloseTimerStartTimeRef.current = new Date().getTime();
|
|
3968
|
+
};
|
|
3969
|
+
const startTimer = ()=>{
|
|
3970
|
+
// setTimeout(, Infinity) behaves as if the delay is 0.
|
|
3971
|
+
// As a result, the toast would be closed immediately, giving the appearance that it was never rendered.
|
|
3972
|
+
// See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout
|
|
3973
|
+
if (remainingTime.current === Infinity) return;
|
|
3974
|
+
closeTimerStartTimeRef.current = new Date().getTime();
|
|
3975
|
+
// Let the toast know it has started
|
|
3976
|
+
timeoutId = setTimeout(()=>{
|
|
3977
|
+
toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast);
|
|
3978
|
+
deleteToast();
|
|
3979
|
+
}, remainingTime.current);
|
|
3980
|
+
};
|
|
3981
|
+
if (expanded || interacting || isDocumentHidden) {
|
|
3982
|
+
pauseTimer();
|
|
3983
|
+
} else {
|
|
3984
|
+
startTimer();
|
|
3985
|
+
}
|
|
3986
|
+
return ()=>clearTimeout(timeoutId);
|
|
3987
|
+
}, [
|
|
3988
|
+
expanded,
|
|
3989
|
+
interacting,
|
|
3990
|
+
toast,
|
|
3991
|
+
toastType,
|
|
3992
|
+
isDocumentHidden,
|
|
3993
|
+
deleteToast
|
|
3994
|
+
]);
|
|
3995
|
+
React__default.useEffect(()=>{
|
|
3996
|
+
if (toast.delete) {
|
|
3997
|
+
deleteToast();
|
|
3998
|
+
}
|
|
3999
|
+
}, [
|
|
4000
|
+
deleteToast,
|
|
4001
|
+
toast.delete
|
|
4002
|
+
]);
|
|
4003
|
+
function getLoadingIcon() {
|
|
4004
|
+
var _toast_classNames;
|
|
4005
|
+
if (icons == null ? void 0 : icons.loading) {
|
|
4006
|
+
var _toast_classNames1;
|
|
4007
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
|
4008
|
+
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'),
|
|
4009
|
+
"data-visible": toastType === 'loading'
|
|
4010
|
+
}, icons.loading);
|
|
4011
|
+
}
|
|
4012
|
+
return /*#__PURE__*/ React__default.createElement(Loader$1, {
|
|
4013
|
+
className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader),
|
|
4014
|
+
visible: toastType === 'loading'
|
|
4015
|
+
});
|
|
4016
|
+
}
|
|
4017
|
+
const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
|
|
4018
|
+
var _toast_richColors, _icons_close;
|
|
4019
|
+
return /*#__PURE__*/ React__default.createElement("li", {
|
|
4020
|
+
tabIndex: 0,
|
|
4021
|
+
ref: toastRef,
|
|
4022
|
+
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]),
|
|
4023
|
+
"data-sonner-toast": "",
|
|
4024
|
+
"data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
|
|
4025
|
+
"data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
|
|
4026
|
+
"data-mounted": mounted,
|
|
4027
|
+
"data-promise": Boolean(toast.promise),
|
|
4028
|
+
"data-swiped": isSwiped,
|
|
4029
|
+
"data-removed": removed,
|
|
4030
|
+
"data-visible": isVisible,
|
|
4031
|
+
"data-y-position": y,
|
|
4032
|
+
"data-x-position": x,
|
|
4033
|
+
"data-index": index,
|
|
4034
|
+
"data-front": isFront,
|
|
4035
|
+
"data-swiping": swiping,
|
|
4036
|
+
"data-dismissible": dismissible,
|
|
4037
|
+
"data-type": toastType,
|
|
4038
|
+
"data-invert": invert,
|
|
4039
|
+
"data-swipe-out": swipeOut,
|
|
4040
|
+
"data-swipe-direction": swipeOutDirection,
|
|
4041
|
+
"data-expanded": Boolean(expanded || expandByDefault && mounted),
|
|
4042
|
+
style: {
|
|
4043
|
+
'--index': index,
|
|
4044
|
+
'--toasts-before': index,
|
|
4045
|
+
'--z-index': toasts.length - index,
|
|
4046
|
+
'--offset': `${removed ? offsetBeforeRemove : offset.current}px`,
|
|
4047
|
+
'--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,
|
|
4048
|
+
...style,
|
|
4049
|
+
...toast.style
|
|
4050
|
+
},
|
|
4051
|
+
onDragEnd: ()=>{
|
|
4052
|
+
setSwiping(false);
|
|
4053
|
+
setSwipeDirection(null);
|
|
4054
|
+
pointerStartRef.current = null;
|
|
4055
|
+
},
|
|
4056
|
+
onPointerDown: (event)=>{
|
|
4057
|
+
if (disabled || !dismissible) return;
|
|
4058
|
+
dragStartTime.current = new Date();
|
|
4059
|
+
setOffsetBeforeRemove(offset.current);
|
|
4060
|
+
// Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)
|
|
4061
|
+
event.target.setPointerCapture(event.pointerId);
|
|
4062
|
+
if (event.target.tagName === 'BUTTON') return;
|
|
4063
|
+
setSwiping(true);
|
|
4064
|
+
pointerStartRef.current = {
|
|
4065
|
+
x: event.clientX,
|
|
4066
|
+
y: event.clientY
|
|
4067
|
+
};
|
|
4068
|
+
},
|
|
4069
|
+
onPointerUp: ()=>{
|
|
4070
|
+
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
4071
|
+
if (swipeOut || !dismissible) return;
|
|
4072
|
+
pointerStartRef.current = null;
|
|
4073
|
+
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0);
|
|
4074
|
+
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0);
|
|
4075
|
+
const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
|
|
4076
|
+
const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;
|
|
4077
|
+
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
4078
|
+
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
|
4079
|
+
setOffsetBeforeRemove(offset.current);
|
|
4080
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4081
|
+
if (swipeDirection === 'x') {
|
|
4082
|
+
setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');
|
|
4083
|
+
} else {
|
|
4084
|
+
setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');
|
|
4085
|
+
}
|
|
4086
|
+
deleteToast();
|
|
4087
|
+
setSwipeOut(true);
|
|
4088
|
+
return;
|
|
4089
|
+
} else {
|
|
4090
|
+
var _toastRef_current2, _toastRef_current3;
|
|
4091
|
+
(_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`);
|
|
4092
|
+
(_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`);
|
|
4093
|
+
}
|
|
4094
|
+
setIsSwiped(false);
|
|
4095
|
+
setSwiping(false);
|
|
4096
|
+
setSwipeDirection(null);
|
|
4097
|
+
},
|
|
4098
|
+
onPointerMove: (event)=>{
|
|
4099
|
+
var _window_getSelection, // Apply transform using both x and y values
|
|
4100
|
+
_toastRef_current, _toastRef_current1;
|
|
4101
|
+
if (!pointerStartRef.current || !dismissible) return;
|
|
4102
|
+
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
|
|
4103
|
+
if (isHighlighted) return;
|
|
4104
|
+
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
4105
|
+
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
4106
|
+
var _props_swipeDirections;
|
|
4107
|
+
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
|
|
4108
|
+
// Determine swipe direction if not already locked
|
|
4109
|
+
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
4110
|
+
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');
|
|
4111
|
+
}
|
|
4112
|
+
let swipeAmount = {
|
|
4113
|
+
x: 0,
|
|
4114
|
+
y: 0
|
|
4115
|
+
};
|
|
4116
|
+
const getDampening = (delta)=>{
|
|
4117
|
+
const factor = Math.abs(delta) / 20;
|
|
4118
|
+
return 1 / (1.5 + factor);
|
|
4119
|
+
};
|
|
4120
|
+
// Only apply swipe in the locked direction
|
|
4121
|
+
if (swipeDirection === 'y') {
|
|
4122
|
+
// Handle vertical swipes
|
|
4123
|
+
if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {
|
|
4124
|
+
if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) {
|
|
4125
|
+
swipeAmount.y = yDelta;
|
|
4126
|
+
} else {
|
|
4127
|
+
// Smoothly transition to dampened movement
|
|
4128
|
+
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
4129
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4130
|
+
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
} else if (swipeDirection === 'x') {
|
|
4134
|
+
// Handle horizontal swipes
|
|
4135
|
+
if (swipeDirections.includes('left') || swipeDirections.includes('right')) {
|
|
4136
|
+
if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) {
|
|
4137
|
+
swipeAmount.x = xDelta;
|
|
4138
|
+
} else {
|
|
4139
|
+
// Smoothly transition to dampened movement
|
|
4140
|
+
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
4141
|
+
// Ensure we don't jump when transitioning to dampened movement
|
|
4142
|
+
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
|
|
4147
|
+
setIsSwiped(true);
|
|
4148
|
+
}
|
|
4149
|
+
(_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);
|
|
4150
|
+
(_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);
|
|
4151
|
+
}
|
|
4152
|
+
}, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React__default.createElement("button", {
|
|
4153
|
+
"aria-label": closeButtonAriaLabel,
|
|
4154
|
+
"data-disabled": disabled,
|
|
4155
|
+
"data-close-button": true,
|
|
4156
|
+
onClick: disabled || !dismissible ? ()=>{} : ()=>{
|
|
4157
|
+
deleteToast();
|
|
4158
|
+
toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast);
|
|
4159
|
+
},
|
|
4160
|
+
className: cn$1(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton)
|
|
4161
|
+
}, (_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__default.createElement("div", {
|
|
4162
|
+
"data-icon": "",
|
|
4163
|
+
className: cn$1(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon)
|
|
4164
|
+
}, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React__default.createElement("div", {
|
|
4165
|
+
"data-content": "",
|
|
4166
|
+
className: cn$1(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content)
|
|
4167
|
+
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
4168
|
+
"data-title": "",
|
|
4169
|
+
className: cn$1(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title)
|
|
4170
|
+
}, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React__default.createElement("div", {
|
|
4171
|
+
"data-description": "",
|
|
4172
|
+
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)
|
|
4173
|
+
}, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React__default.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React__default.createElement("button", {
|
|
4174
|
+
"data-button": true,
|
|
4175
|
+
"data-cancel": true,
|
|
4176
|
+
style: toast.cancelButtonStyle || cancelButtonStyle,
|
|
4177
|
+
onClick: (event)=>{
|
|
4178
|
+
// We need to check twice because typescript
|
|
4179
|
+
if (!isAction(toast.cancel)) return;
|
|
4180
|
+
if (!dismissible) return;
|
|
4181
|
+
toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event);
|
|
4182
|
+
deleteToast();
|
|
4183
|
+
},
|
|
4184
|
+
className: cn$1(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
|
|
4185
|
+
}, toast.cancel.label) : null, /*#__PURE__*/ React__default.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React__default.createElement("button", {
|
|
4186
|
+
"data-button": true,
|
|
4187
|
+
"data-action": true,
|
|
4188
|
+
style: toast.actionButtonStyle || actionButtonStyle,
|
|
4189
|
+
onClick: (event)=>{
|
|
4190
|
+
// We need to check twice because typescript
|
|
4191
|
+
if (!isAction(toast.action)) return;
|
|
4192
|
+
toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event);
|
|
4193
|
+
if (event.defaultPrevented) return;
|
|
4194
|
+
deleteToast();
|
|
4195
|
+
},
|
|
4196
|
+
className: cn$1(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton)
|
|
4197
|
+
}, toast.action.label) : null);
|
|
4198
|
+
};
|
|
4199
|
+
function getDocumentDirection() {
|
|
4200
|
+
if (typeof window === 'undefined') return 'ltr';
|
|
4201
|
+
if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose
|
|
4202
|
+
const dirAttribute = document.documentElement.getAttribute('dir');
|
|
4203
|
+
if (dirAttribute === 'auto' || !dirAttribute) {
|
|
4204
|
+
return window.getComputedStyle(document.documentElement).direction;
|
|
4205
|
+
}
|
|
4206
|
+
return dirAttribute;
|
|
4207
|
+
}
|
|
4208
|
+
function assignOffset(defaultOffset, mobileOffset) {
|
|
4209
|
+
const styles = {};
|
|
4210
|
+
[
|
|
4211
|
+
defaultOffset,
|
|
4212
|
+
mobileOffset
|
|
4213
|
+
].forEach((offset, index)=>{
|
|
4214
|
+
const isMobile = index === 1;
|
|
4215
|
+
const prefix = isMobile ? '--mobile-offset' : '--offset';
|
|
4216
|
+
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
4217
|
+
function assignAll(offset) {
|
|
4218
|
+
[
|
|
4219
|
+
'top',
|
|
4220
|
+
'right',
|
|
4221
|
+
'bottom',
|
|
4222
|
+
'left'
|
|
4223
|
+
].forEach((key)=>{
|
|
4224
|
+
styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;
|
|
4225
|
+
});
|
|
4226
|
+
}
|
|
4227
|
+
if (typeof offset === 'number' || typeof offset === 'string') {
|
|
4228
|
+
assignAll(offset);
|
|
4229
|
+
} else if (typeof offset === 'object') {
|
|
4230
|
+
[
|
|
4231
|
+
'top',
|
|
4232
|
+
'right',
|
|
4233
|
+
'bottom',
|
|
4234
|
+
'left'
|
|
4235
|
+
].forEach((key)=>{
|
|
4236
|
+
if (offset[key] === undefined) {
|
|
4237
|
+
styles[`${prefix}-${key}`] = defaultValue;
|
|
4238
|
+
} else {
|
|
4239
|
+
styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];
|
|
4240
|
+
}
|
|
4241
|
+
});
|
|
4242
|
+
} else {
|
|
4243
|
+
assignAll(defaultValue);
|
|
4244
|
+
}
|
|
4245
|
+
});
|
|
4246
|
+
return styles;
|
|
4247
|
+
}
|
|
4248
|
+
const Toaster$1 = /*#__PURE__*/ React__default.forwardRef(function Toaster(props, ref) {
|
|
4249
|
+
const { invert, position = 'bottom-right', hotkey = [
|
|
4250
|
+
'altKey',
|
|
4251
|
+
'KeyT'
|
|
4252
|
+
], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props;
|
|
4253
|
+
const [toasts, setToasts] = React__default.useState([]);
|
|
4254
|
+
const possiblePositions = React__default.useMemo(()=>{
|
|
4255
|
+
return Array.from(new Set([
|
|
4256
|
+
position
|
|
4257
|
+
].concat(toasts.filter((toast)=>toast.position).map((toast)=>toast.position))));
|
|
4258
|
+
}, [
|
|
4259
|
+
toasts,
|
|
4260
|
+
position
|
|
4261
|
+
]);
|
|
4262
|
+
const [heights, setHeights] = React__default.useState([]);
|
|
4263
|
+
const [expanded, setExpanded] = React__default.useState(false);
|
|
4264
|
+
const [interacting, setInteracting] = React__default.useState(false);
|
|
4265
|
+
const [actualTheme, setActualTheme] = React__default.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light');
|
|
4266
|
+
const listRef = React__default.useRef(null);
|
|
4267
|
+
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
|
|
4268
|
+
const lastFocusedElementRef = React__default.useRef(null);
|
|
4269
|
+
const isFocusWithinRef = React__default.useRef(false);
|
|
4270
|
+
const removeToast = React__default.useCallback((toastToRemove)=>{
|
|
4271
|
+
setToasts((toasts)=>{
|
|
4272
|
+
var _toasts_find;
|
|
4273
|
+
if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
|
|
4274
|
+
ToastState.dismiss(toastToRemove.id);
|
|
4275
|
+
}
|
|
4276
|
+
return toasts.filter(({ id })=>id !== toastToRemove.id);
|
|
4277
|
+
});
|
|
4278
|
+
}, []);
|
|
4279
|
+
React__default.useEffect(()=>{
|
|
4280
|
+
return ToastState.subscribe((toast)=>{
|
|
4281
|
+
if (toast.dismiss) {
|
|
4282
|
+
// Prevent batching of other state updates
|
|
4283
|
+
requestAnimationFrame(()=>{
|
|
4284
|
+
setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? {
|
|
4285
|
+
...t,
|
|
4286
|
+
delete: true
|
|
4287
|
+
} : t));
|
|
4288
|
+
});
|
|
4289
|
+
return;
|
|
4290
|
+
}
|
|
4291
|
+
// Prevent batching, temp solution.
|
|
4292
|
+
setTimeout(()=>{
|
|
4293
|
+
ReactDOM.flushSync(()=>{
|
|
4294
|
+
setToasts((toasts)=>{
|
|
4295
|
+
const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id);
|
|
4296
|
+
// Update the toast if it already exists
|
|
4297
|
+
if (indexOfExistingToast !== -1) {
|
|
4298
|
+
return [
|
|
4299
|
+
...toasts.slice(0, indexOfExistingToast),
|
|
4300
|
+
{
|
|
4301
|
+
...toasts[indexOfExistingToast],
|
|
4302
|
+
...toast
|
|
4303
|
+
},
|
|
4304
|
+
...toasts.slice(indexOfExistingToast + 1)
|
|
4305
|
+
];
|
|
4306
|
+
}
|
|
4307
|
+
return [
|
|
4308
|
+
toast,
|
|
4309
|
+
...toasts
|
|
4310
|
+
];
|
|
4311
|
+
});
|
|
4312
|
+
});
|
|
4313
|
+
});
|
|
4314
|
+
});
|
|
4315
|
+
}, [
|
|
4316
|
+
toasts
|
|
4317
|
+
]);
|
|
4318
|
+
React__default.useEffect(()=>{
|
|
4319
|
+
if (theme !== 'system') {
|
|
4320
|
+
setActualTheme(theme);
|
|
4321
|
+
return;
|
|
4322
|
+
}
|
|
4323
|
+
if (theme === 'system') {
|
|
4324
|
+
// check if current preference is dark
|
|
4325
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
4326
|
+
// it's currently dark
|
|
4327
|
+
setActualTheme('dark');
|
|
4328
|
+
} else {
|
|
4329
|
+
// it's not dark
|
|
4330
|
+
setActualTheme('light');
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
if (typeof window === 'undefined') return;
|
|
4334
|
+
const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
4335
|
+
try {
|
|
4336
|
+
// Chrome & Firefox
|
|
4337
|
+
darkMediaQuery.addEventListener('change', ({ matches })=>{
|
|
4338
|
+
if (matches) {
|
|
4339
|
+
setActualTheme('dark');
|
|
4340
|
+
} else {
|
|
4341
|
+
setActualTheme('light');
|
|
4342
|
+
}
|
|
4343
|
+
});
|
|
4344
|
+
} catch (error) {
|
|
4345
|
+
// Safari < 14
|
|
4346
|
+
darkMediaQuery.addListener(({ matches })=>{
|
|
4347
|
+
try {
|
|
4348
|
+
if (matches) {
|
|
4349
|
+
setActualTheme('dark');
|
|
4350
|
+
} else {
|
|
4351
|
+
setActualTheme('light');
|
|
4352
|
+
}
|
|
4353
|
+
} catch (e) {
|
|
4354
|
+
console.error(e);
|
|
4355
|
+
}
|
|
4356
|
+
});
|
|
4357
|
+
}
|
|
4358
|
+
}, [
|
|
4359
|
+
theme
|
|
4360
|
+
]);
|
|
4361
|
+
React__default.useEffect(()=>{
|
|
4362
|
+
// Ensure expanded is always false when no toasts are present / only one left
|
|
4363
|
+
if (toasts.length <= 1) {
|
|
4364
|
+
setExpanded(false);
|
|
4365
|
+
}
|
|
4366
|
+
}, [
|
|
4367
|
+
toasts
|
|
4368
|
+
]);
|
|
4369
|
+
React__default.useEffect(()=>{
|
|
4370
|
+
const handleKeyDown = (event)=>{
|
|
4371
|
+
var _listRef_current;
|
|
4372
|
+
const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key);
|
|
4373
|
+
if (isHotkeyPressed) {
|
|
4374
|
+
var _listRef_current1;
|
|
4375
|
+
setExpanded(true);
|
|
4376
|
+
(_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
|
|
4377
|
+
}
|
|
4378
|
+
if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
|
|
4379
|
+
setExpanded(false);
|
|
4380
|
+
}
|
|
4381
|
+
};
|
|
4382
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
4383
|
+
return ()=>document.removeEventListener('keydown', handleKeyDown);
|
|
4384
|
+
}, [
|
|
4385
|
+
hotkey
|
|
4386
|
+
]);
|
|
4387
|
+
React__default.useEffect(()=>{
|
|
4388
|
+
if (listRef.current) {
|
|
4389
|
+
return ()=>{
|
|
4390
|
+
if (lastFocusedElementRef.current) {
|
|
4391
|
+
lastFocusedElementRef.current.focus({
|
|
4392
|
+
preventScroll: true
|
|
4393
|
+
});
|
|
4394
|
+
lastFocusedElementRef.current = null;
|
|
4395
|
+
isFocusWithinRef.current = false;
|
|
4396
|
+
}
|
|
4397
|
+
};
|
|
4398
|
+
}
|
|
4399
|
+
}, [
|
|
4400
|
+
listRef.current
|
|
4401
|
+
]);
|
|
4402
|
+
return(// Remove item from normal navigation flow, only available via hotkey
|
|
4403
|
+
/*#__PURE__*/ React__default.createElement("section", {
|
|
4404
|
+
ref: ref,
|
|
4405
|
+
"aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
|
|
4406
|
+
tabIndex: -1,
|
|
4407
|
+
"aria-live": "polite",
|
|
4408
|
+
"aria-relevant": "additions text",
|
|
4409
|
+
"aria-atomic": "false",
|
|
4410
|
+
suppressHydrationWarning: true
|
|
4411
|
+
}, possiblePositions.map((position, index)=>{
|
|
4412
|
+
var _heights_;
|
|
4413
|
+
const [y, x] = position.split('-');
|
|
4414
|
+
if (!toasts.length) return null;
|
|
4415
|
+
return /*#__PURE__*/ React__default.createElement("ol", {
|
|
4416
|
+
key: position,
|
|
4417
|
+
dir: dir === 'auto' ? getDocumentDirection() : dir,
|
|
4418
|
+
tabIndex: -1,
|
|
4419
|
+
ref: listRef,
|
|
4420
|
+
className: className,
|
|
4421
|
+
"data-sonner-toaster": true,
|
|
4422
|
+
"data-sonner-theme": actualTheme,
|
|
4423
|
+
"data-y-position": y,
|
|
4424
|
+
"data-lifted": expanded && toasts.length > 1 && !expand,
|
|
4425
|
+
"data-x-position": x,
|
|
4426
|
+
style: {
|
|
4427
|
+
'--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
|
|
4428
|
+
'--width': `${TOAST_WIDTH}px`,
|
|
4429
|
+
'--gap': `${gap}px`,
|
|
4430
|
+
...style,
|
|
4431
|
+
...assignOffset(offset, mobileOffset)
|
|
4432
|
+
},
|
|
4433
|
+
onBlur: (event)=>{
|
|
4434
|
+
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
4435
|
+
isFocusWithinRef.current = false;
|
|
4436
|
+
if (lastFocusedElementRef.current) {
|
|
4437
|
+
lastFocusedElementRef.current.focus({
|
|
4438
|
+
preventScroll: true
|
|
4439
|
+
});
|
|
4440
|
+
lastFocusedElementRef.current = null;
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
},
|
|
4444
|
+
onFocus: (event)=>{
|
|
4445
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4446
|
+
if (isNotDismissible) return;
|
|
4447
|
+
if (!isFocusWithinRef.current) {
|
|
4448
|
+
isFocusWithinRef.current = true;
|
|
4449
|
+
lastFocusedElementRef.current = event.relatedTarget;
|
|
4450
|
+
}
|
|
4451
|
+
},
|
|
4452
|
+
onMouseEnter: ()=>setExpanded(true),
|
|
4453
|
+
onMouseMove: ()=>setExpanded(true),
|
|
4454
|
+
onMouseLeave: ()=>{
|
|
4455
|
+
// Avoid setting expanded to false when interacting with a toast, e.g. swiping
|
|
4456
|
+
if (!interacting) {
|
|
4457
|
+
setExpanded(false);
|
|
4458
|
+
}
|
|
4459
|
+
},
|
|
4460
|
+
onDragEnd: ()=>setExpanded(false),
|
|
4461
|
+
onPointerDown: (event)=>{
|
|
4462
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';
|
|
4463
|
+
if (isNotDismissible) return;
|
|
4464
|
+
setInteracting(true);
|
|
4465
|
+
},
|
|
4466
|
+
onPointerUp: ()=>setInteracting(false)
|
|
4467
|
+
}, toasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{
|
|
4468
|
+
var _toastOptions_duration, _toastOptions_closeButton;
|
|
4469
|
+
return /*#__PURE__*/ React__default.createElement(Toast, {
|
|
4470
|
+
key: toast.id,
|
|
4471
|
+
icons: icons,
|
|
4472
|
+
index: index,
|
|
4473
|
+
toast: toast,
|
|
4474
|
+
defaultRichColors: richColors,
|
|
4475
|
+
duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
|
|
4476
|
+
className: toastOptions == null ? void 0 : toastOptions.className,
|
|
4477
|
+
descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
|
|
4478
|
+
invert: invert,
|
|
4479
|
+
visibleToasts: visibleToasts,
|
|
4480
|
+
closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
4481
|
+
interacting: interacting,
|
|
4482
|
+
position: position,
|
|
4483
|
+
style: toastOptions == null ? void 0 : toastOptions.style,
|
|
4484
|
+
unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
|
|
4485
|
+
classNames: toastOptions == null ? void 0 : toastOptions.classNames,
|
|
4486
|
+
cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
|
|
4487
|
+
actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
|
|
4488
|
+
closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
|
|
4489
|
+
removeToast: removeToast,
|
|
4490
|
+
toasts: toasts.filter((t)=>t.position == toast.position),
|
|
4491
|
+
heights: heights.filter((h)=>h.position == toast.position),
|
|
4492
|
+
setHeights: setHeights,
|
|
4493
|
+
expandByDefault: expand,
|
|
4494
|
+
gap: gap,
|
|
4495
|
+
expanded: expanded,
|
|
4496
|
+
swipeDirections: props.swipeDirections
|
|
4497
|
+
});
|
|
4498
|
+
}));
|
|
4499
|
+
})));
|
|
4500
|
+
});
|
|
4501
|
+
|
|
4502
|
+
const Toaster = (_a) => {
|
|
4503
|
+
var props = __rest(_a, []);
|
|
4504
|
+
const { theme = "system" } = z$1();
|
|
4505
|
+
return (React__default.createElement(Toaster$1, Object.assign({ theme: theme, className: "toaster group", style: {
|
|
4506
|
+
"--normal-bg": "var(--popover)",
|
|
4507
|
+
"--normal-text": "var(--popover-foreground)",
|
|
4508
|
+
"--normal-border": "var(--border)",
|
|
4509
|
+
} }, props)));
|
|
4510
|
+
};
|
|
4511
|
+
|
|
3373
4512
|
const appearance = {
|
|
3374
4513
|
variables: {
|
|
3375
4514
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Geist", "Gill Sans", sans-serif'}};
|
|
@@ -3584,6 +4723,18 @@ const MotionConfigContext = createContext({
|
|
|
3584
4723
|
reducedMotion: "never",
|
|
3585
4724
|
});
|
|
3586
4725
|
|
|
4726
|
+
function isObject$1(value) {
|
|
4727
|
+
return typeof value === "object" && value !== null;
|
|
4728
|
+
}
|
|
4729
|
+
|
|
4730
|
+
/**
|
|
4731
|
+
* Checks if an element is an HTML element in a way
|
|
4732
|
+
* that works across iframes
|
|
4733
|
+
*/
|
|
4734
|
+
function isHTMLElement$1(element) {
|
|
4735
|
+
return isObject$1(element) && "offsetHeight" in element;
|
|
4736
|
+
}
|
|
4737
|
+
|
|
3587
4738
|
/**
|
|
3588
4739
|
* Measurement functionality has to be within a separate component
|
|
3589
4740
|
* to leverage snapshot lifecycle.
|
|
@@ -3593,7 +4744,9 @@ class PopChildMeasure extends React.Component {
|
|
|
3593
4744
|
const element = this.props.childRef.current;
|
|
3594
4745
|
if (element && prevProps.isPresent && !this.props.isPresent) {
|
|
3595
4746
|
const parent = element.offsetParent;
|
|
3596
|
-
const parentWidth = parent
|
|
4747
|
+
const parentWidth = isHTMLElement$1(parent)
|
|
4748
|
+
? parent.offsetWidth || 0
|
|
4749
|
+
: 0;
|
|
3597
4750
|
const size = this.props.sizeRef.current;
|
|
3598
4751
|
size.height = element.offsetHeight || 0;
|
|
3599
4752
|
size.width = element.offsetWidth || 0;
|
|
@@ -3653,7 +4806,9 @@ function PopChild({ children, isPresent, anchorX }) {
|
|
|
3653
4806
|
`);
|
|
3654
4807
|
}
|
|
3655
4808
|
return () => {
|
|
3656
|
-
document.head.
|
|
4809
|
+
if (document.head.contains(style)) {
|
|
4810
|
+
document.head.removeChild(style);
|
|
4811
|
+
}
|
|
3657
4812
|
};
|
|
3658
4813
|
}, [isPresent]);
|
|
3659
4814
|
return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));
|
|
@@ -4680,8 +5835,6 @@ function isForcedMotionValue(key, { layout, layoutId }) {
|
|
|
4680
5835
|
(!!scaleCorrectors[key] || key === "opacity")));
|
|
4681
5836
|
}
|
|
4682
5837
|
|
|
4683
|
-
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
4684
|
-
|
|
4685
5838
|
/**
|
|
4686
5839
|
* Provided a value and a ValueType, returns the value as that value type.
|
|
4687
5840
|
*/
|
|
@@ -4928,6 +6081,8 @@ const createHtmlRenderState = () => ({
|
|
|
4928
6081
|
vars: {},
|
|
4929
6082
|
});
|
|
4930
6083
|
|
|
6084
|
+
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
6085
|
+
|
|
4931
6086
|
function copyRawValuesOnly(target, source, props) {
|
|
4932
6087
|
for (const key in source) {
|
|
4933
6088
|
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
|
|
@@ -4978,65 +6133,6 @@ function useHTMLProps(props, visualState) {
|
|
|
4978
6133
|
return htmlProps;
|
|
4979
6134
|
}
|
|
4980
6135
|
|
|
4981
|
-
/**
|
|
4982
|
-
* We keep these listed separately as we use the lowercase tag names as part
|
|
4983
|
-
* of the runtime bundle to detect SVG components
|
|
4984
|
-
*/
|
|
4985
|
-
const lowercaseSVGElements = [
|
|
4986
|
-
"animate",
|
|
4987
|
-
"circle",
|
|
4988
|
-
"defs",
|
|
4989
|
-
"desc",
|
|
4990
|
-
"ellipse",
|
|
4991
|
-
"g",
|
|
4992
|
-
"image",
|
|
4993
|
-
"line",
|
|
4994
|
-
"filter",
|
|
4995
|
-
"marker",
|
|
4996
|
-
"mask",
|
|
4997
|
-
"metadata",
|
|
4998
|
-
"path",
|
|
4999
|
-
"pattern",
|
|
5000
|
-
"polygon",
|
|
5001
|
-
"polyline",
|
|
5002
|
-
"rect",
|
|
5003
|
-
"stop",
|
|
5004
|
-
"switch",
|
|
5005
|
-
"symbol",
|
|
5006
|
-
"svg",
|
|
5007
|
-
"text",
|
|
5008
|
-
"tspan",
|
|
5009
|
-
"use",
|
|
5010
|
-
"view",
|
|
5011
|
-
];
|
|
5012
|
-
|
|
5013
|
-
function isSVGComponent(Component) {
|
|
5014
|
-
if (
|
|
5015
|
-
/**
|
|
5016
|
-
* If it's not a string, it's a custom React component. Currently we only support
|
|
5017
|
-
* HTML custom React components.
|
|
5018
|
-
*/
|
|
5019
|
-
typeof Component !== "string" ||
|
|
5020
|
-
/**
|
|
5021
|
-
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
5022
|
-
*/
|
|
5023
|
-
Component.includes("-")) {
|
|
5024
|
-
return false;
|
|
5025
|
-
}
|
|
5026
|
-
else if (
|
|
5027
|
-
/**
|
|
5028
|
-
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
5029
|
-
*/
|
|
5030
|
-
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
5031
|
-
/**
|
|
5032
|
-
* If it contains a capital letter, it's an SVG component
|
|
5033
|
-
*/
|
|
5034
|
-
/[A-Z]/u.test(Component)) {
|
|
5035
|
-
return true;
|
|
5036
|
-
}
|
|
5037
|
-
return false;
|
|
5038
|
-
}
|
|
5039
|
-
|
|
5040
6136
|
const dashKeys = {
|
|
5041
6137
|
offset: "stroke-dashoffset",
|
|
5042
6138
|
array: "stroke-dasharray",
|
|
@@ -5071,7 +6167,7 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
5071
6167
|
*/
|
|
5072
6168
|
function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0,
|
|
5073
6169
|
// This is object creation, which we try to avoid per-frame.
|
|
5074
|
-
...latest }, isSVGTag, transformTemplate) {
|
|
6170
|
+
...latest }, isSVGTag, transformTemplate, styleProp) {
|
|
5075
6171
|
buildHTMLStyles(state, latest, transformTemplate);
|
|
5076
6172
|
/**
|
|
5077
6173
|
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
|
|
@@ -5103,7 +6199,7 @@ function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing
|
|
|
5103
6199
|
* SVG's element transform-origin uses its own median as a reference.
|
|
5104
6200
|
* Therefore, transformBox becomes a fill-box
|
|
5105
6201
|
*/
|
|
5106
|
-
style.transformBox = "fill-box";
|
|
6202
|
+
style.transformBox = styleProp?.transformBox ?? "fill-box";
|
|
5107
6203
|
delete attrs.transformBox;
|
|
5108
6204
|
}
|
|
5109
6205
|
// Render attrX/attrY/attrScale as attributes
|
|
@@ -5129,7 +6225,7 @@ const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"
|
|
|
5129
6225
|
function useSVGProps(props, visualState, _isStatic, Component) {
|
|
5130
6226
|
const visualProps = useMemo(() => {
|
|
5131
6227
|
const state = createSvgRenderState();
|
|
5132
|
-
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate);
|
|
6228
|
+
buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);
|
|
5133
6229
|
return {
|
|
5134
6230
|
...state.attrs,
|
|
5135
6231
|
style: { ...state.style },
|
|
@@ -5143,6 +6239,65 @@ function useSVGProps(props, visualState, _isStatic, Component) {
|
|
|
5143
6239
|
return visualProps;
|
|
5144
6240
|
}
|
|
5145
6241
|
|
|
6242
|
+
/**
|
|
6243
|
+
* We keep these listed separately as we use the lowercase tag names as part
|
|
6244
|
+
* of the runtime bundle to detect SVG components
|
|
6245
|
+
*/
|
|
6246
|
+
const lowercaseSVGElements = [
|
|
6247
|
+
"animate",
|
|
6248
|
+
"circle",
|
|
6249
|
+
"defs",
|
|
6250
|
+
"desc",
|
|
6251
|
+
"ellipse",
|
|
6252
|
+
"g",
|
|
6253
|
+
"image",
|
|
6254
|
+
"line",
|
|
6255
|
+
"filter",
|
|
6256
|
+
"marker",
|
|
6257
|
+
"mask",
|
|
6258
|
+
"metadata",
|
|
6259
|
+
"path",
|
|
6260
|
+
"pattern",
|
|
6261
|
+
"polygon",
|
|
6262
|
+
"polyline",
|
|
6263
|
+
"rect",
|
|
6264
|
+
"stop",
|
|
6265
|
+
"switch",
|
|
6266
|
+
"symbol",
|
|
6267
|
+
"svg",
|
|
6268
|
+
"text",
|
|
6269
|
+
"tspan",
|
|
6270
|
+
"use",
|
|
6271
|
+
"view",
|
|
6272
|
+
];
|
|
6273
|
+
|
|
6274
|
+
function isSVGComponent(Component) {
|
|
6275
|
+
if (
|
|
6276
|
+
/**
|
|
6277
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
6278
|
+
* HTML custom React components.
|
|
6279
|
+
*/
|
|
6280
|
+
typeof Component !== "string" ||
|
|
6281
|
+
/**
|
|
6282
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
6283
|
+
*/
|
|
6284
|
+
Component.includes("-")) {
|
|
6285
|
+
return false;
|
|
6286
|
+
}
|
|
6287
|
+
else if (
|
|
6288
|
+
/**
|
|
6289
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
6290
|
+
*/
|
|
6291
|
+
lowercaseSVGElements.indexOf(Component) > -1 ||
|
|
6292
|
+
/**
|
|
6293
|
+
* If it contains a capital letter, it's an SVG component
|
|
6294
|
+
*/
|
|
6295
|
+
/[A-Z]/u.test(Component)) {
|
|
6296
|
+
return true;
|
|
6297
|
+
}
|
|
6298
|
+
return false;
|
|
6299
|
+
}
|
|
6300
|
+
|
|
5146
6301
|
function createUseRender(forwardMotionProps = false) {
|
|
5147
6302
|
const useRender = (Component, props, ref, { latestValues }, isStatic) => {
|
|
5148
6303
|
const useVisualProps = isSVGComponent(Component)
|
|
@@ -5454,11 +6609,6 @@ class MotionValue {
|
|
|
5454
6609
|
* - `transformer`: A function to transform incoming values with.
|
|
5455
6610
|
*/
|
|
5456
6611
|
constructor(init, options = {}) {
|
|
5457
|
-
/**
|
|
5458
|
-
* This will be replaced by the build step with the latest version number.
|
|
5459
|
-
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
5460
|
-
*/
|
|
5461
|
-
this.version = "__VERSION__";
|
|
5462
6612
|
/**
|
|
5463
6613
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
5464
6614
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -5486,6 +6636,11 @@ class MotionValue {
|
|
|
5486
6636
|
// Update update subscribers
|
|
5487
6637
|
if (this.current !== this.prev) {
|
|
5488
6638
|
this.events.change?.notify(this.current);
|
|
6639
|
+
if (this.dependents) {
|
|
6640
|
+
for (const dependent of this.dependents) {
|
|
6641
|
+
dependent.dirty();
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
5489
6644
|
}
|
|
5490
6645
|
// Update render subscribers
|
|
5491
6646
|
if (render) {
|
|
@@ -5627,6 +6782,20 @@ class MotionValue {
|
|
|
5627
6782
|
if (this.stopPassiveEffect)
|
|
5628
6783
|
this.stopPassiveEffect();
|
|
5629
6784
|
}
|
|
6785
|
+
dirty() {
|
|
6786
|
+
this.events.change?.notify(this.current);
|
|
6787
|
+
}
|
|
6788
|
+
addDependent(dependent) {
|
|
6789
|
+
if (!this.dependents) {
|
|
6790
|
+
this.dependents = new Set();
|
|
6791
|
+
}
|
|
6792
|
+
this.dependents.add(dependent);
|
|
6793
|
+
}
|
|
6794
|
+
removeDependent(dependent) {
|
|
6795
|
+
if (this.dependents) {
|
|
6796
|
+
this.dependents.delete(dependent);
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
5630
6799
|
/**
|
|
5631
6800
|
* Returns the latest state of `MotionValue`
|
|
5632
6801
|
*
|
|
@@ -5722,6 +6891,7 @@ class MotionValue {
|
|
|
5722
6891
|
* @public
|
|
5723
6892
|
*/
|
|
5724
6893
|
destroy() {
|
|
6894
|
+
this.dependents?.clear();
|
|
5725
6895
|
this.events.destroy?.notify();
|
|
5726
6896
|
this.clearListeners();
|
|
5727
6897
|
this.stop();
|
|
@@ -6301,7 +7471,7 @@ function mix(from, to, p) {
|
|
|
6301
7471
|
const frameloopDriver = (update) => {
|
|
6302
7472
|
const passTimestamp = ({ timestamp }) => update(timestamp);
|
|
6303
7473
|
return {
|
|
6304
|
-
start: () => frame.update(passTimestamp,
|
|
7474
|
+
start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
|
|
6305
7475
|
stop: () => cancelFrame(passTimestamp),
|
|
6306
7476
|
/**
|
|
6307
7477
|
* If we're processing this frame we can use the
|
|
@@ -6760,7 +7930,7 @@ function createMixers(output, ease, customMixer) {
|
|
|
6760
7930
|
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
|
|
6761
7931
|
* ```
|
|
6762
7932
|
*
|
|
6763
|
-
* TODO
|
|
7933
|
+
* TODO Revisit this approach once we've moved to data models for values,
|
|
6764
7934
|
* probably not needed to pregenerate mixer functions.
|
|
6765
7935
|
*
|
|
6766
7936
|
* @public
|
|
@@ -6995,14 +8165,12 @@ function replaceTransitionType(transition) {
|
|
|
6995
8165
|
|
|
6996
8166
|
class WithPromise {
|
|
6997
8167
|
constructor() {
|
|
6998
|
-
this.count = 0;
|
|
6999
8168
|
this.updateFinished();
|
|
7000
8169
|
}
|
|
7001
8170
|
get finished() {
|
|
7002
8171
|
return this._finished;
|
|
7003
8172
|
}
|
|
7004
8173
|
updateFinished() {
|
|
7005
|
-
this.count++;
|
|
7006
8174
|
this._finished = new Promise((resolve) => {
|
|
7007
8175
|
this.resolve = resolve;
|
|
7008
8176
|
});
|
|
@@ -7043,17 +8211,18 @@ class JSAnimation extends WithPromise {
|
|
|
7043
8211
|
* This method is bound to the instance to fix a pattern where
|
|
7044
8212
|
* animation.stop is returned as a reference from a useEffect.
|
|
7045
8213
|
*/
|
|
7046
|
-
this.stop = () => {
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
8214
|
+
this.stop = (sync = true) => {
|
|
8215
|
+
if (sync) {
|
|
8216
|
+
const { motionValue } = this.options;
|
|
8217
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
8218
|
+
this.tick(time.now());
|
|
8219
|
+
}
|
|
7050
8220
|
}
|
|
7051
8221
|
this.isStopped = true;
|
|
7052
8222
|
if (this.state === "idle")
|
|
7053
8223
|
return;
|
|
7054
8224
|
this.teardown();
|
|
7055
|
-
|
|
7056
|
-
onStop && onStop();
|
|
8225
|
+
this.options.onStop?.();
|
|
7057
8226
|
};
|
|
7058
8227
|
this.options = options;
|
|
7059
8228
|
this.initAnimation();
|
|
@@ -7253,6 +8422,7 @@ class JSAnimation extends WithPromise {
|
|
|
7253
8422
|
else if (this.driver) {
|
|
7254
8423
|
this.startTime = this.driver.now() - newTime / this.playbackSpeed;
|
|
7255
8424
|
}
|
|
8425
|
+
this.driver?.start(false);
|
|
7256
8426
|
}
|
|
7257
8427
|
get speed() {
|
|
7258
8428
|
return this.playbackSpeed;
|
|
@@ -7268,11 +8438,11 @@ class JSAnimation extends WithPromise {
|
|
|
7268
8438
|
play() {
|
|
7269
8439
|
if (this.isStopped)
|
|
7270
8440
|
return;
|
|
7271
|
-
const { driver = frameloopDriver,
|
|
8441
|
+
const { driver = frameloopDriver, startTime } = this.options;
|
|
7272
8442
|
if (!this.driver) {
|
|
7273
8443
|
this.driver = driver((timestamp) => this.tick(timestamp));
|
|
7274
8444
|
}
|
|
7275
|
-
onPlay
|
|
8445
|
+
this.options.onPlay?.();
|
|
7276
8446
|
const now = this.driver.now();
|
|
7277
8447
|
if (this.state === "finished") {
|
|
7278
8448
|
this.updateFinished();
|
|
@@ -7308,19 +8478,19 @@ class JSAnimation extends WithPromise {
|
|
|
7308
8478
|
this.holdTime = null;
|
|
7309
8479
|
}
|
|
7310
8480
|
finish() {
|
|
8481
|
+
this.notifyFinished();
|
|
7311
8482
|
this.teardown();
|
|
7312
8483
|
this.state = "finished";
|
|
7313
|
-
|
|
7314
|
-
onComplete && onComplete();
|
|
8484
|
+
this.options.onComplete?.();
|
|
7315
8485
|
}
|
|
7316
8486
|
cancel() {
|
|
7317
8487
|
this.holdTime = null;
|
|
7318
8488
|
this.startTime = 0;
|
|
7319
8489
|
this.tick(0);
|
|
7320
8490
|
this.teardown();
|
|
8491
|
+
this.options.onCancel?.();
|
|
7321
8492
|
}
|
|
7322
8493
|
teardown() {
|
|
7323
|
-
this.notifyFinished();
|
|
7324
8494
|
this.state = "idle";
|
|
7325
8495
|
this.stopDriver();
|
|
7326
8496
|
this.startTime = this.holdTime = null;
|
|
@@ -7341,6 +8511,7 @@ class JSAnimation extends WithPromise {
|
|
|
7341
8511
|
this.options.ease = "linear";
|
|
7342
8512
|
this.initAnimation();
|
|
7343
8513
|
}
|
|
8514
|
+
this.driver?.stop();
|
|
7344
8515
|
return timeline.observe(this);
|
|
7345
8516
|
}
|
|
7346
8517
|
}
|
|
@@ -7525,11 +8696,7 @@ function flushKeyframeResolvers() {
|
|
|
7525
8696
|
}
|
|
7526
8697
|
class KeyframeResolver {
|
|
7527
8698
|
constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {
|
|
7528
|
-
|
|
7529
|
-
* Track whether this resolver has completed. Once complete, it never
|
|
7530
|
-
* needs to attempt keyframe resolution again.
|
|
7531
|
-
*/
|
|
7532
|
-
this.isComplete = false;
|
|
8699
|
+
this.state = "pending";
|
|
7533
8700
|
/**
|
|
7534
8701
|
* Track whether this resolver is async. If it is, it'll be added to the
|
|
7535
8702
|
* resolver queue and flushed in the next frame. Resolvers that aren't going
|
|
@@ -7541,11 +8708,6 @@ class KeyframeResolver {
|
|
|
7541
8708
|
* to resolve its keyframes.
|
|
7542
8709
|
*/
|
|
7543
8710
|
this.needsMeasurement = false;
|
|
7544
|
-
/**
|
|
7545
|
-
* Track whether this resolver is currently scheduled to resolve
|
|
7546
|
-
* to allow it to be cancelled and resumed externally.
|
|
7547
|
-
*/
|
|
7548
|
-
this.isScheduled = false;
|
|
7549
8711
|
this.unresolvedKeyframes = [...unresolvedKeyframes];
|
|
7550
8712
|
this.onComplete = onComplete;
|
|
7551
8713
|
this.name = name;
|
|
@@ -7554,7 +8716,7 @@ class KeyframeResolver {
|
|
|
7554
8716
|
this.isAsync = isAsync;
|
|
7555
8717
|
}
|
|
7556
8718
|
scheduleResolve() {
|
|
7557
|
-
this.
|
|
8719
|
+
this.state = "scheduled";
|
|
7558
8720
|
if (this.isAsync) {
|
|
7559
8721
|
toResolve.add(this);
|
|
7560
8722
|
if (!isScheduled) {
|
|
@@ -7597,19 +8759,19 @@ class KeyframeResolver {
|
|
|
7597
8759
|
measureInitialState() { }
|
|
7598
8760
|
renderEndStyles() { }
|
|
7599
8761
|
measureEndState() { }
|
|
7600
|
-
complete(
|
|
7601
|
-
this.
|
|
7602
|
-
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe,
|
|
8762
|
+
complete(isForcedComplete = false) {
|
|
8763
|
+
this.state = "complete";
|
|
8764
|
+
this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);
|
|
7603
8765
|
toResolve.delete(this);
|
|
7604
8766
|
}
|
|
7605
8767
|
cancel() {
|
|
7606
|
-
if (
|
|
7607
|
-
this.isScheduled = false;
|
|
8768
|
+
if (this.state === "scheduled") {
|
|
7608
8769
|
toResolve.delete(this);
|
|
8770
|
+
this.state = "pending";
|
|
7609
8771
|
}
|
|
7610
8772
|
}
|
|
7611
8773
|
resume() {
|
|
7612
|
-
if (
|
|
8774
|
+
if (this.state === "pending")
|
|
7613
8775
|
this.scheduleResolve();
|
|
7614
8776
|
}
|
|
7615
8777
|
}
|
|
@@ -7772,10 +8934,6 @@ class NativeAnimation extends WithPromise {
|
|
|
7772
8934
|
onComplete?.();
|
|
7773
8935
|
this.notifyFinished();
|
|
7774
8936
|
};
|
|
7775
|
-
/**
|
|
7776
|
-
* TODO: In a breaking change, we should replace this with `.notifyCancel()`
|
|
7777
|
-
*/
|
|
7778
|
-
this.animation.oncancel = () => this.notifyFinished();
|
|
7779
8937
|
}
|
|
7780
8938
|
play() {
|
|
7781
8939
|
if (this.isStopped)
|
|
@@ -8029,16 +9187,13 @@ const acceleratedValues = new Set([
|
|
|
8029
9187
|
"clipPath",
|
|
8030
9188
|
"filter",
|
|
8031
9189
|
"transform",
|
|
8032
|
-
// TODO:
|
|
8033
|
-
// or until we implement support for linear() easing.
|
|
9190
|
+
// TODO: Could be re-enabled now we have support for linear() easing
|
|
8034
9191
|
// "background-color"
|
|
8035
9192
|
]);
|
|
8036
9193
|
const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
8037
9194
|
function supportsBrowserAnimation(options) {
|
|
8038
9195
|
const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
|
|
8039
|
-
if (!motionValue
|
|
8040
|
-
!motionValue.owner ||
|
|
8041
|
-
!(motionValue.owner.current instanceof HTMLElement)) {
|
|
9196
|
+
if (!isHTMLElement$1(motionValue?.owner?.current)) {
|
|
8042
9197
|
return false;
|
|
8043
9198
|
}
|
|
8044
9199
|
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
|
|
@@ -8077,9 +9232,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8077
9232
|
this._animation.stop();
|
|
8078
9233
|
this.stopTimeline?.();
|
|
8079
9234
|
}
|
|
8080
|
-
|
|
8081
|
-
this.keyframeResolver?.cancel();
|
|
8082
|
-
}
|
|
9235
|
+
this.keyframeResolver?.cancel();
|
|
8083
9236
|
};
|
|
8084
9237
|
this.createdAt = time.now();
|
|
8085
9238
|
const optionsWithDefaults = {
|
|
@@ -8170,6 +9323,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8170
9323
|
}
|
|
8171
9324
|
get animation() {
|
|
8172
9325
|
if (!this._animation) {
|
|
9326
|
+
this.keyframeResolver?.resume();
|
|
8173
9327
|
flushKeyframeResolvers();
|
|
8174
9328
|
}
|
|
8175
9329
|
return this._animation;
|
|
@@ -8214,7 +9368,10 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
8214
9368
|
this.animation.complete();
|
|
8215
9369
|
}
|
|
8216
9370
|
cancel() {
|
|
8217
|
-
this.
|
|
9371
|
+
if (this._animation) {
|
|
9372
|
+
this.animation.cancel();
|
|
9373
|
+
}
|
|
9374
|
+
this.keyframeResolver?.cancel();
|
|
8218
9375
|
}
|
|
8219
9376
|
}
|
|
8220
9377
|
|
|
@@ -8304,7 +9461,9 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
8304
9461
|
return;
|
|
8305
9462
|
}
|
|
8306
9463
|
}
|
|
8307
|
-
return
|
|
9464
|
+
return valueTransition.isSync
|
|
9465
|
+
? new JSAnimation(options)
|
|
9466
|
+
: new AsyncMotionValueAnimation(options);
|
|
8308
9467
|
};
|
|
8309
9468
|
|
|
8310
9469
|
const positionalKeys = new Set([
|
|
@@ -10175,7 +11334,7 @@ class MeasureLayoutWithContext extends Component {
|
|
|
10175
11334
|
}
|
|
10176
11335
|
getSnapshotBeforeUpdate(prevProps) {
|
|
10177
11336
|
const { layoutDependency, visualElement, drag, isPresent } = this.props;
|
|
10178
|
-
const projection = visualElement
|
|
11337
|
+
const { projection } = visualElement;
|
|
10179
11338
|
if (!projection)
|
|
10180
11339
|
return null;
|
|
10181
11340
|
/**
|
|
@@ -10273,10 +11432,6 @@ function animateSingleValue(value, keyframes, options) {
|
|
|
10273
11432
|
return motionValue$1.animation;
|
|
10274
11433
|
}
|
|
10275
11434
|
|
|
10276
|
-
function isSVGElement(element) {
|
|
10277
|
-
return element instanceof SVGElement && element.tagName !== "svg";
|
|
10278
|
-
}
|
|
10279
|
-
|
|
10280
11435
|
const compareByDepth = (a, b) => a.depth - b.depth;
|
|
10281
11436
|
|
|
10282
11437
|
class FlatTree {
|
|
@@ -10663,6 +11818,22 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
|
|
|
10663
11818
|
return transform || "none";
|
|
10664
11819
|
}
|
|
10665
11820
|
|
|
11821
|
+
/**
|
|
11822
|
+
* Checks if an element is an SVG element in a way
|
|
11823
|
+
* that works across iframes
|
|
11824
|
+
*/
|
|
11825
|
+
function isSVGElement(element) {
|
|
11826
|
+
return isObject$1(element) && "ownerSVGElement" in element;
|
|
11827
|
+
}
|
|
11828
|
+
|
|
11829
|
+
/**
|
|
11830
|
+
* Checks if an element is specifically an SVGSVGElement (the root SVG element)
|
|
11831
|
+
* in a way that works across iframes
|
|
11832
|
+
*/
|
|
11833
|
+
function isSVGSVGElement(element) {
|
|
11834
|
+
return isSVGElement(element) && element.tagName === "svg";
|
|
11835
|
+
}
|
|
11836
|
+
|
|
10666
11837
|
const transformAxes = ["", "X", "Y", "Z"];
|
|
10667
11838
|
const hiddenVisibility = { visibility: "hidden" };
|
|
10668
11839
|
/**
|
|
@@ -10856,10 +12027,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10856
12027
|
/**
|
|
10857
12028
|
* Lifecycles
|
|
10858
12029
|
*/
|
|
10859
|
-
mount(instance
|
|
12030
|
+
mount(instance) {
|
|
10860
12031
|
if (this.instance)
|
|
10861
12032
|
return;
|
|
10862
|
-
this.isSVG = isSVGElement(instance);
|
|
12033
|
+
this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);
|
|
10863
12034
|
this.instance = instance;
|
|
10864
12035
|
const { layoutId, layout, visualElement } = this.options;
|
|
10865
12036
|
if (visualElement && !visualElement.current) {
|
|
@@ -10867,7 +12038,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
10867
12038
|
}
|
|
10868
12039
|
this.root.nodes.add(this);
|
|
10869
12040
|
this.parent && this.parent.children.add(this);
|
|
10870
|
-
if (
|
|
12041
|
+
if (this.root.hasTreeAnimated && (layout || layoutId)) {
|
|
10871
12042
|
this.isLayoutDirty = true;
|
|
10872
12043
|
}
|
|
10873
12044
|
if (attachResizeListener) {
|
|
@@ -11167,7 +12338,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11167
12338
|
this.scroll.phase === phase) {
|
|
11168
12339
|
needsMeasurement = false;
|
|
11169
12340
|
}
|
|
11170
|
-
if (needsMeasurement) {
|
|
12341
|
+
if (needsMeasurement && this.instance) {
|
|
11171
12342
|
const isRoot = checkIsScrollRoot(this.instance);
|
|
11172
12343
|
this.scroll = {
|
|
11173
12344
|
animationId: this.root.animationId,
|
|
@@ -11191,6 +12362,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11191
12362
|
: undefined;
|
|
11192
12363
|
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
|
|
11193
12364
|
if (isResetRequested &&
|
|
12365
|
+
this.instance &&
|
|
11194
12366
|
(hasProjection ||
|
|
11195
12367
|
hasTransform(this.latestValues) ||
|
|
11196
12368
|
transformTemplateHasChanged)) {
|
|
@@ -11662,10 +12834,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11662
12834
|
}
|
|
11663
12835
|
startAnimation(options) {
|
|
11664
12836
|
this.notifyListeners("animationStart");
|
|
11665
|
-
this.currentAnimation
|
|
11666
|
-
|
|
11667
|
-
this.resumingFrom.currentAnimation.stop();
|
|
11668
|
-
}
|
|
12837
|
+
this.currentAnimation?.stop(false);
|
|
12838
|
+
this.resumingFrom?.currentAnimation?.stop(false);
|
|
11669
12839
|
if (this.pendingAnimation) {
|
|
11670
12840
|
cancelFrame(this.pendingAnimation);
|
|
11671
12841
|
this.pendingAnimation = undefined;
|
|
@@ -11677,8 +12847,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11677
12847
|
*/
|
|
11678
12848
|
this.pendingAnimation = frame.update(() => {
|
|
11679
12849
|
globalProjectionState.hasAnimatedSinceResize = true;
|
|
11680
|
-
this.
|
|
12850
|
+
this.motionValue || (this.motionValue = motionValue(0));
|
|
12851
|
+
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {
|
|
11681
12852
|
...options,
|
|
12853
|
+
isSync: true,
|
|
11682
12854
|
onUpdate: (latest) => {
|
|
11683
12855
|
this.mixTargetDelta(latest);
|
|
11684
12856
|
options.onUpdate && options.onUpdate(latest);
|
|
@@ -11712,7 +12884,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11712
12884
|
finishAnimation() {
|
|
11713
12885
|
if (this.currentAnimation) {
|
|
11714
12886
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
11715
|
-
this.currentAnimation.stop();
|
|
12887
|
+
this.currentAnimation.stop(false);
|
|
11716
12888
|
}
|
|
11717
12889
|
this.completeAnimation();
|
|
11718
12890
|
}
|
|
@@ -11977,7 +13149,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
11977
13149
|
}
|
|
11978
13150
|
// Only run on root
|
|
11979
13151
|
resetTree() {
|
|
11980
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
13152
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop(false));
|
|
11981
13153
|
this.root.nodes.forEach(clearMeasurements);
|
|
11982
13154
|
this.root.sharedNodes.clear();
|
|
11983
13155
|
}
|
|
@@ -12449,17 +13621,19 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12449
13621
|
const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);
|
|
12450
13622
|
const startPress = (startEvent) => {
|
|
12451
13623
|
const target = startEvent.currentTarget;
|
|
12452
|
-
if (!isValidPressEvent(startEvent)
|
|
13624
|
+
if (!isValidPressEvent(startEvent))
|
|
12453
13625
|
return;
|
|
12454
13626
|
isPressing.add(target);
|
|
12455
13627
|
const onPressEnd = onPressStart(target, startEvent);
|
|
12456
13628
|
const onPointerEnd = (endEvent, success) => {
|
|
12457
13629
|
window.removeEventListener("pointerup", onPointerUp);
|
|
12458
13630
|
window.removeEventListener("pointercancel", onPointerCancel);
|
|
12459
|
-
if (
|
|
13631
|
+
if (isPressing.has(target)) {
|
|
13632
|
+
isPressing.delete(target);
|
|
13633
|
+
}
|
|
13634
|
+
if (!isValidPressEvent(endEvent)) {
|
|
12460
13635
|
return;
|
|
12461
13636
|
}
|
|
12462
|
-
isPressing.delete(target);
|
|
12463
13637
|
if (typeof onPressEnd === "function") {
|
|
12464
13638
|
onPressEnd(endEvent, { success });
|
|
12465
13639
|
}
|
|
@@ -12479,7 +13653,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
|
|
|
12479
13653
|
targets.forEach((target) => {
|
|
12480
13654
|
const pointerDownTarget = options.useGlobalTarget ? window : target;
|
|
12481
13655
|
pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
|
|
12482
|
-
if (target
|
|
13656
|
+
if (isHTMLElement$1(target)) {
|
|
12483
13657
|
target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
|
|
12484
13658
|
if (!isElementKeyboardAccessible(target) &&
|
|
12485
13659
|
!target.hasAttribute("tabindex")) {
|
|
@@ -12983,7 +14157,6 @@ class VisualElement {
|
|
|
12983
14157
|
}
|
|
12984
14158
|
unmount() {
|
|
12985
14159
|
this.projection && this.projection.unmount();
|
|
12986
|
-
this.projection = undefined;
|
|
12987
14160
|
cancelFrame(this.notifyUpdate);
|
|
12988
14161
|
cancelFrame(this.render);
|
|
12989
14162
|
this.valueSubscriptions.forEach((remove) => remove());
|
|
@@ -13418,7 +14591,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
13418
14591
|
}
|
|
13419
14592
|
}
|
|
13420
14593
|
}
|
|
13421
|
-
else {
|
|
14594
|
+
else if (positionalValues[name]) {
|
|
13422
14595
|
/**
|
|
13423
14596
|
* Else, the only way to resolve this is by measuring the element.
|
|
13424
14597
|
*/
|
|
@@ -13534,7 +14707,9 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
13534
14707
|
}
|
|
13535
14708
|
readValueFromInstance(instance, key) {
|
|
13536
14709
|
if (transformProps.has(key)) {
|
|
13537
|
-
return
|
|
14710
|
+
return this.projection?.isProjecting
|
|
14711
|
+
? defaultTransformValue(key)
|
|
14712
|
+
: readTransformValue(instance, key);
|
|
13538
14713
|
}
|
|
13539
14714
|
else {
|
|
13540
14715
|
const computedStyle = getComputedStyle$1(instance);
|
|
@@ -13613,7 +14788,7 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
13613
14788
|
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
|
|
13614
14789
|
}
|
|
13615
14790
|
build(renderState, latestValues, props) {
|
|
13616
|
-
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
|
|
14791
|
+
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);
|
|
13617
14792
|
}
|
|
13618
14793
|
renderInstance(instance, renderState, styleProp, projection) {
|
|
13619
14794
|
renderSVG(instance, renderState, styleProp, projection);
|
|
@@ -14601,15 +15776,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
|
|
|
14601
15776
|
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])))`;
|
|
14602
15777
|
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
14603
15778
|
function timeRegexSource(args) {
|
|
14604
|
-
|
|
14605
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
15779
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
14606
15780
|
if (args.precision) {
|
|
14607
|
-
|
|
15781
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
14608
15782
|
}
|
|
14609
15783
|
else if (args.precision == null) {
|
|
14610
|
-
|
|
15784
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
14611
15785
|
}
|
|
14612
|
-
|
|
15786
|
+
const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
|
|
15787
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
14613
15788
|
}
|
|
14614
15789
|
function timeRegex(args) {
|
|
14615
15790
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -18306,47 +19481,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
18306
19481
|
return result;
|
|
18307
19482
|
};
|
|
18308
19483
|
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
function deepEqual(object1, object2) {
|
|
18312
|
-
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
18313
|
-
return object1 === object2;
|
|
18314
|
-
}
|
|
18315
|
-
if (isDateObject(object1) && isDateObject(object2)) {
|
|
18316
|
-
return object1.getTime() === object2.getTime();
|
|
18317
|
-
}
|
|
18318
|
-
const keys1 = Object.keys(object1);
|
|
18319
|
-
const keys2 = Object.keys(object2);
|
|
18320
|
-
if (keys1.length !== keys2.length) {
|
|
18321
|
-
return false;
|
|
18322
|
-
}
|
|
18323
|
-
for (const key of keys1) {
|
|
18324
|
-
const val1 = object1[key];
|
|
18325
|
-
if (!keys2.includes(key)) {
|
|
18326
|
-
return false;
|
|
18327
|
-
}
|
|
18328
|
-
if (key !== 'ref') {
|
|
18329
|
-
const val2 = object2[key];
|
|
18330
|
-
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
18331
|
-
(isObject(val1) && isObject(val2)) ||
|
|
18332
|
-
(Array.isArray(val1) && Array.isArray(val2))
|
|
18333
|
-
? !deepEqual(val1, val2)
|
|
18334
|
-
: val1 !== val2) {
|
|
18335
|
-
return false;
|
|
18336
|
-
}
|
|
18337
|
-
}
|
|
18338
|
-
}
|
|
18339
|
-
return true;
|
|
18340
|
-
}
|
|
18341
|
-
|
|
18342
|
-
const useDeepEqualEffect = (effect, deps) => {
|
|
18343
|
-
const ref = React.useRef(deps);
|
|
18344
|
-
if (!deepEqual(deps, ref.current)) {
|
|
18345
|
-
ref.current = deps;
|
|
18346
|
-
}
|
|
18347
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18348
|
-
React.useEffect(effect, ref.current);
|
|
18349
|
-
};
|
|
19484
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
18350
19485
|
|
|
18351
19486
|
/**
|
|
18352
19487
|
* 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.
|
|
@@ -18392,7 +19527,7 @@ function useFormState(props) {
|
|
|
18392
19527
|
isValid: false,
|
|
18393
19528
|
errors: false,
|
|
18394
19529
|
});
|
|
18395
|
-
|
|
19530
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18396
19531
|
name: name,
|
|
18397
19532
|
formState: _localProxyFormState.current,
|
|
18398
19533
|
exact,
|
|
@@ -18443,16 +19578,17 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
|
18443
19578
|
function useWatch(props) {
|
|
18444
19579
|
const methods = useFormContext();
|
|
18445
19580
|
const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
|
|
18446
|
-
const
|
|
18447
|
-
|
|
19581
|
+
const _defaultValue = React__default.useRef(defaultValue);
|
|
19582
|
+
const [value, updateValue] = React__default.useState(control._getWatch(name, _defaultValue.current));
|
|
19583
|
+
useIsomorphicLayoutEffect(() => control._subscribe({
|
|
18448
19584
|
name: name,
|
|
18449
19585
|
formState: {
|
|
18450
19586
|
values: true,
|
|
18451
19587
|
},
|
|
18452
19588
|
exact,
|
|
18453
19589
|
callback: (formState) => !disabled &&
|
|
18454
|
-
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false,
|
|
18455
|
-
}), [name,
|
|
19590
|
+
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current)),
|
|
19591
|
+
}), [name, control, disabled, exact]);
|
|
18456
19592
|
React__default.useEffect(() => control._removeUnmounted());
|
|
18457
19593
|
return value;
|
|
18458
19594
|
}
|
|
@@ -18687,6 +19823,39 @@ var createSubject = () => {
|
|
|
18687
19823
|
};
|
|
18688
19824
|
};
|
|
18689
19825
|
|
|
19826
|
+
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
19827
|
+
|
|
19828
|
+
function deepEqual(object1, object2) {
|
|
19829
|
+
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
19830
|
+
return object1 === object2;
|
|
19831
|
+
}
|
|
19832
|
+
if (isDateObject(object1) && isDateObject(object2)) {
|
|
19833
|
+
return object1.getTime() === object2.getTime();
|
|
19834
|
+
}
|
|
19835
|
+
const keys1 = Object.keys(object1);
|
|
19836
|
+
const keys2 = Object.keys(object2);
|
|
19837
|
+
if (keys1.length !== keys2.length) {
|
|
19838
|
+
return false;
|
|
19839
|
+
}
|
|
19840
|
+
for (const key of keys1) {
|
|
19841
|
+
const val1 = object1[key];
|
|
19842
|
+
if (!keys2.includes(key)) {
|
|
19843
|
+
return false;
|
|
19844
|
+
}
|
|
19845
|
+
if (key !== 'ref') {
|
|
19846
|
+
const val2 = object2[key];
|
|
19847
|
+
if ((isDateObject(val1) && isDateObject(val2)) ||
|
|
19848
|
+
(isObject(val1) && isObject(val2)) ||
|
|
19849
|
+
(Array.isArray(val1) && Array.isArray(val2))
|
|
19850
|
+
? !deepEqual(val1, val2)
|
|
19851
|
+
: val1 !== val2) {
|
|
19852
|
+
return false;
|
|
19853
|
+
}
|
|
19854
|
+
}
|
|
19855
|
+
}
|
|
19856
|
+
return true;
|
|
19857
|
+
}
|
|
19858
|
+
|
|
18690
19859
|
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
18691
19860
|
|
|
18692
19861
|
var isFileInput = (element) => element.type === 'file';
|
|
@@ -19250,7 +20419,7 @@ function createFormControl(props = {}) {
|
|
|
19250
20419
|
};
|
|
19251
20420
|
const _fields = {};
|
|
19252
20421
|
let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
|
|
19253
|
-
? cloneObject(_options.
|
|
20422
|
+
? cloneObject(_options.defaultValues || _options.values) || {}
|
|
19254
20423
|
: {};
|
|
19255
20424
|
let _formValues = _options.shouldUnregister
|
|
19256
20425
|
? {}
|
|
@@ -19285,8 +20454,6 @@ function createFormControl(props = {}) {
|
|
|
19285
20454
|
array: createSubject(),
|
|
19286
20455
|
state: createSubject(),
|
|
19287
20456
|
};
|
|
19288
|
-
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
|
19289
|
-
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
|
19290
20457
|
const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
|
|
19291
20458
|
const debounce = (callback) => (wait) => {
|
|
19292
20459
|
clearTimeout(timer);
|
|
@@ -19557,13 +20724,17 @@ function createFormControl(props = {}) {
|
|
|
19557
20724
|
}
|
|
19558
20725
|
else if (fieldReference.refs) {
|
|
19559
20726
|
if (isCheckBoxInput(fieldReference.ref)) {
|
|
19560
|
-
fieldReference.refs.
|
|
19561
|
-
|
|
19562
|
-
(
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
20727
|
+
fieldReference.refs.forEach((checkboxRef) => {
|
|
20728
|
+
if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
|
|
20729
|
+
if (Array.isArray(fieldValue)) {
|
|
20730
|
+
checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
|
|
20731
|
+
}
|
|
20732
|
+
else {
|
|
20733
|
+
checkboxRef.checked =
|
|
20734
|
+
fieldValue === checkboxRef.value || !!fieldValue;
|
|
20735
|
+
}
|
|
20736
|
+
}
|
|
20737
|
+
});
|
|
19567
20738
|
}
|
|
19568
20739
|
else {
|
|
19569
20740
|
fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));
|
|
@@ -19589,6 +20760,9 @@ function createFormControl(props = {}) {
|
|
|
19589
20760
|
};
|
|
19590
20761
|
const setValues = (name, value, options) => {
|
|
19591
20762
|
for (const fieldKey in value) {
|
|
20763
|
+
if (!value.hasOwnProperty(fieldKey)) {
|
|
20764
|
+
return;
|
|
20765
|
+
}
|
|
19592
20766
|
const fieldValue = value[fieldKey];
|
|
19593
20767
|
const fieldName = `${name}.${fieldKey}`;
|
|
19594
20768
|
const field = get(_fields, fieldName);
|
|
@@ -19645,6 +20819,8 @@ function createFormControl(props = {}) {
|
|
|
19645
20819
|
(isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||
|
|
19646
20820
|
deepEqual(fieldValue, get(_formValues, name, fieldValue));
|
|
19647
20821
|
};
|
|
20822
|
+
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
|
20823
|
+
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
|
19648
20824
|
if (field) {
|
|
19649
20825
|
let error;
|
|
19650
20826
|
let isValid;
|
|
@@ -20255,7 +21431,6 @@ function createFormControl(props = {}) {
|
|
|
20255
21431
|
};
|
|
20256
21432
|
}
|
|
20257
21433
|
|
|
20258
|
-
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
|
20259
21434
|
/**
|
|
20260
21435
|
* Custom hook to manage the entire form.
|
|
20261
21436
|
*
|
|
@@ -21602,21 +22777,21 @@ const getDefaultConfig = () => {
|
|
|
21602
22777
|
* @see https://tailwindcss.com/docs/height
|
|
21603
22778
|
*/
|
|
21604
22779
|
h: [{
|
|
21605
|
-
h: ['screen', ...scaleSizing()]
|
|
22780
|
+
h: ['screen', 'lh', ...scaleSizing()]
|
|
21606
22781
|
}],
|
|
21607
22782
|
/**
|
|
21608
22783
|
* Min-Height
|
|
21609
22784
|
* @see https://tailwindcss.com/docs/min-height
|
|
21610
22785
|
*/
|
|
21611
22786
|
'min-h': [{
|
|
21612
|
-
'min-h': ['screen', 'none', ...scaleSizing()]
|
|
22787
|
+
'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
|
|
21613
22788
|
}],
|
|
21614
22789
|
/**
|
|
21615
22790
|
* Max-Height
|
|
21616
22791
|
* @see https://tailwindcss.com/docs/max-height
|
|
21617
22792
|
*/
|
|
21618
22793
|
'max-h': [{
|
|
21619
|
-
'max-h': ['screen', ...scaleSizing()]
|
|
22794
|
+
'max-h': ['screen', 'lh', ...scaleSizing()]
|
|
21620
22795
|
}],
|
|
21621
22796
|
// ------------------
|
|
21622
22797
|
// --- Typography ---
|
|
@@ -23415,7 +24590,7 @@ function FormMessage(_a) {
|
|
|
23415
24590
|
|
|
23416
24591
|
function Input(_a) {
|
|
23417
24592
|
var { className, type } = _a, props = __rest(_a, ["className", "type"]);
|
|
23418
|
-
return (React.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-
|
|
24593
|
+
return (React.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)));
|
|
23419
24594
|
}
|
|
23420
24595
|
|
|
23421
24596
|
function InputGroup(_a) {
|
|
@@ -23481,9 +24656,9 @@ const buttonVariants = cva("inline-flex cursor-pointer items-center justify-cent
|
|
|
23481
24656
|
},
|
|
23482
24657
|
size: {
|
|
23483
24658
|
link: "p-0 h-auto",
|
|
23484
|
-
default: "h-
|
|
24659
|
+
default: "h-10 px-4 py-2 has-[>svg]:px-3",
|
|
23485
24660
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
23486
|
-
lg: "h-
|
|
24661
|
+
lg: "h-12 rounded-md px-6 has-[>svg]:px-4",
|
|
23487
24662
|
icon: "size-9",
|
|
23488
24663
|
},
|
|
23489
24664
|
},
|
|
@@ -28847,7 +30022,7 @@ function requireCurrencies () {
|
|
|
28847
30022
|
name: 'Lesotho loti',
|
|
28848
30023
|
number: '426'
|
|
28849
30024
|
}, {
|
|
28850
|
-
code: '
|
|
30025
|
+
code: 'LTL',
|
|
28851
30026
|
decimals: 2,
|
|
28852
30027
|
name: 'Lithuanian litas',
|
|
28853
30028
|
number: '440'
|
|
@@ -32947,12 +34122,12 @@ function requireReactStripe_umd () {
|
|
|
32947
34122
|
|
|
32948
34123
|
stripe._registerWrapper({
|
|
32949
34124
|
name: 'react-stripe-js',
|
|
32950
|
-
version: "3.
|
|
34125
|
+
version: "3.7.0"
|
|
32951
34126
|
});
|
|
32952
34127
|
|
|
32953
34128
|
stripe.registerAppInfo({
|
|
32954
34129
|
name: 'react-stripe-js',
|
|
32955
|
-
version: "3.
|
|
34130
|
+
version: "3.7.0",
|
|
32956
34131
|
url: 'https://stripe.com/docs/stripe-js/react'
|
|
32957
34132
|
});
|
|
32958
34133
|
};
|
|
@@ -33195,20 +34370,24 @@ function requireReactStripe_umd () {
|
|
|
33195
34370
|
}, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes
|
|
33196
34371
|
|
|
33197
34372
|
var prevOptions = usePrevious(options);
|
|
34373
|
+
var prevCheckoutSdk = usePrevious(ctx.checkoutSdk);
|
|
33198
34374
|
React.useEffect(function () {
|
|
33199
34375
|
var _prevOptions$elements, _options$elementsOpti;
|
|
33200
34376
|
|
|
34377
|
+
// Ignore changes while checkout sdk is not initialized.
|
|
33201
34378
|
if (!ctx.checkoutSdk) {
|
|
33202
34379
|
return;
|
|
33203
34380
|
}
|
|
33204
34381
|
|
|
33205
34382
|
var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;
|
|
33206
34383
|
var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;
|
|
34384
|
+
var hasAppearanceChanged = !isEqual(currentAppearance, previousAppearance);
|
|
34385
|
+
var hasSdkLoaded = !prevCheckoutSdk && ctx.checkoutSdk;
|
|
33207
34386
|
|
|
33208
|
-
if (currentAppearance &&
|
|
34387
|
+
if (currentAppearance && (hasAppearanceChanged || hasSdkLoaded)) {
|
|
33209
34388
|
ctx.checkoutSdk.changeAppearance(currentAppearance);
|
|
33210
34389
|
}
|
|
33211
|
-
}, [options, prevOptions, ctx.checkoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
34390
|
+
}, [options, prevOptions, ctx.checkoutSdk, prevCheckoutSdk]); // Attach react-stripe-js version to stripe.js instance
|
|
33212
34391
|
|
|
33213
34392
|
React.useEffect(function () {
|
|
33214
34393
|
registerWithStripeJs(ctx.stripe);
|
|
@@ -34242,7 +35421,7 @@ const motionSettings = {
|
|
|
34242
35421
|
exit: { opacity: 0 },
|
|
34243
35422
|
transition: { duration: 0.2 },
|
|
34244
35423
|
};
|
|
34245
|
-
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, }) {
|
|
35424
|
+
function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, setCheckout, }) {
|
|
34246
35425
|
const { formData, setFormData, step, setStep, checkoutId: storedCheckoutId, setCheckoutId, } = useFormStore();
|
|
34247
35426
|
const [paymentSecret, setPaymentSecret] = useState(null);
|
|
34248
35427
|
const [publicKey, setPublicKey] = useState(null);
|
|
@@ -34378,10 +35557,11 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34378
35557
|
name: data.name,
|
|
34379
35558
|
},
|
|
34380
35559
|
});
|
|
34381
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35560
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34382
35561
|
setPaymentSecret(paymentSecret);
|
|
34383
35562
|
setPublicKey(publicKey);
|
|
34384
35563
|
setShippingCost(data.price);
|
|
35564
|
+
setCheckout(newCheckout);
|
|
34385
35565
|
setStep("payment");
|
|
34386
35566
|
});
|
|
34387
35567
|
// Navigate back to previous step
|
|
@@ -34399,9 +35579,10 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
34399
35579
|
};
|
|
34400
35580
|
useEffect(() => {
|
|
34401
35581
|
const asyncFunc = () => __awaiter(this, void 0, void 0, function* () {
|
|
34402
|
-
const { paymentSecret, publicKey } = yield storeClient.
|
|
35582
|
+
const { paymentSecret, publicKey, checkoutSession: newCheckout, } = yield storeClient.generateCheckoutPaymentSecret(clientSecret, checkoutId);
|
|
34403
35583
|
setPaymentSecret(paymentSecret);
|
|
34404
35584
|
setPublicKey(publicKey);
|
|
35585
|
+
setCheckout(newCheckout);
|
|
34405
35586
|
});
|
|
34406
35587
|
if (!paymentSecret && step === "payment") {
|
|
34407
35588
|
asyncFunc();
|
|
@@ -34428,26 +35609,66 @@ function CheckoutFormLoading() {
|
|
|
34428
35609
|
React__default.createElement(InputGroupLoading, { className: "md:col-span-2" }),
|
|
34429
35610
|
React__default.createElement(InputGroupLoading, null),
|
|
34430
35611
|
React__default.createElement("div", { className: "flex md:col-span-2 justify-end pt-2" },
|
|
34431
|
-
React__default.createElement(Skeleton, { className: "w-32 h-
|
|
35612
|
+
React__default.createElement(Skeleton, { className: "w-32 h-10" }))));
|
|
34432
35613
|
}
|
|
34433
35614
|
function InputGroupLoading({ className }) {
|
|
34434
35615
|
return (React__default.createElement("div", { className: clsx("flex flex-col gap-2", className) },
|
|
34435
35616
|
React__default.createElement(Skeleton, { className: "w-10 h-3" }),
|
|
34436
|
-
React__default.createElement(Skeleton, { className: "w-full h-
|
|
35617
|
+
React__default.createElement(Skeleton, { className: "w-full h-10" })));
|
|
34437
35618
|
}
|
|
34438
35619
|
|
|
34439
|
-
function
|
|
34440
|
-
|
|
35620
|
+
function DiscountCode({ applyDiscountCode, revalidateDiscounts, }) {
|
|
35621
|
+
const { t } = useTranslation();
|
|
35622
|
+
const [discountCode, setDiscountCode] = useState("");
|
|
35623
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
35624
|
+
const [error, setError] = useState(null);
|
|
35625
|
+
const isValid = discountCode.length > 0;
|
|
35626
|
+
const handleSubmit = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
35627
|
+
e.preventDefault();
|
|
35628
|
+
setIsLoading(true);
|
|
35629
|
+
try {
|
|
35630
|
+
yield applyDiscountCode(discountCode);
|
|
35631
|
+
yield revalidateDiscounts();
|
|
35632
|
+
setDiscountCode("");
|
|
35633
|
+
toast.success(t("CheckoutEmbed.Summary.discountCodeSuccess"));
|
|
35634
|
+
}
|
|
35635
|
+
catch (error) {
|
|
35636
|
+
console.error(error);
|
|
35637
|
+
setError(t("CheckoutEmbed.Summary.discountCodeError"));
|
|
35638
|
+
}
|
|
35639
|
+
finally {
|
|
35640
|
+
setIsLoading(false);
|
|
35641
|
+
}
|
|
35642
|
+
});
|
|
35643
|
+
return (React__default.createElement("form", { className: "pb-1", onSubmit: handleSubmit },
|
|
35644
|
+
React__default.createElement(Label, { className: "text-sm font-medium mb-2" }, "Discount Code"),
|
|
35645
|
+
React__default.createElement("div", { className: "flex items-center gap-2" },
|
|
35646
|
+
React__default.createElement(Input, { "aria-invalid": !!error, value: discountCode, onChange: (e) => {
|
|
35647
|
+
setError("");
|
|
35648
|
+
setDiscountCode(e.target.value);
|
|
35649
|
+
}, name: "discountCode", placeholder: t("CheckoutEmbed.Summary.discountCodePlaceholder") }),
|
|
35650
|
+
React__default.createElement(SubmitButton, { isSubmitting: isLoading, isValid: isValid, type: "submit" }, t("CheckoutEmbed.Summary.discountCodeApply"))),
|
|
35651
|
+
error && React__default.createElement("p", { className: "text-red-500 mt-2 text-sm" }, error)));
|
|
35652
|
+
}
|
|
35653
|
+
|
|
35654
|
+
function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency, onCancel, exchangeRate, applyDiscountCode, revalidateDiscounts, removeDiscount, }) {
|
|
35655
|
+
var _a, _b;
|
|
34441
35656
|
const { formData } = useFormStore();
|
|
34442
35657
|
const [isOpen, setIsOpen] = useState(false);
|
|
34443
35658
|
const { t } = useTranslation();
|
|
34444
35659
|
const subtotal = lineItems.reduce((acc, item) => {
|
|
34445
|
-
var _a;
|
|
34446
|
-
const productItem = item.
|
|
34447
|
-
return acc + ((
|
|
35660
|
+
var _a, _b;
|
|
35661
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35662
|
+
return acc + ((_b = productItem === null || productItem === void 0 ? void 0 : productItem.priceInCents) !== null && _b !== void 0 ? _b : 0) * item.quantity;
|
|
34448
35663
|
}, 0);
|
|
34449
|
-
const shippingPrice = shipping !== null && shipping !== void 0 ? shipping : (_a = formData.shipping) === null || _a === void 0 ? void 0 : _a.price;
|
|
34450
|
-
const total = subtotal + (tax !== null && tax !== void 0 ? tax : 0) +
|
|
35664
|
+
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;
|
|
35665
|
+
const total = subtotal + (tax !== null && tax !== void 0 ? tax : 0) + shippingPrice;
|
|
35666
|
+
const isShippingFree = subtotal > shippingPrice &&
|
|
35667
|
+
appliedDiscounts.some((discount) => discount.discount.type === "FREE_SHIPPING");
|
|
35668
|
+
const filteredDiscounts = appliedDiscounts.filter((discount) => discount.discount.type !== "FREE_SHIPPING");
|
|
35669
|
+
const totalWithDiscounts = total -
|
|
35670
|
+
filteredDiscounts.reduce((acc, { amount }) => acc + amount, 0) -
|
|
35671
|
+
(isShippingFree ? 0 : shippingPrice);
|
|
34451
35672
|
return (React__default.createElement("div", { className: "grid gap-5" },
|
|
34452
35673
|
React__default.createElement("div", { className: "flex justify-between items-center" },
|
|
34453
35674
|
React__default.createElement("div", { onClick: () => setIsOpen(!isOpen), className: "flex items-center gap-2 cursor-pointer" },
|
|
@@ -34458,7 +35679,7 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34458
35679
|
React__default.createElement("p", { className: "font-bold text-lg tracking-tight md:hidden" }, storeHelpers.formatPrice(total, currency, exchangeRate)),
|
|
34459
35680
|
React__default.createElement(Button, { className: "max-sm:hidden", variant: "link", size: "link", onClick: onCancel }, t("CheckoutEmbed.Summary.edit"))),
|
|
34460
35681
|
React__default.createElement("hr", null),
|
|
34461
|
-
React__default.createElement("div", { className: clsx("gap-
|
|
35682
|
+
React__default.createElement("div", { className: clsx("gap-2 order-4 md:order-none", {
|
|
34462
35683
|
"hidden md:grid": !isOpen,
|
|
34463
35684
|
grid: isOpen,
|
|
34464
35685
|
}) },
|
|
@@ -34467,41 +35688,91 @@ function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchang
|
|
|
34467
35688
|
React__default.createElement("p", null, storeHelpers.formatPrice(subtotal, currency, exchangeRate))),
|
|
34468
35689
|
React__default.createElement("div", { className: "flex justify-between" },
|
|
34469
35690
|
React__default.createElement("p", null, t("CheckoutEmbed.Summary.shipping")),
|
|
34470
|
-
React__default.createElement("p", null,
|
|
34471
|
-
?
|
|
34472
|
-
:
|
|
35691
|
+
React__default.createElement("p", null, isShippingFree
|
|
35692
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35693
|
+
: !!shippingPrice
|
|
35694
|
+
? storeHelpers.formatPrice(shippingPrice, currency, exchangeRate)
|
|
35695
|
+
: t("CheckoutEmbed.Summary.calculatedAtNextStep"))),
|
|
34473
35696
|
!!tax && (React__default.createElement("div", { className: "flex justify-between" },
|
|
34474
35697
|
React__default.createElement("p", null, t("CheckoutEmbed.Summary.tax")),
|
|
34475
35698
|
React__default.createElement("p", null, storeHelpers.formatPrice(tax, currency, exchangeRate)))),
|
|
34476
|
-
|
|
35699
|
+
filteredDiscounts.map(({ discount, amount, id }) => {
|
|
35700
|
+
var _a;
|
|
35701
|
+
return (React__default.createElement("div", { key: discount.id, className: "flex not-last:-mb-0.5 justify-between text-muted-foreground" },
|
|
35702
|
+
React__default.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" }),
|
|
35703
|
+
React__default.createElement("p", null,
|
|
35704
|
+
"- ",
|
|
35705
|
+
storeHelpers.formatPrice(amount, currency, exchangeRate))));
|
|
35706
|
+
}),
|
|
35707
|
+
React__default.createElement("div", { className: "flex font-bold justify-between items-center" },
|
|
34477
35708
|
React__default.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34478
|
-
React__default.createElement("p", null, storeHelpers.formatPrice(
|
|
35709
|
+
React__default.createElement("p", null, storeHelpers.formatPrice(totalWithDiscounts, currency, exchangeRate)))),
|
|
35710
|
+
React__default.createElement("hr", { className: clsx("order-7 md:order-none", {
|
|
35711
|
+
"hidden md:block": !isOpen,
|
|
35712
|
+
block: isOpen,
|
|
35713
|
+
}) }),
|
|
35714
|
+
React__default.createElement("div", { className: clsx("gap-0 order-6 md:order-none", {
|
|
35715
|
+
"hidden md:grid": !isOpen,
|
|
35716
|
+
grid: isOpen,
|
|
35717
|
+
}) },
|
|
35718
|
+
React__default.createElement(DiscountCode, { applyDiscountCode: applyDiscountCode, revalidateDiscounts: revalidateDiscounts })),
|
|
34479
35719
|
React__default.createElement("hr", { className: clsx("order-5 md:order-none", {
|
|
34480
35720
|
"hidden md:block": !isOpen,
|
|
34481
35721
|
block: isOpen,
|
|
34482
35722
|
}) }),
|
|
34483
|
-
React__default.createElement("div", { className: clsx("gap-
|
|
35723
|
+
React__default.createElement("div", { className: clsx("gap-0 order-3 md:order-none", {
|
|
34484
35724
|
"hidden md:grid": !isOpen,
|
|
34485
35725
|
grid: isOpen,
|
|
34486
35726
|
}) }, lineItems.map((item, index) => {
|
|
34487
|
-
var _a, _b, _c, _d, _e;
|
|
34488
|
-
const
|
|
35727
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35728
|
+
const productAppliedDiscounts = appliedDiscounts.filter(({ discount }) => discount.allowedProductIDs.includes(item.productData.productId));
|
|
35729
|
+
const discount = productAppliedDiscounts.length > 0
|
|
35730
|
+
? productAppliedDiscounts.reduce((acc, curr) => {
|
|
35731
|
+
return curr.amount > acc.amount ? curr : acc;
|
|
35732
|
+
}, productAppliedDiscounts[0])
|
|
35733
|
+
: null;
|
|
35734
|
+
const isDiscounted = !!discount;
|
|
35735
|
+
const productItem = ((_a = item.productData) === null || _a === void 0 ? void 0 : _a.selectedVariant) || item.productData;
|
|
35736
|
+
const discountedPrice = productItem.priceInCents - ((_b = discount === null || discount === void 0 ? void 0 : discount.amount) !== null && _b !== void 0 ? _b : 0);
|
|
34489
35737
|
return (React__default.createElement("div", { key: index, className: "flex items-center" },
|
|
34490
35738
|
React__default.createElement("div", { className: "relative" },
|
|
34491
35739
|
React__default.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__default.createElement("img", { src: productItem.images[0] ||
|
|
34492
|
-
((
|
|
34493
|
-
"/placeholder.svg", alt: ((
|
|
35740
|
+
((_c = item === null || item === void 0 ? void 0 : item.productData) === null || _c === void 0 ? void 0 : _c.images[0]) ||
|
|
35741
|
+
"/placeholder.svg", alt: ((_d = item.productData) === null || _d === void 0 ? void 0 : _d.title) || "", className: "object-cover w-full h-full", sizes: "64px" }))),
|
|
34494
35742
|
React__default.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)),
|
|
34495
35743
|
React__default.createElement("div", { className: "ml-4 flex-1" },
|
|
34496
|
-
React__default.createElement("h3", { className: "text-lg font-medium" }, (
|
|
35744
|
+
React__default.createElement("h3", { className: "text-lg font-medium" }, (_e = item.productData) === null || _e === void 0 ? void 0 : _e.title),
|
|
34497
35745
|
React__default.createElement("p", { className: "text-muted-foreground text-sm" }, item.variantOptions.map((option) => (React__default.createElement("span", { key: option.name },
|
|
34498
35746
|
option.name,
|
|
34499
35747
|
": ",
|
|
34500
35748
|
option.value))))),
|
|
34501
|
-
React__default.createElement("div", { className: "text-right" },
|
|
34502
|
-
React__default.createElement("p", { className: "text-
|
|
35749
|
+
React__default.createElement("div", { className: "text-right" }, isDiscounted ? (React__default.createElement("div", { className: "flex flex-col" },
|
|
35750
|
+
React__default.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)),
|
|
35751
|
+
React__default.createElement("p", { className: "text-lg font-medium" }, discountedPrice <= 0
|
|
35752
|
+
? t("CheckoutEmbed.Summary.free")
|
|
35753
|
+
: storeHelpers.formatPrice(discountedPrice, currency, exchangeRate)))) : (React__default.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))))));
|
|
34503
35754
|
}))));
|
|
34504
35755
|
}
|
|
35756
|
+
function DiscountItem({ id, removeDiscount, label, canRemove, }) {
|
|
35757
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
35758
|
+
const handleRemove = () => __awaiter(this, void 0, void 0, function* () {
|
|
35759
|
+
setIsLoading(true);
|
|
35760
|
+
try {
|
|
35761
|
+
yield removeDiscount(id);
|
|
35762
|
+
}
|
|
35763
|
+
catch (error) {
|
|
35764
|
+
console.error(error);
|
|
35765
|
+
}
|
|
35766
|
+
finally {
|
|
35767
|
+
setIsLoading(false);
|
|
35768
|
+
}
|
|
35769
|
+
});
|
|
35770
|
+
return (React__default.createElement("div", { className: "flex items-center gap-0.5" },
|
|
35771
|
+
React__default.createElement("p", null, isLoading ? "Removing..." : label),
|
|
35772
|
+
!isLoading && canRemove && (React__default.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" },
|
|
35773
|
+
React__default.createElement(X$2, { className: "size-3" }),
|
|
35774
|
+
React__default.createElement("p", { className: "sr-only" }, "Remove")))));
|
|
35775
|
+
}
|
|
34505
35776
|
|
|
34506
35777
|
function CheckoutSummaryLoading() {
|
|
34507
35778
|
const { t } = useTranslation();
|
|
@@ -34525,7 +35796,11 @@ function CheckoutSummaryLoading() {
|
|
|
34525
35796
|
React__default.createElement("p", null, t("CheckoutEmbed.Summary.total")),
|
|
34526
35797
|
React__default.createElement(Skeleton, { className: "w-24 h-[18px]" }))),
|
|
34527
35798
|
React__default.createElement("hr", { className: "hidden md:block" }),
|
|
34528
|
-
|
|
35799
|
+
React__default.createElement("div", null,
|
|
35800
|
+
React__default.createElement(Skeleton, { className: "w-24 h-5 mb-2" }),
|
|
35801
|
+
React__default.createElement(Skeleton, { className: "h-10 w-full mb-1" })),
|
|
35802
|
+
React__default.createElement("hr", { className: "hidden md:block" }),
|
|
35803
|
+
Array.from({ length: 2 }).map((_, index) => (React__default.createElement("div", { key: index, className: "hidden md:flex items-center" },
|
|
34529
35804
|
React__default.createElement(Skeleton, { className: "rounded-lg size-16" }),
|
|
34530
35805
|
React__default.createElement("div", { className: "ml-4 grid gap-2 flex-1" },
|
|
34531
35806
|
React__default.createElement(Skeleton, { className: "w-28 h-5" }),
|
|
@@ -34535,11 +35810,11 @@ function CheckoutSummaryLoading() {
|
|
|
34535
35810
|
}
|
|
34536
35811
|
|
|
34537
35812
|
function CheckoutEmbed({ checkoutId, config }) {
|
|
34538
|
-
var _a, _b, _c, _d, _e;
|
|
35813
|
+
var _a, _b, _c, _d, _e, _f;
|
|
34539
35814
|
const { cancelUrl, successUrl, appearance, locale, clientSecret, clientProxy, } = config;
|
|
34540
|
-
const storeClient = createStoreClient({ proxy: clientProxy });
|
|
35815
|
+
const storeClient = React__default.useMemo(() => createStoreClient({ proxy: clientProxy }), [clientProxy]);
|
|
34541
35816
|
React__default.useMemo(() => createI18nInstance(locale), []);
|
|
34542
|
-
const { formData, setFormData,
|
|
35817
|
+
const { formData, setFormData, setStep } = useFormStore();
|
|
34543
35818
|
const [checkout, setCheckout] = useState(null);
|
|
34544
35819
|
const [loading, setLoading] = useState(true);
|
|
34545
35820
|
useEffect(() => {
|
|
@@ -34590,10 +35865,31 @@ function CheckoutEmbed({ checkoutId, config }) {
|
|
|
34590
35865
|
return;
|
|
34591
35866
|
setCheckout(Object.assign(Object.assign({}, checkout), { shipping: cost }));
|
|
34592
35867
|
};
|
|
35868
|
+
const applyDiscountCode = (code) => __awaiter(this, void 0, void 0, function* () {
|
|
35869
|
+
const newCheckout = yield storeClient.applyDiscountCode(clientSecret, checkoutId, code);
|
|
35870
|
+
setCheckout(newCheckout);
|
|
35871
|
+
});
|
|
35872
|
+
const revalidateDiscounts = () => __awaiter(this, void 0, void 0, function* () {
|
|
35873
|
+
const newCheckout = yield storeClient.revalidateDiscounts(clientSecret, checkoutId);
|
|
35874
|
+
setCheckout(newCheckout);
|
|
35875
|
+
});
|
|
35876
|
+
const removeDiscount = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
35877
|
+
console.log("storeclient method", storeClient);
|
|
35878
|
+
const newCheckout = yield storeClient.removeDiscount(clientSecret, checkoutId, id);
|
|
35879
|
+
setCheckout(newCheckout);
|
|
35880
|
+
});
|
|
35881
|
+
useEffect(() => {
|
|
35882
|
+
const interval = setTimeout(() => {
|
|
35883
|
+
revalidateDiscounts();
|
|
35884
|
+
}, 1000 * 5);
|
|
35885
|
+
return () => clearInterval(interval);
|
|
35886
|
+
}, []);
|
|
34593
35887
|
return (React__default.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 " },
|
|
34594
35888
|
React__default.createElement(Appearance, { appearance: appearance }),
|
|
34595
|
-
React__default.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React__default.createElement(CheckoutFormLoading, null)) : (React__default.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 }))),
|
|
34596
|
-
React__default.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35889
|
+
React__default.createElement("div", { className: "md:col-span-4 px-4 md:px-8" }, loading ? (React__default.createElement(CheckoutFormLoading, null)) : (React__default.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 }))),
|
|
35890
|
+
React__default.createElement("div", { className: "md:col-span-3 px-4 md:px-8 order-first md:order-last" },
|
|
35891
|
+
React__default.createElement(Toaster, null),
|
|
35892
|
+
loading ? (React__default.createElement(CheckoutSummaryLoading, null)) : (React__default.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 })))));
|
|
34597
35893
|
}
|
|
34598
35894
|
var index = memo$1(CheckoutEmbed);
|
|
34599
35895
|
|
|
@@ -34624,7 +35920,7 @@ function styleInject(css, ref) {
|
|
|
34624
35920
|
}
|
|
34625
35921
|
}
|
|
34626
35922
|
|
|
34627
|
-
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";
|
|
35923
|
+
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";
|
|
34628
35924
|
styleInject(css_248z);
|
|
34629
35925
|
|
|
34630
35926
|
export { index as CheckoutEmbed, PaymentElement$1 as PaymentElement, useCart, useCheckout };
|