@zuzjs/ui 1.0.25 → 1.0.27
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/bin.cjs +4 -4
- package/dist/bin.js +1 -1
- package/dist/css/styles.css +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -6
- package/package.json +2 -2
- /package/dist/{chunk-X2GGFKXO.js → chunk-4MKLFX4L.js} +0 -0
- /package/dist/{chunk-S2I6IQYE.cjs → chunk-WLB2PTNQ.cjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f,e,g,d,h,c}from'./chunk-
|
|
1
|
+
import {f,e,g,d,h,c}from'./chunk-4MKLFX4L.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-4MKLFX4L.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useImperativeHandle,useState,useCallback,createElement,isValidElement,useId,useLayoutEffect,useContext,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useCommandActions,useDimensions,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {MD5,uuid,withPost,_,clamp,timeSince,toHash,numberInRange,checkPasswordStrength,PubSub}from'@zuzjs/core';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var qo={Circle:"CIRCLE",Square:"SQUARE"},zp={Default:"DEFAULT",Circle:"CIRCLE"},_p={Light:"light",Dark:"dark",System:"system"},Se={Default:"DEFAULT",Switch:"SWITCH"},At={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},oe=At,qe=AnchorType,Fp=qe,K={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Zp={Asc:"ASC",Desc:"DESC"},Kp={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Wp={Dots:"DOTS"},Ce={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},ue={Success:"success",Error:"error",Warning:"warning",Info:"info"},G={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},q={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Up={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},fe={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},ze=fe,$t={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},Xo=$t,Gp={Bar:"BAR",Ring:"RING"},dt={Default:"range",Text:"number"},zt={Default:"DEFAULT",Card:"CARD"},gt={Gooey:"gooey"},ie={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Yo=Symbol.for("zuz.global.map"),Qo=t=>{globalThis[Yo]=t;},Ks=()=>globalThis[Yo]||{},_t=t=>{let s=Array.isArray(t)?t.join(" "):t;if(!s||typeof s!="string")return "";let e$1=Ks();return process.env.NODE_ENV==="development"&&Object.keys(e$1).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(s).filter(Boolean).map(o=>{let r=o.match(/^([&@][\w-]+)\((.*)\)$/);if(r){let[l,m,f]=r;return g(f).map(i=>{let c=`${m}(${i})`;return e$1[c]||i}).join(" ")}return e$1[o]||o}).join(" ")},fu=t=>{let s=Array.isArray(t)?t.join(" "):t;return !s||typeof s!="string"?"":_t(s)},Jo=t=>{let s={};for(let e in t){let n=t[e];if(e.startsWith("--")){s[e]=n;continue}let o=d[e]?.toString()??e;if(o==="x"||o==="translateX"){let r=s.translate?.split(" ")??["0px","0px"];s.translate=`${h.addUnitsSafely(e,n)} ${r[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let r=s.translate?.split(" ")??["0px","0px"];s.translate=`${r[0]??"0px"} ${h.addUnitsSafely(e,n)}`;}else c.includes(o)?s[o]=h.addUnitsSafely(e,n):s[o]=n;}return s},Ft=t=>{if(!t)return "linear";switch(t.toUpperCase()){case G.Bounce:return "var(--bounce)";case G.Liquid:return "var(--liquid)";case G.Spring:return "var(--spring)";case G.EaseInOut:return "ease-in-out";case G.EaseOutBack:return "ease-out-back";default:return "linear"}},Xe=(t,s=0)=>{let e={},n={},o=s||20;switch(t){case q.SlideInLeft:case q.SlideInRight:e={"--fx-x":t===q.SlideInLeft?`-${o}px`:`${o}px`,opacity:0},n={"--fx-x":"0px",opacity:1};break;case q.SlideInTop:case q.SlideInBottom:e={"--fx-y":t===q.SlideInTop?`-${o}px`:`${o}px`,opacity:0},n={"--fx-y":"0px",opacity:1};break;case q.ScaleIn:e={scale:0,opacity:0},n={scale:1,opacity:1};break;case q.FadeIn:e={opacity:0},n={opacity:1};break}return {from:e,to:n}},du=(t,s,e)=>{let{from:n,to:o}=Xe(t);return s?{...n,...o}:e?n:o};var Us=(t,s)=>{let e=useRef([]),n=useRef(false);return useEffect(()=>{t?.when||(n.current=false);},[t?.transition]),useEffect(()=>{let o=s?.current;if(!o||!t||!t.clearAtEnd)return;let r=l=>{e.current.includes(l.propertyName)&&t.clearAtEnd===true&&(o.style.transform="",o.style.filter="",e.current.forEach(m=>o.style.removeProperty(m)));};return o.addEventListener("transitionend",r),()=>o.removeEventListener("transitionend",r)},[t,s]),useEffect(()=>{if(typeof window>"u"||!s?.current)return;let o=s.current;(t?.scroll||t?.mouse)&&(o.style.willChange="transform",o.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",o.style.transition=`translate 0.1s ${t.curve?Ft(t.curve):"var(--spring)"}`);},[t,s]),useMemo(()=>{if(!t)return {style:{}};let{transition:o,from:r,to:l,exit:m,when:f,duration:i=.3,delay:c=0,curve:p,watch:a=[]}=t,g=f===false&&!n.current;f===true&&(n.current=true);let T={},{from:h,to:S}=o?Xe(o):{from:r||{},to:l||{}};T=f===void 0?{...h,...S}:f?{...S}:m||h;let P=Ft(p),R=[],y=Jo(T);e.current=Object.keys(y);let d={...y};return Object.keys(y).forEach(I=>{let w=I.startsWith("--")?"all":I;R.includes(w)||R.push(`${w} ${i}s ${P} ${c}s`);}),a.forEach(I=>{R.includes(I)||R.push(`${I} 0.1s ${P} 0s`);}),{style:{...d,transition:g?"none":R.join(", "),opacity:g?0:d.opacity,pointerEvents:g?"none":d.pointerEvents}}},[t,t?.when,t?.watch])},le=Us;var Gs=(t,s)=>{let{as:e,fx:n,transition:o,skeleton:r,className:l,propsToRemove:m,style:f$1,...i}=t||{},c=o?{transition:o,duration:.3}:n||{},{style:p}=le(c,s),a=_t(e??"");return {style:{...f$1,...p},className:[l||"",a||"",r?.enabled?"--skeleton":""].join(" ").trim(),rest:{...f(i,m?[...m,"skeleton"]:["skeleton"])}}},E=Gs;var tr="(prefers-color-scheme: dark)",Ys=typeof window>"u",rr=createContext(void 0),Ut=t=>{let s=useContext(rr);if(!s){if(t===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return s},X=Ut,Qs=({children:t,storageKey:s="--ucs",forceTheme:e,zuzMap:n,...o})=>(n&&Qo(n),jsx(Js,{storageKey:s,forceTheme:e,...o,children:t})),Js=({children:t,storageKey:s,forceTheme:e,...n})=>{let[o,r]=useState(()=>e||or(s,"system")),[l,m]=useState(()=>e||or(s)),f=a=>(a||(a=window.matchMedia(tr)),a.matches?"dark":"light"),i=useCallback(a=>{let g=a=="system"?f():a,T=document.documentElement;T.setAttribute("color-scheme",g),T.style.colorScheme=g,m(g);},[f]),c=useCallback(a=>{r(a),localStorage.setItem(s,a),i(a);},[o]),p=useCallback(a=>{let g=f(a);m(g),o==="system"&&i("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(s);},[o]),useEffect(()=>{window.matchMedia(tr).addEventListener("change",p);},[p]),useEffect(()=>{let a=g=>{g.key==s&&(g.newValue?c(g.newValue):c("system"));};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[c]),useEffect(()=>{i(e||o||"system");},[o]),jsxs(rr,{value:{colorScheme:o,resolvedScheme:l,setColorScheme:c,...n},children:[e?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
2
2
|
const themes = ['light', 'dark']
|
|
3
3
|
let theme = localStorage.getItem(\`${s}\`) || "system";
|
|
4
4
|
if (theme === "system") {
|
|
5
5
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
6
6
|
}
|
|
7
7
|
document.documentElement.setAttribute("color-scheme", theme);
|
|
8
|
-
document.documentElement.style.colorScheme = theme;`}}),jsx(qt,{children:t})]})},or=(t,s)=>{if(Ys)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||s};var nr=({ref:t,...s})=>{let{style:e,...r}=s,{style:o,className:n,rest:i}=E(r);return jsx("span",{ref:t,style:e,className:n,...i})};nr.displayName="Zuz.Span";var te=nr;var ar=forwardRef((t,s)=>{let{name:e,pathCount:r,variant:o,color:n,...i}=t,{variant:m}=X(true),{className:f,style:l,rest:c}=E(i);return jsx("div",{style:{color:n,...l},className:`icon-${e} --icon --${o||m||K.Small} ${f}`.trim(),ref:s,...c,children:Array(r||0).fill(0).map((p,a)=>jsx(te,{className:`path${a+1}`},`${e}-layer-${a}`))})});ar.displayName="Zuz.Icon";var Q=ar;var se={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var ir=t=>{let{type:s,variant:e,color:r,...o}=t,{className:n,style:i,rest:m}=E(o),{spinner:f}=X(true),l=()=>{switch(s||f?.type||se.Simple){case se.Simple:return null;case se.Wave:return jsxs(Fragment$1,{children:[jsx(u,{as:"--bar --bar1"}),jsx(u,{as:"--bar --bar2"}),jsx(u,{as:"--bar --bar3"})]});case se.Roller:return null}};return jsx(u,{className:`${n} --spinner --${(s||f?.type||se.Simple).toLowerCase()} --${e||f?.variant||K.Small}`.trim(),style:{...i},...m,children:l()})};ir.displayName="Zuz.Spinner";var he=ir;var xt={Loading:"loading",Normal:"normal"};var cr=({ref:t,...s})=>{let{reset:e,kind:r="solid",variant:o,icon:n,iconSize:i,children:m,withLabel:f,spinner:l,state:c,disabled:p,...a}=s,{style:d,className:T,rest:h}=E(a),{variant:S}=X(true);return jsxs("button",{className:`--button --${r} --${o||S} flex aic ${e?"":"jcc"} ${n?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:d,ref:t,disabled:c==xt.Loading||s.skeleton?.enabled||p,...h,children:[c==xt.Loading&&jsx(he,{variant:o||S,type:l||se.Simple}),(!c||c==xt.Normal)&&jsxs(Fragment$1,{children:[n&&jsx(Q,{variant:i,name:n}),f===true?jsx(te,{children:m}):m]})]})};cr.displayName="Zuz.Button";var z=cr;var pr=forwardRef((t,s)=>{let{h:e,html:r,children:o,lines:n,...i}=t,{style:m,className:f,rest:l}=E(i),c=`h${t.h||1}`;return jsx(c,{ref:s,style:m,className:f,...l,children:r?jsx(te,{dangerouslySetInnerHTML:{__html:r}}):o})});pr.displayName="Zuz.Text";var V=pr;var aa=t=>{let{label:s,labelColor:e,icon:r,iconColor:o,index:n,className:i,onSelect:m}=t;return s=="-"?jsx(u,{className:"--line"}):jsxs(z,{reset:true,onClick:f=>m?.(t),className:`--item ${i||""}`.trim(),children:[jsx(u,{as:"--icon",children:jsx(Q,{name:r,className:"--ico",style:o?{color:o}:{}})}),jsx(V,{className:"--lbl flex aic",style:e?{color:e}:{},children:s})]})},ur=aa;var gr=({ref:t,...s})=>{let{id:e,as:r,fx:o,offsetX:n,offsetY:i,parent:m,event:f,arrow:l,when:c,items:p,header:a,footer:d,origin:T=qe.TopRight,...h}=s,[S,P]=useState(false),[R,y]=useState(p||[]),{position:g,targetRef:I,calculatedAnchor:v}=useAnchorPosition(m?.current,f,{offsetX:n,offsetY:i,preferredAnchor:T}),N=m&&g.top>m.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",O=useMemo(()=>{let U=v.toLowerCase();return U.includes("left")?"--arrow-left":U.includes("right")?"--arrow-right":"--arrow-center"},[v]),L=g.top!==0||g.left!==0;useEffect(()=>{c&&L?P(true):c||P(false);},[c,L]);let{className:$,style:B,rest:_}=E(h),F=le({...o?.transition?{transition:o.transition??q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??G.EaseInOut,duration:o?.duration??.05,when:S&&L});return jsxs(u,{ref:I,className:`--contextmenu ${l||m!=null?`--has-arrow ${N} ${O}`:""} abs flex cols ${$}`.trim(),"aria-hidden":!S,style:{...B,...F.style,top:g.top,left:g.left,visibility:L?"visible":"hidden",transformOrigin:v},..._,children:[typeof a=="function"?createElement(a):a,R.map((U,x)=>jsx(ur,{...U,index:x},`context-${U.label.toLowerCase()}-${x}`)),typeof d=="function"?createElement(d):d]})};gr.displayName="Zuz.ContextMenu";var Yt=gr;var hr=forwardRef((t,s)=>{let{children:e,fx:r,when:o,fxDelay:n,fxStep:i,classToIgnore:m,...f}=t,l=X(true),c=useDelayed(),p=r||l?.group?.fx,a=n||l?.group?.fxDelay,d=i||l?.group?.fxStep,T=m||l?.group?.classToIgnore||"--ignore",h=useMemo(()=>p?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let P=S.props||{},R="fx"in P,y=P.as?Array.isArray(P.as)?P.as.join(" "):P.as:P.className||"",g=typeof y=="string"&&y.includes(T);return !R&&!g},S=>({fx:{...p,delay:(a||0)+S*(d||.1),when:o??(r?.when||c)}})):e,[e,o,c,p]);return jsx(u,{className:"--group",ref:s,...f,children:h})});hr.displayName="Zuz.Group";var Qt=hr;var xr=forwardRef((t,s)=>{let{message:e,spinner:r,spinnerSize:o,color:n,when:i,hideMessage:m,...f}=t,{className:l,style:c,rest:p}=E(f),{spinner:a}=X(true);return "when"in t&&t.when==false?null:jsxs(Qt,{fx:{transition:q.SlideInBottom,curve:G.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...p,children:[jsx(he,{variant:o||a?.variant||K.Small,type:r||a?.type||se.Simple}),!m&&jsx(V,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});xr.displayName="Zuz.Cover";var ye=xr;var br=forwardRef((t,s)=>{let{when:e,...r}=t;return jsx(u,{ref:s,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:q.FadeIn,when:e},...r})});br.displayName="Zuz.Overlay";var Me=br;var Ca=({action:t,render:s=true,message:e=""})=>jsx(u,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:s?e:null}),wr=Ca;var Pa=({action:t,actionPosition:s,dialogID:e,variant:r})=>jsx(u,{as:`--footer flex aic rel ${s?s==Xo.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,n)=>jsx(z,{variant:r,onClick:i=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),Sr=Pa;var Ra={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[ue.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[ue.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[ue.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[ue.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},H=Ra;var Ia=({title:t="Alert",onClose:s})=>jsxs(u,{as:"--head flex aic rel",children:[jsx(u,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx(z,{onClick:e=>s(),className:"--closer abs center-v",children:H.close})]}),Tr=Ia;var Nr=({ref:t,...s})=>{let{index:e,id:r,title:o,message:n,transition:i,curve:m,speed:f,type:l,action:c,actionPosition:p,spinner:a,loadingMessage:d,variant:T,inBackground:h,forceClose:S,forceLoading:P,onClose:R,onShow:y,onHide:g,...I}=s,v=useMemo(()=>uuid(12),[]),[C,N]=useState(o||""),[O,L]=useState(n||""),[$,B]=useState(l||ze.Dialog),[_,F]=useState(false),[U,x]=useState(true),[M,A]=useState(c||null),[W,D]=useState(false),{variant:Z,spinner:Y,dialog:J}=X(true),ee=T||J?.variant||Z||K.Small,{style:pe,className:ne,rest:we}=E(I),ke=useRef(null),ve=le({when:_,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:i||J?.transition||q.SlideInBottom,curve:m||J?.curve||G.EaseInOut,watch:["scale","filter","transform"]}),ae=()=>{F(false),R(r);};useEffect(()=>{B(ze.Dialog),L(n),N(C),M&&A(M.reduce((Fo,Zo)=>(Fo.push({...Zo,key:Zo.key||uuid(12)}),Fo),[])),F(true),setTimeout(()=>y?y():()=>{},500);},[]),useEffect(()=>{S&&ae();},[S]),useEffect(()=>{P!=null&&D(P);},[P]);let j=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(Me,{style:{zIndex:j},when:_}),jsxs(u,{as:`--dialog --${(l??ze.Default).toLowerCase()} ${_?"--visible":""} ${ne} fixed abc`.trim(),style:{...ve.style,zIndex:j+1,pointerEvents:h==true?"none":"auto",...h==true?{scale:"0.92",filter:"blur(2px)"}:{}},...we,ref:ke,children:[jsx(Tr,{title:C,onClose:ae}),jsx(wr,{message:O,render:U,action:M}),M&&M.length>0&&jsx(Sr,{variant:ee,action:M,dialogID:v,actionPosition:p}),jsx(ye,{when:W,spinner:a||J?.spinner||Y?.type||se.Simple,message:d||J?.loadingMessage})]})]})};Nr.displayName="Zuz.Dialog";var jt=Nr;var eo=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(s){return this.stack[this.stack.length-1]===s}push(s){this.stack.includes(s)||(this.stack.push(s),this.updateScrollLock());}pop(s){this.stack=this.stack.filter(e=>e!==s),this.updateScrollLock();}handleEscape(){let s=this.stack[this.stack.length-1];return s?(s(),true):false}get count(){return this.stack.length}},Qe=new eo;var Er=forwardRef((t,s)=>{let{speed:e,style:r,...o}=t,{rootRef:n,containerRef:i,thumbY:m,thumbX:f,onScrollY:l,onScrollX:c}=useScrollbar(e||1),{style:p,className:a,rest:d}=E(o);return useEffect(()=>{let T=i.current;if(!T)return;let h=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",h),()=>T.removeEventListener("scroll",h)},[]),jsxs(u,{ref:n,className:a.trim(),as:"--scrollview rel",children:[jsx(u,{as:`--scroll-content ${a}`.trim(),ref:i,style:r||{},children:d.children}),jsx(u,{as:"--scroll-track --track-y --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:m,onMouseDown:l})}),jsx(u,{as:"--scroll-track --track-x --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:f,onMouseDown:c})})]})});Er.displayName="Zuz.ScrollView";var to=Er;var Br=({ref:t,...s})=>{let{id:e,index:r,from:o,speed:n,children:i,margin:m,animation:f,prerender:l,inBackground:c,forceClose:p,forceLoading:a,onClose:d,...T}=s,{drawer:h}=X(true),[S,P]=useState(i),[R,y]=useState(false),[g,I]=useState(l??(h?.prerender||true)),[v,C]=useState(false),N=()=>{y(false),d?.(e??-1);},{className:O,style:L,rest:$}=E(T),B=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Qe.isTop(N)&&N();}}],[R]);useShortcuts(B),useEffect(()=>{P(i);},[i]),useEffect(()=>(R?Qe.push(N):Qe.pop(N),()=>Qe.pop(N)),[R]),useEffect(()=>{y(true);},[]),useEffect(()=>{p&&N();},[p]),useEffect(()=>{a!=null&&C(a);},[a]);let _=o||h?.from||ie.Left,F=useMemo(()=>{switch(_){case ie.Left:return {from:{x:"-100vw"},to:{x:0}};case ie.Right:return {from:{x:"100vw"},to:{x:0}};case ie.Top:return {from:{y:"-100vh"},to:{y:0}};case ie.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,h?.from]),U=le({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:R,curve:f||h?.animation||G.EaseInOut,duration:n||h?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(r||1)*10,[r]);return jsxs(Fragment$1,{children:[jsx(Me,{onClick:M=>{R&&N();},when:R,style:{zIndex:x}}),jsxs(u,{ref:t,"aria-hidden":!R,className:`--drawer flex cols ${O} --${_.toLowerCase()} fixed`,style:{...L,...U.style,"--m":`${m||h?.margin||0}px`,zIndex:x+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...$,children:[o==ie.Top||o==ie.Bottom?jsx(u,{className:"--handle"}):null,jsxs(to,{as:"rel",children:[g||R?S:null,jsx(ye,{when:v})]})]})]})};Br.displayName="Zuz.Drawer";var so=Br;var kr=forwardRef((t,s)=>{let{progress:e,type:r,animated:o,...n}=t,i=useRef(null);useImperativeHandle(s,()=>({setProgress:c=>{i.current.style.width=`${c*100}%`;}}),[]),useEffect(()=>{e&&i.current&&(o?setTimeout(()=>i.current.style.width=`${e*100}%`,500):i.current.style.width=`${e*100}%`);},[e,i.current]);let{className:m,style:f,rest:l}=E(n);return jsx(u,{className:`--progress ${o?"--animated":""} flex rel ${m}`.trim(),style:f,...l,children:jsx(u,{ref:i,className:"--bar rel"})})});kr.displayName="Zuz.ProgressBar";var et=kr;var vt=(n=>(n.Default="default",n.Success="success",n.Error="error",n.Warn="warn",n.Promise="promise",n))(vt||{}),St=(i=>(i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(St||{}),Mr=(e=>(e.Stack="stack",e.Individual="individual",e))(Mr||{}),Or={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Fa=t=>{let{index:s,id:e,type:r,icon:o,title:n,message:i,duration:m,sticky:f=false,actions:l=[],position:c,style:p,isHovered:a,total:d,progress:T,forceClose:h,variant:S,onClick:P,onClose:R}=t,[y,g]=useState(false),[I,v]=useState(false),{toast:C}=X(true),N=I||h,O=c||C?.position||"TopCenter",L=r||C?.type||"default",$=p||C?.style||"stack",B=m||C?.duration||4,_=T||C?.progress||false,F=useRef(B*1e3),U=useRef(void 0),x=useRef(void 0),M=useRef(null),A=le({when:y&&!N,duration:.3,transition:C?.transition||(O.includes("Top")?q.SlideInTop:O.includes("Bottom")?q.SlideInBottom:O.includes("Left")?q.SlideInLeft:q.SlideInRight),curve:C?.curve||G.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{g(true);let ne=we=>{if(x.current!==void 0){let ke=we-x.current;if(!a&&!f&&!N&&(F.current-=ke,M.current)){let ve=Math.max(0,F.current/(B*1e3)*100);M.current?.setProgress?.(ve/100);}}x.current=we,F.current<=0?v(true):U.current=requestAnimationFrame(ne);};return U.current=requestAnimationFrame(ne),()=>{U.current&&cancelAnimationFrame(U.current);}},[a,f,N,B]),useEffect(()=>{if(N){let ne=setTimeout(()=>{R?.(e);},350);return ()=>clearTimeout(ne)}},[N,e]);let W=$==="stack",D=a?s*65:s*8,Z=a?1:Math.max(.85,1-s*.05),Y=a?1:Math.max(.4,1-s*.2),J=()=>{P?P():(!l||l.length===0)&&v(true);},ee=A.style.transform||"translate(0, 0)",pe=N?ee:`${ee} translateY(${O.includes("Top")?D:-D}px) scale(${Z})`;return jsxs(u,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${S||C?.variant||K.Medium} --${L} --${O.toLowerCase()} abs flex aic`,style:{...A.style,zIndex:1e3-s,pointerEvents:N?"none":"auto",opacity:N?A.style.opacity:Y,transform:pe,filter:!N&&W&&!a&&s>0?"blur(1px)":"none",cursor:!l||l.length===0?"pointer":"default",transition:`${A.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(u,{as:"--ico flex aic jcc",children:o?jsx(Q,{name:o}):jsx(u,{as:"--no-icon"})}),jsxs(u,{as:"--meta flex cols",children:[jsx(V,{as:"--tt",children:n||Or[r]}),jsx(V,{as:"--tm",children:i})]}),l&&l.length>0&&jsx(u,{as:"--actions flex gap:5",children:l.map((ne,we)=>jsx(z,{as:"--snack-btn bold",onClick:ke=>{ke.stopPropagation(),ne.onClick();},children:ne.label},we))}),_&&jsx(et,{as:"abs",ref:M})]})},ao=Fa;var ce=createContext(null),qa=({ref:t,...s})=>{let r=useContext(ce)?.depth??0,[o,n]=useState(null),[i,m]=useState(null),[f,l]=useState(false),[c,p]=useState([]),a=useDelayed(),d=useRef(0),T=()=>++d.current,h=()=>{l(false),setTimeout(()=>m(null),200);};useImperativeHandle(t,()=>({add(g){let I=T(),v={id:I,...g};return p(C=>[...C,v]),I},openMenu(g){l(false),setTimeout(()=>{m({id:T(),type:"menu",props:g}),l(true);},16);},remove(g){p(I=>I.map(v=>v.id===g?{...v,props:{...v.props,forceClose:true}}:v)),i?.id===g&&h();},loading(g,I){p(v=>v.map(C=>C.id===g?{...C,props:{...C.props,forceLoading:I}}:C)),i?.id===g&&h();},clear(g){p(c.filter(I=>I.type!=g));}})),useEffect(()=>{if(i&&f){let g=()=>h();return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}},[i,f,h]);let S=g=>{setTimeout(()=>{p(I=>I.filter(v=>v.id!==g)),i?.id===g&&m(null);},250);},P=useMemo(()=>[...c.filter(g=>g.type!="toast")],[c]);if(!a)return null;let R=c.filter(g=>g.type=="toast").reverse(),y=Object.values(St);return createPortal(jsxs(u,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[P.map((g,I)=>{let v=I<P.length-1;return g.type==="dialog"?jsx(jt,{onClose:S,index:I,id:g.id,...g.props,inBackground:v},`layer-${g.type}-${g.id}`):g.type==="drawer"?jsx(so,{onClose:S,index:I,id:g.id,...g.props,inBackground:v},`layer-${g.type}-${g.id}`):null}),y.map(g=>{let I=R.filter(v=>(v.props.position||"TopCenter")===g);return I.length===0?null:jsx(u,{onMouseEnter:()=>n(g),onMouseLeave:()=>n(null),as:`--toast-container fixed --${g.toLowerCase()} flex cols`,style:{pointerEvents:"auto"},children:I.map((v,C)=>jsx(ao,{index:C,total:I.length,isHovered:o===g,onClose:S,id:v.id,...v.props},v.id))},g)}),i&&jsx(u,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Yt,{onClose:h,when:f,...i.props},`menu-${i.id}`)})]}),document.body)},Xa=({children:t})=>{let s=useContext(ce),e=s?s.depth+1:0,r=useRef(null),o=useMemo(()=>({add:n=>r.current?.add(n),openMenu:n=>r.current?.openMenu(n),remove:n=>r.current?.remove(n),loading:(n,i)=>r.current?.loading(n,i),clear:n=>r.current?.clear(n),depth:e,isSubLayer:!!s}),[s]);return jsxs(ce.Provider,{value:o,children:[t,jsx(qa,{ref:r})]})},qt=Xa;var Qa=()=>{let t=useContext(ce);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,o,n)=>{r.preventDefault(),t.openMenu({event:r,items:o,origin:n});},showMenu:(r,{items:o,origin:n,offsetX:i,offsetY:m,transition:f,curve:l,arrow:c,duration:p,header:a,footer:d})=>{t.openMenu({fx:{transition:f,curve:l,duration:p},parent:r,items:o,origin:n||qe.TopCenter,offsetX:i,offsetY:m,arrow:c,header:a,footer:d});},hide:t.clear}},Ja=Qa;var ei=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("dialog"),e=n=>t.remove(n),r=(n,i)=>t.loading(n,i);return {clearAll:s,show:n=>{let i=t.add({type:"dialog",props:{...n,type:ze.Dialog}});return {id:i,setLoading:m=>r(i,m),hide:()=>e(i)}},hide:e}},ti=ei;var ri=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("drawer"),e=n=>t.remove(n),r=(n,i)=>t.loading(n,i),o=n=>{let i=t.add({type:"drawer",props:n});return {id:i,setLoading:m=>r(i,m),close:()=>e(i)}};return {clearAll:s,open:n=>o({children:n}),right:n=>o({children:n,from:ie.Right}),left:n=>o({children:n,from:ie.Left}),top:n=>o({children:n,from:ie.Top}),bottom:n=>o({children:n,from:ie.Bottom}),close:e}},ni=ri;var ai=(t,s,e={})=>{let[r,o]=useState(null),[n,i]=useState(false),{duration:m=.25,curve:f=G.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=e;return useLayoutEffect(()=>{s&&t.current?(o(t.current.getBoundingClientRect()),i(true)):s||i(false);},[s,t]),{style:le({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:f,duration:m,when:n&&s}).style,isMeasured:n,sourceRect:r}},ii=ai;var pi=(t,s={})=>{let{offset:e=8,direction:r="bottom",container:o=null,triggerRef:n=null}=s,i=useRef(null),m=useCallback(()=>{let f=t.current;if(!f)return;let l=n?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=f.getBoundingClientRect(),p=l.getBoundingClientRect(),a,d;o?(a=o.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(f).position==="fixed"?d="fixed":d="absolute",d==="fixed"?a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==d&&(f.style.position=d),i.current=d;let S=0,P=0;switch(r){case "top":S=p.top-c.height-e,P=p.left,S<a.top&&p.bottom+c.height+e<=a.bottom&&(S=p.bottom+e);break;case "bottom":S=p.bottom+e,P=p.left,S+c.height>a.bottom&&p.top-c.height-e>=a.top&&(S=p.top-c.height-e);break;case "left":S=p.top,P=p.left-c.width-e,P<a.left&&p.right+c.width+e<=a.right&&(P=p.right+e);break;case "right":S=p.top,P=p.right+e,P+c.width>a.right&&p.left-c.width-e>=a.left&&(P=p.left-c.width-e);break}if(S=Math.max(a.top,Math.min(S,a.bottom-c.height)),P=Math.max(a.left,Math.min(P,a.right-c.width)),i.current==="fixed")f.style.top=`${S}px`,f.style.left=`${P}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let y=S-R.top+window.scrollY,g=P-R.left+window.scrollX;f.style.top=`${y}px`,f.style.left=`${g}px`;}},[t,n,e,r,o]);return useEffect(()=>{let f=t.current;if(!f)return;let l=n?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(m);return c.observe(f),l&&c.observe(l),m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,true);}},[t,r,e,o,n]),{postion:i.current,reposition:m}},tt=pi;var fi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(p,a)=>t.add({type:"toast",props:{...a,type:p}}),r=p=>t.remove(p),l=(p,a,d)=>{let T=s(p,{...a,sticky:a.sticky??false,actions:[{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(T);}}]});return T},c=(p,a,d,T)=>{let h=s(p,{...a,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),r(h);}},{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(h);}}]});return h};return {ok:(p,a)=>l("default",p,a),success:(p,a)=>l("success",p,a),error:(p,a)=>l("error",p,a),confirm:(p,a,d)=>c("default",p,a,d),warn:(p,a)=>l("warn",p,a)}},di=fi;var hi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(l,c)=>t.add({type:"toast",props:{...c,type:l}});return {show:(l,c,p,a)=>s("default",{title:l,message:c,icon:p,duration:a}),hide:l=>t.remove(l),success:(l,c,p,a)=>s("success",{title:l,message:c,icon:p,duration:a}),error:(l,c,p,a)=>s("error",{title:l,message:c,icon:p,duration:a}),warn:(l,c,p,a)=>s("warn",{title:l,message:c,icon:p,duration:a}),promise:(l,c,p,a)=>s("promise",{title:l,message:c,icon:p,duration:a}),clearAll:()=>t.clear("toast")}},io=hi;var Zr=({ref:t,style:s,...e})=>{let r=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:r,[t]),{style:n,className:i,rest:m}=E(e,o);return jsx("div",{ref:t||r,style:{...n,...s||{}},className:i,...m})};Zr.displayName="Zuz.Box";var u=Zr;var Wr=forwardRef((t,s)=>{let{title:e,message:r,...o}=t,[n,i]=useState(false);return jsxs(u,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:m=>i(!n),className:`--toggle flex aic ${n?"--open":""}`.trim(),children:[jsx(V,{className:"--label flex",children:e}),jsx(u,{className:"--arrow flex",children:n?H.arrowUp:H.arrowDown})]}),n&&jsx(u,{className:"--detail",children:r})]})});Wr.displayName="Zuz.Accordion";var Si=Wr;var Ci=({label:t,icon:s,onClick:e,idx:r,selected:o})=>jsx(z,{onClick:e,onMouseMove:n=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof s=="string"?jsx(Q,{name:s}):s}),Gr=Ci;var qr=forwardRef((t,s)=>{let{items:e,name:r,selected:o,position:n,...i}=t,m=useRef(null),[f,l]=useState(o||e[0].tag||0),c=useCallback(({x:S,y:P})=>{if(m.current){let R=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-R.left}`),document.documentElement.style.setProperty("--tip-y",`${P-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),p=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",p),m.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),a=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",p),m.current.addEventListener("pointermove",c));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,P)=>P.label.length>S.length?P.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),m.current?.addEventListener("pointerenter",a));},[]);let{className:d,style:T,rest:h}=E(i);return jsxs(u,{ref:m,style:T,className:[`--actionbar flex aic ${d}`,`${!n||n==oe.Auto?"rel":`--${n}`}`].join(" ").trim(),...h,children:[e.map((S,P)=>jsx(Gr,{selected:f===S.tag||o==P,...S,idx:P},`actionbar-action-${S.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(u,{className:"--tip abs",children:jsx(u,{className:"--track flex aic",children:e.map(({label:S})=>jsx(u,{className:"--lb",children:S},`tool-tip-${S.toLowerCase().replace(/\s+/g,"-")}`))})})]})});qr.displayName="Zuz.ActionBar";var Ni=qr;var Yr=forwardRef((t,s)=>{let{type:e,icon:r,title:o,message:n,iconSize:i,...m}=t,{className:f,style:l,rest:c}=E(m);return jsxs(u,{className:`--alert --${e||ue.Info} flex aic ${f}`.trim(),style:l,...c,children:[jsx(u,{className:`--icon icon-${r||"auto-matic"}`,style:i?{fontSize:i,width:i,height:i}:{},children:!r&&H[e||ue.Info]}),jsxs(u,{className:"--meta flex cols",children:[jsx(V,{className:`--title ${n?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),n&&jsx(V,{className:"--message",h:2,children:n})]})]})});Yr.displayName="Zuz.Alert";var Li=Yr;var Qr=({ref:t,...s})=>{let{variant:e,numeric:r,onConfirm:o,...n}=s,{style:i,className:m,rest:f}=E(n),{variant:l}=X(true),c=p=>{r&&(p.currentTarget.value=p.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||l} flex ${m}`.trim(),style:i,onInput:c,onKeyDown:p=>{p.key=="Enter"&&o?.(p.currentTarget.value);},ref:t,...f})};Qr.displayName="Zuz.Input";var re=Qr;var jr=t=>{let{meta:s,children:e}=t,r=useDelayed(),{label:o,icon:n,...i}=isValidElement(s)?{}:s,{className:m,style:f,rest:l}=E({...i,...i.animate?{animate:{...i.animate,when:r}}:{}});return isValidElement(s)?jsx("li",{style:f,className:m,children:s}):jsxs("li",{style:f,className:m,...l,children:[e,typeof s=="string"?s:o]})};jr.displayName="Zuz.ListItem";var en=jr;var on=forwardRef((t,s)=>{let{items:e,variant:r,direction:o,seperator:n,ol:i,...m}=t,{className:f,style:l,rest:c}=E(m),p=i==true?"ol":"ul";return createElement(p,{className:`--list --${r||K.Small} flex ${o??"cols"} ${f}`.trim(),style:l,ref:s,...c,children:e.map((a,d,T)=>{let h=`${typeof a=="string"?`li-${String(a)}`:isValidElement(a)?`li-${a.key}`||`${d}-${MD5(a.toString())}`:a.label}-${d}`;return jsxs(Fragment,{children:[jsx(en,{meta:a}),n&&T[d+1]?jsx("li",{className:"--list-seperator",children:n},`spt-${d+1}-${h}`):null]},h)})})});on.displayName="Zuz.List";var He=on;var nn=forwardRef((t,s)=>{let{fx:e,action:r,data:o,withStyle:n,onChange:i,...m}=t,{className:f}=E({as:n||""}),{style:l}=E(m),[c,p]=useState(false),[a,d]=useState(o||[]),T=useRef(null),h=useRef(null),S=useRef(null),P=useMemo(()=>m.name||uuid(12),[]),[R,y]=useState(null),[g,I]=useState(null),[v,C]=useState([]),O=useDebounce(x=>{x.target.value==""?(p(false),d([])):r&&x.target.value.trim()!=""&&withPost(r,{query:x.target.value}).then(M=>{"items"in M&&_(M.items).isArray()?(d(M.items),I(x.target.value),C(M.items)):console.error("Action Response should contain items array"),y(null);}).catch(M=>{y(null),d([]);});},250),L=()=>{if(h.current){let x=h.current.getBoundingClientRect(),M=window.innerHeight-x.bottom,A=x.top;if(S.current){let W=S.current;M<W.offsetHeight&&A>M?(W.style.top="auto",W.style.bottom=`${x.height}px`,W.style.maxHeight=`${A-150}px`):(W.style.top=`${x.height+5}px`,W.style.bottom="auto",W.style.maxHeight=`${M-150}px`);}}},$=x=>{if(a.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")y(null),p(false),d([]);else if(x.key==="ArrowDown")y(M=>{let A=M===null||M===a.length-1?0:M+1;return _$1(A),A});else if(x.key==="ArrowUp")y(M=>{let A=M===null||M===0?a.length-1:M-1;return _$1(A),A});else if(x.key==="Enter"&&R!==null){let M=a[R];T.current&&(T.current.value=M,p(false),d([]));}}},B=x=>{T.current&&(T.current.value=x,p(false),d([]));},_$1=x=>{let M=a[x];if(M&&T.current&&(T.current.value=M,T.current.setSelectionRange(M.length,M.length)),S.current){let W=S.current.children[x];W&&W.scrollIntoView({block:"nearest"});}},F=x=>{h.current&&!h.current.contains(x.target)&&(p(false),d([]));},U=()=>{T.current&&T.current.value===g&&(d(v),y(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{L();},[a]),jsxs(u,{style:l,ref:h,className:`--autocomplete --${t.size||K.Small} flex aic rel ${f}`.trim(),children:[jsx(re,{ref:T,autoComplete:"off",onChange:O,onKeyDown:$,onFocus:U,...m}),jsx(u,{className:"--arrow rel flex aic jcc",children:a.length>0?H.arrowUp:H.arrowDown}),a.length>0&&jsx(He,{id:P,ref:S,className:"--suggestion-list flex cols abs",items:a.map((x,M)=>({label:x,onClick:A=>{A.preventDefault(),A.stopPropagation(),B(x);},className:R===M?"--current":"",animate:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:clamp(.02*M,.02,.5)}}))})]})});nn.displayName="Zuz.AutoComplete";var Xi=nn;var sn=forwardRef((t,s)=>{let e=useRef(null),r=useMemo(()=>s&&typeof s!="function"&&s.current?s:e,[s]),{style:o,className:n,rest:i}=E(t,r);return !i.src||i.src==""?null:jsx("img",{ref:r,style:o,className:`${n} flex`,...i})});sn.displayName="Zuz.Image";var rt=sn;var an=forwardRef((t,s)=>{let{src:e,variant:r,type:o,crossOrigin:n,referrerPolicy:i,fx:m,as:f,alt:l,color:c,style:p,...a}=t,[d,T,h]=useImage(e??"",n,i),{className:S,style:P,rest:R}=E({fx:m,as:f});return jsx(u,{className:`--avatar --${r||K.Small} --${(o||qo.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:c||"var(--primary)",...p,...P},...R,children:e?jsx(rt,{src:d,crossOrigin:n,referrerPolicy:i,...a}):jsx(V,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});an.displayName="Zuz.Avatar";var rl=an;var nl=({size:t=5,type:s="dead",label:e="",variant:r=K.Small,loading:o=false,spinner:n,...i})=>{let{style:m,className:f,rest:l}=E(i);return jsxs(u,{style:{..._(e).isEmpty()?{width:`${t+4}px`,height:`${t+4}px`}:{},...m},as:`--badge --${r} --${s} rel flex aic jcc ${f}`.trim(),children:[jsx(u,{fx:{transition:q.FadeIn,curve:G.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(he,{type:n})}),_(e).isEmpty()?jsx(u,{style:{width:`${t}px`,height:`${t}px`},as:`--dot --${s}`}):jsx(V,{as:"--label",children:e})]})},sl=nl;var bl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let t=new Date,s=t.getDay();return addDays(t,(6-s)%7||6)},getDateFormat:()=>{let t=new Date,s=t.getDay();return format(addDays(t,(6-s)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],wl=t=>{let s=new Set;return t.filter(e=>{if(e.label=="Later")return true;let r=e.getDate().toISOString().split("T")[0];return s.has(r)?false:(s.add(r),true)})},cn=forwardRef((t,s)=>{let{defaultValue:e,variant:r,onChange:o,...n}=t,{style:i,className:m,rest:f}=E(n),[l,c]=useState(e||new Date),p=startOfMonth(l),a=endOfMonth(l),d=startOfWeek(p),T=endOfWeek(a),h=useMemo(()=>eachDayOfInterval({start:d,end:T}),[d,T]),S=y=>{o?.(y),c(y);},P=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()-1));},R=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()+1));};return jsxs(u,{as:`--calendar flex --${r||"sm"} ${m}`,style:i,children:[jsx(u,{as:"--calendar-quick-select flex cols flex:1",children:wl(bl).map(y=>{let g=y.getDate();return jsxs(z,{onClick:()=>S(g),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(V,{as:"flex:1",children:y.label}),jsx(V,{as:"tar",children:y.getDateFormat()})]},`--dtp-option-label-${y.label}`)})}),jsxs(u,{as:"--calendar-selector flex cols flex:1",children:[jsxs(u,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(V,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(z,{onClick:P,as:"--calendar-chevron",children:H.chevronUpOutline}),jsx(z,{onClick:R,as:"--calendar-chevron",children:H.chevronDownOutline})]}),jsxs(u,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(y=>jsx(V,{as:"--calendar-day",children:y},`--calendar-hd-${y}`)),h.map((y,g)=>{let I=isSameMonth(y,l),v=isSameDay(y,l),C=isToday(y);return jsx(z,{disabled:!I,onClick:()=>S(y),as:["--calendar-day --calendar-dd",`${v?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:format(y,"d")},`--calendar-day-${g}-${y.getFullYear()}-${y.getMonth()}-${y.getDay()}`)})]})]})]})});cn.displayName="Zuz.Calendar";var go=cn;var mn=(s=>(s.Line="line",s))(mn||{});var fn=forwardRef((t,s)=>{let{data:e,width:r,height:o,lineColor:n,strokeWidth:i=2,gradientStartColor:m,gradientEndColor:f,animated:l,animDuration:c=2,animDelay:p=0,padding:a=0,type:d,...T}=t,{className:h,style:S,rest:P}=E(T),R=useRef(null),y=useResizeObserver(R.current?.parentElement||R),g=typeof r=="number"?r:y.width,I=typeof o=="number"?o:y.height,v={width:g,height:I},C=useId(),{pathD:N,areaPathD:O}=useLineChart(e,v,a+(i||2)),L=useRef(null),$=useRef(null),[B,_]=useState(0),[F,U]=useState(0);return useEffect(()=>{l&&(L.current&&_(L.current.getTotalLength()),$.current&&U($.current.getTotalLength()));},[l,N,O,g,I]),jsx(u,{ref:R,as:`--chart --${d||"line"}-chart ${h}`.trim(),style:{...S,width:r,height:o},...P,children:g>0&&I>0&&jsxs("svg",{viewBox:`0 0 ${g} ${I}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:$,d:O,fill:`url(#${C})`,stroke:"none",style:l?{strokeDasharray:F,strokeDashoffset:F}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:N,fill:"none",stroke:n,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:B,strokeDashoffset:B}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:B,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})})]})})});fn.displayName="Zuz.Chart";var Rl=fn;var dn=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(dn||{}),gn=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(gn||{});var hn=forwardRef((t,s)=>{let{text:e,media:r,side:o="me",status:n=1,timeStamp:i=Date.now(),arrow:m=true,...f}=t,{className:l,style:c,rest:p}=E(f);return jsx(u,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(u,{className:`--bubble --bubble-${o} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...p,children:[e&&jsx(V,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(u,{as:"flex aic --bubble-audio",children:[jsx(te,{className:"--bm-action",children:H.play}),jsx(et,{progress:.7}),jsx(V,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(u,{as:"--bubble-image",children:jsx(rt,{src:r.source})}):null:null,jsxs(u,{as:"flex aie jce --bubble-stats",children:[jsx(V,{className:"--bubble-stamp tar",children:timeSince(i)}),o=="me"&&jsx(te,{className:`--bubble-status --bs-${n}`,children:n==0?H.pending:n==1?H.done:n==2?H.doneAll:H.doneAll})]})]})})});hn.displayName="Zuz.Bubble";var El=hn;var yn=forwardRef((t,s)=>{let{style:e,className:r,rest:o}=E(t);return jsx("label",{ref:s,style:e,className:r,...o})});yn.displayName="Zuz.Label";var st=yn;var xn=forwardRef((t,s)=>{let{name:e,required:r,type:o,value:n,size:i,variant:m,checked:f,onSwitch:l,...c}=t,[p,a]=useState(f||false),d=useRef(null),{variant:T}=X(true);return useImperativeHandle(s,()=>({setChecked(h,S=true){a(h),d.current&&(d.current.checked=h),S&&l&&l(h,n||"cb");},toggle(h=true){d.current&&(d.current.checked=!p),h&&l&&l&&l(!p,n||"cb"),a(!p);}})),jsxs(st,{className:`--${(o||Se.Default).toLowerCase()} ${!o||o==Se.Default?"--checkbox":"--switch"} --${m||T||K.Small} flex aic jcc ${p?"is-checked":""} rel`.trim(),...c,children:[(!o||o==Se.Default)&&H.check,jsx(re,{ref:d,defaultChecked:p,value:n||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:h=>{l&&l(h.target.checked,n||"cb"),a(h.target.checked);}})]})});xn.displayName="Zuz.CheckBox";var at=xn;var $l=({ref:t,...s})=>{let{code:e,lang:r="tsx",showLines:o=false,highlight:n="",as:i,fx:m,...f}=s,l=useRef(null),{className:c,style:p,rest:a}=E({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${i}`,fx:m},l),d=useMemo(()=>{let h=new Set;return n.split(",").forEach(S=>{if(S.includes("-")){let[P,R]=S.split("-").map(Number);for(let y=P;y<=R;y++)h.add(y);}else S&&h.add(Number(S));}),h},[n]),T=useMemo(()=>{let h=e.split(`
|
|
9
|
-
`);for(;h.length>0&&h[0].trim()==="";)h.shift();for(;h.length>0&&h[h.length-1].trim()==="";)h.pop();let S=h[0]?.match(/^\s*/)?.[0].length||0,P=h.map(y=>{let
|
|
10
|
-
${o==true?`<span class="--line-number">${
|
|
8
|
+
document.documentElement.style.colorScheme = theme;`}}),jsx(Gt,{children:t})]})},or=(t,s)=>{if(Ys)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||s};var nr=({ref:t,...s})=>{let{style:e,...n}=s,{style:o,className:r,rest:l}=E(n);return jsx("span",{ref:t,style:e,className:r,...l})};nr.displayName="Zuz.Span";var te=nr;var ar=forwardRef((t,s)=>{let{name:e,pathCount:n,variant:o,color:r,...l}=t,{variant:m}=X(true),{className:f,style:i,rest:c}=E(l);return jsx("div",{style:{color:r,...i},className:`icon-${e} --icon --${o||m||K.Small} ${f}`.trim(),ref:s,...c,children:Array(n||0).fill(0).map((p,a)=>jsx(te,{className:`path${a+1}`},`${e}-layer-${a}`))})});ar.displayName="Zuz.Icon";var Q=ar;var se={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var ir=t=>{let{type:s,variant:e,color:n,...o}=t,{className:r,style:l,rest:m}=E(o),{spinner:f}=X(true),i=()=>{switch(s||f?.type||se.Simple){case se.Simple:return null;case se.Wave:return jsxs(Fragment$1,{children:[jsx(u,{as:"--bar --bar1"}),jsx(u,{as:"--bar --bar2"}),jsx(u,{as:"--bar --bar3"})]});case se.Roller:return null}};return jsx(u,{className:`${r} --spinner --${(s||f?.type||se.Simple).toLowerCase()} --${e||f?.variant||K.Small}`.trim(),style:{...l},...m,children:i()})};ir.displayName="Zuz.Spinner";var he=ir;var xt={Loading:"loading",Normal:"normal"};var cr=({ref:t,...s})=>{let{reset:e,kind:n="solid",variant:o,icon:r,iconSize:l,children:m,withLabel:f,spinner:i,state:c,disabled:p,...a}=s,{style:g,className:T,rest:h}=E(a),{variant:S}=X(true);return jsxs("button",{className:`--button --${n} --${o||S} flex aic ${e?"":"jcc"} ${r?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:g,ref:t,disabled:c==xt.Loading||s.skeleton?.enabled||p,...h,children:[c==xt.Loading&&jsx(he,{variant:o||S,type:i||se.Simple}),(!c||c==xt.Normal)&&jsxs(Fragment$1,{children:[r&&jsx(Q,{variant:l,name:r}),f===true?jsx(te,{children:m}):m]})]})};cr.displayName="Zuz.Button";var z=cr;var pr=forwardRef((t,s)=>{let{h:e,html:n,children:o,lines:r,...l}=t,{style:m,className:f,rest:i}=E(l),c=`h${t.h||1}`;return jsx(c,{ref:s,style:m,className:f,...i,children:n?jsx(te,{dangerouslySetInnerHTML:{__html:n}}):o})});pr.displayName="Zuz.Text";var V=pr;var aa=t=>{let{label:s,labelColor:e,icon:n,iconColor:o,index:r,className:l,onSelect:m}=t;return s=="-"?jsx(u,{className:"--line"}):jsxs(z,{reset:true,onClick:f=>m?.(t),className:`--item ${l||""}`.trim(),children:[jsx(u,{as:"--icon",children:jsx(Q,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(V,{className:"--lbl flex aic",style:e?{color:e}:{},children:s})]})},ur=aa;var gr=({ref:t,...s})=>{let{id:e,as:n,fx:o,offsetX:r,offsetY:l,parent:m,event:f,arrow:i,when:c,items:p,header:a,footer:g,origin:T=qe.TopRight,...h}=s,[S,P]=useState(false),[R,y]=useState(p||[]),{position:d,targetRef:I,calculatedAnchor:w}=useAnchorPosition(m?.current,f,{offsetX:r,offsetY:l,preferredAnchor:T}),N=m&&d.top>m.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",M=useMemo(()=>{let U=w.toLowerCase();return U.includes("left")?"--arrow-left":U.includes("right")?"--arrow-right":"--arrow-center"},[w]),L=d.top!==0||d.left!==0;useEffect(()=>{c&&L?P(true):c||P(false);},[c,L]);let{className:$,style:B,rest:_}=E(h),F=le({...o?.transition?{transition:o.transition??q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??G.EaseInOut,duration:o?.duration??.05,when:S&&L});return jsxs(u,{ref:I,className:`--contextmenu ${i||m!=null?`--has-arrow ${N} ${M}`:""} abs flex cols ${$}`.trim(),"aria-hidden":!S,style:{...B,...F.style,top:d.top,left:d.left,visibility:L?"visible":"hidden",transformOrigin:w},..._,children:[typeof a=="function"?createElement(a):a,R.map((U,x)=>jsx(ur,{...U,index:x},`context-${U.label.toLowerCase()}-${x}`)),typeof g=="function"?createElement(g):g]})};gr.displayName="Zuz.ContextMenu";var Xt=gr;var hr=forwardRef((t,s)=>{let{children:e,fx:n,when:o,fxDelay:r,fxStep:l,classToIgnore:m,...f}=t,i=X(true),c=useDelayed(),p=n||i?.group?.fx,a=r||i?.group?.fxDelay,g=l||i?.group?.fxStep,T=m||i?.group?.classToIgnore||"--ignore",h=useMemo(()=>p?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let P=S.props||{},R="fx"in P,y=P.as?Array.isArray(P.as)?P.as.join(" "):P.as:P.className||"",d=typeof y=="string"&&y.includes(T);return !R&&!d},S=>({fx:{...p,delay:(a||0)+S*(g||.1),when:o??(n?.when||c)}})):e,[e,o,c,p]);return jsx(u,{className:"--group",ref:s,...f,children:h})});hr.displayName="Zuz.Group";var Yt=hr;var xr=forwardRef((t,s)=>{let{message:e,spinner:n,spinnerSize:o,color:r,when:l,hideMessage:m,...f}=t,{className:i,style:c,rest:p}=E(f),{spinner:a}=X(true);return "when"in t&&t.when==false?null:jsxs(Yt,{fx:{transition:q.SlideInBottom,curve:G.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${i}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...p,children:[jsx(he,{variant:o||a?.variant||K.Small,type:n||a?.type||se.Simple}),!m&&jsx(V,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});xr.displayName="Zuz.Cover";var ye=xr;var br=forwardRef((t,s)=>{let{when:e,...n}=t;return jsx(u,{ref:s,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:q.FadeIn,when:e},...n})});br.displayName="Zuz.Overlay";var Me=br;var Ca=({action:t,render:s=true,message:e=""})=>jsx(u,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:s?e:null}),vr=Ca;var Pa=({action:t,actionPosition:s,dialogID:e,variant:n})=>jsx(u,{as:`--footer flex aic rel ${s?s==Xo.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,r)=>jsx(z,{variant:n,onClick:l=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),Sr=Pa;var Ra={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[ue.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[ue.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[ue.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[ue.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},H=Ra;var Ia=({title:t="Alert",onClose:s})=>jsxs(u,{as:"--head flex aic rel",children:[jsx(u,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx(z,{onClick:e=>s(),className:"--closer abs center-v",children:H.close})]}),Tr=Ia;var Nr=({ref:t,...s})=>{let{index:e,id:n,title:o,message:r,transition:l,curve:m,speed:f,type:i,action:c,actionPosition:p,spinner:a,loadingMessage:g,variant:T,inBackground:h,forceClose:S,forceLoading:P,onClose:R,onShow:y,onHide:d,...I}=s,w=useMemo(()=>uuid(12),[]),[C,N]=useState(o||""),[M,L]=useState(r||""),[$,B]=useState(i||ze.Dialog),[_,F]=useState(false),[U,x]=useState(true),[O,A]=useState(c||null),[W,D]=useState(false),{variant:Z,spinner:Y,dialog:J}=X(true),ee=T||J?.variant||Z||K.Small,{style:pe,className:ne,rest:ve}=E(I),ke=useRef(null),we=le({when:_,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:l||J?.transition||q.SlideInBottom,curve:m||J?.curve||G.EaseInOut,watch:["scale","filter","transform"]}),ae=()=>{F(false),R(n);};useEffect(()=>{B(ze.Dialog),L(r),N(C),O&&A(O.reduce((Fo,Zo)=>(Fo.push({...Zo,key:Zo.key||uuid(12)}),Fo),[])),F(true),setTimeout(()=>y?y():()=>{},500);},[]),useEffect(()=>{S&&ae();},[S]),useEffect(()=>{P!=null&&D(P);},[P]);let j=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(Me,{style:{zIndex:j},when:_}),jsxs(u,{as:`--dialog --${(i??ze.Default).toLowerCase()} ${_?"--visible":""} ${ne} fixed abc`.trim(),style:{...we.style,zIndex:j+1,pointerEvents:h==true?"none":"auto",...h==true?{scale:"0.92",filter:"blur(2px)"}:{}},...ve,ref:ke,children:[jsx(Tr,{title:C,onClose:ae}),jsx(vr,{message:M,render:U,action:O}),O&&O.length>0&&jsx(Sr,{variant:ee,action:O,dialogID:w,actionPosition:p}),jsx(ye,{when:W,spinner:a||J?.spinner||Y?.type||se.Simple,message:g||J?.loadingMessage})]})]})};Nr.displayName="Zuz.Dialog";var Jt=Nr;var jt=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(s){return this.stack[this.stack.length-1]===s}push(s){this.stack.includes(s)||(this.stack.push(s),this.updateScrollLock());}pop(s){this.stack=this.stack.filter(e=>e!==s),this.updateScrollLock();}handleEscape(){let s=this.stack[this.stack.length-1];return s?(s(),true):false}get count(){return this.stack.length}},Qe=new jt;var Er=forwardRef((t,s)=>{let{speed:e,style:n,...o}=t,{rootRef:r,containerRef:l,thumbY:m,thumbX:f,onScrollY:i,onScrollX:c}=useScrollbar(e||1),{style:p,className:a,rest:g}=E(o);return useEffect(()=>{let T=l.current;if(!T)return;let h=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",h),()=>T.removeEventListener("scroll",h)},[]),jsxs(u,{ref:r,className:a.trim(),as:"--scrollview rel",children:[jsx(u,{as:`--scroll-content ${a}`.trim(),ref:l,style:n||{},children:g.children}),jsx(u,{as:"--scroll-track --track-y --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:m,onMouseDown:i})}),jsx(u,{as:"--scroll-track --track-x --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:f,onMouseDown:c})})]})});Er.displayName="Zuz.ScrollView";var eo=Er;var Br=({ref:t,...s})=>{let{id:e,index:n,from:o,speed:r,children:l,margin:m,animation:f,prerender:i,inBackground:c,forceClose:p,forceLoading:a,onClose:g,...T}=s,{drawer:h}=X(true),[S,P]=useState(l),[R,y]=useState(false),[d,I]=useState(i??(h?.prerender||true)),[w,C]=useState(false),N=()=>{y(false),g?.(e??-1);},{className:M,style:L,rest:$}=E(T),B=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Qe.isTop(N)&&N();}}],[R]);useShortcuts(B),useEffect(()=>{P(l);},[l]),useEffect(()=>(R?Qe.push(N):Qe.pop(N),()=>Qe.pop(N)),[R]),useEffect(()=>{y(true);},[]),useEffect(()=>{p&&N();},[p]),useEffect(()=>{a!=null&&C(a);},[a]);let _=o||h?.from||ie.Left,F=useMemo(()=>{switch(_){case ie.Left:return {from:{x:"-100vw"},to:{x:0}};case ie.Right:return {from:{x:"100vw"},to:{x:0}};case ie.Top:return {from:{y:"-100vh"},to:{y:0}};case ie.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,h?.from]),U=le({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:R,curve:f||h?.animation||G.EaseInOut,duration:r||h?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(Me,{onClick:O=>{R&&N();},when:R,style:{zIndex:x}}),jsxs(u,{ref:t,"aria-hidden":!R,className:`--drawer flex cols ${M} --${_.toLowerCase()} fixed`,style:{...L,...U.style,"--m":`${m||h?.margin||0}px`,zIndex:x+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...$,children:[o==ie.Top||o==ie.Bottom?jsx(u,{className:"--handle"}):null,jsxs(eo,{as:"rel",children:[d||R?S:null,jsx(ye,{when:w})]})]})]})};Br.displayName="Zuz.Drawer";var no=Br;var kr=forwardRef((t,s)=>{let{progress:e,type:n,animated:o,...r}=t,l=useRef(null);useImperativeHandle(s,()=>({setProgress:c=>{l.current.style.width=`${c*100}%`;}}),[]),useEffect(()=>{e&&l.current&&(o?setTimeout(()=>l.current.style.width=`${e*100}%`,500):l.current.style.width=`${e*100}%`);},[e,l.current]);let{className:m,style:f,rest:i}=E(r);return jsx(u,{className:`--progress ${o?"--animated":""} flex rel ${m}`.trim(),style:f,...i,children:jsx(u,{ref:l,className:"--bar rel"})})});kr.displayName="Zuz.ProgressBar";var et=kr;var wt=(r=>(r.Default="default",r.Success="success",r.Error="error",r.Warn="warn",r.Promise="promise",r))(wt||{}),St=(l=>(l.TopLeft="TopLeft",l.TopCenter="TopCenter",l.TopRight="TopRight",l.BottomLeft="BottomLeft",l.BottomCenter="BottomCenter",l.BottomRight="BottomRight",l))(St||{}),Mr=(e=>(e.Stack="stack",e.Individual="individual",e))(Mr||{}),Or={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Fa=t=>{let{index:s,id:e,type:n,icon:o,title:r,message:l,duration:m,sticky:f=false,actions:i=[],position:c,style:p,isHovered:a,total:g,progress:T,forceClose:h,variant:S,onClick:P,onClose:R}=t,[y,d]=useState(false),[I,w]=useState(false),{toast:C}=X(true),N=I||h,M=c||C?.position||"TopCenter",L=n||C?.type||"default",$=p||C?.style||"stack",B=m||C?.duration||4,_=T||C?.progress||false,F=useRef(B*1e3),U=useRef(void 0),x=useRef(void 0),O=useRef(null),A=le({when:y&&!N,duration:.3,transition:C?.transition||(M.includes("Top")?q.SlideInTop:M.includes("Bottom")?q.SlideInBottom:M.includes("Left")?q.SlideInLeft:q.SlideInRight),curve:C?.curve||G.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{d(true);let ne=ve=>{if(x.current!==void 0){let ke=ve-x.current;if(!a&&!f&&!N&&(F.current-=ke,O.current)){let we=Math.max(0,F.current/(B*1e3)*100);O.current?.setProgress?.(we/100);}}x.current=ve,F.current<=0?w(true):U.current=requestAnimationFrame(ne);};return U.current=requestAnimationFrame(ne),()=>{U.current&&cancelAnimationFrame(U.current);}},[a,f,N,B]),useEffect(()=>{if(N){let ne=setTimeout(()=>{R?.(e);},350);return ()=>clearTimeout(ne)}},[N,e]);let W=$==="stack",D=a?s*65:s*8,Z=a?1:Math.max(.85,1-s*.05),Y=a?1:Math.max(.4,1-s*.2),J=()=>{P?P():(!i||i.length===0)&&w(true);},ee=A.style.transform||"translate(0, 0)",pe=N?ee:`${ee} translateY(${M.includes("Top")?D:-D}px) scale(${Z})`;return jsxs(u,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${S||C?.variant||K.Medium} --${L} --${M.toLowerCase()} abs flex aic`,style:{...A.style,zIndex:1e3-s,pointerEvents:N?"none":"auto",opacity:N?A.style.opacity:Y,transform:pe,filter:!N&&W&&!a&&s>0?"blur(1px)":"none",cursor:!i||i.length===0?"pointer":"default",transition:`${A.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(u,{as:"--ico flex aic jcc",children:o?jsx(Q,{name:o}):jsx(u,{as:"--no-icon"})}),jsxs(u,{as:"--meta flex cols",children:[jsx(V,{as:"--tt",children:r||Or[n]}),jsx(V,{as:"--tm",children:l})]}),i&&i.length>0&&jsx(u,{as:"--actions flex gap:5",children:i.map((ne,ve)=>jsx(z,{as:"--snack-btn bold",onClick:ke=>{ke.stopPropagation(),ne.onClick();},children:ne.label},ve))}),_&&jsx(et,{as:"abs",ref:O})]})},so=Fa;var ce=createContext(null),qa=({ref:t,...s})=>{let n=useContext(ce)?.depth??0,[o,r]=useState(null),[l,m]=useState(null),[f,i]=useState(false),[c,p]=useState([]),a=useDelayed(),g=useRef(0),T=()=>++g.current,h=()=>{i(false),setTimeout(()=>m(null),200);};useImperativeHandle(t,()=>({add(d){let I=T(),w={id:I,...d};return p(C=>[...C,w]),I},openMenu(d){i(false),setTimeout(()=>{m({id:T(),type:"menu",props:d}),i(true);},16);},remove(d){p(I=>I.map(w=>w.id===d?{...w,props:{...w.props,forceClose:true}}:w)),l?.id===d&&h();},loading(d,I){p(w=>w.map(C=>C.id===d?{...C,props:{...C.props,forceLoading:I}}:C)),l?.id===d&&h();},clear(d){p(c.filter(I=>I.type!=d));}})),useEffect(()=>{if(l&&f){let d=()=>h();return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}},[l,f,h]);let S=d=>{setTimeout(()=>{p(I=>I.filter(w=>w.id!==d)),l?.id===d&&m(null);},250);},P=useMemo(()=>[...c.filter(d=>d.type!="toast")],[c]);if(!a)return null;let R=c.filter(d=>d.type=="toast").reverse(),y=Object.values(St);return createPortal(jsxs(u,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[P.map((d,I)=>{let w=I<P.length-1;return d.type==="dialog"?jsx(Jt,{onClose:S,index:I,id:d.id,...d.props,inBackground:w},`layer-${d.type}-${d.id}`):d.type==="drawer"?jsx(no,{onClose:S,index:I,id:d.id,...d.props,inBackground:w},`layer-${d.type}-${d.id}`):null}),y.map(d=>{let I=R.filter(w=>(w.props.position||"TopCenter")===d);return I.length===0?null:jsx(u,{onMouseEnter:()=>r(d),onMouseLeave:()=>r(null),as:`--toast-container fixed --${d.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:I.map((w,C)=>jsx(so,{index:C,total:I.length,isHovered:o===d,onClose:S,id:w.id,...w.props},w.id))},d)}),l&&jsx(u,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Xt,{onClose:h,when:f,...l.props},`menu-${l.id}`)})]}),document.body)},Xa=({children:t})=>{let s=useContext(ce),e=s?s.depth+1:0,n=useRef(null),o=useMemo(()=>({add:r=>n.current?.add(r),openMenu:r=>n.current?.openMenu(r),remove:r=>n.current?.remove(r),loading:(r,l)=>n.current?.loading(r,l),clear:r=>n.current?.clear(r),depth:e,isSubLayer:!!s}),[s]);return jsxs(ce.Provider,{value:o,children:[t,jsx(qa,{ref:n})]})},Gt=Xa;var Qa=()=>{let t=useContext(ce);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,r)=>{n.preventDefault(),t.openMenu({event:n,items:o,origin:r});},showMenu:(n,{items:o,origin:r,offsetX:l,offsetY:m,transition:f,curve:i,arrow:c,duration:p,header:a,footer:g})=>{t.openMenu({fx:{transition:f,curve:i,duration:p},parent:n,items:o,origin:r||qe.TopCenter,offsetX:l,offsetY:m,arrow:c,header:a,footer:g});},hide:t.clear}},Ja=Qa;var ei=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("dialog"),e=r=>t.remove(r),n=(r,l)=>t.loading(r,l);return {clearAll:s,show:r=>{let l=t.add({type:"dialog",props:{...r,type:ze.Dialog}});return {id:l,setLoading:m=>n(l,m),hide:()=>e(l)}},hide:e}},ti=ei;var ri=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("drawer"),e=r=>t.remove(r),n=(r,l)=>t.loading(r,l),o=r=>{let l=t.add({type:"drawer",props:r});return {id:l,setLoading:m=>n(l,m),close:()=>e(l)}};return {clearAll:s,open:r=>o({children:r}),right:r=>o({children:r,from:ie.Right}),left:r=>o({children:r,from:ie.Left}),top:r=>o({children:r,from:ie.Top}),bottom:r=>o({children:r,from:ie.Bottom}),close:e}},ni=ri;var ai=(t,s,e={})=>{let[n,o]=useState(null),[r,l]=useState(false),{duration:m=.25,curve:f=G.EaseOutBack,borderRadius:i={from:40,to:24},targetWidth:c=320}=e;return useLayoutEffect(()=>{s&&t.current?(o(t.current.getBoundingClientRect()),l(true)):s||l(false);},[s,t]),{style:le({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:i.from},to:{opacity:1,width:c,height:"auto",borderRadius:i.to},curve:f,duration:m,when:r&&s}).style,isMeasured:r,sourceRect:n}},ii=ai;var pi=(t,s={})=>{let{offset:e=8,direction:n="bottom",container:o=null,triggerRef:r=null}=s,l=useRef(null),m=useCallback(()=>{let f=t.current;if(!f)return;let i=r?.current||f.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=f.getBoundingClientRect(),p=i.getBoundingClientRect(),a,g;o?(a=o.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(f).position==="fixed"?g="fixed":g="absolute",g==="fixed"?a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==g&&(f.style.position=g),l.current=g;let S=0,P=0;switch(n){case "top":S=p.top-c.height-e,P=p.left,S<a.top&&p.bottom+c.height+e<=a.bottom&&(S=p.bottom+e);break;case "bottom":S=p.bottom+e,P=p.left,S+c.height>a.bottom&&p.top-c.height-e>=a.top&&(S=p.top-c.height-e);break;case "left":S=p.top,P=p.left-c.width-e,P<a.left&&p.right+c.width+e<=a.right&&(P=p.right+e);break;case "right":S=p.top,P=p.right+e,P+c.width>a.right&&p.left-c.width-e>=a.left&&(P=p.left-c.width-e);break}if(S=Math.max(a.top,Math.min(S,a.bottom-c.height)),P=Math.max(a.left,Math.min(P,a.right-c.width)),l.current==="fixed")f.style.top=`${S}px`,f.style.left=`${P}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let y=S-R.top+window.scrollY,d=P-R.left+window.scrollX;f.style.top=`${y}px`,f.style.left=`${d}px`;}},[t,r,e,n,o]);return useEffect(()=>{let f=t.current;if(!f)return;let i=r?.current||f.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(m);return c.observe(f),i&&c.observe(i),m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,true),()=>{c.disconnect(),i&&c.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,true);}},[t,n,e,o,r]),{postion:l.current,reposition:m}},tt=pi;var fi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(p,a)=>t.add({type:"toast",props:{...a,type:p}}),n=p=>t.remove(p),i=(p,a,g)=>{let T=s(p,{...a,sticky:a.sticky??false,actions:[{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),n(T);}}]});return T},c=(p,a,g,T)=>{let h=s(p,{...a,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),n(h);}},{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),n(h);}}]});return h};return {ok:(p,a)=>i("default",p,a),success:(p,a)=>i("success",p,a),error:(p,a)=>i("error",p,a),confirm:(p,a,g)=>c("default",p,a,g),warn:(p,a)=>i("warn",p,a)}},di=fi;var hi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(i,c)=>t.add({type:"toast",props:{...c,type:i}});return {show:(i,c,p,a)=>s("default",{title:i,message:c,icon:p,duration:a}),hide:i=>t.remove(i),success:(i,c,p,a)=>s("success",{title:i,message:c,icon:p,duration:a}),error:(i,c,p,a)=>s("error",{title:i,message:c,icon:p,duration:a}),warn:(i,c,p,a)=>s("warn",{title:i,message:c,icon:p,duration:a}),promise:(i,c,p,a)=>s("promise",{title:i,message:c,icon:p,duration:a}),clearAll:()=>t.clear("toast")}},ao=hi;var Zr=({ref:t,style:s,...e})=>{let n=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:n,[t]),{style:r,className:l,rest:m}=E(e,o);return jsx("div",{ref:t||n,style:{...r,...s||{}},className:l,...m})};Zr.displayName="Zuz.Box";var u=Zr;var Wr=forwardRef((t,s)=>{let{title:e,message:n,...o}=t,[r,l]=useState(false);return jsxs(u,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:m=>l(!r),className:`--toggle flex aic ${r?"--open":""}`.trim(),children:[jsx(V,{className:"--label flex",children:e}),jsx(u,{className:"--arrow flex",children:r?H.arrowUp:H.arrowDown})]}),r&&jsx(u,{className:"--detail",children:n})]})});Wr.displayName="Zuz.Accordion";var Si=Wr;var Ci=({label:t,icon:s,onClick:e,idx:n,selected:o})=>jsx(z,{onClick:e,onMouseMove:r=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof s=="string"?jsx(Q,{name:s}):s}),Gr=Ci;var qr=forwardRef((t,s)=>{let{items:e,name:n,selected:o,position:r,...l}=t,m=useRef(null),[f,i]=useState(o||e[0].tag||0),c=useCallback(({x:S,y:P})=>{if(m.current){let R=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-R.left}`),document.documentElement.style.setProperty("--tip-y",`${P-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),p=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",p),m.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),a=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",p),m.current.addEventListener("pointermove",c));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,P)=>P.label.length>S.length?P.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),m.current?.addEventListener("pointerenter",a));},[]);let{className:g,style:T,rest:h}=E(l);return jsxs(u,{ref:m,style:T,className:[`--actionbar flex aic ${g}`,`${!r||r==oe.Auto?"rel":`--${r}`}`].join(" ").trim(),...h,children:[e.map((S,P)=>jsx(Gr,{selected:f===S.tag||o==P,...S,idx:P},`actionbar-action-${S.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(u,{className:"--tip abs",children:jsx(u,{className:"--track flex aic",children:e.map(({label:S})=>jsx(u,{className:"--lb",children:S},`tool-tip-${S.toLowerCase().replace(/\s+/g,"-")}`))})})]})});qr.displayName="Zuz.ActionBar";var Ni=qr;var Yr=forwardRef((t,s)=>{let{type:e,icon:n,title:o,message:r,iconSize:l,...m}=t,{className:f,style:i,rest:c}=E(m);return jsxs(u,{className:`--alert --${e||ue.Info} flex aic ${f}`.trim(),style:i,...c,children:[jsx(u,{className:`--icon icon-${n||"auto-matic"}`,style:l?{fontSize:l,width:l,height:l}:{},children:!n&&H[e||ue.Info]}),jsxs(u,{className:"--meta flex cols",children:[jsx(V,{className:`--title ${r?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),r&&jsx(V,{className:"--message",h:2,children:r})]})]})});Yr.displayName="Zuz.Alert";var Li=Yr;var Qr=({ref:t,...s})=>{let{variant:e,numeric:n,onConfirm:o,...r}=s,{style:l,className:m,rest:f}=E(r),{variant:i}=X(true),c=p=>{n&&(p.currentTarget.value=p.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||i} flex ${m}`.trim(),style:l,onInput:c,onKeyDown:p=>{p.key=="Enter"&&o?.(p.currentTarget.value);},ref:t,...f})};Qr.displayName="Zuz.Input";var re=Qr;var jr=t=>{let{meta:s,children:e}=t,n=useDelayed(),{label:o,icon:r,...l}=isValidElement(s)?{}:s,{className:m,style:f,rest:i}=E({...l,...l.animate?{animate:{...l.animate,when:n}}:{}});return isValidElement(s)?jsx("li",{style:f,className:m,children:s}):jsxs("li",{style:f,className:m,...i,children:[e,typeof s=="string"?s:o]})};jr.displayName="Zuz.ListItem";var en=jr;var on=forwardRef((t,s)=>{let{items:e,variant:n,direction:o,seperator:r,ol:l,...m}=t,{className:f,style:i,rest:c}=E(m),p=l==true?"ol":"ul";return createElement(p,{className:`--list --${n||K.Small} flex ${o??"cols"} ${f}`.trim(),style:i,ref:s,...c,children:e.map((a,g,T)=>{let h=`${typeof a=="string"?`li-${String(a)}`:isValidElement(a)?`li-${a.key}`||`${g}-${MD5(a.toString())}`:a.label}-${g}`;return jsxs(Fragment,{children:[jsx(en,{meta:a}),r&&T[g+1]?jsx("li",{className:"--list-seperator",children:r},`spt-${g+1}-${h}`):null]},h)})})});on.displayName="Zuz.List";var He=on;var nn=forwardRef((t,s)=>{let{fx:e,action:n,data:o,withStyle:r,onChange:l,...m}=t,{className:f}=E({as:r||""}),{style:i}=E(m),[c,p]=useState(false),[a,g]=useState(o||[]),T=useRef(null),h=useRef(null),S=useRef(null),P=useMemo(()=>m.name||uuid(12),[]),[R,y]=useState(null),[d,I]=useState(null),[w,C]=useState([]),M=useDebounce(x=>{x.target.value==""?(p(false),g([])):n&&x.target.value.trim()!=""&&withPost(n,{query:x.target.value}).then(O=>{"items"in O&&_(O.items).isArray()?(g(O.items),I(x.target.value),C(O.items)):console.error("Action Response should contain items array"),y(null);}).catch(O=>{y(null),g([]);});},250),L=()=>{if(h.current){let x=h.current.getBoundingClientRect(),O=window.innerHeight-x.bottom,A=x.top;if(S.current){let W=S.current;O<W.offsetHeight&&A>O?(W.style.top="auto",W.style.bottom=`${x.height}px`,W.style.maxHeight=`${A-150}px`):(W.style.top=`${x.height+5}px`,W.style.bottom="auto",W.style.maxHeight=`${O-150}px`);}}},$=x=>{if(a.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")y(null),p(false),g([]);else if(x.key==="ArrowDown")y(O=>{let A=O===null||O===a.length-1?0:O+1;return _$1(A),A});else if(x.key==="ArrowUp")y(O=>{let A=O===null||O===0?a.length-1:O-1;return _$1(A),A});else if(x.key==="Enter"&&R!==null){let O=a[R];T.current&&(T.current.value=O,p(false),g([]));}}},B=x=>{T.current&&(T.current.value=x,p(false),g([]));},_$1=x=>{let O=a[x];if(O&&T.current&&(T.current.value=O,T.current.setSelectionRange(O.length,O.length)),S.current){let W=S.current.children[x];W&&W.scrollIntoView({block:"nearest"});}},F=x=>{h.current&&!h.current.contains(x.target)&&(p(false),g([]));},U=()=>{T.current&&T.current.value===d&&(g(w),y(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{L();},[a]),jsxs(u,{style:i,ref:h,className:`--autocomplete --${t.size||K.Small} flex aic rel ${f}`.trim(),children:[jsx(re,{ref:T,autoComplete:"off",onChange:M,onKeyDown:$,onFocus:U,...m}),jsx(u,{className:"--arrow rel flex aic jcc",children:a.length>0?H.arrowUp:H.arrowDown}),a.length>0&&jsx(He,{id:P,ref:S,className:"--suggestion-list flex cols abs",items:a.map((x,O)=>({label:x,onClick:A=>{A.preventDefault(),A.stopPropagation(),B(x);},className:R===O?"--current":"",animate:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:clamp(.02*O,.02,.5)}}))})]})});nn.displayName="Zuz.AutoComplete";var Xi=nn;var sn=forwardRef((t,s)=>{let e=useRef(null),n=useMemo(()=>s&&typeof s!="function"&&s.current?s:e,[s]),{style:o,className:r,rest:l}=E(t,n);return !l.src||l.src==""?null:jsx("img",{ref:n,style:o,className:`${r} flex`,...l})});sn.displayName="Zuz.Image";var rt=sn;var an=forwardRef((t,s)=>{let{src:e,variant:n,type:o,crossOrigin:r,referrerPolicy:l,fx:m,as:f,alt:i,color:c,style:p,...a}=t,[g,T,h]=useImage(e??"",r,l),{className:S,style:P,rest:R}=E({fx:m,as:f});return jsx(u,{className:`--avatar --${n||K.Small} --${(o||qo.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:c||"var(--primary)",...p,...P},...R,children:e?jsx(rt,{src:g,crossOrigin:r,referrerPolicy:l,...a}):jsx(V,{className:"--avatar-label",children:(i?i.charAt(0):"A").toUpperCase()})})});an.displayName="Zuz.Avatar";var rl=an;var nl=({size:t=5,type:s="dead",label:e="",variant:n=K.Small,loading:o=false,spinner:r,...l})=>{let{style:m,className:f,rest:i}=E(l);return jsxs(u,{style:{..._(e).isEmpty()?{"--badge-size":t}:{},...m},as:`--badge --${n} --${s} rel flex aic jcc ${f}`.trim(),children:[jsx(u,{fx:{transition:q.FadeIn,curve:G.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(he,{type:r})}),_(e).isEmpty()?jsx(u,{as:`--dot --${s}`}):jsx(V,{as:"--label",children:e})]})},sl=nl;var bl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let t=new Date,s=t.getDay();return addDays(t,(6-s)%7||6)},getDateFormat:()=>{let t=new Date,s=t.getDay();return format(addDays(t,(6-s)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],vl=t=>{let s=new Set;return t.filter(e=>{if(e.label=="Later")return true;let n=e.getDate().toISOString().split("T")[0];return s.has(n)?false:(s.add(n),true)})},cn=forwardRef((t,s)=>{let{defaultValue:e,variant:n,onChange:o,...r}=t,{style:l,className:m,rest:f}=E(r),[i,c]=useState(e||new Date),p=startOfMonth(i),a=endOfMonth(i),g=startOfWeek(p),T=endOfWeek(a),h=useMemo(()=>eachDayOfInterval({start:g,end:T}),[g,T]),S=y=>{o?.(y),c(y);},P=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()-1));},R=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()+1));};return jsxs(u,{as:`--calendar flex --${n||"sm"} ${m}`,style:l,children:[jsx(u,{as:"--calendar-quick-select flex cols flex:1",children:vl(bl).map(y=>{let d=y.getDate();return jsxs(z,{onClick:()=>S(d),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(V,{as:"flex:1",children:y.label}),jsx(V,{as:"tar",children:y.getDateFormat()})]},`--dtp-option-label-${y.label}`)})}),jsxs(u,{as:"--calendar-selector flex cols flex:1",children:[jsxs(u,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(V,{as:"flex:1 --calendar-cm bold",children:format(i,"MMMM yyyy")}),jsx(z,{onClick:P,as:"--calendar-chevron",children:H.chevronUpOutline}),jsx(z,{onClick:R,as:"--calendar-chevron",children:H.chevronDownOutline})]}),jsxs(u,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(y=>jsx(V,{as:"--calendar-day",children:y},`--calendar-hd-${y}`)),h.map((y,d)=>{let I=isSameMonth(y,i),w=isSameDay(y,i),C=isToday(y);return jsx(z,{disabled:!I,onClick:()=>S(y),as:["--calendar-day --calendar-dd",`${w?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:format(y,"d")},`--calendar-day-${d}-${y.getFullYear()}-${y.getMonth()}-${y.getDay()}`)})]})]})]})});cn.displayName="Zuz.Calendar";var fo=cn;var mn=(s=>(s.Line="line",s))(mn||{});var fn=forwardRef((t,s)=>{let{data:e,width:n,height:o,lineColor:r,strokeWidth:l=2,gradientStartColor:m,gradientEndColor:f,animated:i,animDuration:c=2,animDelay:p=0,padding:a=0,type:g,...T}=t,{className:h,style:S,rest:P}=E(T),R=useRef(null),y=useResizeObserver(R.current?.parentElement||R),d=typeof n=="number"?n:y.width,I=typeof o=="number"?o:y.height,w={width:d,height:I},C=useId(),{pathD:N,areaPathD:M}=useLineChart(e,w,a+(l||2)),L=useRef(null),$=useRef(null),[B,_]=useState(0),[F,U]=useState(0);return useEffect(()=>{i&&(L.current&&_(L.current.getTotalLength()),$.current&&U($.current.getTotalLength()));},[i,N,M,d,I]),jsx(u,{ref:R,as:`--chart --${g||"line"}-chart ${h}`.trim(),style:{...S,width:n,height:o},...P,children:d>0&&I>0&&jsxs("svg",{viewBox:`0 0 ${d} ${I}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:$,d:M,fill:`url(#${C})`,stroke:"none",style:i?{strokeDasharray:F,strokeDashoffset:F}:{},children:i&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:N,fill:"none",stroke:r,strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round",style:i?{strokeDasharray:B,strokeDashoffset:B}:{},children:i&&jsx("animate",{attributeName:"stroke-dashoffset",from:B,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})})]})})});fn.displayName="Zuz.Chart";var Rl=fn;var dn=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(dn||{}),gn=(i=>(i.Image="img",i.Video="vid",i.Audio="audio",i.Link="link",i.Document="doc",i.Location="loc",i.Contact="contact",i.Event="event",i.Poll="poll",i))(gn||{});var hn=forwardRef((t,s)=>{let{text:e,media:n,side:o="me",status:r=1,timeStamp:l=Date.now(),arrow:m=true,...f}=t,{className:i,style:c,rest:p}=E(f);return jsx(u,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(u,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${i}`.trim(),style:{...c},...p,children:[e&&jsx(V,{className:"--bubble-text",children:e}),n?n.type=="audio"?jsxs(u,{as:"flex aic --bubble-audio",children:[jsx(te,{className:"--bm-action",children:H.play}),jsx(et,{progress:.7}),jsx(V,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(u,{as:"--bubble-image",children:jsx(rt,{src:n.source})}):null:null,jsxs(u,{as:"flex aie jce --bubble-stats",children:[jsx(V,{className:"--bubble-stamp tar",children:timeSince(l)}),o=="me"&&jsx(te,{className:`--bubble-status --bs-${r}`,children:r==0?H.pending:r==1?H.done:r==2?H.doneAll:H.doneAll})]})]})})});hn.displayName="Zuz.Bubble";var El=hn;var yn=forwardRef((t,s)=>{let{style:e,className:n,rest:o}=E(t);return jsx("label",{ref:s,style:e,className:n,...o})});yn.displayName="Zuz.Label";var st=yn;var xn=forwardRef((t,s)=>{let{name:e,required:n,type:o,value:r,size:l,variant:m,checked:f,onSwitch:i,...c}=t,[p,a]=useState(f||false),g=useRef(null),{variant:T}=X(true);return useImperativeHandle(s,()=>({setChecked(h,S=true){a(h),g.current&&(g.current.checked=h),S&&i&&i(h,r||"cb");},toggle(h=true){g.current&&(g.current.checked=!p),h&&i&&i&&i(!p,r||"cb"),a(!p);}})),jsxs(st,{className:`--${(o||Se.Default).toLowerCase()} ${!o||o==Se.Default?"--checkbox":"--switch"} --${m||T||K.Small} flex aic jcc ${p?"is-checked":""} rel`.trim(),...c,children:[(!o||o==Se.Default)&&H.check,jsx(re,{ref:g,defaultChecked:p,value:r||"cb",type:"checkbox",className:"abs",name:e,required:n||false,onChange:h=>{i&&i(h.target.checked,r||"cb"),a(h.target.checked);}})]})});xn.displayName="Zuz.CheckBox";var at=xn;var $l=({ref:t,...s})=>{let{code:e,lang:n="tsx",showLines:o=false,highlight:r="",as:l,fx:m,...f}=s,i=useRef(null),{className:c,style:p,rest:a}=E({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${l}`,fx:m},i),g=useMemo(()=>{let h=new Set;return r.split(",").forEach(S=>{if(S.includes("-")){let[P,R]=S.split("-").map(Number);for(let y=P;y<=R;y++)h.add(y);}else S&&h.add(Number(S));}),h},[r]),T=useMemo(()=>{let h=e.split(`
|
|
9
|
+
`);for(;h.length>0&&h[0].trim()==="";)h.shift();for(;h.length>0&&h[h.length-1].trim()==="";)h.pop();let S=h[0]?.match(/^\s*/)?.[0].length||0,P=h.map(y=>{let d=y.match(/^\s*/)?.[0].length||0,I=Math.min(d,S);return y.slice(I)}),R=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(<\/?[A-Z][\w\.]*|>)/g},{name:"var",re:/(?<!<\/|<)\b[A-Z]\w*\b/g},{name:"fn",re:/\b([a-z_]\w*)(?=\s*\()/gi},{name:"prop",re:/\.([a-z_]\w*)\b/gi},{name:"num",re:/\b\d+\b(?![#|A-Z|a-z|_|ZUZ])/g}];return P.map((y,d)=>{let I=y.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),w=g.has(d+1),C=[];R.forEach(N=>{I=I.replace(N.re,M=>{let L=`ZUZ_ID_${C.length}_ZUZ`;return C.push(`<span class="--token-${N.name}">${M}</span>`),L});});for(let N=C.length-1;N>=0;N--)I=I.replace(`ZUZ_ID_${N}_ZUZ`,C[N]);return `<div class="--code-line ${o==true?"--with-ln":""} ${w?"--is-highlighted":""}">
|
|
10
|
+
${o==true?`<span class="--line-number">${d+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${I||" "}</span>
|
|
12
|
-
</div>`}).join("")},[e,d]);return jsx(u,{as:`--code-block ${c}`,style:p,...f,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:T}})})})},zl=$l;var wn=({onSelect:t,meta:s,selected:e})=>{let r=useRef(null),{index:o,icon:n,label:i}=s,[m,f]=useState({x:0,width:0}),l=useDelayed();return useLayoutEffect(()=>{if(l&&r.current){let{width:c,x:p}=r.current.getBoundingClientRect();f({x:p,width:c}),e&&t(o,c,p,s,true);}},[l,r.current]),useEffect(()=>{e&&t(o,m.width,m.x,s,false);},[e]),jsxs(z,{onClick:()=>t(o,m.width,m.x,s,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[n?typeof n=="string"?jsx(Q,{name:n,as:"--segment-icon"}):jsx(u,{as:"--segment-icon flex aic jcc",children:n}):null,i&&String(i).trim()!=""&&jsx(u,{className:"--segment-label",children:i||`Item ${o}`})]})};wn.displayName="SelectTabItem";var vn=wn;var Cn=forwardRef((t,s)=>{let{fx:e,items:r,selected:o,variant:n,onSwitch:i,...m}=t,[f,l]=useState(o||0),c=useRef(false),p=useRef(f),{className:a,style:d,rest:T}=E(m),h=useRef(null),S=useRef(null),{variant:P}=X(true),R=(y,g,I,v,C)=>{if((C||f!=y&&f!=-2)&&(l(y),p.current=f,c.current&&i?.(v)),h.current){let N=S.current?.getBoundingClientRect();h.current.style.setProperty("--w",`${g}px`),h.current.style.setProperty("--x",`${N?I-N.left:I}px`);}};return useImperativeHandle(s,()=>({setSelected:y=>{typeof y=="number"&&y!=f&&l(y);}}),[f]),useEffect(()=>{c.current=true;},[]),jsxs(u,{ref:S,"data-selected":f,className:`${a} --segmented --${n||P||K.Medium} flex aic rel`,style:d,...T,children:[jsx(u,{ref:h,className:"--segment-tab abs"}),r.map((y,g)=>jsx(vn,{onSelect:R,selected:f==g,meta:{...y,index:g}},`segment-${y.label}-${g}`))]})});Cn.displayName="Zuz.SelectTabs";var it=Cn;var Rn=forwardRef((t,s)=>{let{type:e,...r}=t,o=useDelayed(),{colorScheme:n,setColorScheme:i}=Gt(),m=useCallback(()=>{i(n=="dark"?"light":n=="light"?"system":"dark");},[n]),{className:f,style:l}=E(r),c=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"system",index:1,label:"",icon:H.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(n),[n]);return !o||p==-1?null:e=="system"||e=="switch"?jsx(it,{className:`--color-scheme --${e}`,onSwitch:({tag:a})=>{i(a);},selected:p,items:c,...r}):jsx(z,{onClick:m,style:l,as:`--color-scheme-switch --${r.variant||K.Small} ${f}`.trim(),children:n=="system"?H.colorSchemeSystem:n=="light"?H.colorSchemeLight:H.colorSchemeDark})});Rn.displayName="Zuz.ColorScheme";var tc=Rn;var Nn=forwardRef((t,s)=>{let[e,r]=useState("wait"),{title:o,message:n,acceptLabel:i,rejectLabel:m,position:f}=t,l=async c=>{r(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");r(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(u,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:G.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${f||oe.Left} flex cols`,children:[jsx(V,{as:"--title",children:o||"This site uses cookies"}),jsx(V,{as:"--message",children:n||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(u,{as:"--footer flex aic",children:[jsx(z,{onClick:c=>l(1),as:"--accept",children:i||"Accept All"}),jsx(z,{onClick:c=>l(0),as:"--reject",children:m||"Cancel"})]})]})});Nn.displayName="Zuz.CookiesConsent";var sc=Nn;var Ln=forwardRef((t,s)=>{let {type:e,value:r,min:o,max:n,step:i,onChange:m,roundValue:f,...l}=t,{className:c,style:p,rest:a}=E(l),d=useRef(i||.01).current,T=useRef(o||0).current,h=useRef(n||1).current,S=useRef(r||0).current,P=useRef(null),R=useRef(null),y=useRef(null);useRef(null);let I=useRef(null),v=useRef(null),C=(A,W,D)=>(A-W)/(D-W)*100,N=A=>{if(R.current){let W=parseFloat(A.currentTarget.value),D=C(W,parseFloat(A.currentTarget.min),parseFloat(A.currentTarget.max));R.current.style.setProperty("--value",`${D}`),R.current.setAttribute("data-value",`${W}`),m&&m(f?+W.toFixed(2):W);}},[O,L]=useState(false),[$,B]=useState(0),[_,F]=useState(0),U=A=>{L(true),B(A.clientX),F(R.current?parseFloat(R.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},x=A=>{if(O){let W=A.clientX-$,D=Math.max(T,Math.min(_+W*d,h));R.current&&(R.current.setAttribute("data-value",`${D}`),v.current.textContent=f?D.toFixed(2):D.toString(),m&&m(f?+D.toFixed(2):D));}},M=()=>{L(false),document.body.style.cursor="auto";};return useEffect(()=>{R.current&&R.current.style.setProperty("--value",P.current?`${C(parseFloat(P.current.value),parseFloat(P.current.min),parseFloat(P.current.max))}`:S.toString());},[]),useEffect(()=>(O?(document.addEventListener("mousemove",x),document.addEventListener("mouseup",M)):(document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",M)),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",M);}),[O]),jsx(u,{ref:R,"data-value":S||0,className:`--slider --${e||dt.Default} flex rel ${c}`.trim(),style:{...p},children:dt.Text===e?jsx(Fragment$1,{children:jsx(V,{ref:v,onMouseDown:U,className:"--slider-text",children:S||0})}):jsxs(Fragment$1,{children:[jsx(u,{ref:I,className:"--slider-track abs fill"}),jsx(u,{ref:y,className:"--slider-knob abs"}),jsx(re,{ref:P,onInput:N,className:"abs fill",tabIndex:0,type:e||dt.Default,defaultValue:S||0,step:d,max:h,min:T})]})})});Ln.displayName="Zuz.Slider";var vo=Ln;var Mn=forwardRef((t,s)=>{let{src:e,shape:r,size:o,...n}=t,{style:i,className:m,rest:f}=E(n),{canvasRef:l,crop:c,setScale:p,handleMouseDown:a,handleMouseUp:d,handleMouseMove:T}=useImageCropper(e,o||200,r||CropShape.Circle);return useImperativeHandle(s,()=>({getCropped(){return c()},setScale(h){p(h);}})),jsxs(u,{as:`--cropper --${r||CropShape.Circle} ${m}`,style:i,...f,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:a,onMouseUp:d,onMouseLeave:d,onMouseMove:T}),jsx(u,{as:"--cropper-slider",children:jsx(vo,{onChange:h=>p(h),min:0,max:1,step:.01,value:1})})]})});Mn.displayName="Zuz.Cropper";var pc=Mn;var fc=(e=>(e.Circle="circle",e.Square="square",e))(fc||{});var Dn=forwardRef((t,s)=>{let{items:e,maxItems:r}=t,o=useMemo(()=>{let m=typeof e=="string",f=m?[]:e;return m&&e.split(",").forEach(l=>{f.push({label:l});}),f},[e]),i=useMemo(()=>r&&r>0&&o.length>r-1,[o,r])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-r)]:o;return jsx(He,{ref:s,className:"--crumb flex aic",direction:"rows",seperator:jsx(u,{as:"--crumb-chevron",children:H.chevronRightOutline}),items:i.map((m,f,l)=>m.ID=="."?jsx(u,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(u,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs(z,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!l[f+1],children:[m.icon&&jsx(Q,{as:"--crumb-icon",name:m.icon}),jsx(V,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});Dn.displayName="Zuz.Crumb";var gc=Dn;var An=forwardRef((t,s)=>{let{icon:e,defaultValue:r,value:o,size:n,variant:i,numeric:m,type:f,onConfirm:l,...c}=t,[p,a]=useState(false),[d,T]=useState(r||null),{style:h,className:S,rest:P}=E(c),R=useRef(null),y=useRef(null),{reposition:g}=tt(y,{direction:oe.Bottom,offset:2}),I=C=>{m&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let C=N=>{let O=N.target,L=R.current?.contains(O),$=y.current?.contains(O);!L&&!$&&a(false);};return p&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[p]),useEffect(()=>{let C=N=>{N.key==="Escape"&&p&&(a(false),R.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[p]);let v=()=>{a(true);};return useEffect(()=>{p&&g();},[p,g]),jsx(Fragment$1,{children:jsxs(u,{as:`--date-picker ${i?`--${i}`:""} rel flex aic ${S}`,"data-value":d?d.toISOString():"",children:[e?typeof e=="string"?jsx(Q,{as:"mr:10 c:#666",name:e}):e:jsx(te,{as:"--date-picker-icon flex aic jcc",children:H.calendar}),jsx("input",{ref:R,value:d?format(d,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${i?`--${i}`:""} flex`.trim(),style:h,onFocus:v,onInput:I,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&l?.(C.currentTarget.value);},...P}),jsx(u,{"aria-hidden":!p,ref:y,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:p,duration:.05},as:`--date-picker-chooser flex aic ${i?`--${i}`:""}`,children:jsx(go,{defaultValue:d,onChange:C=>{T(C),a(false);}})})]})})});An.displayName="Zuz.DatePicker";var bc=An;var $n=forwardRef((t,s)=>{let{icon:e,variant:r,position:o}=t;return jsx(z,{className:`--fab fixed --${r||K.Large} --${o||"bottomright"}`,children:e||H.plus})});$n.displayName="Zuz.Fab";var Cc=$n;var zn=t=>{let{names:s,strength:e}=t,r={[gt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${gt.Gooey}`)};return useEffect(()=>{},[s]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(s||[gt.Gooey]).map(o=>r[o](e))})})};zn.displayName="Zuz.Filters";var Rc=zn;var Ee=null,me=null,Fn=forwardRef((t,s)=>{let{title:e,message:r,transition:o,curve:n,speed:i,type:m,actionPosition:f,spinner:l,loadingMessage:c,onShow:p,onHide:a,...d}=t,{className:T,style:h,rest:S}=E(d),[P,R]=useState(e||""),[y,g]=useState(r||""),[I,v]=useState(null),[C,N]=useState(m||fe.Default),O=useMemo(()=>uuid(12),[]),[L,$]=useState(false),B=useRef(null),_=useRef(null),[F,U]=useState(false),[x,M]=useState(true),A=useRef(null),W=y;useImperativeHandle(s,()=>({setLoading(Z){U(Z);},showDialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),Y&&g(Y),Z&&R(Z),J&&v(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},dialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),g(Y),R(Z),J&&v(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},error(Z,Y){this.show(Z,Y,fe.Error);},warn(Z,Y){this.show(Z,Y,fe.Warn);},success(Z,Y){this.show(Z,Y,fe.Success);},show(Z,Y,J){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),_.current=B.current.style.transform,B.current.style.transform="",B.current.classList.remove("--wobble"),setTimeout(()=>{B.current.classList.add("--wobble"),B.current.style.transform=`${_.current} scale(.9)`.trim();},50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),B.current.style.transform=_.current||"",me=null;},500)),Ee=setTimeout(()=>{$(false),Ee=null,me=null;},(Y||4)*1e3),N(J||fe.Default),g(Z),$(true),p?.();},hide(){$(false),a?.();}}));let D=useMemo(()=>{let Z={when:L,duration:i||.3,delay:.1};if(C==fe.Dialog){if(o){let{from:Y,to:J}=Xe(o,20);return {from:Y,to:J,curve:n||G.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:G.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:G.Spring,...Z}},[L,C]);return useEffect(()=>{A.current&&clearTimeout(A.current),L?M(true):A.current=setTimeout(()=>M(false),1e3);},[L]),C==fe.Dialog?jsxs(Fragment$1,{children:[jsx(Me,{when:L}),jsxs(u,{className:`--sheet --sheet-${C.toLowerCase()} ${L?"is-visible":""} ${T} fixed`.trim(),style:h,fx:D,...S,ref:B,children:[jsx(ye,{when:F,spinner:l,message:c}),jsxs(u,{className:"--head flex aic rel",children:[jsx(u,{className:`--${P?"title":"dot"} flex aic rel`,children:P||""}),jsx(z,{onClick:Z=>$(false),className:"--closer abs",children:"\xD7"})]}),jsx(u,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:x?W:null}),I&&jsx(u,{className:`--footer flex aic rel ${f?f==zt.Center?"jcc":"":"jce"}`.trim(),children:I.map((Z,Y)=>jsx(z,{onClick:J=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${O}-action-${Z.key}`))})]})]}):jsx(u,{className:`--sheet --sheet-${C.toLowerCase()} ${T} abs`.trim(),style:h,...S,fx:D,ref:B,children:L?y:null})}),ct=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;Fn.displayName="Zuz.Sheet";var Lc=Fn;var Zn=({ref:t,...s})=>{let{name:e,cover:r,spinner:o,errors:n,action:i,children:m,withData:f,beforeSubmit:l,onSubmit:c,onError:p,onSuccess:a,resetOnSuccess:d,...T}=s,{className:h,style:S,rest:P}=E(T),[R,y]=useState(false),g=useRef(null),I=useRef(null),v=useRef(null),C=io(),N=useCallback(x=>g.current?g.current.querySelectorAll(x):[],[g.current]),O=x=>({name:x.name||x.getAttribute("name")||x.getAttribute("data-name"),required:x.required?true:x.getAttribute("data-required")?x.getAttribute("data-required")=="true":false,with:x.with||x.getAttribute("with")}),L=x=>{let M=[];return x.querySelectorAll(".--input").forEach(A=>{M.push(A.value);}),M.join("")},$=useCallback(x=>{let{required:A}=O(x);if(A){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let D=L(x);if(D==""||D.length<parseInt(x.getAttribute("data-size")))return false}if(x.classList.contains("--select")&&x.querySelector("button.--selected").dataset.value=="-1"||x.value=="")return false}if(x.getAttribute("with")){let D=x.getAttribute("with");switch(D.includes("@")&&(D=D.split("@")[0],D=="match"&&(D=Ce.MatchField)),D.toUpperCase()){case Ce.IPV4:return _(x.value).isIPv4();case Ce.IPV6:return _(x.value).isIPv6();case Ce.Email:return _(x.value).isEmail();case Ce.Uri:try{return new URL(x.value),!0}catch{return false}case Ce.Password:return console.log("Add FORMVALIDATION.Password"),false;case Ce.MatchField:let[Z,Y,J]=x.getAttribute("with").split("@"),ee=document.querySelector(`[name=${Y.trim()}]`);if(!ee)return false;switch(J||"direct-match"){case "if-not-empty":if(ee&&!_(ee.value).isEmpty()&&ee.value!=x.value)return false;break;case "direct-match":if(ee&&ee.classList.contains("--otp")&&x.classList.contains("--otp")&&L(ee)!=L(x))return false;if(ee&&ee.value!=x.value)return false;break}break;default:return true}}return true},[g.current]),B=useCallback(()=>{let x={},M={},A=null,W=null;if(Array.from(N("[name]")).forEach(D=>{let{name:Z,required:Y,with:J}=O(D),ee=true;(Y||J)&&(ee=$(D)),x[Z]={valid:ee,value:D.type=="checkbox"?D.checked==true?D.value:false:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value},M[Z]=D.type=="checkbox"?D.checked==true:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value,ee?D.classList.remove("input-with-error"):(A==null&&n&&(A=D,W=n[Z]),D.classList.add("input-with-error"));}),A){let D=A;if(D.classList.contains("--otp"))for(let Z of Array.from(D.querySelectorAll(".--input"))){let Y=Z;if(Y.value==""){Y.focus();break}}else D.focus();}return {error:A!=null,errorMsg:W||"Fix errors to continue...",data:x,payload:M}},[g.current]),_$1=useCallback(()=>{let{error:x,errorMsg:M,payload:A}=B();x?C.error(M):i?startTransition(async()=>{l&&l(A),ct(r)?r.setLoading(true):y(true),C.clearAll(),withPost(i,{...A,...f||{}}).then(W=>{let D=W;ct(r)?r.setLoading(false):y(false),d&&Array.from(N("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),a?a(D):(C.clearAll(),C.success(D.message||"Redirecting..."));}).catch(W=>{ct(r)?r.setLoading(false):y(false),p?p(W):C.error(W.message||"We cannot process your request at this time.");});}):c&&c(A);},[i,I.current,g.current]),F=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(M=>{M.addEventListener("click",_$1);});},[g.current]),U=useMemo(()=>addPropsToChildren(m,x=>x.props.type=="submit",x=>({ref:v})),[m]);return useImperativeHandle(t,()=>({setLoading(x){if(x){I.current?.hide();try{C.clearAll();}catch{}}y(x);},showError(x){typeof x=="string"?C.error(x):I.current.error(x,4);},hideError(){I.current.hide();try{C.clearAll();}catch{}},init(){F();},submit(){_$1();}})),useEffect(F,[]),jsxs(u,{ref:g,style:S,className:`--form flex rel ${h} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!ct(r)&&jsx(ye,{message:r?r.message||void 0:"working",spinner:o,color:r&&"color"in r?r.color:"#ffffff",when:R}),U]})};Zn.displayName="Zuz.Form";var zc=Zn;var Kn=t=>{let {ref:s,cols:e,rows:r,gap:o,gapX:n,gapY:i,align:m,justify:f,inline:l,flow:c,autoCols:p,autoRows:a,template:d,...T}=t;useRef(null);let {className:S,style:P,rest:R}=E(T),y=I=>typeof I=="number"?`repeat(${I}, 1fr)`:I,g={display:l?"inline-grid":"grid",gridTemplateColumns:y(e),gridTemplateRows:y(r),gap:o,columnGap:n,rowGap:i,alignItems:m,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:c,gridAutoColumns:p,gridAutoRows:a,gridTemplateAreas:d,...P};return jsx(u,{ref:s,as:`--grid ${S}`.trim(),style:g,...R})};Kn.displayName="Zuz.Grid";var Kc=Kn;var Wn=t=>typeof t=="string"&&t.includes("+"),Un={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},Gn={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var Xn=forwardRef(({children:t,keys:s,variant:e},r)=>{let o=useMemo(()=>{if(Wn(s)){let n=null;return {keys:String(s).split("+").reduce((m,f,l,c)=>(c[l+1]?m.push(f):n=f.toUpperCase(),m),[]),children:n}}return {keys:s,children:String(t).toUpperCase()}},[s]);return jsxs(u,{as:`--keyboard-keys --${e||K.Small} flex aic`,children:[(Array.isArray(o.keys)?o.keys:[o.keys]).map(n=>jsx("abbr",{title:Gn[n],children:Un[n]},n)),jsx(te,{children:o?.children??t})]})});Xn.displayName="Zuz.KeyboardKeys";var No=Xn;var Qn=forwardRef((t,s)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:o,variant:n}=t;return jsxs(u,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:G.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${n||K.Small} fixed flex`,children:[jsx(u,{className:"--ico",children:e?H[ue.Success]:H[ue.Error]}),jsx(V,{as:"--message",children:e?r||"internet connection restored :)":o||"no internet connection"})]})});Qn.displayName="Zuz.NetWorkManager";var Qc=Qn;var Eo=(e=>(e.Table="table",e.Gooey="gooey",e))(Eo||{});var es=forwardRef((t,s)=>{let{itemCount:e,itemsPerPage:r,startPage:o,pageRange:n,paginationStyle:i,breakLabel:m,prevLabel:f,nextLabel:l,hash:c,loading:p,seperator:a,renderOnZeroPageCount:d,onPageChange:T,...h}=t,S=useMemo(()=>toHash(numberInRange(4,8)),[]),P=useCallback(B=>`${toHash(B,c||6,S)}${a||""}${S}`,[S]),R=useMemo(()=>m||"...",[m]),[y,g]=useState({id:c?o?typeof o=="number"?P(o):o:1:o||1,label:o||1}),{style:I,className:v,rest:C}=E(h),N=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!e)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(e/r),[e,r]),L=useMemo(()=>{let B=[],_=Math.max(N(y)-(n||2),1),F=Math.min(N(y)+(n||2),O);_>1&&B.push({id:c?P(1):1,label:1}),_>2&&B.push({id:-1,label:R});for(let U=_;U<=F;U++)B.push({id:c?P(U):U,label:U});return F<O-1&&B.push({id:-1,label:R}),F<O&&B.push({id:c?P(O):O,label:O}),B},[y]),$=useCallback(B=>{let _=B;+_.label<1||+_.label>O||(g(_),T?.(_));},[e,r,y]);return L.length<=1&&(d??false)===false?null:jsxs(u,{ref:s,as:`--pagination --pgt-${i||"table"} flex aic w:100% jcc ${v}`,children:[jsx(u,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:R}]).map((B,_,F)=>jsx(z,{disabled:B.id==-1||N(y)==+B.label,className:(typeof B=="string"?B:B.label)==N(y)?"--current-page":"",onClick:U=>$(B),children:typeof B=="string"?B:B.label},`--pg-${_}-${B.id}`))}),jsx(u,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(y)-1)*r+1} - `,`${Math.min(N(y)*r,e)} of ${e} items`].join(" ")}),jsxs(u,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:N(y)<=1,onClick:B=>$({id:c?P(N(y)-1):N(y)-1,label:N(y)-1}),children:H.chevronLeftOutline}),jsx(z,{disabled:L.length<=1||N(y)==N(L[L.length-1]),onClick:B=>$({id:c?P(N(y)+1):N(y)+1,label:N(y)+1}),children:H.chevronRightOutline})]})]})});es.displayName="Zuz.Pagination";var Lo=es;var os=forwardRef((t,s)=>{let{strenthMeter:e,onChange:r,...o}=t;"type"in o&&delete o.type;let{style:n,className:i,rest:m}=E(o),[f,l]=useState(false),[c,p]=useState(""),a=useMemo(()=>checkPasswordStrength(c),[c]),d=useDebounce(T=>{e&&p(T.target.value),r&&r(T);},100);return useEffect(()=>{},[]),jsxs(u,{as:"w:100% flex cols",children:[jsxs(u,{style:n,className:"--password flex aic rel",children:[jsx(re,{ref:s,type:f?"text":"password",className:i,onChange:d,...m}),jsx(z,{tabIndex:-1,onClick:()=>l(T=>!T),className:"--toggle flex aic jcc abs",children:f?H.eye:H.eyeSlash})]}),e&&jsxs(u,{as:`flex aic --password-meter --pb-score-${a.score}`,style:n,children:[jsxs(u,{as:"--password-bars flex aic",children:[jsx(u,{as:`--pbar ${a.score>=1?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=2?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=3?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=4?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=5?"--pb-on":""}`.trim()})]}),jsx(V,{as:"--password-meter-label","aria-hidden":true,children:a.result})]})]})});os.displayName="Zuz.Password";var im=os;var ns=forwardRef((t,s)=>{let{size:e,length:r,mask:o,...n}=t,i=useRef([]),m="pinput",f=false,l={};"with"in n&&(l={with:n.with},delete n.with),"type"in n&&delete n.type,"name"in n&&(m=n.name,delete n.name),"required"in n&&(f=true,delete n.required);let{style:c}=E(n),p=a=>{let d=a.currentTarget,T=i.current[parseInt(d.dataset.index)+1],h=i.current[parseInt(d.dataset.index)-1];d.value.length===1&&T?T.focus():d.value.length===0&&h&&h.focus();};return useEffect(()=>{i.current=i.current.slice(0,e||r);},[e||r]),jsx(u,{name:m,style:c,className:"--otp flex aic rel","data-required":f,"data-size":e||r||4,...l,children:Array(e||r||4).fill(1).map((a,d)=>jsx(re,{autoComplete:"new-password","data-index":d,ref:T=>{i.current[d]=T;},numeric:true,onChange:p,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...n},`pin-${d}`))})});ns.displayName="Zuz.PinInput";var pm=ns;var ss=forwardRef((t,s)=>{let{children:e,className:r,name:o,required:n,type:i,value:m,variant:f,checked:l,onSwitch:c,...p}=t,[a,d]=useState(l||false),{variant:T}=X(true),h=useRef(null);return jsxs(st,{className:`${r} --${(i||_t.Default).toLowerCase()} --radio${!i||i==_t.Default?"":"card"} --${f||T||K.Small} flex aic rel`.trim(),...p,children:[jsx(re,{ref:h,defaultChecked:a,value:m||"rd",type:"radio",className:"abs",name:o,required:n||false,onChange:S=>{c&&c(S.target.checked,m||"cb"),d(S.target.checked);}}),jsx(u,{className:"--dot rel",children:jsx(u,{className:"--rod abs abc"})}),jsx(u,{className:"--value",children:e})]})});ss.displayName="Zuz.Radio";var gm=ss;var as=forwardRef((t,s)=>{let{fx:e,withStyle:r,as:o,reverse:n=false,searchIcon:i=H.search,hideSearchIcon:m=false,clearIcon:f=H.close,hideClearIcon:l=false,onChange:c,onClear:p,...a}=t,{style:d,className:T}=E({as:t.as}),[h,S]=useState(""),{variant:P}=X(true),R=useRef(null),y=useMemo(()=>jsx(z,{tabIndex:-1,onClick:v=>I(),className:"--send flex aic jcc",variant:t.variant||K.Small,children:h!==""?!l&&(typeof f=="string"?jsx(Q,{name:f,as:"--search-action"}):f):!m&&(typeof i=="string"?jsx(Q,{name:i,as:"--search-action"}):i)}),[n,i,l,f,m]);"type"in t&&delete t.type;let g=v=>{S(v.target.value),c?.(v.target.value);},I=v=>{h.trim()!==""&&(S(""),c?.(""),R.current&&(R.current.value="",t.onConfirm?.("")));};return useImperativeHandle(s,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(u,{style:d,className:`--search ${n?"--search-rev":""} --${t.variant||P||K.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[n&&y,jsx(re,{ref:R,onChange:g,...a}),t.shortcut&&jsx(No,{keys:t.shortcut,as:"abs"}),!n&&y]})});as.displayName="Zuz.Search";var Cm=as;var ls=({value:t,updateValue:s,o:e})=>jsxs(z,{onClick:r=>s(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(Q,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(V,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});ls.displayName="Option";var cs=ls;var ps=({ref:t,...s})=>{let{selected:e,options:r,label:o,name:n,variant:i,search:m,searchPlaceholder:f,maxHeight:l,arrowDownIcon:c=H.arrowDown,arrowUpIcon:p=H.arrowUp,expanded:a,onChange:d,...T}=s,[h,S]=useState(e?typeof e=="string"?r.find(x=>x.value===e):e:r[0]),[P,R]=useState(false),[y,g]=useState(null),I=useRef(null),v=useRef(null),C=useRef(null),N=useId(),O=useMemo(()=>n||N,[]),{reposition:L}=tt(C,{direction:$t.Bottom,offset:2}),{variant:$}=X(true),{className:B,style:_,rest:F}=E(T),U=x=>{S(x),R(false),d&&d(x);};return useImperativeHandle(t,()=>({setSelected:x=>{if(typeof x=="string"){let M=r.find(A=>A.value===x);M&&S(M);}else S(x);},getValue:()=>h||null})),useEffect(()=>{if(!P)return;let x=()=>{L();};return window.addEventListener("scroll",x,true),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",L);}},[P,L]),useEffect(()=>{if(!P){v.current&&(v.current.value=""),g(null);return}v.current?.focus(),L();let x=A=>{C.current&&!C.current.contains(A.target)&&R(false);},M=setTimeout(()=>{document.addEventListener("click",x);},0);return ()=>{clearTimeout(M),document.removeEventListener("click",x);}},[P,L]),jsxs(u,{className:`--select --${a==true?"expanded":""} --${i||$} ${n?`--${n}`:""} rel`.trim(),name:O,children:[jsxs(z,{ref:I,"data-value":h?typeof h=="string"?h:h.value:h||"-1",className:`--selected flex aic rel ${B}`.trim(),withLabel:false,style:_,onClick:x=>{x.stopPropagation(),R(M=>!M);},...F,children:[jsx(V,{className:"--label",children:h?typeof h=="string"?h:h.label:o||"Choose"}),jsx(u,{className:"--svg-arrow rel flex aic jcc",children:P?typeof p=="string"?jsx(Q,{name:p,as:"--search-action"}):p:typeof c=="string"?jsx(Q,{name:c,as:"--search-action"}):c})]}),jsxs(u,{id:O,className:"--options-list flex cols abs","aria-hidden":!P,style:{maxHeight:l||"auto"},ref:C,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:P,duration:.05},children:[m&&jsx(u,{as:"--select-search --sticky",children:jsx(re,{ref:v,onChange:x=>{g(x.target.value==""?null:x.target.value);},className:"--search-input",placeholder:f||"Search..."})}),(y==null?r:r.filter(x=>x.label.toLowerCase().includes(y.toLowerCase())||x.value.toLowerCase().includes(y.toLowerCase()))).map(x=>jsx(cs,{updateValue:U,value:h,o:x},`option-${(typeof x=="string"?x:x.label).replace(/\s+/g,"-")}-${typeof x=="string"?x:x.value}`))]})]})};ps.displayName="Zuz.Select";var Em=ps;var us=forwardRef((t,s)=>jsx(at,{type:Se.Switch,...t,ref:s}));us.displayName="Zuz.Switch";var Lm=us;var ds=t=>{let{idx:s,id:e,as:r,weight:o,style:n,value:i,render:m,resize:f,sortBy:l,sortable:c,onSort:p}=t,[a,d]=useState(0),T=()=>{c&&(p?.(String(e),a==1?-1:1),d(h=>h==1?-1:1));};return jsxs(u,{style:{flex:o||1,...n},as:`--col flex aic ${r||""} ${c?"--sortable":""}`,onClick:T,children:[jsx(u,{children:i}),s==-1&&c&&l==e&&jsx(u,{as:"--arrow flex aib",children:a==1?H.arrowUp:H.arrowDown})]})};ds.displayName="Zuz.Column";var Ot=ds;var hs=t=>{let{index:s,pubsub:e,schema:r,data:o,ids:n,styles:i,animate:m,sortBy:f,selectable:l,tableRef:c,loading:p,rowClassName:a,onSort:d,onRowClick:T,onSelect:h,onContextMenu:S}=t,P=useDelayed(),R=useMemo(()=>({transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(s+1)}),[]),y=useRef(null),g=(v,C)=>{s==-1?e.emit(`ALL_ROWS_${v?"CHECKED":"UNCHECKED"}`,v):(h&&h(o,v),e.emit(`ROW_${v?"CHECKED":"UNCHECKED"}`,v,C));},I=(v,C,N)=>jsx(Ot,{idx:v,id:C,as:"--selector",pubsub:e,value:jsx(at,{value:N,ref:y,onSwitch:g,type:Se.Default})});return useEffect(()=>{let v=(L,$)=>{y.current?.setChecked(L,false);},C=(L,$)=>{let B=false;c?.current&&c.current.querySelectorAll(".--row").forEach(_=>{let F=_;if(!F.classList.contains("--row-head")){let U=F.querySelector(".--selector input[type=checkbox]");U&&U.checked&&!B&&(B=U.checked);}}),y.current.setChecked(B,false);},N=L=>{y.current?.setChecked(L,false),h&&h(o,L);},O=L=>{y.current?.setChecked(L,false),h&&h(o,L);};return s==-1?(e.on("ROW_CHECKED",v),e.on("ROW_UNCHECKED",C),()=>{e.off("ROW_CHECKED",v),e.off("ROW_UNCHECKED",C);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",O),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",O);})},[]),jsxs(u,{onContextMenu:v=>S?S(v,o):null,onClick:v=>T?T(v,t.data):()=>{},...m?{fx:{...R,when:P}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${s==-1?"--row-head":""} ${a||""}`,children:[s==-1&&r.map((v,C)=>{let{renderWhenHeader:N,render:O,value:L,...$}=v;return jsxs(Fragment,{children:[l&&C==0&&I(-1,`--selector-${v.id}`,"all"),jsx(Ot,{idx:-1,onSort:d,sortBy:f,value:L,...$,pubsub:e,style:i[v.id]})]},`--col-${v.id}`)}),p&&s>-1&&jsx(u,{as:"--col",children:jsx(V,{as:"opacity:0",children:"..."})}),!p&&s>-1&&n&&o&&r.map((v,C)=>jsxs(Fragment,{children:[l&&C==0&&I(C,`--selector-${v.id}`,v.id.toString()),n.includes(String(v.id))?jsx(Ot,{pubsub:e,idx:C,id:String(v.id),style:i[String(v.id)],value:v.render?v.render(o,s):o[String(v.id).includes(".")?String(v.id).split(".").reverse()[0]:v.id]}):null]},`--${String(v.id)}-val-${C}`))]})};hs.displayName="Zuz.Row";var Dt=hs;var ws=(t,s)=>{let{schema:e,rows:r,rowCount:o,rowsPerPage:n,currentPage:i,pagination:m,paginationHash:f,showPaginationOnZeroPageCount:l,animateRows:c,header:p,rowClassName:a,selectableRows:d,hoverable:T,sortBy:h,loading:S,loadingRowCount:P,loadingMessage:R,spinner:y,emptyMessage:g,onSort:I,onRowClick:v,onRowSelectToggle:C,onPageChange:N,onRowContextMenu:O,...L}=t,$=useRef(null),B=useMemo(()=>e.reduce((ae,j)=>(ae[j.id]={flex:j.weight||1,...j.w&&{width:j.w},...j.maxW&&{maxWidth:j.maxW},...j.minW&&{minWidth:j.minW},...j.h&&{height:j.h},...j.maxH&&{maxHeight:j.maxH},...j.minH&&{minHeight:j.minH}},ae),{}),[e]),_=useMemo(()=>Object.keys(B),[e]),F=useMemo(()=>p??true,[p]),{style:U,className:x,rest:M}=E(L),A=useRef(null),W=useMemo(()=>new PubSub,[]),D=useRef(r.map(()=>uuid(8))),[Z,Y]=useState(h||null),[J,ee]=useState(R||"loading"),pe=useMemo(()=>!S&&r&&r.length==0,[S,r]),ne=useCallback(()=>g?typeof g=="function"?jsx(g,{}):g:jsx(V,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,r]);useEffect(()=>{D.current=r.map(()=>uuid(8));},[r]);let we=(ae,j)=>{Y(ae),I?.(ae,j);},ke=(o||(r?r.length:0))/(n||10),ve=useMemo(()=>l||ke>1?jsx(Lo,{hash:f,ref:$,renderOnZeroPageCount:l,onPageChange:N,paginationStyle:"table",startPage:i,itemCount:o||(r?r.length:0),itemsPerPage:n||10}):null,[i,o]);return useImperativeHandle(s,()=>({setLoading(ae){}})),jsxs(u,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${x}`,ref:A,children:[F==true&&jsx(Dt,{sortBy:Z,onSort:we,tableRef:A,pubsub:W,selectable:d,index:-1,schema:e,loading:true,styles:B}),S&&jsxs(u,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:y||se.Simple}),J&&jsx(V,{as:"--table-loading-message",children:J})]}),S&&Array(P||5).fill({}).map((ae,j)=>jsx(Dt,{tableRef:A,index:j,pubsub:W,schema:e,styles:B,loading:true,animate:c,onRowClick:v},`--trow-loading-${j}-${e[0].id}`)),!S&&r&&r.map((ae,j)=>jsx(Dt,{tableRef:A,pubsub:W,loading:false,index:j,schema:e,ids:_,styles:B,animate:c,data:ae,onRowClick:v,rowClassName:a,selectable:d,onSelect:C,onContextMenu:O},`--trow-${D.current[j]||j}-${e[0].id}`)),pe&&ne(),jsx(u,{"aria-hidden":!m||!ve,...c?{fx:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(r.length+1),when:!S&&r&&m&&ve!=null}}:{},as:"--row flex aic --row-footer",children:m&&ve?ve:null})]})};ws.displayName="Zuz.Table";var Km=forwardRef(ws),Wm=Km;var Gm=({ref:t,...s})=>{let{title:e,items:r}=s,[o,n]=useState(0),i=(m,f,l)=>{m.preventDefault(),n(f),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(u,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx(V,{as:"--toc-title",children:e}),jsx(He,{items:r.map((m,f)=>jsx("a",{className:o==f?"--toc-active":"",style:{anchorName:o===f?"--toc-active":"none",color:o==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>i(l,f,m.tag),href:`#${m.tag}`,children:m.label}))})]})},qm=Gm;var vs=({isActive:t,transitionType:s,speed:e,width:r,render:o,content:n,onHeightChange:i})=>{let m=useRef(null),f=useResizeObserver(m);useEffect(()=>{t&&f.height>0&&i(f.height);},[t,f.height]);let l=useMemo(()=>{let c={flexShrink:0,height:"fit-content"};return s==="fade"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,visibility:t?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:t?1:0}:s==="scale"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,transform:`scale(${t?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:t?1:0}:c},[t,s,r,e]);return jsx(u,{ref:m,style:{...l},className:"--content",children:o||t?n:null})};vs.displayName="Zuz.TabBody";var Ss=vs;var Ps=({ref:t,...s})=>{let{tabs:e,speed:r=.3,prerender:o=true,variant:n,tabStyle:i="fixed",onChange:m,transitionType:f="slide",...l}=s,[c,p]=useState(0),a=useRef(null),d=useResizeObserver(a),T=useMemo(()=>uuid(8),[]),[h,S]=useState("auto"),P=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(t,()=>({setTab:C=>p(C)}));let R=useMemo(()=>e.map(C=>({...C,key:C.key||uuid(8)})),[e]),{style:y,className:g,rest:I}=E({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),v=()=>{if(!P)return {opacity:0};switch(f){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${c*d.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(u,{ref:a,style:y,className:`--tabview --${i} flex cols ${g}`,children:[jsx(it,{as:"--tabview-head",onSwitch:C=>{p(C.index);let N=R.find(O=>O.tag==C.tag);N&&N.onSelect&&(N.onSelect(N,C.index),m?.(N,C.index));},selected:c,items:R.reduce((C,N,O)=>(C.push({icon:N.icon,index:O,label:N.label,tag:N.tag}),C),[])}),jsx(u,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:h,transition:P?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:P?1:0},children:jsx(u,{className:"--track",style:{...v()},children:R.map((C,N)=>jsx(Ss,{isActive:N===c,transitionType:f,speed:r,width:d.width,render:o||N===c,onHeightChange:O=>N===c&&S(O),content:C.body},`tab-body-${C.key||N}-${T}`))})})]})};Ps.displayName="Zuz.TabView";var np=Ps;var lp=({ref:t,commands:s,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:n,...i})=>{let[m,f]=useState([{type:"output",content:r}]),[l,c]=useState(""),p=useRef(null),a=useRef(null),{variant:d}=X(true);useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight);},[m]);let T=g=>{let I=typeof g=="string"?{type:"output",content:g}:g;f(v=>{let C=[...v,I];return C.length>1e3?C.slice(-1e3):C});},h=()=>f([]);useImperativeHandle(t,()=>({write:T,clear:h}));let S=async g=>{let[I,...v]=g.split(" "),C=I.toLowerCase();return s&&s[C]?await s[C](v):e?await e(g):`command not found: ${I}`},P=g=>{let I=/\u001b\[(\d+)m/g,v=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,O="#d4d4d4",L=false,$;for(;($=I.exec(g))!==null;){let _=g.slice(N,$.index);_&&v.push({text:_,color:O,bold:L});let F=$[1];F==="0"?(O="#d4d4d4",L=false):F==="1"?L=true:C[F]&&(O=C[F]),N=I.lastIndex;}let B=g.slice(N);return B&&v.push({text:B,color:O,bold:L}),v},R=(g,I)=>g.includes("\x1B")?P(g).map((v,C)=>jsx(te,{style:{color:v.color||"#d4d4d4",fontWeight:v.bold?"bold":"normal"},children:v.text},`--terminal-msg-${C}-${v.text.replace(/\S+/g,"-")}`)):jsx(te,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:g}),y=async g=>{if(g.key==="Enter"&&l.trim()){let I=l.trim(),v=[...m,{type:"command",content:`${o}${I}`}];c(""),f(v);let C=await S(I);f(N=>[...N,{type:"output",content:C}]);}};return jsxs(u,{as:`--zuz-terminal --${n||d||K.Medium} flex cols ${i.className}`,onClick:()=>a.current?.focus(),children:[jsx(u,{ref:p,className:"--terminal-log",children:m.map((g,I)=>jsx(u,{children:jsx(V,{children:R(g.content,g.type)})},I))}),jsxs(u,{as:"flex aic --terminal-input",children:[jsx(V,{as:"--terminal-prompt",children:o}),jsx(re,{ref:a,className:"--zuz-term-input",autoFocus:true,value:l,variant:n||d||K.Medium,onChange:g=>c(g.target.value),onKeyDown:y})]})]})},cp=lp;var mp=({meta:t})=>jsxs(z,{as:"flex aic --command-item",children:[t.icon&&jsx(Q,{name:t.icon,as:"--command-icon"}),jsx(V,{children:t.label})]}),pp=({position:t,onSelect:s,commands:e,visible:r})=>jsx(u,{"aria-hidden":!r,fx:{transition:q.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(mp,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Es=pp;var ks=forwardRef((t,s)=>{let{autoResize:e,maxHeight:r,variant:o,resize:n="none",command:i,commands:m,onInput:f,cmd:l,renderDropdown:c,value:p,defaultValue:a,...d}=t,T=useRef(null),h=useRef(null),{variant:S}=X(true),{style:P,className:R,rest:y}=E(d),{showDropdown:g,dropdownPosition:I,handleKeyDown:v,handleInput:C,handleCommandSelect:N}=useCommandActions({command:i,commands:m,cmd:l,ref:T}),O=useCallback(()=>{let $=T.current;!$||!e||(h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{$.style.height="auto";let B=$.scrollHeight;if(r){let _=parseInt(r.toString(),10);isNaN(_)||(B=Math.min(B,_));}$.style.height=`${B}px`,$.style.overflowY=r&&B>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),L=$=>{f?.($),C($),O();};return useEffect(()=>{O();},[p,a,O]),useEffect(()=>{e&&T.current&&O();},[e,O]),useEffect(()=>()=>{h.current&&cancelAnimationFrame(h.current);},[]),jsxs(u,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||K.Medium} flex ${R}`.trim(),style:{...P,resize:n,height:e?"auto":P?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:v,onInput:L,ref:$=>{typeof s=="function"?s($):s&&(s.current=$),T.current=$;},value:p,defaultValue:a,...y}),c?c({show:g,position:I,commands:m||[],onSelect:N}):m&&m.length>0&&jsx(Es,{visible:g,commands:m,onSelect:N,position:I})]})});ks.displayName="Zuz.TextArea";var hp=ks;var Os=forwardRef((t,s)=>{let{as:e,value:r,color:o,direction:n,...i}=t,m=useRef(null),[f,l]=useState(r||0);return useImperativeHandle(s,()=>({updateValue(c){f.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),m.current){let p=c.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((a,d)=>{let T=p[d];if(a instanceof HTMLElement){a.setAttribute("data-value",T);let h=a.querySelector(".--wheel-char-track");h instanceof HTMLElement&&(h.style.setProperty("--v",T),h.offsetWidth);}});}}})),useEffect(()=>{l(r||0);},[r]),jsxs(u,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:m,...i,children:[(f||0).toString().split("").map((c,p)=>isNaN(parseInt(c,10))?jsx(te,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${p}`):jsx(te,{"data-value":c,className:`--wheel-char grid ${p>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(te,{className:`--wheel-char-track --wheel-track-${n||"down"} grid`,style:{"--v":c},children:[jsx(te,{children:!n||n==="down"?0:9}),(!n||n==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((a,d)=>jsx(te,{children:a},`${p}--${d}`)),jsx(te,{children:!n||n==="down"?9:0})]})},`wheel-char-${p}`)),o&&jsx(u,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Os.displayName="Zuz.TextWheel";var Cp=Os;var As=forwardRef((t,s)=>{let{title:e,position:r,margin:o,children:n,...i}=t,{style:m,className:f,rest:l}=E(i),[c,p]=useState(false),a=useMemo(()=>r||oe.Top,[]),d=useRef(null),T=useRef(null),h=y=>{},S=typeof ResizeObserver<"u"?new ResizeObserver(h):{observe:()=>{},unobserve:()=>{}},P=useDimensions(),R=useMemo(()=>{if(!T.current)return {left:0,top:0};let y=T.current.previousElementSibling;if(y){let g=y.getBoundingClientRect();switch(S.observe(y),a){case oe.Top:return {left:g.left+g.width/2,top:g.top-(o||25)};case oe.Bottom:return {left:g.left+g.width/2,top:g.top+(o||25)};case oe.Left:return {left:g.left-g.width/2,top:g.top+g.height/2};case oe.Right:return {left:g.right,top:g.top+g.height/2};default:return {left:0,top:0}}}},[T.current,P,S]);return useEffect(()=>{},[]),jsxs(u,{ref:d,className:"--with-tooltip rel",onMouseEnter:y=>p(true),onMouseLeave:y=>p(false),children:[n,jsx(u,{ref:T,style:{left:R?.left+"px",top:R?.top+"px"},className:`--tooltip --${r||oe.Top} fixed ${f}`.trim(),fx:{from:a==oe.Bottom||a==oe.Top?{opacity:0,x:"-50%",y:a==oe.Top?-5:5}:{opacity:0,y:"-50%",x:a==oe.Right?15:-25},to:a==oe.Bottom||a==oe.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:a==oe.Right?10:-20},curve:G.EaseInOut,when:c},children:jsx(V,{className:"--text rel",children:e})})]})});As.displayName="Zuz.ToolTip";var Np=As;var _o=forwardRef((t,s)=>{let{as:e,meta:r,nodes:o,icons:n,onSelect:i,treeTag:m,selected:f,roots:l,expanded:c,...p}=t,{tag:a,label:d,icon:T,under:h,isHead:S}=r,P=useMemo(()=>l.includes(a),[l]),[R,y]=useState(c),g=()=>{localStorage.setItem(`--tn${m}-${a}`,R?"0":"1"),y(!R);};useEffect(()=>{c||P&&!localStorage.getItem(`--tn${m}-${a}`)?(localStorage.setItem(`--tn${m}-${a}`,"1"),y(true)):y(localStorage.getItem(`--tn${m}-${a}`)=="1");},[]);let I=useMemo(()=>o.filter(v=>v.under==a),[o,a]);return jsxs(u,{className:`--treenode ${P?"--is-root":""} --treenode-${a} flex cols`,children:[jsxs(u,{className:`--node --node-${a} flex aic ${f==a?" --selected":""}`,children:[jsx(z,{skeleton:p.skeleton,onClick:g,className:"--node-aro-btn",disabled:I.length==0,children:n?.arrowClose&&n?.arrowOpen?jsx(Q,{skeleton:p.skeleton,className:"--node-aro-icon",name:I.length==0?n?.arrowDisabled||n?.arrowClose:R?n?.arrowOpen:n?.arrowClose}):I.length==0?H.chevronBottom:R?H.chevronBottom:H.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:v=>i(a),children:[(n?.nodeOpen&&n?.nodeClose||P&&n?.rootOpen&&n?.rootClose)&&jsx(Q,{skeleton:p.skeleton,className:`--node-icon ${P?"--icon-root":""}`,name:T||(R?P&&n?.rootOpen||n.nodeOpen:P&&n?.rootClose||n?.nodeClose)}),jsx(V,{className:`--node-label ${P?"--node-label-root":""}`.trim(),skeleton:p.skeleton,children:d})]})]}),R&&I.length>0&&jsx(u,{className:`--sub-node tree-sub-node-${a} flex cols`,children:I.map(v=>jsx(_o,{treeTag:m,selected:f,onSelect:i,icons:n,roots:l,expanded:v.expanded||false,meta:v,nodes:o},`--node-${v.tag}`))})]})});_o.displayName="TreeItem";var zs=_o;var Fs=forwardRef((t,s)=>{let{as:e,nodes:r,onNodeSelect:o,tag:n,icons:i,roots:m,selected:f,...l}=t,[c,p]=useState(f);useImperativeHandle(s,()=>({getSelected:()=>c}),[o]);let a=d=>{p(d),o&&o(d);};return useEffect(()=>{c!=f&&p(f);},[f]),jsx(u,{className:"--treeview flex cols",children:r.filter(d=>m.includes(d.tag)).map(d=>jsx(zs,{treeTag:n?`-${n}`:"",selected:c,onSelect:T=>a(T),icons:i,meta:d,roots:m,expanded:d.expanded||false,skeleton:l.skeleton,nodes:r},`--node-${d.tag}`))})});Fs.displayName="Zuz.TreeView";var Vp=Fs;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
-
export{ue as ALERT,qo as AVATAR,Si as Accordion,Ni as ActionBar,Li as Alert,Xi as AutoComplete,rl as Avatar,sl as Badge,u as Box,El as Bubble,gn as BubbleMediaType,dn as BubbleStatus,z as Button,mn as CHART,Se as CHECKBOX,_p as COLORTHEME,
|
|
12
|
+
</div>`}).join("")},[e,g]);return jsx(u,{as:`--code-block ${c}`,style:p,...f,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${n}`,dangerouslySetInnerHTML:{__html:T}})})})},zl=$l;var vn=({onSelect:t,meta:s,selected:e,disabled:n=false})=>{let o=useRef(null),{index:r,icon:l,label:m}=s,[f,i]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&o.current){let{width:p,x:a}=o.current.getBoundingClientRect();i({x:a,width:p}),e&&t(r,p,a,s,true);}},[c,o.current]),useEffect(()=>{e&&t(r,f.width,f.x,s,false);},[e]),jsxs(z,{disabled:n,onClick:()=>t(r,f.width,f.x,s,false),ref:o,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[l?typeof l=="string"?jsx(Q,{name:l,as:"--segment-icon"}):jsx(u,{as:"--segment-icon flex aic jcc",children:l}):null,m&&String(m).trim()!=""&&jsx(u,{className:"--segment-label",children:m||`Item ${r}`})]})};vn.displayName="SelectTabItem";var wn=vn;var Cn=forwardRef((t,s)=>{let{fx:e,items:n,selected:o,variant:r,disabled:l=false,onSwitch:m,...f}=t,[i,c]=useState(o||0),p=useDelayed(50),a=useRef(i),{className:g,style:T,rest:h}=E(f),S=useRef(null),P=useRef(null),{variant:R}=X(true),y=(d,I,w,C,N)=>{if((N||i!=d&&i!=-2)&&(c(d),a.current=i,queueMicrotask(()=>{p&&m?.(C);})),S.current){let M=P.current?.getBoundingClientRect();S.current.style.setProperty("--w",`${I}px`),S.current.style.setProperty("--x",`${M?w-M.left:w}px`);}};return useImperativeHandle(s,()=>({setSelected:d=>{typeof d=="number"&&d!=i&&c(d);}}),[i]),jsxs(u,{ref:P,"data-selected":i,className:`${g} --segmented --${r||R||K.Medium} flex aic rel`,style:T,...h,children:[jsx(u,{ref:S,className:`--segment-tab --${l?"disabled":"abled"} abs`}),n.map((d,I)=>jsx(wn,{disabled:l,onSelect:y,selected:i==I,meta:{...d,index:I}},`segment-${d.label}-${I}`))]})});Cn.displayName="Zuz.SelectTabs";var it=Cn;var Rn=forwardRef((t,s)=>{let{type:e,...n}=t,o=useDelayed(),{colorScheme:r,setColorScheme:l}=Ut(),m=useCallback(()=>{l(r=="dark"?"light":r=="light"?"system":"dark");},[r]),{className:f,style:i}=E(n),c=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"system",index:1,label:"",icon:H.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(r),[r]);return !o||p==-1?null:e=="system"||e=="switch"?jsx(it,{className:`--color-scheme --${e}`,onSwitch:({tag:a})=>{l(a);},selected:p,items:c,...n}):jsx(z,{onClick:m,style:i,as:`--color-scheme-switch --${n.variant||K.Small} ${f}`.trim(),children:r=="system"?H.colorSchemeSystem:r=="light"?H.colorSchemeLight:H.colorSchemeDark})});Rn.displayName="Zuz.ColorScheme";var tc=Rn;var Nn=forwardRef((t,s)=>{let[e,n]=useState("wait"),{title:o,message:r,acceptLabel:l,rejectLabel:m,position:f}=t,i=async c=>{n(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");n(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(u,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:G.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${f||oe.Left} flex cols`,children:[jsx(V,{as:"--title",children:o||"This site uses cookies"}),jsx(V,{as:"--message",children:r||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(u,{as:"--footer flex aic",children:[jsx(z,{onClick:c=>i(1),as:"--accept",children:l||"Accept All"}),jsx(z,{onClick:c=>i(0),as:"--reject",children:m||"Cancel"})]})]})});Nn.displayName="Zuz.CookiesConsent";var sc=Nn;var Ln=forwardRef((t,s)=>{let {type:e,value:n,min:o,max:r,step:l,onChange:m,roundValue:f,...i}=t,{className:c,style:p,rest:a}=E(i),g=useRef(l||.01).current,T=useRef(o||0).current,h=useRef(r||1).current,S=useRef(n||0).current,P=useRef(null),R=useRef(null),y=useRef(null);useRef(null);let I=useRef(null),w=useRef(null),C=(A,W,D)=>(A-W)/(D-W)*100,N=A=>{if(R.current){let W=parseFloat(A.currentTarget.value),D=C(W,parseFloat(A.currentTarget.min),parseFloat(A.currentTarget.max));R.current.style.setProperty("--value",`${D}`),R.current.setAttribute("data-value",`${W}`),m&&m(f?+W.toFixed(2):W);}},[M,L]=useState(false),[$,B]=useState(0),[_,F]=useState(0),U=A=>{L(true),B(A.clientX),F(R.current?parseFloat(R.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},x=A=>{if(M){let W=A.clientX-$,D=Math.max(T,Math.min(_+W*g,h));R.current&&(R.current.setAttribute("data-value",`${D}`),w.current.textContent=f?D.toFixed(2):D.toString(),m&&m(f?+D.toFixed(2):D));}},O=()=>{L(false),document.body.style.cursor="auto";};return useEffect(()=>{R.current&&R.current.style.setProperty("--value",P.current?`${C(parseFloat(P.current.value),parseFloat(P.current.min),parseFloat(P.current.max))}`:S.toString());},[]),useEffect(()=>(M?(document.addEventListener("mousemove",x),document.addEventListener("mouseup",O)):(document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",O)),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",O);}),[M]),jsx(u,{ref:R,"data-value":S||0,className:`--slider --${e||dt.Default} flex rel ${c}`.trim(),style:{...p},children:dt.Text===e?jsx(Fragment$1,{children:jsx(V,{ref:w,onMouseDown:U,className:"--slider-text",children:S||0})}):jsxs(Fragment$1,{children:[jsx(u,{ref:I,className:"--slider-track abs fill"}),jsx(u,{ref:y,className:"--slider-knob abs"}),jsx(re,{ref:P,onInput:N,className:"abs fill",tabIndex:0,type:e||dt.Default,defaultValue:S||0,step:g,max:h,min:T})]})})});Ln.displayName="Zuz.Slider";var wo=Ln;var Mn=forwardRef((t,s)=>{let{src:e,shape:n,size:o,...r}=t,{style:l,className:m,rest:f}=E(r),{canvasRef:i,crop:c,setScale:p,handleMouseDown:a,handleMouseUp:g,handleMouseMove:T}=useImageCropper(e,o||200,n||CropShape.Circle);return useImperativeHandle(s,()=>({getCropped(){return c()},setScale(h){p(h);}})),jsxs(u,{as:`--cropper --${n||CropShape.Circle} ${m}`,style:l,...f,children:[jsx("canvas",{ref:i,width:o||200,height:o||200,onMouseDown:a,onMouseUp:g,onMouseLeave:g,onMouseMove:T}),jsx(u,{as:"--cropper-slider",children:jsx(wo,{onChange:h=>p(h),min:0,max:1,step:.01,value:1})})]})});Mn.displayName="Zuz.Cropper";var pc=Mn;var fc=(e=>(e.Circle="circle",e.Square="square",e))(fc||{});var Dn=forwardRef((t,s)=>{let{items:e,maxItems:n}=t,o=useMemo(()=>{let m=typeof e=="string",f=m?[]:e;return m&&e.split(",").forEach(i=>{f.push({label:i});}),f},[e]),l=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(He,{ref:s,className:"--crumb flex aic",direction:"rows",seperator:jsx(u,{as:"--crumb-chevron",children:H.chevronRightOutline}),items:l.map((m,f,i)=>m.ID=="."?jsx(u,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(u,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs(z,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!i[f+1],children:[m.icon&&jsx(Q,{as:"--crumb-icon",name:m.icon}),jsx(V,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});Dn.displayName="Zuz.Crumb";var gc=Dn;var An=forwardRef((t,s)=>{let{icon:e,defaultValue:n,value:o,size:r,variant:l,numeric:m,type:f,onConfirm:i,...c}=t,[p,a]=useState(false),[g,T]=useState(n||null),{style:h,className:S,rest:P}=E(c),R=useRef(null),y=useRef(null),{reposition:d}=tt(y,{direction:oe.Bottom,offset:2}),I=C=>{m&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let C=N=>{let M=N.target,L=R.current?.contains(M),$=y.current?.contains(M);!L&&!$&&a(false);};return p&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[p]),useEffect(()=>{let C=N=>{N.key==="Escape"&&p&&(a(false),R.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[p]);let w=()=>{a(true);};return useEffect(()=>{p&&d();},[p,d]),jsx(Fragment$1,{children:jsxs(u,{as:`--date-picker ${l?`--${l}`:""} rel flex aic ${S}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsx(Q,{as:"mr:10 c:#666",name:e}):e:jsx(te,{as:"--date-picker-icon flex aic jcc",children:H.calendar}),jsx("input",{ref:R,value:g?format(g,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${l?`--${l}`:""} flex`.trim(),style:h,onFocus:w,onInput:I,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&i?.(C.currentTarget.value);},...P}),jsx(u,{"aria-hidden":!p,ref:y,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:p,duration:.05},as:`--date-picker-chooser flex aic ${l?`--${l}`:""}`,children:jsx(fo,{defaultValue:g,onChange:C=>{T(C),a(false);}})})]})})});An.displayName="Zuz.DatePicker";var bc=An;var $n=forwardRef((t,s)=>{let{icon:e,variant:n,position:o}=t;return jsx(z,{className:`--fab fixed --${n||K.Large} --${o||"bottomright"}`,children:e||H.plus})});$n.displayName="Zuz.Fab";var Cc=$n;var zn=t=>{let{names:s,strength:e}=t,n={[gt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${gt.Gooey}`)};return useEffect(()=>{},[s]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(s||[gt.Gooey]).map(o=>n[o](e))})})};zn.displayName="Zuz.Filters";var Rc=zn;var Ee=null,me=null,Fn=forwardRef((t,s)=>{let{title:e,message:n,transition:o,curve:r,speed:l,type:m,actionPosition:f,spinner:i,loadingMessage:c,onShow:p,onHide:a,...g}=t,{className:T,style:h,rest:S}=E(g),[P,R]=useState(e||""),[y,d]=useState(n||""),[I,w]=useState(null),[C,N]=useState(m||fe.Default),M=useMemo(()=>uuid(12),[]),[L,$]=useState(false),B=useRef(null),_=useRef(null),[F,U]=useState(false),[x,O]=useState(true),A=useRef(null),W=y;useImperativeHandle(s,()=>({setLoading(Z){U(Z);},showDialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),Y&&d(Y),Z&&R(Z),J&&w(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},dialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),d(Y),R(Z),J&&w(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},error(Z,Y){this.show(Z,Y,fe.Error);},warn(Z,Y){this.show(Z,Y,fe.Warn);},success(Z,Y){this.show(Z,Y,fe.Success);},show(Z,Y,J){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),_.current=B.current.style.transform,B.current.style.transform="",B.current.classList.remove("--wobble"),setTimeout(()=>{B.current.classList.add("--wobble"),B.current.style.transform=`${_.current} scale(.9)`.trim();},50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),B.current.style.transform=_.current||"",me=null;},500)),Ee=setTimeout(()=>{$(false),Ee=null,me=null;},(Y||4)*1e3),N(J||fe.Default),d(Z),$(true),p?.();},hide(){$(false),a?.();}}));let D=useMemo(()=>{let Z={when:L,duration:l||.3,delay:.1};if(C==fe.Dialog){if(o){let{from:Y,to:J}=Xe(o,20);return {from:Y,to:J,curve:r||G.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:G.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:G.Spring,...Z}},[L,C]);return useEffect(()=>{A.current&&clearTimeout(A.current),L?O(true):A.current=setTimeout(()=>O(false),1e3);},[L]),C==fe.Dialog?jsxs(Fragment$1,{children:[jsx(Me,{when:L}),jsxs(u,{className:`--sheet --sheet-${C.toLowerCase()} ${L?"is-visible":""} ${T} fixed`.trim(),style:h,fx:D,...S,ref:B,children:[jsx(ye,{when:F,spinner:i,message:c}),jsxs(u,{className:"--head flex aic rel",children:[jsx(u,{className:`--${P?"title":"dot"} flex aic rel`,children:P||""}),jsx(z,{onClick:Z=>$(false),className:"--closer abs",children:"\xD7"})]}),jsx(u,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:x?W:null}),I&&jsx(u,{className:`--footer flex aic rel ${f?f==$t.Center?"jcc":"":"jce"}`.trim(),children:I.map((Z,Y)=>jsx(z,{onClick:J=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${M}-action-${Z.key}`))})]})]}):jsx(u,{className:`--sheet --sheet-${C.toLowerCase()} ${T} abs`.trim(),style:h,...S,fx:D,ref:B,children:L?y:null})}),ct=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;Fn.displayName="Zuz.Sheet";var Lc=Fn;var Zn=({ref:t,...s})=>{let{name:e,cover:n,spinner:o,errors:r,action:l,children:m,withData:f,beforeSubmit:i,onSubmit:c,onError:p,onSuccess:a,resetOnSuccess:g,...T}=s,{className:h,style:S,rest:P}=E(T),[R,y]=useState(false),d=useRef(null),I=useRef(null),w=useRef(null),C=ao(),N=useCallback(x=>d.current?d.current.querySelectorAll(x):[],[d.current]),M=x=>({name:x.name||x.getAttribute("name")||x.getAttribute("data-name"),required:x.required?true:x.getAttribute("data-required")?x.getAttribute("data-required")=="true":false,with:x.with||x.getAttribute("with")}),L=x=>{let O=[];return x.querySelectorAll(".--input").forEach(A=>{O.push(A.value);}),O.join("")},$=useCallback(x=>{let{required:A}=M(x);if(A){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let D=L(x);if(D==""||D.length<parseInt(x.getAttribute("data-size")))return false}if(x.classList.contains("--select")&&x.querySelector("button.--selected").dataset.value=="-1"||x.value=="")return false}if(x.getAttribute("with")){let D=x.getAttribute("with");switch(D.includes("@")&&(D=D.split("@")[0],D=="match"&&(D=Ce.MatchField)),D.toUpperCase()){case Ce.IPV4:return _(x.value).isIPv4();case Ce.IPV6:return _(x.value).isIPv6();case Ce.Email:return _(x.value).isEmail();case Ce.Uri:try{return new URL(x.value),!0}catch{return false}case Ce.Password:return console.log("Add FORMVALIDATION.Password"),false;case Ce.MatchField:let[Z,Y,J]=x.getAttribute("with").split("@"),ee=document.querySelector(`[name=${Y.trim()}]`);if(!ee)return false;switch(J||"direct-match"){case "if-not-empty":if(ee&&!_(ee.value).isEmpty()&&ee.value!=x.value)return false;break;case "direct-match":if(ee&&ee.classList.contains("--otp")&&x.classList.contains("--otp")&&L(ee)!=L(x))return false;if(ee&&ee.value!=x.value)return false;break}break;default:return true}}return true},[d.current]),B=useCallback(()=>{let x={},O={},A=null,W=null;if(Array.from(N("[name]")).forEach(D=>{let{name:Z,required:Y,with:J}=M(D),ee=true;(Y||J)&&(ee=$(D)),x[Z]={valid:ee,value:D.type=="checkbox"?D.checked==true?D.value:false:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value},O[Z]=D.type=="checkbox"?D.checked==true:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value,ee?D.classList.remove("input-with-error"):(A==null&&r&&(A=D,W=r[Z]),D.classList.add("input-with-error"));}),A){let D=A;if(D.classList.contains("--otp"))for(let Z of Array.from(D.querySelectorAll(".--input"))){let Y=Z;if(Y.value==""){Y.focus();break}}else D.focus();}return {error:A!=null,errorMsg:W||"Fix errors to continue...",data:x,payload:O}},[d.current]),_$1=useCallback(()=>{let{error:x,errorMsg:O,payload:A}=B();x?C.error(O):l?startTransition(async()=>{i&&i(A),ct(n)?n.setLoading(true):y(true),C.clearAll(),withPost(l,{...A,...f||{}}).then(W=>{let D=W;ct(n)?n.setLoading(false):y(false),g&&Array.from(N("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),a?a(D):(C.clearAll(),C.success(D.message||"Redirecting..."));}).catch(W=>{ct(n)?n.setLoading(false):y(false),p?p(W):C.error(W.message||"We cannot process your request at this time.");});}):c&&c(A);},[l,I.current,d.current]),F=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(O=>{O.addEventListener("click",_$1);});},[d.current]),U=useMemo(()=>addPropsToChildren(m,x=>x.props.type=="submit",x=>({ref:w})),[m]);return useImperativeHandle(t,()=>({setLoading(x){if(x){I.current?.hide();try{C.clearAll();}catch{}}y(x);},showError(x){typeof x=="string"?C.error(x):I.current.error(x,4);},hideError(){I.current.hide();try{C.clearAll();}catch{}},init(){F();},submit(){_$1();}})),useEffect(F,[]),jsxs(u,{ref:d,style:S,className:`--form flex rel ${h} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!ct(n)&&jsx(ye,{message:n?n.message||void 0:"working",spinner:o,color:n&&"color"in n?n.color:"#ffffff",when:R}),U]})};Zn.displayName="Zuz.Form";var zc=Zn;var Kn=t=>{let {ref:s,cols:e,rows:n,gap:o,gapX:r,gapY:l,align:m,justify:f,inline:i,flow:c,autoCols:p,autoRows:a,template:g,...T}=t;useRef(null);let {className:S,style:P,rest:R}=E(T),y=I=>typeof I=="number"?`repeat(${I}, 1fr)`:I,d={display:i?"inline-grid":"grid",gridTemplateColumns:y(e),gridTemplateRows:y(n),gap:o,columnGap:r,rowGap:l,alignItems:m,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:c,gridAutoColumns:p,gridAutoRows:a,gridTemplateAreas:g,...P};return jsx(u,{ref:s,as:`--grid ${S}`.trim(),style:d,...R})};Kn.displayName="Zuz.Grid";var Kc=Kn;var Wn=t=>typeof t=="string"&&t.includes("+"),Un={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},Gn={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var Xn=forwardRef(({children:t,keys:s,variant:e},n)=>{let o=useMemo(()=>{if(Wn(s)){let r=null;return {keys:String(s).split("+").reduce((m,f,i,c)=>(c[i+1]?m.push(f):r=f.toUpperCase(),m),[]),children:r}}return {keys:s,children:String(t).toUpperCase()}},[s]);return jsxs(u,{as:`--keyboard-keys --${e||K.Small} flex aic`,children:[(Array.isArray(o.keys)?o.keys:[o.keys]).map(r=>jsx("abbr",{title:Gn[r],children:Un[r]},r)),jsx(te,{children:o?.children??t})]})});Xn.displayName="Zuz.KeyboardKeys";var No=Xn;var Qn=forwardRef((t,s)=>{let e=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:r}=t;return jsxs(u,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:G.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${r||K.Small} fixed flex`,children:[jsx(u,{className:"--ico",children:e?H[ue.Success]:H[ue.Error]}),jsx(V,{as:"--message",children:e?n||"internet connection restored :)":o||"no internet connection"})]})});Qn.displayName="Zuz.NetWorkManager";var Qc=Qn;var Eo=(e=>(e.Table="table",e.Gooey="gooey",e))(Eo||{});var es=forwardRef((t,s)=>{let{itemCount:e,itemsPerPage:n,startPage:o,pageRange:r,paginationStyle:l,breakLabel:m,prevLabel:f,nextLabel:i,hash:c,loading:p,seperator:a,renderOnZeroPageCount:g,onPageChange:T,...h}=t,S=useMemo(()=>toHash(numberInRange(4,8)),[]),P=useCallback(B=>`${toHash(B,c||6,S)}${a||""}${S}`,[S]),R=useMemo(()=>m||"...",[m]),[y,d]=useState({id:c?o?typeof o=="number"?P(o):o:1:o||1,label:o||1}),{style:I,className:w,rest:C}=E(h),N=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!e)throw new Error('"itemCount" prop is required');let M=useMemo(()=>Math.ceil(e/n),[e,n]),L=useMemo(()=>{let B=[],_=Math.max(N(y)-(r||2),1),F=Math.min(N(y)+(r||2),M);_>1&&B.push({id:c?P(1):1,label:1}),_>2&&B.push({id:-1,label:R});for(let U=_;U<=F;U++)B.push({id:c?P(U):U,label:U});return F<M-1&&B.push({id:-1,label:R}),F<M&&B.push({id:c?P(M):M,label:M}),B},[y]),$=useCallback(B=>{let _=B;+_.label<1||+_.label>M||(d(_),T?.(_));},[e,n,y]);return L.length<=1&&(g??false)===false?null:jsxs(u,{ref:s,as:`--pagination --pgt-${l||"table"} flex aic w:100% jcc ${w}`,children:[jsx(u,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:R}]).map((B,_,F)=>jsx(z,{disabled:B.id==-1||N(y)==+B.label,className:(typeof B=="string"?B:B.label)==N(y)?"--current-page":"",onClick:U=>$(B),children:typeof B=="string"?B:B.label},`--pg-${_}-${B.id}`))}),jsx(u,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(y)-1)*n+1} - `,`${Math.min(N(y)*n,e)} of ${e} items`].join(" ")}),jsxs(u,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:N(y)<=1,onClick:B=>$({id:c?P(N(y)-1):N(y)-1,label:N(y)-1}),children:H.chevronLeftOutline}),jsx(z,{disabled:L.length<=1||N(y)==N(L[L.length-1]),onClick:B=>$({id:c?P(N(y)+1):N(y)+1,label:N(y)+1}),children:H.chevronRightOutline})]})]})});es.displayName="Zuz.Pagination";var Lo=es;var os=forwardRef((t,s)=>{let{strenthMeter:e,onChange:n,...o}=t;"type"in o&&delete o.type;let{style:r,className:l,rest:m}=E(o),[f,i]=useState(false),[c,p]=useState(""),a=useMemo(()=>checkPasswordStrength(c),[c]),g=useDebounce(T=>{e&&p(T.target.value),n&&n(T);},100);return useEffect(()=>{},[]),jsxs(u,{as:"w:100% flex cols",children:[jsxs(u,{style:r,className:"--password flex aic rel",children:[jsx(re,{ref:s,type:f?"text":"password",className:l,onChange:g,...m}),jsx(z,{tabIndex:-1,onClick:()=>i(T=>!T),className:"--toggle flex aic jcc abs",children:f?H.eye:H.eyeSlash})]}),e&&jsxs(u,{as:`flex aic --password-meter --pb-score-${a.score}`,style:r,children:[jsxs(u,{as:"--password-bars flex aic",children:[jsx(u,{as:`--pbar ${a.score>=1?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=2?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=3?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=4?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=5?"--pb-on":""}`.trim()})]}),jsx(V,{as:"--password-meter-label","aria-hidden":true,children:a.result})]})]})});os.displayName="Zuz.Password";var im=os;var ns=forwardRef((t,s)=>{let{size:e,length:n,mask:o,...r}=t,l=useRef([]),m="pinput",f=false,i={};"with"in r&&(i={with:r.with},delete r.with),"type"in r&&delete r.type,"name"in r&&(m=r.name,delete r.name),"required"in r&&(f=true,delete r.required);let{style:c}=E(r),p=a=>{let g=a.currentTarget,T=l.current[parseInt(g.dataset.index)+1],h=l.current[parseInt(g.dataset.index)-1];g.value.length===1&&T?T.focus():g.value.length===0&&h&&h.focus();};return useEffect(()=>{l.current=l.current.slice(0,e||n);},[e||n]),jsx(u,{name:m,style:c,className:"--otp flex aic rel","data-required":f,"data-size":e||n||4,...i,children:Array(e||n||4).fill(1).map((a,g)=>jsx(re,{autoComplete:"new-password","data-index":g,ref:T=>{l.current[g]=T;},numeric:true,onChange:p,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...r},`pin-${g}`))})});ns.displayName="Zuz.PinInput";var pm=ns;var ss=forwardRef((t,s)=>{let{children:e,className:n,name:o,required:r,type:l,value:m,variant:f,checked:i,onSwitch:c,...p}=t,[a,g]=useState(i||false),{variant:T}=X(true),h=useRef(null);return jsxs(st,{className:`${n} --${(l||zt.Default).toLowerCase()} --radio${!l||l==zt.Default?"":"card"} --${f||T||K.Small} flex aic rel`.trim(),...p,children:[jsx(re,{ref:h,defaultChecked:a,value:m||"rd",type:"radio",className:"abs",name:o,required:r||false,onChange:S=>{c&&c(S.target.checked,m||"cb"),g(S.target.checked);}}),jsx(u,{className:"--dot rel",children:jsx(u,{className:"--rod abs abc"})}),jsx(u,{className:"--value",children:e})]})});ss.displayName="Zuz.Radio";var gm=ss;var as=forwardRef((t,s)=>{let{fx:e,withStyle:n,as:o,reverse:r=false,searchIcon:l=H.search,hideSearchIcon:m=false,clearIcon:f=H.close,hideClearIcon:i=false,onChange:c,onClear:p,...a}=t,{style:g,className:T}=E({as:t.as}),[h,S]=useState(""),{variant:P}=X(true),R=useRef(null),y=useMemo(()=>jsx(z,{tabIndex:-1,onClick:w=>I(),className:"--send flex aic jcc",variant:t.variant||K.Small,children:h!==""?!i&&(typeof f=="string"?jsx(Q,{name:f,as:"--search-action"}):f):!m&&(typeof l=="string"?jsx(Q,{name:l,as:"--search-action"}):l)}),[r,l,i,f,m]);"type"in t&&delete t.type;let d=w=>{S(w.target.value),c?.(w.target.value);},I=w=>{h.trim()!==""&&(S(""),c?.(""),R.current&&(R.current.value="",t.onConfirm?.("")));};return useImperativeHandle(s,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(u,{style:g,className:`--search ${r?"--search-rev":""} --${t.variant||P||K.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[r&&y,jsx(re,{ref:R,onChange:d,...a}),t.shortcut&&jsx(No,{keys:t.shortcut,as:"abs"}),!r&&y]})});as.displayName="Zuz.Search";var Cm=as;var ls=({value:t,updateValue:s,o:e})=>jsxs(z,{onClick:n=>s(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(Q,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(V,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});ls.displayName="Option";var cs=ls;var ps=({ref:t,...s})=>{let{selected:e,options:n,label:o,name:r,variant:l,search:m,searchPlaceholder:f,maxHeight:i,arrowDownIcon:c=H.arrowDown,arrowUpIcon:p=H.arrowUp,expanded:a,onChange:g,...T}=s,[h,S]=useState(e?typeof e=="string"?n.find(x=>x.value===e):e:n[0]),[P,R]=useState(false),[y,d]=useState(null),I=useRef(null),w=useRef(null),C=useRef(null),N=useId(),M=useMemo(()=>r||N,[]),{reposition:L}=tt(C,{direction:At.Bottom,offset:2}),{variant:$}=X(true),{className:B,style:_,rest:F}=E(T),U=x=>{S(x),R(false),g&&g(x);};return useImperativeHandle(t,()=>({setSelected:x=>{if(typeof x=="string"){let O=n.find(A=>A.value===x);O&&S(O);}else S(x);},getValue:()=>h||null})),useEffect(()=>{if(!P)return;let x=()=>{L();};return window.addEventListener("scroll",x,true),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",L);}},[P,L]),useEffect(()=>{if(!P){w.current&&(w.current.value=""),d(null);return}w.current?.focus(),L();let x=A=>{C.current&&!C.current.contains(A.target)&&R(false);},O=setTimeout(()=>{document.addEventListener("click",x);},0);return ()=>{clearTimeout(O),document.removeEventListener("click",x);}},[P,L]),jsxs(u,{className:`--select --${a==true?"expanded":""} --${l||$} ${r?`--${r}`:""} rel`.trim(),name:M,children:[jsxs(z,{ref:I,"data-value":h?typeof h=="string"?h:h.value:h||"-1",className:`--selected flex aic rel ${B}`.trim(),withLabel:false,style:_,onClick:x=>{x.stopPropagation(),R(O=>!O);},...F,children:[jsx(V,{className:"--label",children:h?typeof h=="string"?h:h.label:o||"Choose"}),jsx(u,{className:"--svg-arrow rel flex aic jcc",children:P?typeof p=="string"?jsx(Q,{name:p,as:"--search-action"}):p:typeof c=="string"?jsx(Q,{name:c,as:"--search-action"}):c})]}),jsxs(u,{id:M,className:"--options-list flex cols abs","aria-hidden":!P,style:{maxHeight:i||"auto"},ref:C,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:P,duration:.05},children:[m&&jsx(u,{as:"--select-search --sticky",children:jsx(re,{ref:w,onChange:x=>{d(x.target.value==""?null:x.target.value);},className:"--search-input",placeholder:f||"Search..."})}),(y==null?n:n.filter(x=>x.label.toLowerCase().includes(y.toLowerCase())||x.value.toLowerCase().includes(y.toLowerCase()))).map(x=>jsx(cs,{updateValue:U,value:h,o:x},`option-${(typeof x=="string"?x:x.label).replace(/\s+/g,"-")}-${typeof x=="string"?x:x.value}`))]})]})};ps.displayName="Zuz.Select";var Em=ps;var us=forwardRef((t,s)=>jsx(at,{type:Se.Switch,...t,ref:s}));us.displayName="Zuz.Switch";var Lm=us;var ds=t=>{let{idx:s,id:e,as:n,weight:o,style:r,value:l,render:m,resize:f,sortBy:i,sortable:c,onSort:p}=t,[a,g]=useState(0),T=()=>{c&&(p?.(String(e),a==1?-1:1),g(h=>h==1?-1:1));};return jsxs(u,{style:{flex:o||1,...r},as:`--col flex aic ${n||""} ${c?"--sortable":""}`,onClick:T,children:[jsx(u,{children:l}),s==-1&&c&&i==e&&jsx(u,{as:"--arrow flex aib",children:a==1?H.arrowUp:H.arrowDown})]})};ds.displayName="Zuz.Column";var Mt=ds;var hs=t=>{let{index:s,pubsub:e,schema:n,data:o,ids:r,styles:l,animate:m,sortBy:f,selectable:i,tableRef:c,loading:p,rowClassName:a,onSort:g,onRowClick:T,onSelect:h,onContextMenu:S}=t,P=useDelayed(),R=useMemo(()=>({transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(s+1)}),[]),y=useRef(null),d=(w,C)=>{s==-1?e.emit(`ALL_ROWS_${w?"CHECKED":"UNCHECKED"}`,w):(h&&h(o,w),e.emit(`ROW_${w?"CHECKED":"UNCHECKED"}`,w,C));},I=(w,C,N)=>jsx(Mt,{idx:w,id:C,as:"--selector",pubsub:e,value:jsx(at,{value:N,ref:y,onSwitch:d,type:Se.Default})});return useEffect(()=>{let w=(L,$)=>{y.current?.setChecked(L,false);},C=(L,$)=>{let B=false;c?.current&&c.current.querySelectorAll(".--row").forEach(_=>{let F=_;if(!F.classList.contains("--row-head")){let U=F.querySelector(".--selector input[type=checkbox]");U&&U.checked&&!B&&(B=U.checked);}}),y.current.setChecked(B,false);},N=L=>{y.current?.setChecked(L,false),h&&h(o,L);},M=L=>{y.current?.setChecked(L,false),h&&h(o,L);};return s==-1?(e.on("ROW_CHECKED",w),e.on("ROW_UNCHECKED",C),()=>{e.off("ROW_CHECKED",w),e.off("ROW_UNCHECKED",C);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",M),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",M);})},[]),jsxs(u,{onContextMenu:w=>S?S(w,o):null,onClick:w=>T?T(w,t.data):()=>{},...m?{fx:{...R,when:P}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${s==-1?"--row-head":""} ${a||""}`,children:[s==-1&&n.map((w,C)=>{let{renderWhenHeader:N,render:M,value:L,...$}=w;return jsxs(Fragment,{children:[i&&C==0&&I(-1,`--selector-${w.id}`,"all"),jsx(Mt,{idx:-1,onSort:g,sortBy:f,value:L,...$,pubsub:e,style:l[w.id]})]},`--col-${w.id}`)}),p&&s>-1&&jsx(u,{as:"--col",children:jsx(V,{as:"opacity:0",children:"..."})}),!p&&s>-1&&r&&o&&n.map((w,C)=>jsxs(Fragment,{children:[i&&C==0&&I(C,`--selector-${w.id}`,w.id.toString()),r.includes(String(w.id))?jsx(Mt,{pubsub:e,idx:C,id:String(w.id),style:l[String(w.id)],value:w.render?w.render(o,s):o[String(w.id).includes(".")?String(w.id).split(".").reverse()[0]:w.id]}):null]},`--${String(w.id)}-val-${C}`))]})};hs.displayName="Zuz.Row";var Ot=hs;var vs=(t,s)=>{let{schema:e,rows:n,rowCount:o,rowsPerPage:r,currentPage:l,pagination:m,paginationHash:f,showPaginationOnZeroPageCount:i,animateRows:c,header:p,rowClassName:a,selectableRows:g,hoverable:T,sortBy:h,loading:S,loadingRowCount:P,loadingMessage:R,spinner:y,emptyMessage:d,onSort:I,onRowClick:w,onRowSelectToggle:C,onPageChange:N,onRowContextMenu:M,...L}=t,$=useRef(null),B=useMemo(()=>e.reduce((ae,j)=>(ae[j.id]={flex:j.weight||1,...j.w&&{width:j.w},...j.maxW&&{maxWidth:j.maxW},...j.minW&&{minWidth:j.minW},...j.h&&{height:j.h},...j.maxH&&{maxHeight:j.maxH},...j.minH&&{minHeight:j.minH}},ae),{}),[e]),_=useMemo(()=>Object.keys(B),[e]),F=useMemo(()=>p??true,[p]),{style:U,className:x,rest:O}=E(L),A=useRef(null),W=useMemo(()=>new PubSub,[]),D=useRef(n.map(()=>uuid(8))),[Z,Y]=useState(h||null),[J,ee]=useState(R||"loading"),pe=useMemo(()=>!S&&n&&n.length==0,[S,n]),ne=useCallback(()=>d?typeof d=="function"?jsx(d,{}):d:jsx(V,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,n]);useEffect(()=>{D.current=n.map(()=>uuid(8));},[n]);let ve=(ae,j)=>{Y(ae),I?.(ae,j);},ke=(o||(n?n.length:0))/(r||10),we=useMemo(()=>i||ke>1?jsx(Lo,{hash:f,ref:$,renderOnZeroPageCount:i,onPageChange:N,paginationStyle:"table",startPage:l,itemCount:o||(n?n.length:0),itemsPerPage:r||10}):null,[l,o]);return useImperativeHandle(s,()=>({setLoading(ae){}})),jsxs(u,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${x}`,ref:A,children:[F==true&&jsx(Ot,{sortBy:Z,onSort:ve,tableRef:A,pubsub:W,selectable:g,index:-1,schema:e,loading:true,styles:B}),S&&jsxs(u,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:y||se.Simple}),J&&jsx(V,{as:"--table-loading-message",children:J})]}),S&&Array(P||5).fill({}).map((ae,j)=>jsx(Ot,{tableRef:A,index:j,pubsub:W,schema:e,styles:B,loading:true,animate:c,onRowClick:w},`--trow-loading-${j}-${e[0].id}`)),!S&&n&&n.map((ae,j)=>jsx(Ot,{tableRef:A,pubsub:W,loading:false,index:j,schema:e,ids:_,styles:B,animate:c,data:ae,onRowClick:w,rowClassName:a,selectable:g,onSelect:C,onContextMenu:M},`--trow-${D.current[j]||j}-${e[0].id}`)),pe&&ne(),jsx(u,{"aria-hidden":!m||!we,...c?{fx:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(n.length+1),when:!S&&n&&m&&we!=null}}:{},as:"--row flex aic --row-footer",children:m&&we?we:null})]})};vs.displayName="Zuz.Table";var Km=forwardRef(vs),Wm=Km;var Gm=({ref:t,...s})=>{let{title:e,items:n}=s,[o,r]=useState(0),l=(m,f,i)=>{m.preventDefault(),r(f),document.getElementById(i)?.scrollIntoView({behavior:"smooth"});};return jsxs(u,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx(V,{as:"--toc-title",children:e}),jsx(He,{items:n.map((m,f)=>jsx("a",{className:o==f?"--toc-active":"",style:{anchorName:o===f?"--toc-active":"none",color:o==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:i=>l(i,f,m.tag),href:`#${m.tag}`,children:m.label}))})]})},qm=Gm;var ws=({isActive:t,transitionType:s,speed:e,width:n,render:o,content:r,onHeightChange:l})=>{let m=useRef(null),f=useResizeObserver(m);useEffect(()=>{t&&f.height>0&&l(f.height);},[t,f.height]);let i=useMemo(()=>{let c={flexShrink:0,height:"fit-content"};return s==="fade"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,visibility:t?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:t?1:0}:s==="scale"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,transform:`scale(${t?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:t?1:0}:c},[t,s,n,e]);return jsx(u,{ref:m,style:{...i},className:"--content",children:o||t?r:null})};ws.displayName="Zuz.TabBody";var Ss=ws;var Ps=({ref:t,...s})=>{let{tabs:e,speed:n=.3,prerender:o=true,variant:r,tabStyle:l="fixed",onChange:m,transitionType:f="slide",...i}=s,[c,p]=useState(0),a=useRef(null),g=useResizeObserver(a),T=useMemo(()=>uuid(8),[]),[h,S]=useState("auto"),P=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(t,()=>({setTab:C=>p(C)}));let R=useMemo(()=>e.map(C=>({...C,key:C.key||uuid(8)})),[e]),{style:y,className:d,rest:I}=E({as:`flex cols w-full no-overflow ${i.as||""}`,...i}),w=()=>{if(!P)return {opacity:0};switch(f){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${c*g.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(u,{ref:a,style:y,className:`--tabview --${l} flex cols ${d}`,children:[jsx(it,{as:"--tabview-head",onSwitch:C=>{p(C.index);let N=R.find(M=>M.tag==C.tag);N&&N.onSelect&&(N.onSelect(N,C.index),m?.(N,C.index));},selected:c,items:R.reduce((C,N,M)=>(C.push({icon:N.icon,index:M,label:N.label,tag:N.tag}),C),[])}),jsx(u,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:h,transition:P?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:P?1:0},children:jsx(u,{className:"--track",style:{...w()},children:R.map((C,N)=>jsx(Ss,{isActive:N===c,transitionType:f,speed:n,width:g.width,render:o||N===c,onHeightChange:M=>N===c&&S(M),content:C.body},`tab-body-${C.key||N}-${T}`))})})]})};Ps.displayName="Zuz.TabView";var np=Ps;var lp=({ref:t,commands:s,onCommand:e,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:r,...l})=>{let[m,f]=useState([{type:"output",content:n}]),[i,c]=useState(""),p=useRef(null),a=useRef(null),{variant:g}=X(true);useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight);},[m]);let T=d=>{let I=typeof d=="string"?{type:"output",content:d}:d;f(w=>{let C=[...w,I];return C.length>1e3?C.slice(-1e3):C});},h=()=>f([]);useImperativeHandle(t,()=>({write:T,clear:h}));let S=async d=>{let[I,...w]=d.split(" "),C=I.toLowerCase();return s&&s[C]?await s[C](w):e?await e(d):`command not found: ${I}`},P=d=>{let I=/\u001b\[(\d+)m/g,w=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,M="#d4d4d4",L=false,$;for(;($=I.exec(d))!==null;){let _=d.slice(N,$.index);_&&w.push({text:_,color:M,bold:L});let F=$[1];F==="0"?(M="#d4d4d4",L=false):F==="1"?L=true:C[F]&&(M=C[F]),N=I.lastIndex;}let B=d.slice(N);return B&&w.push({text:B,color:M,bold:L}),w},R=(d,I)=>d.includes("\x1B")?P(d).map((w,C)=>jsx(te,{style:{color:w.color||"#d4d4d4",fontWeight:w.bold?"bold":"normal"},children:w.text},`--terminal-msg-${C}-${w.text.replace(/\S+/g,"-")}`)):jsx(te,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:d}),y=async d=>{if(d.key==="Enter"&&i.trim()){let I=i.trim(),w=[...m,{type:"command",content:`${o}${I}`}];c(""),f(w);let C=await S(I);f(N=>[...N,{type:"output",content:C}]);}};return jsxs(u,{as:`--zuz-terminal --${r||g||K.Medium} flex cols ${l.className}`,onClick:()=>a.current?.focus(),children:[jsx(u,{ref:p,className:"--terminal-log",children:m.map((d,I)=>jsx(u,{children:jsx(V,{children:R(d.content,d.type)})},I))}),jsxs(u,{as:"flex aic --terminal-input",children:[jsx(V,{as:"--terminal-prompt",children:o}),jsx(re,{ref:a,className:"--zuz-term-input",autoFocus:true,value:i,variant:r||g||K.Medium,onChange:d=>c(d.target.value),onKeyDown:y})]})]})},cp=lp;var mp=({meta:t})=>jsxs(z,{as:"flex aic --command-item",children:[t.icon&&jsx(Q,{name:t.icon,as:"--command-icon"}),jsx(V,{children:t.label})]}),pp=({position:t,onSelect:s,commands:e,visible:n})=>jsx(u,{"aria-hidden":!n,fx:{transition:q.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(mp,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Es=pp;var ks=forwardRef((t,s)=>{let{autoResize:e,maxHeight:n,variant:o,resize:r="none",command:l,commands:m,onInput:f,cmd:i,renderDropdown:c,value:p,defaultValue:a,...g}=t,T=useRef(null),h=useRef(null),{variant:S}=X(true),{style:P,className:R,rest:y}=E(g),{showDropdown:d,dropdownPosition:I,handleKeyDown:w,handleInput:C,handleCommandSelect:N}=useCommandActions({command:l,commands:m,cmd:i,ref:T}),M=useCallback(()=>{let $=T.current;!$||!e||(h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{$.style.height="auto";let B=$.scrollHeight;if(n){let _=parseInt(n.toString(),10);isNaN(_)||(B=Math.min(B,_));}$.style.height=`${B}px`,$.style.overflowY=n&&B>=parseInt(n.toString(),10)?"auto":"hidden";}));},[e,n]),L=$=>{f?.($),C($),M();};return useEffect(()=>{M();},[p,a,M]),useEffect(()=>{e&&T.current&&M();},[e,M]),useEffect(()=>()=>{h.current&&cancelAnimationFrame(h.current);},[]),jsxs(u,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||K.Medium} flex ${R}`.trim(),style:{...P,resize:r,height:e?"auto":P?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:w,onInput:L,ref:$=>{typeof s=="function"?s($):s&&(s.current=$),T.current=$;},value:p,defaultValue:a,...y}),c?c({show:d,position:I,commands:m||[],onSelect:N}):m&&m.length>0&&jsx(Es,{visible:d,commands:m,onSelect:N,position:I})]})});ks.displayName="Zuz.TextArea";var hp=ks;var Os=forwardRef((t,s)=>{let{as:e,value:n,color:o,direction:r,...l}=t,m=useRef(null),[f,i]=useState(n||0);return useImperativeHandle(s,()=>({updateValue(c){f.toString().length!==c.toString().length&&i(c);},setValue(c){if(this.updateValue(c),m.current){let p=c.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((a,g)=>{let T=p[g];if(a instanceof HTMLElement){a.setAttribute("data-value",T);let h=a.querySelector(".--wheel-char-track");h instanceof HTMLElement&&(h.style.setProperty("--v",T),h.offsetWidth);}});}}})),useEffect(()=>{i(n||0);},[n]),jsxs(u,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:m,...l,children:[(f||0).toString().split("").map((c,p)=>isNaN(parseInt(c,10))?jsx(te,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${p}`):jsx(te,{"data-value":c,className:`--wheel-char grid ${p>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(te,{className:`--wheel-char-track --wheel-track-${r||"down"} grid`,style:{"--v":c},children:[jsx(te,{children:!r||r==="down"?0:9}),(!r||r==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((a,g)=>jsx(te,{children:a},`${p}--${g}`)),jsx(te,{children:!r||r==="down"?9:0})]})},`wheel-char-${p}`)),o&&jsx(u,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Os.displayName="Zuz.TextWheel";var Cp=Os;var As=forwardRef((t,s)=>{let{title:e,position:n,margin:o,children:r,...l}=t,{style:m,className:f,rest:i}=E(l),[c,p]=useState(false),a=useMemo(()=>n||oe.Top,[]),g=useRef(null),T=useRef(null),h=y=>{},S=typeof ResizeObserver<"u"?new ResizeObserver(h):{observe:()=>{},unobserve:()=>{}},P=useDimensions(),R=useMemo(()=>{if(!T.current)return {left:0,top:0};let y=T.current.previousElementSibling;if(y){let d=y.getBoundingClientRect();switch(S.observe(y),a){case oe.Top:return {left:d.left+d.width/2,top:d.top-(o||25)};case oe.Bottom:return {left:d.left+d.width/2,top:d.top+(o||25)};case oe.Left:return {left:d.left-d.width/2,top:d.top+d.height/2};case oe.Right:return {left:d.right,top:d.top+d.height/2};default:return {left:0,top:0}}}},[T.current,P,S]);return useEffect(()=>{},[]),jsxs(u,{ref:g,className:"--with-tooltip rel",onMouseEnter:y=>p(true),onMouseLeave:y=>p(false),children:[r,jsx(u,{ref:T,style:{left:R?.left+"px",top:R?.top+"px"},className:`--tooltip --${n||oe.Top} fixed ${f}`.trim(),fx:{from:a==oe.Bottom||a==oe.Top?{opacity:0,x:"-50%",y:a==oe.Top?-5:5}:{opacity:0,y:"-50%",x:a==oe.Right?15:-25},to:a==oe.Bottom||a==oe.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:a==oe.Right?10:-20},curve:G.EaseInOut,when:c},children:jsx(V,{className:"--text rel",children:e})})]})});As.displayName="Zuz.ToolTip";var Np=As;var _o=forwardRef((t,s)=>{let{as:e,meta:n,nodes:o,icons:r,onSelect:l,treeTag:m,selected:f,roots:i,expanded:c,...p}=t,{tag:a,label:g,icon:T,under:h,isHead:S}=n,P=useMemo(()=>i.includes(a),[i]),[R,y]=useState(c),d=()=>{localStorage.setItem(`--tn${m}-${a}`,R?"0":"1"),y(!R);};useEffect(()=>{c||P&&!localStorage.getItem(`--tn${m}-${a}`)?(localStorage.setItem(`--tn${m}-${a}`,"1"),y(true)):y(localStorage.getItem(`--tn${m}-${a}`)=="1");},[]);let I=useMemo(()=>o.filter(w=>w.under==a),[o,a]);return jsxs(u,{className:`--treenode ${P?"--is-root":""} --treenode-${a} flex cols`,children:[jsxs(u,{className:`--node --node-${a} flex aic ${f==a?" --selected":""}`,children:[jsx(z,{skeleton:p.skeleton,onClick:d,className:"--node-aro-btn",disabled:I.length==0,children:r?.arrowClose&&r?.arrowOpen?jsx(Q,{skeleton:p.skeleton,className:"--node-aro-icon",name:I.length==0?r?.arrowDisabled||r?.arrowClose:R?r?.arrowOpen:r?.arrowClose}):I.length==0?H.chevronBottom:R?H.chevronBottom:H.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:w=>l(a),children:[(r?.nodeOpen&&r?.nodeClose||P&&r?.rootOpen&&r?.rootClose)&&jsx(Q,{skeleton:p.skeleton,className:`--node-icon ${P?"--icon-root":""}`,name:T||(R?P&&r?.rootOpen||r.nodeOpen:P&&r?.rootClose||r?.nodeClose)}),jsx(V,{className:`--node-label ${P?"--node-label-root":""}`.trim(),skeleton:p.skeleton,children:g})]})]}),R&&I.length>0&&jsx(u,{className:`--sub-node tree-sub-node-${a} flex cols`,children:I.map(w=>jsx(_o,{treeTag:m,selected:f,onSelect:l,icons:r,roots:i,expanded:w.expanded||false,meta:w,nodes:o},`--node-${w.tag}`))})]})});_o.displayName="TreeItem";var zs=_o;var Fs=forwardRef((t,s)=>{let{as:e,nodes:n,onNodeSelect:o,tag:r,icons:l,roots:m,selected:f,...i}=t,[c,p]=useState(f);useImperativeHandle(s,()=>({getSelected:()=>c}),[o]);let a=g=>{p(g),o&&o(g);};return useEffect(()=>{c!=f&&p(f);},[f]),jsx(u,{className:"--treeview flex cols",children:n.filter(g=>m.includes(g.tag)).map(g=>jsx(zs,{treeTag:r?`-${r}`:"",selected:c,onSelect:T=>a(T),icons:l,meta:g,roots:m,expanded:g.expanded||false,skeleton:i.skeleton,nodes:n},`--node-${g.tag}`))})});Fs.displayName="Zuz.TreeView";var Vp=Fs;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
+
export{ue as ALERT,qo as AVATAR,Si as Accordion,Ni as ActionBar,Li as Alert,Xi as AutoComplete,rl as Avatar,sl as Badge,u as Box,El as Bubble,gn as BubbleMediaType,dn as BubbleStatus,z as Button,mn as CHART,Se as CHECKBOX,_p as COLORTHEME,fo as Calendar,Rl as Chart,at as CheckBox,zl as CodeBlock,tc as ColorScheme,Xt as ContextMenu,sc as CookiesConsent,ye as Cover,fc as CropShape,pc as Cropper,gc as Crumb,Kp as DATATYPE,ze as DIALOG,Xo as DIALOG_ACTION_POSITION,ie as DRAWER_SIDE,bc as DatePicker,Jt as Dialog,no as Drawer,gt as FILTER,Ce as FORMVALIDATION,Wp as FORMVALIDATION_STYLE,Cc as Fab,Rc as Filters,zc as Form,Kc as Grid,Yt as Group,Q as Icon,rt as Image,re as Input,No as KeyboardKeys,Gn as KeysLabelMap,Un as KeysMap,st as Label,Gt as LayersProvider,He as List,Qc as NetworkStatus,qe as ORIGIN,Fp as OriginType,Me as Overlay,At as POSITION,Gp as PROGRESS,Lo as Pagination,Eo as PaginationStyle,im as Password,pm as PinInput,oe as Position,et as ProgressBar,zt as RADIO,gm as Radio,fe as SHEET,$t as SHEET_ACTION_POSITION,zp as SKELETON,dt as SLIDER,Zp as SORT,se as SPINNER,eo as ScrollView,Cm as Search,Em as Select,it as SelectTabs,Lc as Sheet,wo as Slider,St as SnackPosition,Mr as SnackStyle,wt as SnackType,te as Span,he as Spinner,Up as Status,Lm as Switch,q as TRANSITIONS,G as TRANSITION_CURVES,np as TabView,Wm as Table,qm as TableOfContents,cp as Terminal,V as Text,Cp as TextWheel,hp as Textarea,Qs as ThemeProvider,Or as ToastDefaultTitle,St as ToastPosition,so as ToastProvider,Mr as ToastStyle,wt as ToastType,Np as ToolTip,Vp as TreeView,K as Variant,Xe as animationTransition,_t as buildClassString,Jo as buildWithStyles,fu as css,Ft as getAnimationCurve,du as getAnimationTransition,Ks as getZuzMap,Wn as isKeyCombination,Qo as setZuzMap,E as useBase,Ja as useContextMenu,ti as useDialog,ni as useDrawer,le as useFx,ii as useMorph,tt as usePosition,di as useSnack,ao as useToast};
|