buildgrid-ui 1.15.4 → 1.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/buildgrid-ui.es.js
CHANGED
|
@@ -15707,7 +15707,7 @@ const uP = TR, dP = MR, fP = jR, IR = u.forwardRef(({ className: e, sideOffset:
|
|
|
15707
15707
|
ref: r,
|
|
15708
15708
|
sideOffset: t,
|
|
15709
15709
|
className: j(
|
|
15710
|
-
"z-50 overflow-hidden rounded-md bg-
|
|
15710
|
+
"z-50 overflow-hidden rounded-md bg-gray-800 px-3 py-1.5 text-xs text-white animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
15711
15711
|
e
|
|
15712
15712
|
),
|
|
15713
15713
|
...n
|
package/dist/buildgrid-ui.umd.js
CHANGED
|
@@ -287,7 +287,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
287
287
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
288
288
|
|
|
289
289
|
Defaulting to \`null\`.`}var Ap=kp,sE=Tp;const Gs=u.forwardRef(({className:e,value:t,...n},r)=>i.jsx(Ap,{ref:r,className:I("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:i.jsx(sE,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Gs.displayName=Ap.displayName;function iE(e){const{showStrengthMeter:t=!0,className:n,strengthLabels:r={veryWeak:"Very weak",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very strong"},showPasswordLabel:o="Show password",hidePasswordLabel:a="Hide password",strengthTitle:s="Password strength",...l}=e,[c,d]=C.useState(""),[f,m]=C.useState(!1),h=y=>{let w=0;return y.length>=8&&(w+=25),y.match(/[a-z]/)&&(w+=25),y.match(/[A-Z]/)&&(w+=25),y.match(/[0-9]/)&&(w+=25),w},p=y=>y===0?r.veryWeak:y<=25?r.weak:y<=50?r.medium:y<=75?r.strong:r.veryStrong,v=h(c),g=p(v),b=y=>{var w;d(y.target.value),(w=e.onChange)==null||w.call(e,y)};return i.jsxs("div",{className:"w-full space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(qn,{...l,type:f?"text":"password",value:c,onChange:b,className:`pr-10 ${n||""}`}),i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full",onClick:()=>m(!f),"aria-label":f?a:o,children:f?i.jsx(cw,{className:"h-4 w-4"}):i.jsx(uw,{className:"h-4 w-4"})})]}),t&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsxs("span",{children:[s,":"]}),i.jsx("span",{children:g})]}),i.jsx(Gs,{value:v,className:"h-2"})]})]})}var Us="Radio",[lE,Ip]=be(Us),[cE,uE]=lE(Us),Rp=u.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:a,disabled:s,value:l="on",onCheck:c,form:d,...f}=e,[m,h]=u.useState(null),p=re(t,b=>h(b)),v=u.useRef(!1),g=m?d||!!m.closest("form"):!0;return i.jsxs(cE,{scope:n,checked:o,disabled:s,children:[i.jsx(z.button,{type:"button",role:"radio","aria-checked":o,"data-state":Lp(o),"data-disabled":s?"":void 0,disabled:s,value:l,...f,ref:p,onClick:B(e.onClick,b=>{o||c==null||c(),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&i.jsx($p,{control:m,bubbles:!v.current,name:r,value:l,checked:o,required:a,disabled:s,form:d,style:{transform:"translateX(-100%)"}})]})});Rp.displayName=Us;var Dp="RadioIndicator",Op=u.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=uE(Dp,n);return i.jsx(xe,{present:r||a.checked,children:i.jsx(z.span,{"data-state":Lp(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})});Op.displayName=Dp;var dE="RadioBubbleInput",$p=u.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=u.useRef(null),l=re(s,a),c=Yn(n),d=Tr(t);return u.useEffect(()=>{const f=s.current;if(!f)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(f,n),f.dispatchEvent(v)}},[c,n,r]),i.jsx(z.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$p.displayName=dE;function Lp(e){return e?"checked":"unchecked"}var fE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ko="RadioGroup",[mE,CT]=be(ko,[Nt,Ip]),Fp=Nt(),Bp=Ip(),[pE,hE]=mE(ko),zp=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:s=!1,disabled:l=!1,orientation:c,dir:d,loop:f=!0,onValueChange:m,...h}=e,p=Fp(n),v=bt(d),[g,b]=ye({prop:a,defaultProp:o??null,onChange:m,caller:ko});return i.jsx(pE,{scope:n,name:r,required:s,disabled:l,value:g,onValueChange:b,children:i.jsx(Ar,{asChild:!0,...p,orientation:c,dir:v,loop:f,children:i.jsx(z.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...h,ref:t})})})});zp.displayName=ko;var Vp="RadioGroupItem",Wp=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,a=hE(Vp,n),s=a.disabled||r,l=Fp(n),c=Bp(n),d=u.useRef(null),f=re(t,d),m=a.value===o.value,h=u.useRef(!1);return u.useEffect(()=>{const p=g=>{fE.includes(g.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),i.jsx(Ir,{asChild:!0,...l,focusable:!s,active:m,children:i.jsx(Rp,{disabled:s,required:a.required,checked:m,...c,...o,name:a.name,ref:f,onCheck:()=>a.onValueChange(o.value),onKeyDown:B(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:B(o.onFocus,()=>{var p;h.current&&((p=d.current)==null||p.click())})})})});Wp.displayName=Vp;var gE="RadioGroupIndicator",Hp=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Bp(n);return i.jsx(Op,{...o,...r,ref:t})});Hp.displayName=gE;var Gp=zp,Up=Wp,vE=Hp;const Yp=u.forwardRef(({className:e,...t},n)=>i.jsx(Gp,{className:I("grid gap-2",e),...t,ref:n}));Yp.displayName=Gp.displayName;const Kp=u.forwardRef(({className:e,...t},n)=>i.jsx(Up,{ref:n,className:I("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(vE,{className:"flex items-center justify-center",children:i.jsx(ml,{className:"h-3.5 w-3.5 fill-primary"})})}));Kp.displayName=Up.displayName;const bE=["primary","secondary","success","error","warning","info","white","neutral"],wE=["xs","sm","md","lg","xl","2xl"],qp=Ft("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{color:{primary:"text-primary",secondary:"text-secondary",success:"text-green-700",error:"text-red-700",warning:"text-yellow-700",info:"text-blue-700",white:"text-white",neutral:"text-gray-700"},size:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-14 w-14","2xl":"h-20 w-20"}},defaultVariants:{color:"primary",size:"md"}}),Xp=e=>{const{label:t,size:n,color:r,className:o}=e;return i.jsxs("div",{className:I("flex flex-col justify-center items-center",o),children:[i.jsx(bw,{className:I(qp({color:r,size:n}),"animate-spin")}),t&&i.jsx("p",{className:I("italic",qp({color:r})),children:t})]})};var Po="Switch",[yE,NT]=be(Po),[xE,CE]=yE(Po),Qp=u.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:s,disabled:l,value:c="on",onCheckedChange:d,form:f,...m}=e,[h,p]=u.useState(null),v=re(t,x=>p(x)),g=u.useRef(!1),b=h?f||!!h.closest("form"):!0,[y,w]=ye({prop:o,defaultProp:a??!1,onChange:d,caller:Po});return i.jsxs(xE,{scope:n,checked:y,disabled:l,children:[i.jsx(z.button,{type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":th(y),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:v,onClick:B(e.onClick,x=>{w(S=>!S),b&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),b&&i.jsx(eh,{control:h,bubbles:!g.current,name:r,value:c,checked:y,required:s,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Qp.displayName=Po;var Zp="SwitchThumb",Jp=u.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=CE(Zp,n);return i.jsx(z.span,{"data-state":th(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Jp.displayName=Zp;var NE="SwitchBubbleInput",eh=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},a)=>{const s=u.useRef(null),l=re(s,a),c=Yn(n),d=Tr(t);return u.useEffect(()=>{const f=s.current;if(!f)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&p){const v=new Event("click",{bubbles:r});p.call(f,n),f.dispatchEvent(v)}},[c,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});eh.displayName=NE;function th(e){return e?"checked":"unchecked"}var nh=Qp,SE=Jp;const rh=u.forwardRef(({className:e,...t},n)=>i.jsx(nh,{className:I("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(SE,{className:I("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));rh.displayName=nh.displayName;var To="Tabs",[EE,ST]=be(To,[Nt]),oh=Nt(),[kE,Ys]=EE(To),ah=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,f=bt(l),[m,h]=ye({prop:r,onChange:o,defaultProp:a??"",caller:To});return i.jsx(kE,{scope:n,baseId:pe(),value:m,onValueChange:h,orientation:s,dir:f,activationMode:c,children:i.jsx(z.div,{dir:f,"data-orientation":s,...d,ref:t})})});ah.displayName=To;var sh="TabsList",ih=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,a=Ys(sh,n),s=oh(n);return i.jsx(Ar,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(z.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});ih.displayName=sh;var lh="TabsTrigger",ch=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=e,s=Ys(lh,n),l=oh(n),c=fh(s.baseId,r),d=mh(s.baseId,r),f=r===s.value;return i.jsx(Ir,{asChild:!0,...l,focusable:!o,active:f,children:i.jsx(z.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...a,ref:t,onMouseDown:B(e.onMouseDown,m=>{!o&&m.button===0&&m.ctrlKey===!1?s.onValueChange(r):m.preventDefault()}),onKeyDown:B(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&s.onValueChange(r)}),onFocus:B(e.onFocus,()=>{const m=s.activationMode!=="manual";!f&&!o&&m&&s.onValueChange(r)})})})});ch.displayName=lh;var uh="TabsContent",dh=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=e,l=Ys(uh,n),c=fh(l.baseId,r),d=mh(l.baseId,r),f=r===l.value,m=u.useRef(f);return u.useEffect(()=>{const h=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(h)},[]),i.jsx(xe,{present:o||f,children:({present:h})=>i.jsx(z.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:h&&a})})});dh.displayName=uh;function fh(e,t){return`${e}-trigger-${t}`}function mh(e,t){return`${e}-content-${t}`}var PE=ah,ph=ih,hh=ch,gh=dh;const TE=PE,vh=u.forwardRef(({className:e,...t},n)=>i.jsx(ph,{ref:n,className:I("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));vh.displayName=ph.displayName;const bh=u.forwardRef(({className:e,...t},n)=>i.jsx(hh,{ref:n,className:I("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));bh.displayName=hh.displayName;const wh=u.forwardRef(({className:e,...t},n)=>i.jsx(gh,{ref:n,className:I("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));wh.displayName=gh.displayName;const yh=u.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:I("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));yh.displayName="Textarea";var ME=e=>{switch(e){case"success":return AE;case"info":return RE;case"warning":return IE;case"error":return DE;default:return null}},jE=Array(12).fill(0),_E=({visible:e,className:t})=>C.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},C.createElement("div",{className:"sonner-spinner"},jE.map((n,r)=>C.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),AE=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),IE=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),RE=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),DE=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",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",clipRule:"evenodd"})),OE=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},C.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$E=()=>{let[e,t]=C.useState(document.hidden);return C.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ks=1,LE=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ks++,a=this.toasts.find(l=>l.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...e,id:o,title:n}),{...l,...e,id:o,dismissible:s,title:n}):l):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,a,s=r.then(async c=>{if(a=["resolve",c],C.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(BE(c)&&!c.ok){o=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:f})}else if(t.success!==void 0){o=!1;let d=typeof t.success=="function"?await t.success(c):t.success,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:f})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){o=!1;let d=typeof t.error=="function"?await t.error(c):t.error,f=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:f})}}).finally(()=>{var c;o&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>s.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Ks++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_e=new LE,FE=(e,t)=>{let n=(t==null?void 0:t.id)||Ks++;return _e.addToast({title:e,...t,id:n}),n},BE=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zE=FE,VE=()=>_e.toasts,WE=()=>_e.getActiveToasts(),mt=Object.assign(zE,{success:_e.success,info:_e.info,warning:_e.warning,error:_e.error,custom:_e.custom,message:_e.message,promise:_e.promise,dismiss:_e.dismiss,loading:_e.loading},{getHistory:VE,getToasts:WE});function HE(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}HE(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)}
|
|
290
|
-
`);function Mo(e){return e.label!==void 0}var GE=3,UE="32px",YE="16px",xh=4e3,KE=356,qE=14,XE=20,QE=200;function Ke(...e){return e.filter(Boolean).join(" ")}function ZE(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JE=e=>{var t,n,r,o,a,s,l,c,d,f,m;let{invert:h,toast:p,unstyled:v,interacting:g,setHeights:b,visibleToasts:y,heights:w,index:x,toasts:S,expanded:k,removeToast:j,defaultRichColors:E,closeButton:P,style:_,cancelButtonStyle:$,actionButtonStyle:H,className:q="",descriptionClassName:W="",duration:U,position:te,gap:V,loadingIcon:X,expandByDefault:R,classNames:O,icons:M,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:T}=e,[D,L]=C.useState(null),[F,ee]=C.useState(null),[A,K]=C.useState(!1),[Q,ne]=C.useState(!1),[oe,ie]=C.useState(!1),[Ce,we]=C.useState(!1),[Be,$e]=C.useState(!1),[Ee,ze]=C.useState(0),[Te,rr]=C.useState(0),It=C.useRef(p.duration||U||xh),or=C.useRef(null),st=C.useRef(null),$o=x===0,Lo=x+1<=y,G=p.type,ae=p.dismissible!==!1,ue=p.className||"",ve=p.descriptionClassName||"",Ae=C.useMemo(()=>w.findIndex(se=>se.toastId===p.id)||0,[w,p.id]),pt=C.useMemo(()=>{var se;return(se=p.closeButton)!=null?se:P},[p.closeButton,P]),it=C.useMemo(()=>p.duration||U||xh,[p.duration,U]),ii=C.useRef(0),Nn=C.useRef(0),cg=C.useRef(0),Sn=C.useRef(null),[SP,EP]=te.split("-"),ug=C.useMemo(()=>w.reduce((se,me,he)=>he>=Ae?se:se+me.height,0),[w,Ae]),dg=$E(),kP=p.invert||h,li=G==="loading";Nn.current=C.useMemo(()=>Ae*V+ug,[Ae,ug]),C.useEffect(()=>{It.current=it},[it]),C.useEffect(()=>{K(!0)},[]),C.useEffect(()=>{let se=st.current;if(se){let me=se.getBoundingClientRect().height;return rr(me),b(he=>[{toastId:p.id,height:me,position:p.position},...he]),()=>b(he=>he.filter(qe=>qe.toastId!==p.id))}},[b,p.id]),C.useLayoutEffect(()=>{if(!A)return;let se=st.current,me=se.style.height;se.style.height="auto";let he=se.getBoundingClientRect().height;se.style.height=me,rr(he),b(qe=>qe.find(Xe=>Xe.toastId===p.id)?qe.map(Xe=>Xe.toastId===p.id?{...Xe,height:he}:Xe):[{toastId:p.id,height:he,position:p.position},...qe])},[A,p.title,p.description,b,p.id]);let Rt=C.useCallback(()=>{ne(!0),ze(Nn.current),b(se=>se.filter(me=>me.toastId!==p.id)),setTimeout(()=>{j(p)},QE)},[p,j,b,Nn]);C.useEffect(()=>{if(p.promise&&G==="loading"||p.duration===1/0||p.type==="loading")return;let se;return k||g||T&&dg?(()=>{if(cg.current<ii.current){let me=new Date().getTime()-ii.current;It.current=It.current-me}cg.current=new Date().getTime()})():It.current!==1/0&&(ii.current=new Date().getTime(),se=setTimeout(()=>{var me;(me=p.onAutoClose)==null||me.call(p,p),Rt()},It.current)),()=>clearTimeout(se)},[k,g,p,G,T,dg,Rt]),C.useEffect(()=>{p.delete&&Rt()},[Rt,p.delete]);function PP(){var se,me,he;return M!=null&&M.loading?C.createElement("div",{className:Ke(O==null?void 0:O.loader,(se=p==null?void 0:p.classNames)==null?void 0:se.loader,"sonner-loader"),"data-visible":G==="loading"},M.loading):X?C.createElement("div",{className:Ke(O==null?void 0:O.loader,(me=p==null?void 0:p.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":G==="loading"},X):C.createElement(_E,{className:Ke(O==null?void 0:O.loader,(he=p==null?void 0:p.classNames)==null?void 0:he.loader),visible:G==="loading"})}return C.createElement("li",{tabIndex:0,ref:st,className:Ke(q,ue,O==null?void 0:O.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[G],(n=p==null?void 0:p.classNames)==null?void 0:n[G]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:E,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":A,"data-promise":!!p.promise,"data-swiped":Be,"data-removed":Q,"data-visible":Lo,"data-y-position":SP,"data-x-position":EP,"data-index":x,"data-front":$o,"data-swiping":oe,"data-dismissible":ae,"data-type":G,"data-invert":kP,"data-swipe-out":Ce,"data-swipe-direction":F,"data-expanded":!!(k||R&&A),style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${Q?Ee:Nn.current}px`,"--initial-height":R?"auto":`${Te}px`,..._,...p.style},onDragEnd:()=>{ie(!1),L(null),Sn.current=null},onPointerDown:se=>{li||!ae||(or.current=new Date,ze(Nn.current),se.target.setPointerCapture(se.pointerId),se.target.tagName!=="BUTTON"&&(ie(!0),Sn.current={x:se.clientX,y:se.clientY}))},onPointerUp:()=>{var se,me,he,qe;if(Ce||!ae)return;Sn.current=null;let Xe=Number(((se=st.current)==null?void 0:se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dt=Number(((me=st.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((he=or.current)==null?void 0:he.getTime()),Qe=D==="x"?Xe:Dt,Ot=Math.abs(Qe)/qt;if(Math.abs(Qe)>=XE||Ot>.11){ze(Nn.current),(qe=p.onDismiss)==null||qe.call(p,p),ee(D==="x"?Xe>0?"right":"left":Dt>0?"down":"up"),Rt(),we(!0),$e(!1);return}ie(!1),L(null)},onPointerMove:se=>{var me,he,qe,Xe;if(!Sn.current||!ae||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;let Dt=se.clientY-Sn.current.y,qt=se.clientX-Sn.current.x,Qe=(he=e.swipeDirections)!=null?he:ZE(te);!D&&(Math.abs(qt)>1||Math.abs(Dt)>1)&&L(Math.abs(qt)>Math.abs(Dt)?"x":"y");let Ot={x:0,y:0};D==="y"?(Qe.includes("top")||Qe.includes("bottom"))&&(Qe.includes("top")&&Dt<0||Qe.includes("bottom")&&Dt>0)&&(Ot.y=Dt):D==="x"&&(Qe.includes("left")||Qe.includes("right"))&&(Qe.includes("left")&&qt<0||Qe.includes("right")&&qt>0)&&(Ot.x=qt),(Math.abs(Ot.x)>0||Math.abs(Ot.y)>0)&&$e(!0),(qe=st.current)==null||qe.style.setProperty("--swipe-amount-x",`${Ot.x}px`),(Xe=st.current)==null||Xe.style.setProperty("--swipe-amount-y",`${Ot.y}px`)}},pt&&!p.jsx?C.createElement("button",{"aria-label":Y,"data-disabled":li,"data-close-button":!0,onClick:li||!ae?()=>{}:()=>{var se;Rt(),(se=p.onDismiss)==null||se.call(p,p)},className:Ke(O==null?void 0:O.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(a=M==null?void 0:M.close)!=null?a:OE):null,p.jsx||C.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:C.createElement(C.Fragment,null,G||p.icon||p.promise?C.createElement("div",{"data-icon":"",className:Ke(O==null?void 0:O.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||PP():null,p.type!=="loading"?p.icon||(M==null?void 0:M[G])||ME(G):null):null,C.createElement("div",{"data-content":"",className:Ke(O==null?void 0:O.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},C.createElement("div",{"data-title":"",className:Ke(O==null?void 0:O.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?C.createElement("div",{"data-description":"",className:Ke(W,ve,O==null?void 0:O.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),C.isValidElement(p.cancel)?p.cancel:p.cancel&&Mo(p.cancel)?C.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||$,onClick:se=>{var me,he;Mo(p.cancel)&&ae&&((he=(me=p.cancel).onClick)==null||he.call(me,se),Rt())},className:Ke(O==null?void 0:O.cancelButton,(f=p==null?void 0:p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,C.isValidElement(p.action)?p.action:p.action&&Mo(p.action)?C.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||H,onClick:se=>{var me,he;Mo(p.action)&&((he=(me=p.action).onClick)==null||he.call(me,se),!se.defaultPrevented&&Rt())},className:Ke(O==null?void 0:O.actionButton,(m=p==null?void 0:p.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function Ch(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ek(e,t){let n={};return[e,t].forEach((r,o)=>{let a=o===1,s=a?"--mobile-offset":"--offset",l=a?YE:UE;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${s}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=l:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var tk=C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:d,theme:f="light",richColors:m,duration:h,style:p,visibleToasts:v=GE,toastOptions:g,dir:b=Ch(),gap:y=qE,loadingIcon:w,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:k}=e,[j,E]=C.useState([]),P=C.useMemo(()=>Array.from(new Set([r].concat(j.filter(T=>T.position).map(T=>T.position)))),[j,r]),[_,$]=C.useState([]),[H,q]=C.useState(!1),[W,U]=C.useState(!1),[te,V]=C.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=C.useRef(null),R=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=C.useRef(null),M=C.useRef(!1),Y=C.useCallback(T=>{E(D=>{var L;return(L=D.find(F=>F.id===T.id))!=null&&L.delete||_e.dismiss(T.id),D.filter(({id:F})=>F!==T.id)})},[]);return C.useEffect(()=>_e.subscribe(T=>{if(T.dismiss){E(D=>D.map(L=>L.id===T.id?{...L,delete:!0}:L));return}setTimeout(()=>{ar.flushSync(()=>{E(D=>{let L=D.findIndex(F=>F.id===T.id);return L!==-1?[...D.slice(0,L),{...D[L],...T},...D.slice(L+1)]:[T,...D]})})})}),[]),C.useEffect(()=>{if(f!=="system"){V(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;let T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:D})=>{V(D?"dark":"light")})}catch{T.addListener(({matches:L})=>{try{V(L?"dark":"light")}catch(F){console.error(F)}})}},[f]),C.useEffect(()=>{j.length<=1&&q(!1)},[j]),C.useEffect(()=>{let T=D=>{var L,F;o.every(ee=>D[ee]||D.code===ee)&&(q(!0),(L=X.current)==null||L.focus()),D.code==="Escape"&&(document.activeElement===X.current||(F=X.current)!=null&&F.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[o]),C.useEffect(()=>{if(X.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,M.current=!1)}},[X.current]),C.createElement("section",{ref:t,"aria-label":`${S} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((T,D)=>{var L;let[F,ee]=T.split("-");return j.length?C.createElement("ol",{key:T,dir:b==="auto"?Ch():b,tabIndex:-1,ref:X,className:l,"data-sonner-toaster":!0,"data-theme":te,"data-y-position":F,"data-lifted":H&&j.length>1&&!a,"data-x-position":ee,style:{"--front-toast-height":`${((L=_[0])==null?void 0:L.height)||0}px`,"--width":`${KE}px`,"--gap":`${y}px`,...p,...ek(c,d)},onBlur:A=>{M.current&&!A.currentTarget.contains(A.relatedTarget)&&(M.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||M.current||(M.current=!0,O.current=A.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{W||q(!1)},onDragEnd:()=>q(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},j.filter(A=>!A.position&&D===0||A.position===T).map((A,K)=>{var Q,ne;return C.createElement(JE,{key:A.id,icons:x,index:K,toast:A,defaultRichColors:m,duration:(Q=g==null?void 0:g.duration)!=null?Q:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(ne=g==null?void 0:g.closeButton)!=null?ne:s,interacting:W,position:T,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:j.filter(oe=>oe.position==A.position),heights:_.filter(oe=>oe.position==A.position),setHeights:$,expandByDefault:a,gap:y,loadingIcon:w,expanded:H,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const jo=({onClick:e})=>i.jsx(fe,{onClick:()=>e(),variant:"ghost",size:"xl",className:"ml-auto px-3",children:i.jsx(ct,{className:"!h-6 !w-6"})}),nk={...mt,success:(e,t)=>{const n=mt.success(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},error:(e,t)=>{const n=mt.error(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},warning:(e,t)=>{const n=mt.warning(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},info:(e,t)=>{const n=mt.info(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n}},rk=({...e})=>i.jsx(tk,{className:"toaster group",toastOptions:{classNames:{title:"py-3 px-0",toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg p-0",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",icon:"p-4 group-data-[type=error]:text-red-500 group-data-[type=success]:text-green-500 group-data-[type=warning]:text-amber-500 group-data-[type=info]:text-blue-500",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e});var Nh="Toggle",qs=u.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...a}=e,[s,l]=ye({prop:n,onChange:o,defaultProp:r??!1,caller:Nh});return i.jsx(z.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:B(e.onClick,()=>{e.disabled||l(!s)})})});qs.displayName=Nh;var Sh=qs;const Xs=Ft("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Eh=u.forwardRef(({className:e,variant:t,size:n,...r},o)=>i.jsx(Sh,{ref:o,className:I(Xs({variant:t,size:n,className:e})),...r}));Eh.displayName=Sh.displayName;var _t="ToggleGroup",[kh,ET]=be(_t,[Nt]),Ph=Nt(),Qs=C.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return i.jsx(ok,{...o,ref:t})}if(n==="multiple"){const o=r;return i.jsx(ak,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${_t}\``)});Qs.displayName=_t;var[Th,Mh]=kh(_t),ok=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[s,l]=ye({prop:n,defaultProp:r??"",onChange:o,caller:_t});return i.jsx(Th,{scope:e.__scopeToggleGroup,type:"single",value:C.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:C.useCallback(()=>l(""),[l]),children:i.jsx(jh,{...a,ref:t})})}),ak=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[s,l]=ye({prop:n,defaultProp:r??[],onChange:o,caller:_t}),c=C.useCallback(f=>l((m=[])=>[...m,f]),[l]),d=C.useCallback(f=>l((m=[])=>m.filter(h=>h!==f)),[l]);return i.jsx(Th,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:c,onItemDeactivate:d,children:i.jsx(jh,{...a,ref:t})})});Qs.displayName=_t;var[sk,ik]=kh(_t),jh=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:a,dir:s,loop:l=!0,...c}=e,d=Ph(n),f=bt(s),m={role:"group",dir:f,...c};return i.jsx(sk,{scope:n,rovingFocus:o,disabled:r,children:o?i.jsx(Ar,{asChild:!0,...d,orientation:a,dir:f,loop:l,children:i.jsx(z.div,{...m,ref:t})}):i.jsx(z.div,{...m,ref:t})})}),_o="ToggleGroupItem",_h=C.forwardRef((e,t)=>{const n=Mh(_o,e.__scopeToggleGroup),r=ik(_o,e.__scopeToggleGroup),o=Ph(e.__scopeToggleGroup),a=n.value.includes(e.value),s=r.disabled||e.disabled,l={...e,pressed:a,disabled:s},c=C.useRef(null);return r.rovingFocus?i.jsx(Ir,{asChild:!0,...o,focusable:!s,active:a,ref:c,children:i.jsx(Ah,{...l,ref:t})}):i.jsx(Ah,{...l,ref:t})});_h.displayName=_o;var Ah=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,a=Mh(_o,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?s:void 0;return i.jsx(qs,{...l,...o,ref:t,onPressedChange:c=>{c?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Ih=Qs,Rh=_h;const Dh=u.createContext({size:"default",variant:"default"}),Oh=u.forwardRef(({className:e,variant:t,size:n,children:r,...o},a)=>i.jsx(Ih,{ref:a,className:I("flex items-center justify-center gap-1",e),...o,children:i.jsx(Dh.Provider,{value:{variant:t,size:n},children:r})}));Oh.displayName=Ih.displayName;const $h=u.forwardRef(({className:e,children:t,variant:n,size:r,...o},a)=>{const s=u.useContext(Dh);return i.jsx(Rh,{ref:a,className:I(Xs({variant:s.variant||n,size:s.size||r}),e),...o,children:t})});$h.displayName=Rh.displayName;var[Ao,kT]=be("Tooltip",[Ct]),Io=Ct(),Lh="TooltipProvider",lk=700,Zs="tooltip.open",[ck,Js]=Ao(Lh),Fh=e=>{const{__scopeTooltip:t,delayDuration:n=lk,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=u.useRef(!0),l=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),i.jsx(ck,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:u.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:a})};Fh.displayName=Lh;var er="Tooltip",[uk,tr]=Ao(er),Bh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=e,c=Js(er,e.__scopeTooltip),d=Io(t),[f,m]=u.useState(null),h=pe(),p=u.useRef(0),v=s??c.disableHoverableContent,g=l??c.delayDuration,b=u.useRef(!1),[y,w]=ye({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zs))):c.onClose(),a==null||a(E)},caller:er}),x=u.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),S=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,w(!0)},[w]),k=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w(!1)},[w]),j=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,w(!0),p.current=0},g)},[g,w]);return u.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(On,{...d,children:i.jsx(uk,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:f,onTriggerChange:m,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:u.useCallback(()=>{v?k():(window.clearTimeout(p.current),p.current=0)},[k,v]),onOpen:S,onClose:k,disableHoverableContent:v,children:n})})};Bh.displayName=er;var ei="TooltipTrigger",zh=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tr(ei,n),a=Js(ei,n),s=Io(n),l=u.useRef(null),c=re(t,l,o.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),m=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),i.jsx($n,{asChild:!0,...s,children:i.jsx(z.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:B(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:B(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})});zh.displayName=ei;var ti="TooltipPortal",[dk,fk]=Ao(ti,{forceMount:void 0}),Vh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=tr(ti,t);return i.jsx(dk,{scope:t,forceMount:n,children:i.jsx(xe,{present:n||a.open,children:i.jsx(Ln,{asChild:!0,container:o,children:r})})})};Vh.displayName=ti;var Cn="TooltipContent",Wh=u.forwardRef((e,t)=>{const n=fk(Cn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=tr(Cn,e.__scopeTooltip);return i.jsx(xe,{present:r||s.open,children:s.disableHoverableContent?i.jsx(Hh,{side:o,...a,ref:t}):i.jsx(mk,{side:o,...a,ref:t})})}),mk=u.forwardRef((e,t)=>{const n=tr(Cn,e.__scopeTooltip),r=Js(Cn,e.__scopeTooltip),o=u.useRef(null),a=re(t,o),[s,l]=u.useState(null),{trigger:c,onClose:d}=n,f=o.current,{onPointerInTransitChange:m}=r,h=u.useCallback(()=>{l(null),m(!1)},[m]),p=u.useCallback((v,g)=>{const b=v.currentTarget,y={x:v.clientX,y:v.clientY},w=bk(y,b.getBoundingClientRect()),x=wk(y,w),S=yk(g.getBoundingClientRect()),k=Ck([...x,...S]);l(k),m(!0)},[m]);return u.useEffect(()=>()=>h(),[h]),u.useEffect(()=>{if(c&&f){const v=b=>p(b,f),g=b=>p(b,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[c,f,p,h]),u.useEffect(()=>{if(s){const v=g=>{const b=g.target,y={x:g.clientX,y:g.clientY},w=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),x=!xk(y,s);w?h():x&&(h(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,s,d,h]),i.jsx(Hh,{...e,ref:a})}),[pk,hk]=Ao(er,{isInside:!1}),gk=rl("TooltipContent"),Hh=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,c=tr(Cn,n),d=Io(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Zs,f),()=>document.removeEventListener(Zs,f)),[f]),u.useEffect(()=>{if(c.trigger){const m=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,f]),i.jsx(Bt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:i.jsxs(Mr,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(gk,{children:r}),i.jsx(pk,{scope:n,isInside:!0,children:i.jsx(Au,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Wh.displayName=Cn;var Gh="TooltipArrow",vk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Io(n);return hk(Gh,n).isInside?null:i.jsx(jr,{...o,...r,ref:t})});vk.displayName=Gh;function bk(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wk(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function yk(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function xk(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const l=t[a],c=t[s],d=l.x,f=l.y,m=c.x,h=c.y;f>r!=h>r&&n<(m-d)*(r-f)/(h-f)+d&&(o=!o)}return o}function Ck(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Nk(t)}function Nk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Sk=Fh,Ek=Bh,kk=zh,Pk=Vh,Uh=Wh;const Tk=Sk,Mk=Ek,jk=kk,Yh=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(Pk,{children:i.jsx(Uh,{ref:r,sideOffset:t,className:I("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Yh.displayName=Uh.displayName;const _k=()=>{const[e,t]=C.useState([]);return[e,a=>{t([...e,a])},a=>{const s=[...e];s.splice(a,1),t(s)},(a,s)=>{const l=[...e];l.filter(c=>c[a]!==s),t(l)}]};function Ak(){const[e,t]=C.useState(null);return[e,async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),t(r),!0}catch(o){return console.warn("Copy failed",o),t(null),!1}}]}function Kh(e,t=250){const[n,r]=C.useState(e);return C.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}const qh=u.createContext(void 0),Xh={sm:"sm:max-w-[425px]",md:"sm:max-w-[550px]",lg:"sm:max-w-[700px]",xl:"sm:max-w-[900px]"},Qh={info:{icon:pl,className:"text-blue-500"},success:{icon:dl,className:"text-green-500"},error:{icon:ra,className:"text-red-500"},warning:{icon:ul,className:"text-yellow-500"},confirm:{icon:fl,className:"text-blue-500"},custom:{icon:fl,className:"text-gray-500"}};function Ik({children:e}){var g,b,y,w,x,S,k,j,E,P,_,$,H,q;const[t,n]=u.useState({isOpen:!1,options:null}),r=u.useCallback(W=>{n({isOpen:!0,options:W})},[]),o=u.useCallback(()=>{n(W=>({...W,isOpen:!1}))},[]),a=u.useCallback(W=>{r({...W,type:"info"})},[r]),s=u.useCallback(W=>{r({...W,type:"success"})},[r]),l=u.useCallback(W=>{r({...W,type:"error"})},[r]),c=u.useCallback(W=>{r({...W,type:"warning"})},[r]),d=u.useCallback(W=>{r({...W,type:"custom"})},[r]),f=u.useCallback(W=>{r({...W,type:"confirm"})},[r]),m=(W,U,te)=>{let V=Qh[W].icon;return U&&(V=U),i.jsx(V,{className:I("h-24 w-24",Qh[W].className,te)})},h=u.useMemo(()=>({open:r,close:o,info:a,success:s,error:l,warning:c,custom:d,confirm:f}),[r,o,a,s,l,c,d,f]),[p,v]=u.useState(!1);return i.jsxs(qh.Provider,{value:h,children:[e,i.jsx(po,{open:t.isOpen,onOpenChange:W=>!W&&o(),children:i.jsxs(Zn,{className:I((g=t.options)!=null&&g.size?Xh[t.options.size]:Xh.sm,(b=t.options)==null?void 0:b.className),showCloseButton:((y=t.options)==null?void 0:y.showCloseButton)??!0,onInteractOutside:W=>{var U;(U=t.options)!=null&&U.blockOutsideClick&&W.preventDefault()},children:[t.options&&i.jsxs(ho,{children:[i.jsx("div",{className:"mx-auto mb-6",children:m(t.options.type,t.options.icon,t.options.iconClassName)}),t.options.title&&i.jsx(go,{className:"text-center",children:t.options.title}),i.jsx(vo,{className:"text-center",children:t.options.message})]}),((w=t.options)==null?void 0:w.type)==="confirm"&&i.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[i.jsx(fe,{isLoading:p??((S=(x=t.options)==null?void 0:x.confirmButton)==null?void 0:S.loading),disabled:(j=(k=t.options)==null?void 0:k.confirmButton)==null?void 0:j.disabled,className:(E=t.options.confirmButton)==null?void 0:E.className,onClick:()=>{var U,te,V,X;if(!((te=(U=t.options)==null?void 0:U.confirmButton)!=null&&te.onClick))throw new Error("Confirmation type dialog needs to implement the onConfirm function");const W=(X=(V=t.options)==null?void 0:V.confirmButton)==null?void 0:X.onClick();W instanceof Promise?(v(!0),W.then(()=>{v(!1),o()}).finally(()=>v(!1))):o()},children:((P=t.options.confirmButton)==null?void 0:P.label)??"Confirm"}),((_=t.options.cancelButton)==null?void 0:_.label)&&i.jsx(fe,{variant:"outline",onClick:o,className:t.options.cancelButton.className,isLoading:($=t.options.cancelButton)==null?void 0:$.loading,disabled:p||((H=t.options.cancelButton)==null?void 0:H.disabled),children:(q=t.options.cancelButton)==null?void 0:q.label})]})]})})]})}function Rk(){const e=u.useContext(qh);if(e===void 0)throw new Error("useDialog must be used within a DialogProvider");return e}const Dk=(e=!1)=>{const[t,n]=u.useState(e),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]),a=u.useCallback(()=>n(s=>!s),[]);return{isOpen:t,open:r,close:o,toggle:a}},Ok=(e=!1)=>{const[t,n]=u.useState(e),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]);return[t,r,o]};/*!
|
|
290
|
+
`);function Mo(e){return e.label!==void 0}var GE=3,UE="32px",YE="16px",xh=4e3,KE=356,qE=14,XE=20,QE=200;function Ke(...e){return e.filter(Boolean).join(" ")}function ZE(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var JE=e=>{var t,n,r,o,a,s,l,c,d,f,m;let{invert:h,toast:p,unstyled:v,interacting:g,setHeights:b,visibleToasts:y,heights:w,index:x,toasts:S,expanded:k,removeToast:j,defaultRichColors:E,closeButton:P,style:_,cancelButtonStyle:$,actionButtonStyle:H,className:q="",descriptionClassName:W="",duration:U,position:te,gap:V,loadingIcon:X,expandByDefault:R,classNames:O,icons:M,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:T}=e,[D,L]=C.useState(null),[F,ee]=C.useState(null),[A,K]=C.useState(!1),[Q,ne]=C.useState(!1),[oe,ie]=C.useState(!1),[Ce,we]=C.useState(!1),[Be,$e]=C.useState(!1),[Ee,ze]=C.useState(0),[Te,rr]=C.useState(0),It=C.useRef(p.duration||U||xh),or=C.useRef(null),st=C.useRef(null),$o=x===0,Lo=x+1<=y,G=p.type,ae=p.dismissible!==!1,ue=p.className||"",ve=p.descriptionClassName||"",Ae=C.useMemo(()=>w.findIndex(se=>se.toastId===p.id)||0,[w,p.id]),pt=C.useMemo(()=>{var se;return(se=p.closeButton)!=null?se:P},[p.closeButton,P]),it=C.useMemo(()=>p.duration||U||xh,[p.duration,U]),ii=C.useRef(0),Nn=C.useRef(0),cg=C.useRef(0),Sn=C.useRef(null),[SP,EP]=te.split("-"),ug=C.useMemo(()=>w.reduce((se,me,he)=>he>=Ae?se:se+me.height,0),[w,Ae]),dg=$E(),kP=p.invert||h,li=G==="loading";Nn.current=C.useMemo(()=>Ae*V+ug,[Ae,ug]),C.useEffect(()=>{It.current=it},[it]),C.useEffect(()=>{K(!0)},[]),C.useEffect(()=>{let se=st.current;if(se){let me=se.getBoundingClientRect().height;return rr(me),b(he=>[{toastId:p.id,height:me,position:p.position},...he]),()=>b(he=>he.filter(qe=>qe.toastId!==p.id))}},[b,p.id]),C.useLayoutEffect(()=>{if(!A)return;let se=st.current,me=se.style.height;se.style.height="auto";let he=se.getBoundingClientRect().height;se.style.height=me,rr(he),b(qe=>qe.find(Xe=>Xe.toastId===p.id)?qe.map(Xe=>Xe.toastId===p.id?{...Xe,height:he}:Xe):[{toastId:p.id,height:he,position:p.position},...qe])},[A,p.title,p.description,b,p.id]);let Rt=C.useCallback(()=>{ne(!0),ze(Nn.current),b(se=>se.filter(me=>me.toastId!==p.id)),setTimeout(()=>{j(p)},QE)},[p,j,b,Nn]);C.useEffect(()=>{if(p.promise&&G==="loading"||p.duration===1/0||p.type==="loading")return;let se;return k||g||T&&dg?(()=>{if(cg.current<ii.current){let me=new Date().getTime()-ii.current;It.current=It.current-me}cg.current=new Date().getTime()})():It.current!==1/0&&(ii.current=new Date().getTime(),se=setTimeout(()=>{var me;(me=p.onAutoClose)==null||me.call(p,p),Rt()},It.current)),()=>clearTimeout(se)},[k,g,p,G,T,dg,Rt]),C.useEffect(()=>{p.delete&&Rt()},[Rt,p.delete]);function PP(){var se,me,he;return M!=null&&M.loading?C.createElement("div",{className:Ke(O==null?void 0:O.loader,(se=p==null?void 0:p.classNames)==null?void 0:se.loader,"sonner-loader"),"data-visible":G==="loading"},M.loading):X?C.createElement("div",{className:Ke(O==null?void 0:O.loader,(me=p==null?void 0:p.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":G==="loading"},X):C.createElement(_E,{className:Ke(O==null?void 0:O.loader,(he=p==null?void 0:p.classNames)==null?void 0:he.loader),visible:G==="loading"})}return C.createElement("li",{tabIndex:0,ref:st,className:Ke(q,ue,O==null?void 0:O.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[G],(n=p==null?void 0:p.classNames)==null?void 0:n[G]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:E,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":A,"data-promise":!!p.promise,"data-swiped":Be,"data-removed":Q,"data-visible":Lo,"data-y-position":SP,"data-x-position":EP,"data-index":x,"data-front":$o,"data-swiping":oe,"data-dismissible":ae,"data-type":G,"data-invert":kP,"data-swipe-out":Ce,"data-swipe-direction":F,"data-expanded":!!(k||R&&A),style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${Q?Ee:Nn.current}px`,"--initial-height":R?"auto":`${Te}px`,..._,...p.style},onDragEnd:()=>{ie(!1),L(null),Sn.current=null},onPointerDown:se=>{li||!ae||(or.current=new Date,ze(Nn.current),se.target.setPointerCapture(se.pointerId),se.target.tagName!=="BUTTON"&&(ie(!0),Sn.current={x:se.clientX,y:se.clientY}))},onPointerUp:()=>{var se,me,he,qe;if(Ce||!ae)return;Sn.current=null;let Xe=Number(((se=st.current)==null?void 0:se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dt=Number(((me=st.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((he=or.current)==null?void 0:he.getTime()),Qe=D==="x"?Xe:Dt,Ot=Math.abs(Qe)/qt;if(Math.abs(Qe)>=XE||Ot>.11){ze(Nn.current),(qe=p.onDismiss)==null||qe.call(p,p),ee(D==="x"?Xe>0?"right":"left":Dt>0?"down":"up"),Rt(),we(!0),$e(!1);return}ie(!1),L(null)},onPointerMove:se=>{var me,he,qe,Xe;if(!Sn.current||!ae||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;let Dt=se.clientY-Sn.current.y,qt=se.clientX-Sn.current.x,Qe=(he=e.swipeDirections)!=null?he:ZE(te);!D&&(Math.abs(qt)>1||Math.abs(Dt)>1)&&L(Math.abs(qt)>Math.abs(Dt)?"x":"y");let Ot={x:0,y:0};D==="y"?(Qe.includes("top")||Qe.includes("bottom"))&&(Qe.includes("top")&&Dt<0||Qe.includes("bottom")&&Dt>0)&&(Ot.y=Dt):D==="x"&&(Qe.includes("left")||Qe.includes("right"))&&(Qe.includes("left")&&qt<0||Qe.includes("right")&&qt>0)&&(Ot.x=qt),(Math.abs(Ot.x)>0||Math.abs(Ot.y)>0)&&$e(!0),(qe=st.current)==null||qe.style.setProperty("--swipe-amount-x",`${Ot.x}px`),(Xe=st.current)==null||Xe.style.setProperty("--swipe-amount-y",`${Ot.y}px`)}},pt&&!p.jsx?C.createElement("button",{"aria-label":Y,"data-disabled":li,"data-close-button":!0,onClick:li||!ae?()=>{}:()=>{var se;Rt(),(se=p.onDismiss)==null||se.call(p,p)},className:Ke(O==null?void 0:O.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(a=M==null?void 0:M.close)!=null?a:OE):null,p.jsx||C.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:C.createElement(C.Fragment,null,G||p.icon||p.promise?C.createElement("div",{"data-icon":"",className:Ke(O==null?void 0:O.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||PP():null,p.type!=="loading"?p.icon||(M==null?void 0:M[G])||ME(G):null):null,C.createElement("div",{"data-content":"",className:Ke(O==null?void 0:O.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},C.createElement("div",{"data-title":"",className:Ke(O==null?void 0:O.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?C.createElement("div",{"data-description":"",className:Ke(W,ve,O==null?void 0:O.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),C.isValidElement(p.cancel)?p.cancel:p.cancel&&Mo(p.cancel)?C.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||$,onClick:se=>{var me,he;Mo(p.cancel)&&ae&&((he=(me=p.cancel).onClick)==null||he.call(me,se),Rt())},className:Ke(O==null?void 0:O.cancelButton,(f=p==null?void 0:p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,C.isValidElement(p.action)?p.action:p.action&&Mo(p.action)?C.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||H,onClick:se=>{var me,he;Mo(p.action)&&((he=(me=p.action).onClick)==null||he.call(me,se),!se.defaultPrevented&&Rt())},className:Ke(O==null?void 0:O.actionButton,(m=p==null?void 0:p.classNames)==null?void 0:m.actionButton)},p.action.label):null))};function Ch(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ek(e,t){let n={};return[e,t].forEach((r,o)=>{let a=o===1,s=a?"--mobile-offset":"--offset",l=a?YE:UE;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${s}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=l:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var tk=C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:d,theme:f="light",richColors:m,duration:h,style:p,visibleToasts:v=GE,toastOptions:g,dir:b=Ch(),gap:y=qE,loadingIcon:w,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:k}=e,[j,E]=C.useState([]),P=C.useMemo(()=>Array.from(new Set([r].concat(j.filter(T=>T.position).map(T=>T.position)))),[j,r]),[_,$]=C.useState([]),[H,q]=C.useState(!1),[W,U]=C.useState(!1),[te,V]=C.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=C.useRef(null),R=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=C.useRef(null),M=C.useRef(!1),Y=C.useCallback(T=>{E(D=>{var L;return(L=D.find(F=>F.id===T.id))!=null&&L.delete||_e.dismiss(T.id),D.filter(({id:F})=>F!==T.id)})},[]);return C.useEffect(()=>_e.subscribe(T=>{if(T.dismiss){E(D=>D.map(L=>L.id===T.id?{...L,delete:!0}:L));return}setTimeout(()=>{ar.flushSync(()=>{E(D=>{let L=D.findIndex(F=>F.id===T.id);return L!==-1?[...D.slice(0,L),{...D[L],...T},...D.slice(L+1)]:[T,...D]})})})}),[]),C.useEffect(()=>{if(f!=="system"){V(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;let T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:D})=>{V(D?"dark":"light")})}catch{T.addListener(({matches:L})=>{try{V(L?"dark":"light")}catch(F){console.error(F)}})}},[f]),C.useEffect(()=>{j.length<=1&&q(!1)},[j]),C.useEffect(()=>{let T=D=>{var L,F;o.every(ee=>D[ee]||D.code===ee)&&(q(!0),(L=X.current)==null||L.focus()),D.code==="Escape"&&(document.activeElement===X.current||(F=X.current)!=null&&F.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[o]),C.useEffect(()=>{if(X.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,M.current=!1)}},[X.current]),C.createElement("section",{ref:t,"aria-label":`${S} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((T,D)=>{var L;let[F,ee]=T.split("-");return j.length?C.createElement("ol",{key:T,dir:b==="auto"?Ch():b,tabIndex:-1,ref:X,className:l,"data-sonner-toaster":!0,"data-theme":te,"data-y-position":F,"data-lifted":H&&j.length>1&&!a,"data-x-position":ee,style:{"--front-toast-height":`${((L=_[0])==null?void 0:L.height)||0}px`,"--width":`${KE}px`,"--gap":`${y}px`,...p,...ek(c,d)},onBlur:A=>{M.current&&!A.currentTarget.contains(A.relatedTarget)&&(M.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||M.current||(M.current=!0,O.current=A.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{W||q(!1)},onDragEnd:()=>q(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},j.filter(A=>!A.position&&D===0||A.position===T).map((A,K)=>{var Q,ne;return C.createElement(JE,{key:A.id,icons:x,index:K,toast:A,defaultRichColors:m,duration:(Q=g==null?void 0:g.duration)!=null?Q:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(ne=g==null?void 0:g.closeButton)!=null?ne:s,interacting:W,position:T,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:j.filter(oe=>oe.position==A.position),heights:_.filter(oe=>oe.position==A.position),setHeights:$,expandByDefault:a,gap:y,loadingIcon:w,expanded:H,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const jo=({onClick:e})=>i.jsx(fe,{onClick:()=>e(),variant:"ghost",size:"xl",className:"ml-auto px-3",children:i.jsx(ct,{className:"!h-6 !w-6"})}),nk={...mt,success:(e,t)=>{const n=mt.success(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},error:(e,t)=>{const n=mt.error(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},warning:(e,t)=>{const n=mt.warning(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n},info:(e,t)=>{const n=mt.info(e,{...t,cancel:i.jsx(jo,{onClick:()=>mt.dismiss(n)})});return n}},rk=({...e})=>i.jsx(tk,{className:"toaster group",toastOptions:{classNames:{title:"py-3 px-0",toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg p-0",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",icon:"p-4 group-data-[type=error]:text-red-500 group-data-[type=success]:text-green-500 group-data-[type=warning]:text-amber-500 group-data-[type=info]:text-blue-500",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e});var Nh="Toggle",qs=u.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...a}=e,[s,l]=ye({prop:n,onChange:o,defaultProp:r??!1,caller:Nh});return i.jsx(z.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:B(e.onClick,()=>{e.disabled||l(!s)})})});qs.displayName=Nh;var Sh=qs;const Xs=Ft("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Eh=u.forwardRef(({className:e,variant:t,size:n,...r},o)=>i.jsx(Sh,{ref:o,className:I(Xs({variant:t,size:n,className:e})),...r}));Eh.displayName=Sh.displayName;var _t="ToggleGroup",[kh,ET]=be(_t,[Nt]),Ph=Nt(),Qs=C.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return i.jsx(ok,{...o,ref:t})}if(n==="multiple"){const o=r;return i.jsx(ak,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${_t}\``)});Qs.displayName=_t;var[Th,Mh]=kh(_t),ok=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[s,l]=ye({prop:n,defaultProp:r??"",onChange:o,caller:_t});return i.jsx(Th,{scope:e.__scopeToggleGroup,type:"single",value:C.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:C.useCallback(()=>l(""),[l]),children:i.jsx(jh,{...a,ref:t})})}),ak=C.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[s,l]=ye({prop:n,defaultProp:r??[],onChange:o,caller:_t}),c=C.useCallback(f=>l((m=[])=>[...m,f]),[l]),d=C.useCallback(f=>l((m=[])=>m.filter(h=>h!==f)),[l]);return i.jsx(Th,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:c,onItemDeactivate:d,children:i.jsx(jh,{...a,ref:t})})});Qs.displayName=_t;var[sk,ik]=kh(_t),jh=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:a,dir:s,loop:l=!0,...c}=e,d=Ph(n),f=bt(s),m={role:"group",dir:f,...c};return i.jsx(sk,{scope:n,rovingFocus:o,disabled:r,children:o?i.jsx(Ar,{asChild:!0,...d,orientation:a,dir:f,loop:l,children:i.jsx(z.div,{...m,ref:t})}):i.jsx(z.div,{...m,ref:t})})}),_o="ToggleGroupItem",_h=C.forwardRef((e,t)=>{const n=Mh(_o,e.__scopeToggleGroup),r=ik(_o,e.__scopeToggleGroup),o=Ph(e.__scopeToggleGroup),a=n.value.includes(e.value),s=r.disabled||e.disabled,l={...e,pressed:a,disabled:s},c=C.useRef(null);return r.rovingFocus?i.jsx(Ir,{asChild:!0,...o,focusable:!s,active:a,ref:c,children:i.jsx(Ah,{...l,ref:t})}):i.jsx(Ah,{...l,ref:t})});_h.displayName=_o;var Ah=C.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,a=Mh(_o,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?s:void 0;return i.jsx(qs,{...l,...o,ref:t,onPressedChange:c=>{c?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Ih=Qs,Rh=_h;const Dh=u.createContext({size:"default",variant:"default"}),Oh=u.forwardRef(({className:e,variant:t,size:n,children:r,...o},a)=>i.jsx(Ih,{ref:a,className:I("flex items-center justify-center gap-1",e),...o,children:i.jsx(Dh.Provider,{value:{variant:t,size:n},children:r})}));Oh.displayName=Ih.displayName;const $h=u.forwardRef(({className:e,children:t,variant:n,size:r,...o},a)=>{const s=u.useContext(Dh);return i.jsx(Rh,{ref:a,className:I(Xs({variant:s.variant||n,size:s.size||r}),e),...o,children:t})});$h.displayName=Rh.displayName;var[Ao,kT]=be("Tooltip",[Ct]),Io=Ct(),Lh="TooltipProvider",lk=700,Zs="tooltip.open",[ck,Js]=Ao(Lh),Fh=e=>{const{__scopeTooltip:t,delayDuration:n=lk,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,s=u.useRef(!0),l=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),i.jsx(ck,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:u.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:a})};Fh.displayName=Lh;var er="Tooltip",[uk,tr]=Ao(er),Bh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=e,c=Js(er,e.__scopeTooltip),d=Io(t),[f,m]=u.useState(null),h=pe(),p=u.useRef(0),v=s??c.disableHoverableContent,g=l??c.delayDuration,b=u.useRef(!1),[y,w]=ye({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zs))):c.onClose(),a==null||a(E)},caller:er}),x=u.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),S=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,w(!0)},[w]),k=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w(!1)},[w]),j=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,w(!0),p.current=0},g)},[g,w]);return u.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(On,{...d,children:i.jsx(uk,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:f,onTriggerChange:m,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:u.useCallback(()=>{v?k():(window.clearTimeout(p.current),p.current=0)},[k,v]),onOpen:S,onClose:k,disableHoverableContent:v,children:n})})};Bh.displayName=er;var ei="TooltipTrigger",zh=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tr(ei,n),a=Js(ei,n),s=Io(n),l=u.useRef(null),c=re(t,l,o.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),m=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),i.jsx($n,{asChild:!0,...s,children:i.jsx(z.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:B(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:B(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})});zh.displayName=ei;var ti="TooltipPortal",[dk,fk]=Ao(ti,{forceMount:void 0}),Vh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=tr(ti,t);return i.jsx(dk,{scope:t,forceMount:n,children:i.jsx(xe,{present:n||a.open,children:i.jsx(Ln,{asChild:!0,container:o,children:r})})})};Vh.displayName=ti;var Cn="TooltipContent",Wh=u.forwardRef((e,t)=>{const n=fk(Cn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,s=tr(Cn,e.__scopeTooltip);return i.jsx(xe,{present:r||s.open,children:s.disableHoverableContent?i.jsx(Hh,{side:o,...a,ref:t}):i.jsx(mk,{side:o,...a,ref:t})})}),mk=u.forwardRef((e,t)=>{const n=tr(Cn,e.__scopeTooltip),r=Js(Cn,e.__scopeTooltip),o=u.useRef(null),a=re(t,o),[s,l]=u.useState(null),{trigger:c,onClose:d}=n,f=o.current,{onPointerInTransitChange:m}=r,h=u.useCallback(()=>{l(null),m(!1)},[m]),p=u.useCallback((v,g)=>{const b=v.currentTarget,y={x:v.clientX,y:v.clientY},w=bk(y,b.getBoundingClientRect()),x=wk(y,w),S=yk(g.getBoundingClientRect()),k=Ck([...x,...S]);l(k),m(!0)},[m]);return u.useEffect(()=>()=>h(),[h]),u.useEffect(()=>{if(c&&f){const v=b=>p(b,f),g=b=>p(b,c);return c.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[c,f,p,h]),u.useEffect(()=>{if(s){const v=g=>{const b=g.target,y={x:g.clientX,y:g.clientY},w=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),x=!xk(y,s);w?h():x&&(h(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,f,s,d,h]),i.jsx(Hh,{...e,ref:a})}),[pk,hk]=Ao(er,{isInside:!1}),gk=rl("TooltipContent"),Hh=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,c=tr(Cn,n),d=Io(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Zs,f),()=>document.removeEventListener(Zs,f)),[f]),u.useEffect(()=>{if(c.trigger){const m=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,f]),i.jsx(Bt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:i.jsxs(Mr,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(gk,{children:r}),i.jsx(pk,{scope:n,isInside:!0,children:i.jsx(Au,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Wh.displayName=Cn;var Gh="TooltipArrow",vk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Io(n);return hk(Gh,n).isInside?null:i.jsx(jr,{...o,...r,ref:t})});vk.displayName=Gh;function bk(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wk(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function yk(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function xk(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const l=t[a],c=t[s],d=l.x,f=l.y,m=c.x,h=c.y;f>r!=h>r&&n<(m-d)*(r-f)/(h-f)+d&&(o=!o)}return o}function Ck(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Nk(t)}function Nk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Sk=Fh,Ek=Bh,kk=zh,Pk=Vh,Uh=Wh;const Tk=Sk,Mk=Ek,jk=kk,Yh=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(Pk,{children:i.jsx(Uh,{ref:r,sideOffset:t,className:I("z-50 overflow-hidden rounded-md bg-gray-800 px-3 py-1.5 text-xs text-white animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Yh.displayName=Uh.displayName;const _k=()=>{const[e,t]=C.useState([]);return[e,a=>{t([...e,a])},a=>{const s=[...e];s.splice(a,1),t(s)},(a,s)=>{const l=[...e];l.filter(c=>c[a]!==s),t(l)}]};function Ak(){const[e,t]=C.useState(null);return[e,async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),t(r),!0}catch(o){return console.warn("Copy failed",o),t(null),!1}}]}function Kh(e,t=250){const[n,r]=C.useState(e);return C.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}const qh=u.createContext(void 0),Xh={sm:"sm:max-w-[425px]",md:"sm:max-w-[550px]",lg:"sm:max-w-[700px]",xl:"sm:max-w-[900px]"},Qh={info:{icon:pl,className:"text-blue-500"},success:{icon:dl,className:"text-green-500"},error:{icon:ra,className:"text-red-500"},warning:{icon:ul,className:"text-yellow-500"},confirm:{icon:fl,className:"text-blue-500"},custom:{icon:fl,className:"text-gray-500"}};function Ik({children:e}){var g,b,y,w,x,S,k,j,E,P,_,$,H,q;const[t,n]=u.useState({isOpen:!1,options:null}),r=u.useCallback(W=>{n({isOpen:!0,options:W})},[]),o=u.useCallback(()=>{n(W=>({...W,isOpen:!1}))},[]),a=u.useCallback(W=>{r({...W,type:"info"})},[r]),s=u.useCallback(W=>{r({...W,type:"success"})},[r]),l=u.useCallback(W=>{r({...W,type:"error"})},[r]),c=u.useCallback(W=>{r({...W,type:"warning"})},[r]),d=u.useCallback(W=>{r({...W,type:"custom"})},[r]),f=u.useCallback(W=>{r({...W,type:"confirm"})},[r]),m=(W,U,te)=>{let V=Qh[W].icon;return U&&(V=U),i.jsx(V,{className:I("h-24 w-24",Qh[W].className,te)})},h=u.useMemo(()=>({open:r,close:o,info:a,success:s,error:l,warning:c,custom:d,confirm:f}),[r,o,a,s,l,c,d,f]),[p,v]=u.useState(!1);return i.jsxs(qh.Provider,{value:h,children:[e,i.jsx(po,{open:t.isOpen,onOpenChange:W=>!W&&o(),children:i.jsxs(Zn,{className:I((g=t.options)!=null&&g.size?Xh[t.options.size]:Xh.sm,(b=t.options)==null?void 0:b.className),showCloseButton:((y=t.options)==null?void 0:y.showCloseButton)??!0,onInteractOutside:W=>{var U;(U=t.options)!=null&&U.blockOutsideClick&&W.preventDefault()},children:[t.options&&i.jsxs(ho,{children:[i.jsx("div",{className:"mx-auto mb-6",children:m(t.options.type,t.options.icon,t.options.iconClassName)}),t.options.title&&i.jsx(go,{className:"text-center",children:t.options.title}),i.jsx(vo,{className:"text-center",children:t.options.message})]}),((w=t.options)==null?void 0:w.type)==="confirm"&&i.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[i.jsx(fe,{isLoading:p??((S=(x=t.options)==null?void 0:x.confirmButton)==null?void 0:S.loading),disabled:(j=(k=t.options)==null?void 0:k.confirmButton)==null?void 0:j.disabled,className:(E=t.options.confirmButton)==null?void 0:E.className,onClick:()=>{var U,te,V,X;if(!((te=(U=t.options)==null?void 0:U.confirmButton)!=null&&te.onClick))throw new Error("Confirmation type dialog needs to implement the onConfirm function");const W=(X=(V=t.options)==null?void 0:V.confirmButton)==null?void 0:X.onClick();W instanceof Promise?(v(!0),W.then(()=>{v(!1),o()}).finally(()=>v(!1))):o()},children:((P=t.options.confirmButton)==null?void 0:P.label)??"Confirm"}),((_=t.options.cancelButton)==null?void 0:_.label)&&i.jsx(fe,{variant:"outline",onClick:o,className:t.options.cancelButton.className,isLoading:($=t.options.cancelButton)==null?void 0:$.loading,disabled:p||((H=t.options.cancelButton)==null?void 0:H.disabled),children:(q=t.options.cancelButton)==null?void 0:q.label})]})]})})]})}function Rk(){const e=u.useContext(qh);if(e===void 0)throw new Error("useDialog must be used within a DialogProvider");return e}const Dk=(e=!1)=>{const[t,n]=u.useState(e),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]),a=u.useCallback(()=>n(s=>!s),[]);return{isOpen:t,open:r,close:o,toggle:a}},Ok=(e=!1)=>{const[t,n]=u.useState(e),r=u.useCallback(()=>n(!0),[]),o=u.useCallback(()=>n(!1),[]);return[t,r,o]};/*!
|
|
291
291
|
* Compressor.js v1.2.1
|
|
292
292
|
* https://fengyuanchen.github.io/compressorjs
|
|
293
293
|
*
|