@zuzjs/ui 1.0.39 → 1.0.40

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/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import {f,e,g,d,h,c as c$1}from'./chunk-HEX5DKPA.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-HEX5DKPA.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,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {MD5,uuid,withPost,_ as _$1,clamp,timeSince,checkPasswordStrength,removeDuplicateWords,PubSub,toHash,numberInRange}from'@zuzjs/core';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var mr={Circle:"CIRCLE",Square:"SQUARE"},Bu={Default:"DEFAULT",Circle:"CIRCLE"},Eu={Light:"light",Dark:"dark",System:"system"},Le={Default:"DEFAULT",Switch:"SWITCH"},mt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},pe=mt,pt=AnchorType,Lu=pt,q={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},ku={Asc:"ASC",Desc:"DESC"},Mu={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Ou={Dots:"DOTS"},ke={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},Se={Success:"success",Error:"error",Warning:"warning",Info:"info"},Y={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},X={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Du={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},Ce={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Qe=Ce,no={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},pr=no,Hu={Bar:"BAR",Ring:"RING"},so={Default:"range",Text:"number"},ao={Default:"DEFAULT",Card:"CARD"},Bt={Gooey:"gooey"},he={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var ur=Symbol.for("zuz.global.map"),fr=e=>{globalThis[ur]=e;},ga=()=>globalThis[ur]||{},io=e$1=>{let n=Array.isArray(e$1)?e$1.join(" "):e$1;if(!n||typeof n!="string")return "";let t=ga();return process.env.NODE_ENV==="development"&&Object.keys(t).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(n).filter(Boolean).map(r=>{let s=r.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,u,f]=s;return g(f).map(m=>{let p=`${u}(${m})`;return t[p]||m}).join(" ")}return t[r]||r}).join(" ")},tf=e=>{let n=Array.isArray(e)?e.join(" "):e;return !n||typeof n!="string"?"":io(n)},dr=e=>{let n={};for(let t in e){let o=e[t];if(t.startsWith("--")){n[t]=o;continue}let r=d[t]?.toString()??t;if(r==="x"||r==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${h.addUnitsSafely(t,o)} ${s[1]??"0px"}`;}else if(r==="y"||r==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${h.addUnitsSafely(t,o)}`;}else c$1.includes(r)?n[r]=h.addUnitsSafely(t,o):n[r]=o;}return n},lo=e=>{if(!e)return "linear";switch(e.toUpperCase()){case Y.Bounce:return "var(--bounce)";case Y.Liquid:return "var(--liquid)";case Y.Spring:return "var(--spring)";case Y.EaseInOut:return "ease-in-out";case Y.EaseOutBack:return "ease-out-back";default:return "linear"}},ut=(e,n=0,t=0)=>{let o={},r={},s=n||20,a=t||0;switch(e){case X.SlideInLeft:case X.SlideInRight:o={"--fx-x":e===X.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},r={"--fx-x":`${a}px`,opacity:1};break;case X.SlideInTop:case X.SlideInBottom:o={"--fx-y":e===X.SlideInTop?`-${s}px`:`${s}px`,opacity:0},r={"--fx-y":`${a}px`,opacity:1};break;case X.ScaleIn:o={scale:0,opacity:0},r={scale:1,opacity:1};break;case X.FadeIn:o={opacity:0},r={opacity:1};break}return {from:o,to:r}},of=(e,n,t)=>{let{from:o,to:r}=ut(e);return n?{...o,...r}:t?o:r};var ya=(e,n)=>{let t=useRef([]),o=useRef(false);return useEffect(()=>{e?.when||(o.current=false);},[e?.transition]),useEffect(()=>{let r=n?.current;if(!r||!e||!e.clearAtEnd)return;let s=a=>{t.current.includes(a.propertyName)&&e.clearAtEnd===true&&(r.style.transform="",r.style.filter="",t.current.forEach(u=>r.style.removeProperty(u)));};return r.addEventListener("transitionend",s),()=>r.removeEventListener("transitionend",s)},[e,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let r=n.current;(e?.scroll||e?.mouse)&&(r.style.willChange="transform",r.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",r.style.transition=`translate 0.1s ${e.curve?lo(e.curve):"var(--spring)"}`);},[e,n]),useMemo(()=>{if(!e)return {style:{}};let{transition:r,from:s,to:a,exit:u,when:f,duration:m=.3,delay:p=0,curve:i,margin:l=0,offset:d=20,watch:T=[]}=e,S=f===false&&!o.current;f===true&&(o.current=true);let C={},{from:R,to:I}=r?ut(r,d,l):{from:s||{},to:a||{}};C=f===void 0?{...R,...I}:f?{...I}:u||R;let P=lo(i),g=[],b=dr(C);t.current=Object.keys(b);let h={...b};return Object.keys(b).forEach(y=>{let N=y.startsWith("--")?"all":y;g.includes(N)||g.push(`${N} ${m}s ${P} ${p}s`);}),T.forEach(y=>{g.includes(y)||g.push(`${y} 0.1s ${P} 0s`);}),{style:{...h,transition:S?"none":g.join(", "),opacity:S?0:h.opacity,pointerEvents:S?"none":h.pointerEvents}}},[e,e?.when,e?.watch])},ue=ya;var Et=null,xa=(e,n)=>{let{as:t,fx:o,transition:r,skeleton:s,className:a,propsToRemove:u,draggable:f$1,dragOptions:m,style:p,...i}=e||{},l=typeof window<"u",d={},T={};if(f$1&&l&&!Et&&(import('@zuzjs/hooks').then(I=>{Et=I.useDrag;}).catch(I=>{console.error("Error loading useDrag:",I);}),Et)){let I=Et(m);d={onMouseDown:I.onMouseDown},T={transform:`translate(${I.position.x}px, ${I.position.y}px)`};}let S=r?{transition:r,duration:.3}:o||{},{style:C}=ue(S,n),R=io(t??"");return {style:{...p,...C,...T},className:[a||"",R||"",s?.enabled?"--skeleton":"",f$1?"--draggable":""].join(" ").trim(),rest:{...d,...f(i,u?[...u,"skeleton"]:["skeleton"])}}},B=xa;var yr="(prefers-color-scheme: dark)",wa=typeof window>"u",br=createContext(void 0),uo=e=>{let n=useContext(br);if(!n){if(e===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},Q=uo,Sa=({children:e,storageKey:n="--ucs",forceTheme:t,zuzMap:o,...r})=>(o&&fr(o),jsx(Ca,{storageKey:n,forceTheme:t,...r,children:e})),Ca=({children:e,storageKey:n,forceTheme:t,...o})=>{let[r,s]=useState(()=>t||xr(n,"system")),[a,u]=useState(()=>t||xr(n)),f=l=>(l||(l=window.matchMedia(yr)),l.matches?"dark":"light"),m=useCallback(l=>{let d=l=="system"?f():l,T=document.documentElement;T.setAttribute("color-scheme",d),T.style.colorScheme=d,u(d);},[f]),p=useCallback(l=>{s(l),localStorage.setItem(n,l),m(l);},[r]),i=useCallback(l=>{let d=f(l);u(d),r==="system"&&m("system");},[r]);return useEffect(()=>{r==null&&window.localStorage.getItem(n);},[r]),useEffect(()=>{window.matchMedia(yr).addEventListener("change",i);},[i]),useEffect(()=>{let l=d=>{d.key==n&&(d.newValue?p(d.newValue):p("system"));};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[p]),useEffect(()=>{m(t||r||"system");},[r]),jsxs(br,{value:{colorScheme:r,resolvedScheme:a,setColorScheme:p,...o},children:[t?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
1
+ import {f,e,g,d,h,c as c$1}from'./chunk-NG5H4LFA.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-NG5H4LFA.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,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {MD5,uuid,withPost,_ as _$1,clamp,timeSince,checkPasswordStrength,removeDuplicateWords,PubSub,toHash,numberInRange,copyToClipboard}from'@zuzjs/core';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var mr={Circle:"CIRCLE",Square:"SQUARE"},ku={Default:"DEFAULT",Circle:"CIRCLE"},Lu={Light:"light",Dark:"dark",System:"system"},Le={Default:"DEFAULT",Switch:"SWITCH"},mt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},pe=mt,pt=AnchorType,Mu=pt,q={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Ou={Asc:"ASC",Desc:"DESC"},Du={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Hu={Dots:"DOTS"},Me={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},Se={Success:"success",Error:"error",Warning:"warning",Info:"info"},Y={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},X={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Au={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},Ce={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Qe=Ce,so={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},pr=so,Vu={Bar:"BAR",Ring:"RING"},ao={Default:"range",Text:"number"},io={Default:"DEFAULT",Card:"CARD"},Bt={Gooey:"gooey"},he={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var ur=Symbol.for("zuz.global.map"),fr=e=>{globalThis[ur]=e;},ga=()=>globalThis[ur]||{},lo=e$1=>{let n=Array.isArray(e$1)?e$1.join(" "):e$1;if(!n||typeof n!="string")return "";let t=ga();return process.env.NODE_ENV==="development"&&Object.keys(t).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(n).filter(Boolean).map(r=>{let s=r.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,u,f]=s;return g(f).map(m=>{let p=`${u}(${m})`;return t[p]||m}).join(" ")}return t[r]||r}).join(" ")},rf=e=>{let n=Array.isArray(e)?e.join(" "):e;return !n||typeof n!="string"?"":lo(n)},dr=e=>{let n={};for(let t in e){let o=e[t];if(t.startsWith("--")){n[t]=o;continue}let r=d[t]?.toString()??t;if(r==="x"||r==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${h.addUnitsSafely(t,o)} ${s[1]??"0px"}`;}else if(r==="y"||r==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${h.addUnitsSafely(t,o)}`;}else c$1.includes(r)?n[r]=h.addUnitsSafely(t,o):n[r]=o;}return n},co=e=>{if(!e)return "linear";switch(e.toUpperCase()){case Y.Bounce:return "var(--bounce)";case Y.Liquid:return "var(--liquid)";case Y.Spring:return "var(--spring)";case Y.EaseInOut:return "ease-in-out";case Y.EaseOutBack:return "ease-out-back";default:return "linear"}},ut=(e,n=0,t=0)=>{let o={},r={},s=n||20,a=t||0;switch(e){case X.SlideInLeft:case X.SlideInRight:o={"--fx-x":e===X.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},r={"--fx-x":`${a}px`,opacity:1};break;case X.SlideInTop:case X.SlideInBottom:o={"--fx-y":e===X.SlideInTop?`-${s}px`:`${s}px`,opacity:0},r={"--fx-y":`${a}px`,opacity:1};break;case X.ScaleIn:o={scale:0,opacity:0},r={scale:1,opacity:1};break;case X.FadeIn:o={opacity:0},r={opacity:1};break}return {from:o,to:r}},nf=(e,n,t)=>{let{from:o,to:r}=ut(e);return n?{...o,...r}:t?o:r};var ya=(e,n)=>{let t=useRef([]),o=useRef(false);return useEffect(()=>{e?.when||(o.current=false);},[e?.transition]),useEffect(()=>{let r=n?.current;if(!r||!e||!e.clearAtEnd)return;let s=a=>{t.current.includes(a.propertyName)&&e.clearAtEnd===true&&(r.style.transform="",r.style.filter="",t.current.forEach(u=>r.style.removeProperty(u)));};return r.addEventListener("transitionend",s),()=>r.removeEventListener("transitionend",s)},[e,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let r=n.current;(e?.scroll||e?.mouse)&&(r.style.willChange="transform",r.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",r.style.transition=`translate 0.1s ${e.curve?co(e.curve):"var(--spring)"}`);},[e,n]),useMemo(()=>{if(!e)return {style:{}};let{transition:r,from:s,to:a,exit:u,when:f,duration:m=.3,delay:p=0,curve:i,margin:l=0,offset:d=20,watch:C=[]}=e,T=f===false&&!o.current;f===true&&(o.current=true);let b={},{from:R,to:P}=r?ut(r,d,l):{from:s||{},to:a||{}};b=f===void 0?{...R,...P}:f?{...P}:u||R;let I=co(i),g=[],v=dr(b);t.current=Object.keys(v);let h={...v};return Object.keys(v).forEach(y=>{let N=y.startsWith("--")?"all":y;g.includes(N)||g.push(`${N} ${m}s ${I} ${p}s`);}),C.forEach(y=>{g.includes(y)||g.push(`${y} 0.1s ${I} 0s`);}),{style:{...h,transition:T?"none":g.join(", "),opacity:T?0:h.opacity,pointerEvents:T?"none":h.pointerEvents}}},[e,e?.when,e?.watch])},ue=ya;var Et=null,xa=(e,n)=>{let{as:t,fx:o,transition:r,skeleton:s,className:a,propsToRemove:u,draggable:f$1,dragOptions:m,style:p,...i}=e||{},l=typeof window<"u",d={},C={};if(f$1&&l&&!Et&&(import('@zuzjs/hooks').then(P=>{Et=P.useDrag;}).catch(P=>{console.error("Error loading useDrag:",P);}),Et)){let P=Et(m);d={onMouseDown:P.onMouseDown},C={transform:`translate(${P.position.x}px, ${P.position.y}px)`};}let T=r?{transition:r,duration:.3}:o||{},{style:b}=ue(T,n),R=lo(t??"");return {style:{...p,...b,...C},className:[a||"",R||"",s?.enabled?"--skeleton":"",f$1?"--draggable":""].join(" ").trim(),rest:{...d,...f(i,u?[...u,"skeleton"]:["skeleton"])}}},B=xa;var yr="(prefers-color-scheme: dark)",wa=typeof window>"u",br=createContext(void 0),fo=e=>{let n=useContext(br);if(!n){if(e===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},Q=fo,Sa=({children:e,storageKey:n="--ucs",forceTheme:t,zuzMap:o,...r})=>(o&&fr(o),jsx(Ca,{storageKey:n,forceTheme:t,...r,children:e})),Ca=({children:e,storageKey:n,forceTheme:t,...o})=>{let[r,s]=useState(()=>t||xr(n,"system")),[a,u]=useState(()=>t||xr(n)),f=l=>(l||(l=window.matchMedia(yr)),l.matches?"dark":"light"),m=useCallback(l=>{let d=l=="system"?f():l,C=document.documentElement;C.setAttribute("color-scheme",d),C.style.colorScheme=d,u(d);},[f]),p=useCallback(l=>{s(l),localStorage.setItem(n,l),m(l);},[r]),i=useCallback(l=>{let d=f(l);u(d),r==="system"&&m("system");},[r]);return useEffect(()=>{r==null&&window.localStorage.getItem(n);},[r]),useEffect(()=>{window.matchMedia(yr).addEventListener("change",i);},[i]),useEffect(()=>{let l=d=>{d.key==n&&(d.newValue?p(d.newValue):p("system"));};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[p]),useEffect(()=>{m(t||r||"system");},[r]),jsxs(br,{value:{colorScheme:r,resolvedScheme:a,setColorScheme:p,...o},children:[t?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
2
2
  const themes = ['light', 'dark']
3
3
  let theme = localStorage.getItem(\`${n}\`) || "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(fo,{children:e})]})},xr=(e,n)=>{if(wa)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||n};var vr=({ref:e,...n})=>{let{style:t,...o}=n,{style:r,className:s,rest:a}=B(o);return jsx("span",{ref:e,style:t,className:s,...a})};vr.displayName="Zuz.Span";var se=vr;var Sr=forwardRef((e,n)=>{let{name:t,pathCount:o,variant:r,color:s,size:a,...u}=e,{variant:f}=Q(true),{className:m,style:p,rest:i}=B(u);return jsx("div",{style:{color:s,...p,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${r||f||q.Small} ${m}`.trim(),ref:n,...i,children:Array(o||0).fill(0).map((l,d)=>jsx(se,{className:`path${d+1}`},`${t}-layer-${d}`))})});Sr.displayName="Zuz.Icon";var ee=Sr;var fe={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Cr=e=>{let{type:n,variant:t,color:o,...r}=e,{className:s,style:a,rest:u}=B(r),{spinner:f}=Q(true),m=()=>{switch(n||f?.type||fe.Simple){case fe.Simple:return null;case fe.Wave:return jsxs(Fragment$1,{children:[jsx(c,{as:"--bar --bar1"}),jsx(c,{as:"--bar --bar2"}),jsx(c,{as:"--bar --bar3"})]});case fe.Roller:return null}};return jsx(c,{className:`${s} --spinner --${(n||f?.type||fe.Simple).toLowerCase()} --${t||f?.variant||q.Small}`.trim(),style:{...a},...u,children:m()})};Cr.displayName="Zuz.Spinner";var Te=Cr;var Mt={Loading:"loading",Normal:"normal"};var Pr=({ref:e,...n})=>{let{reset:t,kind:o="solid",variant:r,icon:s,iconSize:a,children:u,withLabel:f,spinner:m,state:p,disabled:i,...l}=n,{style:d,className:T,rest:S}=B(l),{variant:C}=Q(true);return jsxs("button",{className:removeDuplicateWords(`--button --${o} --${r||C} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${T}`).trim().replace(/\s+/g," "),style:d,ref:e,disabled:p==Mt.Loading||n.skeleton?.enabled||i,...S,children:[p==Mt.Loading&&jsx(Te,{variant:r||C,type:m||fe.Simple}),(!p||p==Mt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(ee,{variant:a,name:s}),f===true?jsx(se,{children:u}):u]})]})};Pr.displayName="Zuz.Button";var _=Pr;var Rr=forwardRef((e,n)=>{let{h:t,html:o,children:r,lines:s,...a}=e,{style:u,className:f,rest:m}=B(a),p=`h${e.h||1}`;return jsx(p,{ref:n,style:u,className:f,...m,children:o?jsx(se,{dangerouslySetInnerHTML:{__html:o}}):r})});Rr.displayName="Zuz.Text";var $=Rr;var ka=e=>{let{label:n,labelColor:t,icon:o,iconColor:r,index:s,className:a,onSelect:u}=e;return n=="-"?jsx(c,{className:"--line"}):jsxs(_,{reset:true,onClick:f=>u?.(e),className:`--item ${a||""}`.trim(),children:[jsx(c,{as:"--icon",children:jsx(ee,{name:o,className:"--ico",style:r?{color:r}:{}})}),jsx($,{className:"--lbl flex aic",style:t?{color:t}:{},children:n})]})},Nr=ka;var Lr=({ref:e,...n})=>{let{id:t,as:o,fx:r,offsetX:s,offsetY:a,parent:u,event:f,arrow:m,when:p,items:i,header:l,footer:d,origin:T=pt.TopRight,...S}=n,[C,R]=useState(false),[I,P]=useState(i||[]),{position:g,targetRef:b,calculatedAnchor:h}=useAnchorPosition(u?.current,f,{offsetX:s,offsetY:a,preferredAnchor:T}),N=u&&g.top>u.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",D=useMemo(()=>{let G=h.toLowerCase();return G.includes("left")?"--arrow-left":G.includes("right")?"--arrow-right":"--arrow-center"},[h]),M=g.top!==0||g.left!==0;useEffect(()=>{p&&M?R(true):p||R(false);},[p,M]);let{className:z,style:E,rest:H}=B(S),V=ue({...r?.transition?{transition:r.transition??X.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:r?.curve??Y.EaseInOut,duration:r?.duration??.05,when:C&&M});return jsxs(c,{ref:b,className:`--contextmenu ${m||u!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${z}`.trim(),"aria-hidden":!C,style:{...E,...V.style,top:g.top,left:g.left,visibility:M?"visible":"hidden",transformOrigin:h},...H,children:[typeof l=="function"?createElement(l):l,I.map((G,x)=>jsx(Nr,{...G,index:x},`context-${G.label.toLowerCase()}-${x}`)),typeof d=="function"?createElement(d):d]})};Lr.displayName="Zuz.ContextMenu";var ho=Lr;var kr=forwardRef((e,n)=>{let{children:t,fx:o,when:r,fxDelay:s,fxStep:a,classToIgnore:u,...f}=e,m=Q(true),p=useDelayed(),i=o||m?.group?.fx,l=s||m?.group?.fxDelay,d=a||m?.group?.fxStep,T=u||m?.group?.classToIgnore||"-fx",S=useMemo(()=>i?addPropsToChildren(t,C=>{if(C.type===Fragment)return false;let R=C.props||{},I="fx"in R,P=R.as?Array.isArray(R.as)?R.as.join(" "):R.as:R.className||"",g=typeof P=="string"&&P.includes(T);return !I&&!g},C=>({fx:{...i,delay:(l||0)+C*(d||.1),when:r??(o?.when||p)}})):t,[t,r,p,i]);return jsx(c,{className:"--group",ref:n,...f,children:S})});kr.displayName="Zuz.Group";var yo=kr;var Or=forwardRef((e,n)=>{let{message:t,spinner:o,spinnerSize:r,color:s,when:a,hideMessage:u,...f}=e,{className:m,style:p,rest:i}=B(f),{spinner:l}=Q(true);return "when"in e&&e.when==false?null:jsxs(yo,{fx:{transition:X.SlideInBottom,curve:Y.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${m}`.trim(),style:{...p,backgroundColor:"var(--cover-bg)"},...i,children:[jsx(Te,{variant:r||l?.variant||q.Small,type:o||l?.type||fe.Simple}),!u&&jsx($,{className:"--label",style:{color:"var(--cover-label)"},children:t||"loading"})]})});Or.displayName="Zuz.Cover";var Re=Or;var xo=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(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(t=>t!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},_e=new xo;var Dr=forwardRef((e,n)=>{let{when:t,...o}=e;return jsx(c,{ref:n,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:X.FadeIn,when:t},...o})});Dr.displayName="Zuz.Overlay";var Fe=Dr;var Xa=({action:e,render:n=true,message:t=""})=>jsx(c,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:n?t:null}),Hr=Xa;var Qa=({action:e,actionPosition:n,dialogID:t,variant:o})=>jsx(c,{as:`--footer flex aic rel ${n?n==pr.Center?"jcc":"":"jce"}`.trim(),children:e.map((r,s)=>jsx(_,{variant:o,onClick:a=>r.handler?r.handler():r.onClick?r.onClick():console.log("onClick Handler missing"),as:"--action",children:r.label},`dialog-${t}-action-${r.key}`))}),Vr=Qa;var ja={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"})," "]}),[Se.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"})}),[Se.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"})}),[Se.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"})}),[Se.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"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),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"})]})},k=ja;var Ja=({title:e="Alert",onClose:n})=>jsxs(c,{as:"--head flex aic rel",children:[jsx(c,{as:`--${e?"title":"dot"} flex aic jcc rel`,children:e}),jsx(_,{onClick:t=>n(),className:"--closer abs center-v",children:k.close})]}),zr=Ja;var Zr=({ref:e,...n})=>{let{index:t,id:o,title:r,message:s,transition:a,curve:u,speed:f,type:m,action:p,actionPosition:i,spinner:l,loadingMessage:d,variant:T,inBackground:S,forceClose:C,forceLoading:R,onClose:I,onShow:P,onHide:g,...b}=n,h=useMemo(()=>uuid(12),[]),[y,N]=useState(r||""),[D,M]=useState(s||""),[z,E]=useState(m||Qe.Dialog),[H,V]=useState(false),[G,x]=useState(true),[L,Z]=useState(p||null),[U,F]=useState(false),{variant:K,spinner:te,dialog:J}=Q(true),j=T||J?.variant||K||q.Small,{style:A,className:W,rest:re}=B(b),le=useRef(null),de=ue({when:H,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:a||J?.transition||X.SlideInBottom,curve:u||J?.curve||Y.EaseInOut,watch:["scale","filter","transform"]}),ce=()=>{V(false),I(o);},oe=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{_e.isTop(ce)&&ce();}}],[H]);useShortcuts(oe),useEffect(()=>{E(Qe.Dialog),M(s),N(y),L&&Z(L.reduce((ae,ve)=>(ae.push({...ve,key:ve.key||uuid(12)}),ae),[])),V(true),setTimeout(()=>P?P():()=>{},500);},[]),useEffect(()=>{C&&ce();},[C]),useEffect(()=>{R!=null&&F(R);},[R]);let ne=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Fe,{style:{zIndex:ne},when:H}),jsxs(c,{as:`--dialog --${(m??Qe.Default).toLowerCase()} ${H?"--visible":""} ${W} fixed abc`.trim(),style:{...de.style,zIndex:ne+1,pointerEvents:S==true?"none":"auto",...S==true?{scale:"0.92",filter:"blur(2px)"}:{}},...re,ref:le,children:[jsx(zr,{title:y,onClose:ce}),jsx(Hr,{message:D,render:G,action:L}),L&&L.length>0&&jsx(Vr,{variant:j,action:L,dialogID:h,actionPosition:i}),jsx(Re,{when:U,spinner:l||J?.spinner||te?.type||fe.Simple,message:d||J?.loadingMessage})]})]})};Zr.displayName="Zuz.Dialog";var wo=Zr;var Kr=forwardRef((e,n)=>{let{speed:t,style:o,...r}=e,{rootRef:s,containerRef:a,thumbY:u,thumbX:f,onScrollY:m,onScrollX:p}=useScrollbar(t||1),{style:i,className:l,rest:d}=B(r);return useEffect(()=>{let T=a.current;if(!T)return;let S=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",S),()=>T.removeEventListener("scroll",S)},[]),jsxs(c,{ref:s,className:l.trim(),as:"--scrollview rel",children:[jsx(c,{as:`--scroll-content ${l}`.trim(),ref:a,style:o||{},children:d.children}),jsx(c,{as:"--scroll-track --track-y --abs",children:jsx(c,{as:"--scroll-thumb --abs",ref:u,onMouseDown:m})}),jsx(c,{as:"--scroll-track --track-x --abs",children:jsx(c,{as:"--scroll-thumb --abs",ref:f,onMouseDown:p})})]})});Kr.displayName="Zuz.ScrollView";var So=Kr;var Wr=({ref:e,...n})=>{let{id:t,index:o,from:r,speed:s,children:a,margin:u,animation:f,prerender:m,inBackground:p,forceClose:i,forceLoading:l,onClose:d,...T}=n,{drawer:S}=Q(true),[C,R]=useState(a),[I,P]=useState(false),[g,b]=useState(m??(S?.prerender||true)),[h,y]=useState(false),N=()=>{P(false),d?.(t??-1);},{className:D,style:M,rest:z}=B(T),E=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{_e.isTop(N)&&N();}}],[I]);useShortcuts(E),useEffect(()=>{R(a);},[a]),useEffect(()=>(I?_e.push(N):_e.pop(N),()=>_e.pop(N)),[I]),useEffect(()=>{P(true);},[]),useEffect(()=>{i&&N();},[i]),useEffect(()=>{l!=null&&y(l);},[l]);let H=r||S?.from||he.Left,V=useMemo(()=>{switch(H){case he.Left:return {from:{x:"-100vw"},to:{x:0}};case he.Right:return {from:{x:"100vw"},to:{x:0}};case he.Top:return {from:{y:"-100vh"},to:{y:0}};case he.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[r,S?.from]),G=ue({from:{...V.from,opacity:0},to:{...V.to,opacity:1},when:I,curve:f||S?.animation||Y.EaseInOut,duration:s||S?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(o||1)*10,[o]);return jsxs(Fragment$1,{children:[jsx(Fe,{onClick:L=>{I&&N();},when:I,style:{zIndex:x}}),jsxs(c,{ref:e,"aria-hidden":!I,className:`--drawer flex cols ${D} --${H.toLowerCase()} fixed`,style:{...M,...G.style,"--m":`${u||S?.margin||0}px`,zIndex:x+1,pointerEvents:p==true?"none":"auto",...p==true?{scale:"0.92",filter:"blur(2px)"}:{}},...z,children:[r==he.Top||r==he.Bottom?jsx(c,{className:"--handle"}):null,jsx(_,{as:"--close-drawer --abs",onClick:N,children:k.close}),jsxs(So,{as:"rel",children:[g||I?C:null,jsx(Re,{when:h})]})]})]})};Wr.displayName="Zuz.Drawer";var Po=Wr;var Ur=forwardRef((e,n)=>{let{progress:t,type:o,animated:r,...s}=e,a=useRef(null);useImperativeHandle(n,()=>({setProgress:p=>{a.current.style.width=`${p*100}%`,a.current.setAttribute("data-value",p+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(r?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:u,style:f,rest:m}=B(s);return jsx(c,{className:`--progress ${r?"--animated":""} flex rel ${u}`.trim(),style:f,...m,children:jsx(c,{ref:a,className:"--bar rel"})})});Ur.displayName="Zuz.ProgressBar";var Ke=Ur;var At=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(At||{}),Vt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Vt||{}),qr=(t=>(t.Stack="stack",t.Individual="individual",t))(qr||{}),Xr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var hi=e=>{let{index:n,id:t,type:o,icon:r,title:s,message:a,duration:u,sticky:f=false,actions:m=[],position:p,style:i,isHovered:l,total:d,progress:T,forceClose:S,variant:C,onClick:R,onClose:I}=e,[P,g]=useState(false),[b,h]=useState(false),{toast:y}=Q(true),N=b||S,D=p||y?.position||"TopCenter",M=o||y?.type||"default",z=i||y?.style||"stack",E=u||y?.duration||4,H=T||y?.progress||false,V=useRef(E*1e3),G=useRef(void 0),x=useRef(void 0),L=useRef(null),Z=ue({when:P&&!N,duration:.3,transition:y?.transition||(D.includes("Top")?X.SlideInTop:D.includes("Bottom")?X.SlideInBottom:D.includes("Left")?X.SlideInLeft:X.SlideInRight),curve:y?.curve||Y.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{g(true);let W=re=>{if(x.current!==void 0){let le=re-x.current;if(!l&&!f&&!N&&(V.current-=le,L.current)){let de=Math.max(0,V.current/(E*1e3)*100);L.current?.setProgress?.(de/100);}}x.current=re,V.current<=0?h(true):G.current=requestAnimationFrame(W);};return G.current=requestAnimationFrame(W),()=>{G.current&&cancelAnimationFrame(G.current);}},[l,f,N,E]),useEffect(()=>{if(N){let W=setTimeout(()=>{I?.(t);},350);return ()=>clearTimeout(W)}},[N,t]);let U=z==="stack",F=l?n*65:n*8,K=l?1:Math.max(.85,1-n*.05),te=l?1:Math.max(.4,1-n*.2),J=()=>{R?R():(!m||m.length===0)&&h(true);},j=Z.style.transform||"translate(0, 0)",A=N?j:`${j} translateY(${D.includes("Top")?F:-F}px) scale(${K})`;return jsxs(c,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${C||y?.variant||q.Medium} --${M} --${D.toLowerCase()} abs flex aic`,style:{...Z.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?Z.style.opacity:te,transform:A,filter:!N&&U&&!l&&n>0?"blur(1px)":"none",cursor:!m||m.length===0?"pointer":"default",transition:`${Z.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(c,{as:"--ico flex aic jcc",children:r?jsx(ee,{name:r}):jsx(c,{as:"--no-icon"})}),jsxs(c,{as:"--meta flex cols",children:[jsx($,{as:"--tt",children:s||Xr[o]}),jsx($,{as:"--tm",children:a})]}),m&&m.length>0&&jsx(c,{as:"--actions flex gap:5",children:m.map((W,re)=>jsx(_,{as:"--snack-btn bold",onClick:le=>{le.stopPropagation(),W.onClick();},children:W.label},re))}),H&&jsx(Ke,{as:"abs",ref:L})]})},Io=hi;var ye=createContext(null),Si=({ref:e,...n})=>{let o=useContext(ye)?.depth??0,[r,s]=useState(null),[a,u]=useState(null),[f,m]=useState(false),[p,i]=useState([]),l=useDelayed(),d=useRef(0),T=()=>++d.current,S=()=>{m(false),setTimeout(()=>u(null),200);};useImperativeHandle(e,()=>({add(g){let b=T(),h={id:b,...g};return i(y=>[...y,h]),b},openMenu(g){m(false),setTimeout(()=>{u({id:T(),type:"menu",props:g}),m(true);},16);},remove(g){i(b=>b.map(h=>h.id===g?{...h,props:{...h.props,forceClose:true}}:h)),a?.id===g&&S();},loading(g,b){i(h=>h.map(y=>y.id===g?{...y,props:{...y.props,forceLoading:b}}:y)),a?.id===g&&S();},clear(g){i(p.filter(b=>b.type!=g));}})),useEffect(()=>{if(a&&f){let g=()=>S();return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}},[a,f,S]);let C=g=>{setTimeout(()=>{i(b=>b.filter(h=>h.id!==g)),a?.id===g&&u(null);},250);},R=useMemo(()=>[...p.filter(g=>g.type!="toast")],[p]);if(!l)return null;let I=p.filter(g=>g.type=="toast").reverse(),P=Object.values(Vt);return createPortal(jsxs(c,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+o},children:[R.map((g,b)=>{let h=b<R.length-1;return g.type==="dialog"?jsx(wo,{onClose:C,index:b,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):g.type==="drawer"?jsx(Po,{onClose:C,index:b,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):null}),P.map(g=>{let b=I.filter(h=>(h.props.position||"TopCenter")===g);return b.length===0?null:jsx(c,{onMouseEnter:()=>s(g),onMouseLeave:()=>s(null),as:`--toast-container fixed --${g.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:b.map((h,y)=>jsx(Io,{index:y,total:b.length,isHovered:r===g,onClose:C,id:h.id,...h.props},h.id))},g)}),a&&jsx(c,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(ho,{onClose:S,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},Ci=({children:e})=>{let n=useContext(ye),t=n?n.depth+1:0,o=useRef(null),r=useMemo(()=>({add:s=>o.current?.add(s),openMenu:s=>o.current?.openMenu(s),remove:s=>o.current?.remove(s),loading:(s,a)=>o.current?.loading(s,a),clear:s=>o.current?.clear(s),depth:t,isSubLayer:!!n}),[n]);return jsxs(ye.Provider,{value:r,children:[e,jsx(Si,{ref:o})]})},fo=Ci;var Pi=()=>{let e=useContext(ye);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(o,r,s)=>{o.preventDefault(),e.openMenu({event:o,items:r,origin:s});},showMenu:(o,{items:r,origin:s,offsetX:a,offsetY:u,transition:f,curve:m,arrow:p,duration:i,header:l,footer:d})=>{e.openMenu({fx:{transition:f,curve:m,duration:i},parent:o,items:r,origin:s||pt.TopCenter,offsetX:a,offsetY:u,arrow:p,header:l,footer:d});},hide:e.clear}},Ii=Pi;var Ni=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("dialog"),t=s=>e.remove(s),o=(s,a)=>e.loading(s,a);return {clearAll:n,show:s=>{let a=e.add({type:"dialog",props:{...s,type:Qe.Dialog}});return {id:a,setLoading:u=>o(a,u),hide:()=>t(a)}},hide:t}},Bi=Ni;var Li=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("drawer"),t=s=>e.remove(s),o=(s,a)=>e.loading(s,a),r=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:u=>o(a,u),close:()=>t(a)}};return {clearAll:n,open:s=>r({children:s}),right:s=>r({children:s,from:he.Right}),left:s=>r({children:s,from:he.Left}),top:s=>r({children:s,from:he.Top}),bottom:s=>r({children:s,from:he.Bottom}),close:t}},ki=Li;var Oi=(e,n,t={})=>{let[o,r]=useState(null),[s,a]=useState(false),{duration:u=.25,curve:f=Y.EaseOutBack,borderRadius:m={from:40,to:24},targetWidth:p=320}=t;return useLayoutEffect(()=>{n&&e.current?(r(e.current.getBoundingClientRect()),a(true)):n||a(false);},[n,e]),{style:ue({from:{opacity:0,width:o?.width,height:o?.height,borderRadius:m.from},to:{opacity:1,width:p,height:"auto",borderRadius:m.to},curve:f,duration:u,when:s&&n}).style,isMeasured:s,sourceRect:o}},Di=Oi;var $i=(e,n={})=>{let{offset:t=8,direction:o="bottom",container:r=null,triggerRef:s=null}=n,a=useRef(null),u=useCallback(()=>{let f=e.current;if(!f)return;let m=s?.current||f.parentElement;if(!m){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let p=f.getBoundingClientRect(),i=m.getBoundingClientRect(),l,d;r?(l=r.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(f).position==="fixed"?d="fixed":d="absolute",d==="fixed"?l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==d&&(f.style.position=d),a.current=d;let C=0,R=0;switch(o){case "top":C=i.top-p.height-t,R=i.left,C<l.top&&i.bottom+p.height+t<=l.bottom&&(C=i.bottom+t);break;case "bottom":C=i.bottom+t,R=i.left,C+p.height>l.bottom&&i.top-p.height-t>=l.top&&(C=i.top-p.height-t);break;case "left":C=i.top,R=i.left-p.width-t,R<l.left&&i.right+p.width+t<=l.right&&(R=i.right+t);break;case "right":C=i.top,R=i.right+t,R+p.width>l.right&&i.left-p.width-t>=l.left&&(R=i.left-p.width-t);break}if(C=Math.max(l.top,Math.min(C,l.bottom-p.height)),R=Math.max(l.left,Math.min(R,l.right-p.width)),a.current==="fixed")f.style.top=`${C}px`,f.style.left=`${R}px`;else {let I;f.offsetParent?I=f.offsetParent.getBoundingClientRect():I={top:0,left:0};let P=C-I.top+window.scrollY,g=R-I.left+window.scrollX;f.style.top=`${P}px`,f.style.left=`${g}px`;}},[e,s,t,o,r]);return useEffect(()=>{let f=e.current;if(!f)return;let m=s?.current||f.parentElement;if(!m){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let p=new ResizeObserver(u);return p.observe(f),m&&p.observe(m),u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,true),()=>{p.disconnect(),m&&p.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true);}},[e,o,t,r,s]),{postion:a.current,reposition:u}},ht=$i;var _i=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(i,l)=>e.add({type:"toast",props:{...l,type:i}}),o=i=>e.remove(i),m=(i,l,d)=>{let T=n(i,{...l,sticky:l.sticky??false,actions:[{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),o(T);}}]});return T},p=(i,l,d,T)=>{let S=n(i,{...l,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),o(S);}},{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),o(S);}}]});return S};return {ok:(i,l)=>m("default",i,l),success:(i,l)=>m("success",i,l),error:(i,l)=>m("error",i,l),confirm:(i,l,d)=>p("default",i,l,d),warn:(i,l)=>m("warn",i,l)}},Fi=_i;var Ki=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(m,p)=>e.add({type:"toast",props:{...p,type:m}});return {show:(m,p,i,l)=>n("default",{title:m,message:p,icon:i,duration:l}),hide:m=>e.remove(m),success:(m,p,i,l)=>n("success",{title:m,message:p,icon:i,duration:l}),error:(m,p,i,l)=>n("error",{title:m,message:p,icon:i,duration:l}),warn:(m,p,i,l)=>n("warn",{title:m,message:p,icon:i,duration:l}),promise:(m,p,i,l)=>n("promise",{title:m,message:p,icon:i,duration:l}),clearAll:()=>e.clear("toast")}},Ro=Ki;var nn=({ref:e,style:n,...t})=>{let o=useRef(null),r=useMemo(()=>e&&typeof e!="function"&&e.current?e:o,[e]),{style:s,className:a,rest:u}=B(t,r);return jsx("div",{ref:e||o,style:{...s,...n||{}},className:a,...u})};nn.displayName="Zuz.Box";var c=nn;var an=forwardRef((e,n)=>{let{title:t,message:o,...r}=e,[s,a]=useState(false);return jsxs(c,{className:"--accordion flex cols",...r,children:[jsxs(_,{onClick:u=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx($,{className:"--label flex",children:t}),jsx(c,{className:"--arrow flex",children:s?k.arrowUp:k.arrowDown})]}),s&&jsx(c,{className:"--detail",children:o})]})});an.displayName="Zuz.Accordion";var Yi=an;var Qi=({label:e,icon:n,onClick:t,idx:o,selected:r})=>jsx(_,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${o}`),className:`--action ${r?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(ee,{name:n}):n}),cn=Qi;var mn=forwardRef((e,n)=>{let{items:t,name:o,selected:r,position:s,...a}=e,u=useRef(null),[f,m]=useState(r||t[0].tag||0),p=useCallback(({x:C,y:R})=>{if(u.current){let I=u.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${C-I.left}`),document.documentElement.style.setProperty("--tip-y",`${R-I.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),i=useCallback(()=>{u.current&&(u.current.removeEventListener("pointerleave",i),u.current.removeEventListener("pointermove",p),document.documentElement.style.setProperty("--tip-s","0"));},[]),l=useCallback(()=>{u.current&&(u.current.addEventListener("pointerleave",i),u.current.addEventListener("pointermove",p));},[]);useEffect(()=>{u.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((C,R)=>R.label.length>C.length?R.label:C,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),u.current?.addEventListener("pointerenter",l));},[]);let{className:d,style:T,rest:S}=B(a);return jsxs(c,{ref:u,style:T,className:[`--actionbar flex aic ${d}`,`${!s||s==pe.Auto?"rel":`--${s}`}`].join(" ").trim(),...S,children:[t.map((C,R)=>jsx(cn,{selected:f===C.tag||r==R,...C,idx:R},`actionbar-action-${C.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(c,{className:"--tip abs",children:jsx(c,{className:"--track flex aic",children:t.map(({label:C})=>jsx(c,{className:"--lb",children:C},`tool-tip-${C.toLowerCase().replace(/\s+/g,"-")}`))})})]})});mn.displayName="Zuz.ActionBar";var ol=mn;var un=forwardRef((e,n)=>{let{type:t,icon:o,title:r,message:s,iconSize:a,...u}=e,{className:f,style:m,rest:p}=B(u);return jsxs(c,{className:`--alert --${t||Se.Info} flex aic ${f}`.trim(),style:m,...p,children:[jsx(c,{className:`--icon icon-${o||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!o&&k[t||Se.Info]}),jsxs(c,{className:"--meta flex cols",children:[jsx($,{className:`--title ${s?"--tm":""}`,children:r||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx($,{className:"--message",h:2,children:s})]})]})});un.displayName="Zuz.Alert";var sl=un;var fn=({ref:e,...n})=>{let{variant:t,numeric:o,onConfirm:r,...s}=n,{style:a,className:u,rest:f}=B(s),{variant:m}=Q(true),p=i=>{o&&(i.currentTarget.value=i.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${t||m} flex ${u}`.trim(),style:a,onInput:p,onKeyDown:i=>{i.key=="Enter"&&r?.(i.currentTarget.value);},ref:e,...f})};fn.displayName="Zuz.Input";var ie=fn;var gn=e=>{let{meta:n,children:t}=e,o=useDelayed(),{label:r,icon:s,...a}=isValidElement(n)?{}:n,{className:u,style:f,rest:m}=B({...a,...a.animate?{animate:{...a.animate,when:o}}:{}});return isValidElement(n)?jsx("li",{style:f,className:u,children:n}):jsxs("li",{style:f,className:u,...m,children:[t,typeof n=="string"?n:r]})};gn.displayName="Zuz.ListItem";var hn=gn;var xn=forwardRef((e,n)=>{let{items:t,variant:o,direction:r,seperator:s,ol:a,...u}=e,{className:f,style:m,rest:p}=B(u),i=a==true?"ol":"ul";return createElement(i,{className:`--list --${o||q.Small} flex ${r??"cols"} ${f}`.trim(),style:m,ref:n,...p,children:t.map((l,d,T)=>{let S=`${typeof l=="string"?`li-${String(l)}`:isValidElement(l)?`li-${l.key}`||`${d}-${MD5(l.toString())}`:l.label}-${d}`;return jsxs(Fragment,{children:[jsx(hn,{meta:l}),s&&T[d+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${d+1}-${S}`):null]},S)})})});xn.displayName="Zuz.List";var Ge=xn;var vn=forwardRef((e,n)=>{let{fx:t,action:o,data:r,withStyle:s,onChange:a,...u}=e,{className:f}=B({as:s||""}),{style:m}=B(u),[p,i]=useState(false),[l,d]=useState(r||[]),T=useRef(null),S=useRef(null),C=useRef(null),R=useMemo(()=>u.name||uuid(12),[]),[I,P]=useState(null),[g,b]=useState(null),[h,y]=useState([]),D=useDebounce(x=>{x.target.value==""?(i(false),d([])):o&&x.target.value.trim()!=""&&withPost(o,{query:x.target.value}).then(L=>{"items"in L&&_$1(L.items).isArray()?(d(L.items),b(x.target.value),y(L.items)):console.error("Action Response should contain items array"),P(null);}).catch(L=>{P(null),d([]);});},250),M=()=>{if(S.current){let x=S.current.getBoundingClientRect(),L=window.innerHeight-x.bottom,Z=x.top;if(C.current){let U=C.current;L<U.offsetHeight&&Z>L?(U.style.top="auto",U.style.bottom=`${x.height}px`,U.style.maxHeight=`${Z-150}px`):(U.style.top=`${x.height+5}px`,U.style.bottom="auto",U.style.maxHeight=`${L-150}px`);}}},z=x=>{if(l.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")P(null),i(false),d([]);else if(x.key==="ArrowDown")P(L=>{let Z=L===null||L===l.length-1?0:L+1;return H(Z),Z});else if(x.key==="ArrowUp")P(L=>{let Z=L===null||L===0?l.length-1:L-1;return H(Z),Z});else if(x.key==="Enter"&&I!==null){let L=l[I];T.current&&(T.current.value=L,i(false),d([]));}}},E=x=>{T.current&&(T.current.value=x,i(false),d([]));},H=x=>{let L=l[x];if(L&&T.current&&(T.current.value=L,T.current.setSelectionRange(L.length,L.length)),C.current){let U=C.current.children[x];U&&U.scrollIntoView({block:"nearest"});}},V=x=>{S.current&&!S.current.contains(x.target)&&(i(false),d([]));},G=()=>{T.current&&T.current.value===g&&(d(h),P(null),M());};return useEffect(()=>(window.addEventListener("resize",M),window.addEventListener("scroll",M,true),document.addEventListener("mousedown",V),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true),document.removeEventListener("mousedown",V);}),[]),useEffect(()=>{M();},[l]),jsxs(c,{style:m,ref:S,className:`--autocomplete --${e.size||q.Small} flex aic rel ${f}`.trim(),children:[jsx(ie,{ref:T,autoComplete:"off",onChange:D,onKeyDown:z,onFocus:G,...u}),jsx(c,{className:"--arrow rel flex aic jcc",children:l.length>0?k.arrowUp:k.arrowDown}),l.length>0&&jsx(Ge,{id:R,ref:C,className:"--suggestion-list flex cols abs",items:l.map((x,L)=>({label:x,onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),E(x);},className:I===L?"--current":"",animate:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:clamp(.02*L,.02,.5)}}))})]})});vn.displayName="Zuz.AutoComplete";var Cl=vn;var wn=forwardRef((e,n)=>{let t=useRef(null),o=useMemo(()=>n&&typeof n!="function"&&n.current?n:t,[n]),{style:r,className:s,rest:a}=B(e,o);return !a.src||a.src==""?null:jsx("img",{ref:o,style:r,className:`${s} flex`,...a})});wn.displayName="Zuz.Image";var Ue=wn;var Sn=forwardRef((e,n)=>{let{src:t,variant:o,type:r,crossOrigin:s,referrerPolicy:a,fx:u,as:f,alt:m,color:p,style:i,...l}=e,[d,T,S]=useImage(t??"",s,a),{className:C,style:R,rest:I}=B({fx:u,as:f});return jsx(c,{className:`--avatar --${o||q.Small} --${(r||mr.Circle).toLowerCase()} rel flex aic jcc ${C}`.trim(),style:{background:p||"var(--primary)",...i,...R},...I,children:t?jsx(Ue,{src:d,crossOrigin:s,referrerPolicy:a,...l}):jsx($,{className:"--avatar-label",children:(m?m.charAt(0):"A").toUpperCase()})})});Sn.displayName="Zuz.Avatar";var Ll=Sn;var kl=({size:e=5,type:n="dead",label:t="",variant:o=q.Small,loading:r=false,spinner:s,...a})=>{let{style:u,className:f,rest:m}=B(a);return jsxs(c,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...u},as:`--badge --${o} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(c,{fx:{transition:X.FadeIn,curve:Y.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(Te,{type:s})}),_$1(t).isEmpty()?jsx(c,{as:`--dot --${n}`}):jsx($,{as:"--label",children:t})]})},Ml=kl;var Ul=[{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 e=new Date,n=e.getDay();return addDays(e,(6-n)%7||6)},getDateFormat:()=>{let e=new Date,n=e.getDay();return format(addDays(e,(6-n)%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)}],ql=e=>{let n=new Set;return e.filter(t=>{if(t.label=="Later")return true;let o=t.getDate().toISOString().split("T")[0];return n.has(o)?false:(n.add(o),true)})},Tn=forwardRef((e,n)=>{let{defaultValue:t,variant:o,onChange:r,...s}=e,{style:a,className:u,rest:f}=B(s),[m,p]=useState(t||new Date),i=startOfMonth(m),l=endOfMonth(m),d=startOfWeek(i),T=endOfWeek(l),S=useMemo(()=>eachDayOfInterval({start:d,end:T}),[d,T]),C=P=>{r?.(P),p(P);},R=()=>{p(P=>new Date(P.getFullYear(),P.getMonth()-1));},I=()=>{p(P=>new Date(P.getFullYear(),P.getMonth()+1));};return jsxs(c,{as:`--calendar flex --${o||"sm"} ${u}`,style:a,children:[jsx(c,{as:"--calendar-quick-select flex cols flex:1",children:ql(Ul).map(P=>{let g=P.getDate();return jsxs(_,{onClick:()=>C(g),as:["--calendar-quick-option flex aic gap:5"],children:[jsx($,{as:"flex:1",children:P.label}),jsx($,{as:"tar",children:P.getDateFormat()})]},`--dtp-option-label-${P.label}`)})}),jsxs(c,{as:"--calendar-selector flex cols flex:1",children:[jsxs(c,{as:"--calendar-head flex aic jcc gap:4",children:[jsx($,{as:"flex:1 --calendar-cm bold",children:format(m,"MMMM yyyy")}),jsx(_,{onClick:R,as:"--calendar-chevron",children:k.chevronUpOutline}),jsx(_,{onClick:I,as:"--calendar-chevron",children:k.chevronDownOutline})]}),jsxs(c,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(P=>jsx($,{as:"--calendar-day",children:P},`--calendar-hd-${P}`)),S.map((P,g)=>{let b=isSameMonth(P,m),h=isSameDay(P,m),y=isToday(P);return jsx(_,{disabled:!b,onClick:()=>C(P),as:["--calendar-day --calendar-dd",`${h?"--calendar-dd-selected":""}`,`${y?"--calendar-dd-current":""}`],children:format(P,"d")},`--calendar-day-${g}-${P.getFullYear()}-${P.getMonth()}-${P.getDay()}`)})]})]})]})});Tn.displayName="Zuz.Calendar";var Oo=Tn;var Kt=(t=>(t.Table="table",t.Gooey="gooey",t))(Kt||{});var Nn=({ref:e,...n})=>{let{itemCount:t,itemsPerPage:o,startPage:r,pageRange:s,paginationStyle:a,breakLabel:u,prevLabel:f,nextLabel:m,hash:p,loading:i,seperator:l,renderOnZeroPageCount:d,asDots:T,progressBar:S,onPageChange:C,...R}=n,I=useRef(null),P=useMemo(()=>toHash(numberInRange(4,8)),[]),g=useCallback(x=>`${toHash(x,p||6,P)}${l||""}${P}`,[P]),b=useMemo(()=>u||"...",[u]),h=useRef(null),[y,N]=useState({id:p?r?typeof r=="number"?g(r):r:1:r||1,label:r||1});useImperativeHandle(e,()=>({setPage:x=>N(x),getPage:x=>y,setProgress:x=>h.current?.setProgress?.(x),getProgress:()=>h.current?.getProgress?.()??0}),[h.current]);let{style:D,className:M,rest:z}=B(R),E=useCallback(x=>typeof x=="number"?x:+x.label,[]);if(!t)throw new Error('"itemCount" prop is required');let H=useMemo(()=>Math.ceil(t/o),[t,o]),V=useMemo(()=>{let x=[],L=Math.max(E(y)-(s||2),1),Z=Math.min(E(y)+(s||2),H);L>1&&x.push({id:p?g(1):1,label:1}),L>2&&x.push({id:-1,label:b});for(let U=L;U<=Z;U++)x.push({id:p?g(U):U,label:U});return Z<H-1&&x.push({id:-1,label:b}),Z<H&&x.push({id:p?g(H):H,label:H}),x},[y]),G=useCallback(x=>{let L=x;+L.label<1||+L.label>H||(N(L),C?.(L));},[t,o,y]);return V.length<=1&&(d??false)===false?null:jsxs(c,{ref:I,as:`--pagination ${T===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${M}`,children:[jsx(c,{as:"flex flex:1 aic --pgt-btns",children:(V.length>1?V:[{id:1,label:1},{id:-1,label:b}]).map((x,L,Z)=>{let U=(typeof x=="string"?x:x.label)==E(y);return jsx(_,{disabled:x.id==-1||E(y)==+x.label,className:U?"--current-page":"",onClick:F=>G(x),children:T===true?S===true&&U?jsx(Ke,{ref:h}):"":typeof x=="string"?x:x.label},`--pg-${L}-${x.id}`)})}),jsx(c,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(y)-1)*o+1} - `,`${Math.min(E(y)*o,t)} of ${t} items`].join(" ")}),jsxs(c,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(_,{disabled:E(y)<=1,onClick:x=>G({id:p?g(E(y)-1):E(y)-1,label:E(y)-1}),children:k.chevronLeftOutline}),jsx(_,{disabled:V.length<=1||E(y)==E(V[V.length-1]),onClick:x=>G({id:p?g(E(y)+1):E(y)+1,label:E(y)+1}),children:k.chevronRightOutline})]})]})};Nn.displayName="Zuz.Pagination";var bt=Nn;function oc(e,n){let{items:t,renderItem:o,effect:r="slide",loop:s=true,loopMode:a="infinite",startIndex:u=0,useKeys:f=true,useWheel:m=true,spacing:p=160,rotation:i=20,scaleStep:l=.15,blur:d=4,animation:T="power",showDots:S=false,autoPlay:C=false,autoPlaySpeed:R=3,onChange:I,...P}=e,{className:g,style:b}=B(P),h=useRef(null),y=R/(R>=1e3?1e3:1),N=useCarousel({total:t.length,initialIndex:u,loop:s,useKeys:f,useWheel:m,onChange:H=>{h.current?.setPage({id:H+1,label:H+1}),h.current?.setProgress(0),I?.(H);}}),{pause:D,resume:M,reset:z}=useTimer({duration:y,autoStart:C===true,onProgress:H=>{C===true&&h.current?.setProgress(1-H);},onExpired:()=>{C===true&&N.next(),z();}}),E={...b,"--carousel-spacing":`${p}px`,"--carousel-rotation":`${i}deg`,"--carousel-blur":`${d}px`,"--carousel-scale-step":l,"--active-index":N.index,"--carousel-transition":`var(--${T})`};return jsxs(c,{ref:n,className:`--carousel --effect-${r} --loop-${a} flex cols aic jcc ${g}`.trim(),style:E,children:[jsx(c,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((H,V)=>{let G=V-N.index;if(a==="infinite"){let L=t.length;G=((G+L/2)%L+L)%L-L/2;}let x=V===N.index;return jsx(c,{onMouseEnter:()=>x&&D(),onMouseLeave:()=>x&&M(),className:`--carousel-item-wrapper abs ${x?"--is-active":""}`,style:{"--offset":G,zIndex:x?100:100-Math.abs(G),display:Math.abs(G)>5?"none":"flex"},children:o(H,V,N.index)},V)})}),S&&jsx(bt,{ref:h,itemCount:t.length,itemsPerPage:1,startPage:u+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:H=>N.goTo(+H.label-1),asDots:true,progressBar:true})]})}var rc=forwardRef(oc),nc=rc;var Bn=(n=>(n.Line="line",n))(Bn||{});var kn=forwardRef((e,n)=>{let{data:t,width:o,height:r,lineColor:s,strokeWidth:a=2,gradientStartColor:u,gradientEndColor:f,animated:m,animDuration:p=2,animDelay:i=0,padding:l=0,type:d,...T}=e,{className:S,style:C,rest:R}=B(T),I=useRef(null),P=useResizeObserver(I.current?.parentElement||I),g=typeof o=="number"?o:P.width,b=typeof r=="number"?r:P.height,h={width:g,height:b},y=useId(),{pathD:N,areaPathD:D}=useLineChart(t,h,l+(a||2)),M=useRef(null),z=useRef(null),[E,H]=useState(0),[V,G]=useState(0);return useEffect(()=>{m&&(M.current&&H(M.current.getTotalLength()),z.current&&G(z.current.getTotalLength()));},[m,N,D,g,b]),jsx(c,{ref:I,as:`--chart --${d||"line"}-chart ${S}`.trim(),style:{...C,width:o,height:r},...R,children:g>0&&b>0&&jsxs("svg",{viewBox:`0 0 ${g} ${b}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:u}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:z,d:D,fill:`url(#${y})`,stroke:"none",style:m?{strokeDasharray:V,strokeDashoffset:V}:{},children:m&&jsx("animate",{attributeName:"stroke-dashoffset",from:V,to:"0",dur:`${p||2}s`,begin:`${i||0}s`,fill:"freeze"})}),jsx("path",{ref:M,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:m?{strokeDasharray:E,strokeDashoffset:E}:{},children:m&&jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${p||2}s`,begin:`${i||0}s`,fill:"freeze"})})]})})});kn.displayName="Zuz.Chart";var pc=kn;var Mn=(r=>(r[r.Sending=0]="Sending",r[r.Sent=1]="Sent",r[r.Delivered=2]="Delivered",r[r.Read=3]="Read",r))(Mn||{}),On=(m=>(m.Image="img",m.Video="vid",m.Audio="audio",m.Link="link",m.Document="doc",m.Location="loc",m.Contact="contact",m.Event="event",m.Poll="poll",m))(On||{});var Dn=forwardRef((e,n)=>{let{text:t,media:o,side:r="me",status:s=1,timeStamp:a=Date.now(),arrow:u=true,...f}=e,{className:m,style:p,rest:i}=B(f);return jsx(c,{className:`--bubble-wrapper flex --bw-${r}`.trim(),children:jsxs(c,{className:`--bubble --bubble-${r} ${o?`--with-media --bma-${o.type}`:""} rel flex cols ${u==true?"--b-arrow":""} ${m}`.trim(),style:{...p},...i,children:[t&&jsx($,{className:"--bubble-text",children:t}),o?o.type=="audio"?jsxs(c,{as:"flex aic --bubble-audio",children:[jsx(se,{className:"--bm-action",children:k.play}),jsx(Ke,{progress:.7}),jsx($,{className:"--bm-dur",children:o.duration??"00:13"})]}):o.type=="img"?jsx(c,{as:"--bubble-image",children:jsx(Ue,{src:o.source})}):null:null,jsxs(c,{as:"flex aie jce --bubble-stats",children:[jsx($,{className:"--bubble-stamp tar",children:timeSince(a)}),r=="me"&&jsx(se,{className:`--bubble-status --bs-${s}`,children:s==0?k.pending:s==1?k.done:s==2?k.doneAll:k.doneAll})]})]})})});Dn.displayName="Zuz.Bubble";var dc=Dn;var Hn=forwardRef((e,n)=>{let{style:t,className:o,rest:r}=B(e);return jsx("label",{ref:n,style:t,className:o,...r})});Hn.displayName="Zuz.Label";var vt=Hn;var An=forwardRef((e,n)=>{let{name:t,required:o,type:r,value:s,size:a,variant:u,checked:f,onSwitch:m,...p}=e,[i,l]=useState(f||false),d=useRef(null),{variant:T}=Q(true);return useImperativeHandle(n,()=>({setChecked(S,C=true){l(S),d.current&&(d.current.checked=S),C&&m&&m(S,s||"cb");},toggle(S=true){d.current&&(d.current.checked=!i),S&&m&&m&&m(!i,s||"cb"),l(!i);}})),jsxs(vt,{className:`--${(r||Le.Default).toLowerCase()} ${!r||r==Le.Default?"--checkbox":"--switch"} --${u||T||q.Small} flex aic jcc ${i?"is-checked":""} rel`.trim(),...p,children:[(!r||r==Le.Default)&&k.check,jsx(ie,{ref:d,defaultChecked:i,value:s||"cb",type:"checkbox",className:"abs",name:t,required:o||false,onChange:S=>{m&&m(S.target.checked,s||"cb"),l(S.target.checked);}})]})});An.displayName="Zuz.CheckBox";var wt=An;var Tc=({ref:e,...n})=>{let{code:t,lang:o="tsx",showLines:r=false,highlight:s="",as:a,fx:u,...f}=n,m=useRef(null),{className:p,style:i,rest:l}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${a}`,fx:u},m),d=useMemo(()=>{let S=new Set;return s.split(",").forEach(C=>{if(C.includes("-")){let[R,I]=C.split("-").map(Number);for(let P=R;P<=I;P++)S.add(P);}else C&&S.add(Number(C));}),S},[s]),T=useMemo(()=>{let S=t.split(`
9
- `);for(;S.length>0&&S[0].trim()==="";)S.shift();for(;S.length>0&&S[S.length-1].trim()==="";)S.pop();let C=S[0]?.match(/^\s*/)?.[0].length||0,R=S.map(P=>{let g=P.match(/^\s*/)?.[0].length||0,b=Math.min(g,C);return P.slice(b)}),I=[{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:/(&lt;\/?[A-Z][\w\.]*|&gt;)/g},{name:"var",re:/(?<!&lt;\/|&lt;)\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 R.map((P,g)=>{let b=P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),h=d.has(g+1),y=[];I.forEach(N=>{b=b.replace(N.re,D=>{let M=`ZUZ_ID_${y.length}_ZUZ`;return y.push(`<span class="--token-${N.name}">${D}</span>`),M});});for(let N=y.length-1;N>=0;N--)b=b.replace(`ZUZ_ID_${N}_ZUZ`,y[N]);return `<div class="--code-line ${r==true?"--with-ln":""} ${h?"--is-highlighted":""}">
10
- ${r==true?`<span class="--line-number">${g+1}</span>`:""}
11
- <span class="--line-content">${b||" "}</span>
12
- </div>`}).join("")},[t,d]);return jsx(c,{as:`--code-block ${p}`,style:i,...f,children:jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:T}})})})},Pc=Tc;var $n=({onSelect:e,meta:n,selected:t,disabled:o=false})=>{let r=useRef(null),{index:s,icon:a,label:u}=n,[f,m]=useState({x:0,width:0}),p=useDelayed();return useLayoutEffect(()=>{if(p&&r.current){let{width:i,x:l}=r.current.getBoundingClientRect();m({x:l,width:i}),t&&e(s,i,l,n,true);}},[p,r.current]),useEffect(()=>{t&&e(s,f.width,f.x,n,false);},[t]),jsxs(_,{disabled:o,onClick:()=>e(s,f.width,f.x,n,false),ref:r,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(ee,{name:a,as:"--segment-icon"}):jsx(c,{as:"--segment-icon flex aic jcc",children:a}):null,u&&String(u).trim()!=""&&jsx(c,{className:"--segment-label",children:u||`Item ${s}`})]})};$n.displayName="SelectTabItem";var zn=$n;var Fn=forwardRef((e,n)=>{let{fx:t,items:o,selected:r,variant:s,disabled:a=false,onSwitch:u,...f}=e,[m,p]=useState(r||0),i=useDelayed(50),l=useRef(m),{className:d,style:T,rest:S}=B(f),C=useRef(null),R=useRef(null),{variant:I}=Q(true),P=(g,b,h,y,N)=>{if((N||m!=g&&m!=-2)&&(p(g),l.current=m,queueMicrotask(()=>{i&&u?.(y);})),C.current){let D=R.current?.getBoundingClientRect();C.current.style.setProperty("--w",`${b}px`),C.current.style.setProperty("--x",`${D?h-D.left:h}px`);}};return useImperativeHandle(n,()=>({setSelected:g=>{typeof g=="number"&&g!=m&&p(g);}}),[m]),jsxs(c,{ref:R,"data-selected":m,className:`${d} --segmented --${s||I||q.Medium} flex aic rel`,style:T,...S,children:[jsx(c,{ref:C,className:`--segment-tab --${a?"disabled":"abled"} abs`}),o.map((g,b)=>jsx(zn,{disabled:a,onSelect:P,selected:m==b,meta:{...g,index:b}},`segment-${g.label}-${b}`))]})});Fn.displayName="Zuz.SelectTabs";var St=Fn;var Wn=forwardRef((e,n)=>{let{type:t,...o}=e,r=useDelayed(),{colorScheme:s,setColorScheme:a}=uo(),u=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:m}=B(o),p=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:k.colorSchemeLight},{tag:"system",index:1,label:"",icon:k.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:k.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:k.colorSchemeLight},{tag:"dark",index:2,label:"",icon:k.colorSchemeDark}],[]),i=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !r||i==-1?null:t=="system"||t=="switch"?jsx(St,{className:`--color-scheme --${t}`,onSwitch:({tag:l})=>{a(l);},selected:i,items:p,...o}):jsx(_,{onClick:u,style:m,as:`--color-scheme-switch --${o.variant||q.Small} ${f}`.trim(),children:s=="system"?k.colorSchemeSystem:s=="light"?k.colorSchemeLight:k.colorSchemeDark})});Wn.displayName="Zuz.ColorScheme";var zc=Wn;var Un=forwardRef((e,n)=>{let[t,o]=useState("wait"),{title:r,message:s,acceptLabel:a,rejectLabel:u,position:f}=e,m=async p=>{o(p==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(p));};return useEffect(()=>{let p=localStorage.getItem("--ccnt");o(p?p=="1"?"accepted":"rejected":"pending");},[]),jsxs(c,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:Y.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${f||pe.Left} flex cols`,children:[jsx($,{as:"--title",children:r||"This site uses cookies"}),jsx($,{as:"--message",children:s||"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(c,{as:"--footer flex aic",children:[jsx(_,{onClick:p=>m(1),as:"--accept",children:a||"Accept All"}),jsx(_,{onClick:p=>m(0),as:"--reject",children:u||"Cancel"})]})]})});Un.displayName="Zuz.CookiesConsent";var Kc=Un;var Yn=({ref:e,...n})=>{let {title:t,position:o,margin:r=4,anchorName:s="--tooltip-anchor",children:a,show:u,variant:f,...m}=n,{style:p,className:i,rest:l}=B(m),d=o||pe.Top;useRef(null);let [S,C]=useState(false);useRef(6);let I=u===true||S,g=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:b}=Q(true),h=useMemo(()=>{let N=false;return addPropsToChildren(a,D=>{let M=D.props.className?.includes(s);return M&&(N=true),M||!N},(D,M)=>{let z=M.props.className?.includes(s),E=D===0,H={};return (z||E)&&(H.style={...M.props.style,anchorName:g}),E&&(H.onMouseEnter=V=>{C(true),M.props.onMouseEnter?.(V);},H.onMouseLeave=V=>{C(false),M.props.onMouseLeave?.(V);}),H})},[a,s,g]),y=ue({transition:d==pe.Top?X.SlideInTop:d==pe.Bottom?X.SlideInBottom:d==pe.Left?X.SlideInLeft:X.SlideInRight,when:I,duration:.2,offset:r+6,margin:d==pe.Top||d==pe.Left?-r:r,curve:b?.curve||Y.EaseInOut});return useImperativeHandle(e,()=>({show:()=>C(true),hide:()=>C(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[h,jsx(c,{style:{positionAnchor:g,...y.style,...d===pe.Top||d===pe.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${I} --${f||b?.variant||q.Small} --${d} abs ${i}`.trim(),children:typeof t=="string"?jsx($,{as:"--text rel",children:t}):t})]})};Yn.displayName="Zuz.ToolTip";var Fo=Yn;var Qn=({ref:e,...n})=>{let {type:t,value:o=0,min:r=0,max:s=1,step:a=.01,onChange:u,showGhostBar:f,showKnobOnHover:m,showToolTip:p,roundValue:i,formatValue:l,...d}=n,{className:T,style:S,rest:C}=B(d),R=useRef(a||.01).current,I=useRef(r||0).current,P=useRef(s||1).current,g=useRef(o||0).current,b=useRef(null),h=useRef(null),y=useRef(null),N=useRef(null);useRef(null);let M=useRef(null),z=useRef(null),E=useRef(null),H=useRef(null),V=(ne,ae,ve)=>(ne-ae)/(ve-ae)*100,G=ne=>{if(h.current){let ae=parseFloat(ne.currentTarget.value);j(ae);let ve=V(ae,parseFloat(ne.currentTarget.min),parseFloat(ne.currentTarget.max));h.current.style.setProperty("--value",`${ve}`),h.current.setAttribute("data-value",`${ae}`),u&&u(i?+ae.toFixed(2):ae);}},[x,L]=useState(false),[Z,U]=useState(0),[F,K]=useState(0),[te,J]=useState(false),j=async ne=>{let ae=l?l(+ne):i?(+ne).toFixed(2):Math.round(+ne);E.current&&(E.current.textContent=String(ae));},W=ne=>{if(x){let ae=ne.clientX-Z,ve=P-I,Ie=ae/200*ve,ge=Math.max(I,Math.min(F+Ie,P));if(ge=Math.round(ge/R)*R,j(ge),h.current){let ct=V(ge,I,P);h.current.style.setProperty("--value",`${ct}`),h.current.setAttribute("data-value",`${ge}`),z.current&&(z.current.textContent=i?ge.toFixed(2):ge.toString()),u&&u(ge);}}},re=()=>{L(false),document.body.style.cursor="auto";},le=ne=>(ne-I)/(P-I)*100,de=ne=>{if(!h.current)return;let ae=h.current.getBoundingClientRect(),ve=ne.clientX-ae.left,lt=Math.max(0,Math.min(100,ve/ae.width*100));if(p&&E.current){let Ie=b.current?+b.current.value:o;j(Ie*100);}if(f){let Ie=le(b.current?+b.current.value:o),ge=Math.min(Ie,lt),ct=Math.abs(lt-Ie);h.current.style.setProperty("--ghost-start",`${ge}`),h.current.style.setProperty("--ghost-width",`${ct}`);}};useEffect(()=>{h.current&&h.current.style.setProperty("--value",b.current?`${V(parseFloat(b.current.value),parseFloat(b.current.min),parseFloat(b.current.max))}`:g.toString());},[]),useEffect(()=>(x?(document.addEventListener("mousemove",W),document.addEventListener("mouseup",re)):(document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",re)),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",re);}),[x]),useEffect(()=>{let ne=V(o,I,P);h.current?.style.setProperty("--value",`${ne}`),j(o);},[o,I,P,E.current]);let oe=()=>jsxs(c,{ref:h,onMouseEnter:()=>J(true),onMouseLeave:()=>J(false),onMouseMove:de,className:`--slider --${t||so.Default} ${m?"--knob-hover":""} flex rel ${T}`.trim(),style:{...S},children:[jsx(c,{ref:M,className:"--slider-track abs fill"}),f&&jsx(c,{ref:N,className:"--slider-ghost abs fill"}),jsx(c,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(c,{ref:y,className:"--slider-knob --tooltip-knob abs"}),jsx(ie,{ref:b,onInput:G,className:"abs fill",tabIndex:0,type:t||so.Default,defaultValue:g||0,step:R,max:P,min:I})]});if(p===true){let ne=l?l(o):i?o.toFixed(2):o;return jsx(Fo,{ref:H,show:x,position:mt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(se,{ref:E,children:ne}),children:oe()})}return oe()};Qn.displayName="Zuz.Slider";var Je=Qn;var Jn=forwardRef((e,n)=>{let{src:t,shape:o,size:r,...s}=e,{style:a,className:u,rest:f}=B(s),{canvasRef:m,crop:p,setScale:i,handleMouseDown:l,handleMouseUp:d,handleMouseMove:T}=useImageCropper(t,r||200,o||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return p()},setScale(S){i(S);}})),jsxs(c,{as:`--cropper --${o||CropShape.Circle} ${u}`,style:a,...f,children:[jsx("canvas",{ref:m,width:r||200,height:r||200,onMouseDown:l,onMouseUp:d,onMouseLeave:d,onMouseMove:T}),jsx(c,{as:"--cropper-slider",children:jsx(Je,{onChange:S=>i(S),min:0,max:1,step:.01,value:1})})]})});Jn.displayName="Zuz.Cropper";var om=Jn;var nm=(t=>(t.Circle="circle",t.Square="square",t))(nm||{});var ts=forwardRef((e,n)=>{let{items:t,maxItems:o}=e,r=useMemo(()=>{let u=typeof t=="string",f=u?[]:t;return u&&t.split(",").forEach(m=>{f.push({label:m});}),f},[t]),a=useMemo(()=>o&&o>0&&r.length>o-1,[r,o])?[...r.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...r.slice(-o)]:r;return jsx(Ge,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(c,{as:"--crumb-chevron",children:k.chevronRightOutline}),items:a.map((u,f,m)=>u.ID=="."?jsx(c,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(c,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs(_,{onClick:()=>u.action?.(),className:"--crumb-item",disabled:!m[f+1],children:[u.icon&&jsx(ee,{as:"--crumb-icon",name:u.icon}),jsx($,{as:"--crumb-label",children:u.label})]},`${u.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});ts.displayName="Zuz.Crumb";var am=ts;var ns=forwardRef((e,n)=>{let{icon:t,defaultValue:o,value:r,size:s,variant:a,numeric:u,type:f,onConfirm:m,...p}=e,[i,l]=useState(false),[d,T]=useState(o||null),{style:S,className:C,rest:R}=B(p),I=useRef(null),P=useRef(null),{reposition:g}=ht(P,{direction:pe.Bottom,offset:2}),b=y=>{u&&(y.currentTarget.value=y.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let y=N=>{let D=N.target,M=I.current?.contains(D),z=P.current?.contains(D);!M&&!z&&l(false);};return i&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[i]),useEffect(()=>{let y=N=>{N.key==="Escape"&&i&&(l(false),I.current?.focus());};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[i]);let h=()=>{l(true);};return useEffect(()=>{i&&g();},[i,g]),jsx(Fragment$1,{children:jsxs(c,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${C}`,"data-value":d?d.toISOString():"",children:[t?typeof t=="string"?jsx(ee,{as:"mr:10 c:#666",name:t}):t:jsx(se,{as:"--date-picker-icon flex aic jcc",children:k.calendar}),jsx("input",{ref:I,value:d?format(d,"EEE, MMM d YYY hh:mm a"):r||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:S,onFocus:h,onInput:b,autoComplete:"new-password",onKeyDown:y=>{y.key=="Enter"&&m?.(y.currentTarget.value);},...R}),jsx(c,{"aria-hidden":!i,ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:i,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(Oo,{defaultValue:d,onChange:y=>{T(y),l(false);}})})]})})});ns.displayName="Zuz.DatePicker";var mm=ns;var ss=forwardRef((e,n)=>{let{icon:t,variant:o,position:r}=e;return jsx(_,{className:`--fab fixed --${o||q.Large} --${r||"bottomright"}`,children:t||k.plus})});ss.displayName="Zuz.Fab";var dm=ss;var as=e=>{let{names:n,strength:t}=e,o={[Bt.Gooey]:r=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:r||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-${Bt.Gooey}`)};return useEffect(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[Bt.Gooey]).map(r=>o[r](t))})})};as.displayName="Zuz.Filters";var ym=as;var is=({cols:e,gap:n,aic:t,jcc:o,className:r="",style:s,...a})=>{let u=["--flex",e?"--cols":"",t?"--aic":"",o?"--jcc":"",r].filter(Boolean).join(" "),f={...s,gap:typeof n=="number"?`${n}px`:n};return jsx(c,{...a,className:u,style:f})};is.displayName="Zuz.FlexBox";var Ae=is;var Ve=null,be=null,cs=forwardRef((e,n)=>{let{title:t,message:o,transition:r,curve:s,speed:a,type:u,actionPosition:f,spinner:m,loadingMessage:p,onShow:i,onHide:l,...d}=e,{className:T,style:S,rest:C}=B(d),[R,I]=useState(t||""),[P,g]=useState(o||""),[b,h]=useState(null),[y,N]=useState(u||Ce.Default),D=useMemo(()=>uuid(12),[]),[M,z]=useState(false),E=useRef(null),H=useRef(null),[V,G]=useState(false),[x,L]=useState(true),Z=useRef(null),U=P;useImperativeHandle(n,()=>({setLoading(K){G(K);},showDialog(K,te,J,j){Ve&&(clearTimeout(Ve),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),te&&g(te),K&&I(K),J&&h(J.reduce((A,W)=>(A.push({...W,key:W.key||uuid(12)}),A),[])),z(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(K,te,J,j){Ve&&(clearTimeout(Ve),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),g(te),I(K),J&&h(J.reduce((A,W)=>(A.push({...W,key:W.key||uuid(12)}),A),[])),z(true),setTimeout(()=>j?j():()=>{},1e3);},error(K,te){this.show(K,te,Ce.Error);},warn(K,te){this.show(K,te,Ce.Warn);},success(K,te){this.show(K,te,Ce.Success);},show(K,te,J){Ve&&(clearTimeout(Ve),be&&clearTimeout(be),H.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${H.current} scale(.9)`.trim();},50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=H.current||"",be=null;},500)),Ve=setTimeout(()=>{z(false),Ve=null,be=null;},(te||4)*1e3),N(J||Ce.Default),g(K),z(true),i?.();},hide(){z(false),l?.();}}));let F=useMemo(()=>{let K={when:M,duration:a||.3,delay:.1};if(y==Ce.Dialog){if(r){let{from:te,to:J}=ut(r,20);return {from:te,to:J,curve:s||Y.EaseInOut,...K}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Y.Spring,...K}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Y.Spring,...K}},[M,y]);return useEffect(()=>{Z.current&&clearTimeout(Z.current),M?L(true):Z.current=setTimeout(()=>L(false),1e3);},[M]),y==Ce.Dialog?jsxs(Fragment$1,{children:[jsx(Fe,{when:M}),jsxs(c,{className:`--sheet --sheet-${y.toLowerCase()} ${M?"is-visible":""} ${T} fixed`.trim(),style:S,fx:F,...C,ref:E,children:[jsx(Re,{when:V,spinner:m,message:p}),jsxs(c,{className:"--head flex aic rel",children:[jsx(c,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx(_,{onClick:K=>z(false),className:"--closer abs",children:"\xD7"})]}),jsx(c,{className:`--body flex aic rel ${b?"":"--no-action"}`.trim(),children:x?U:null}),b&&jsx(c,{className:`--footer flex aic rel ${f?f==no.Center?"jcc":"":"jce"}`.trim(),children:b.map((K,te)=>jsx(_,{onClick:J=>K.handler?K.handler():K.onClick?K.onClick():console.log("onClick Handler missing"),className:"--action",children:K.label},`sheet-${D}-action-${K.key}`))})]})]}):jsx(c,{className:`--sheet --sheet-${y.toLowerCase()} ${T} abs`.trim(),style:S,...C,fx:F,ref:E,children:M?P:null})}),Tt=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;cs.displayName="Zuz.Sheet";var Cm=cs;var ms=({ref:e,...n})=>{let{name:t,cover:o,spinner:r,errors:s,action:a,children:u,withData:f,beforeSubmit:m,onSubmit:p,onError:i,onSuccess:l,resetOnSuccess:d,...T}=n,{className:S,style:C,rest:R}=B(T),[I,P]=useState(false),g=useRef(null),b=useRef(null),h=useRef(null),y=Ro(),N=useCallback(x=>g.current?g.current.querySelectorAll(x):[],[g.current]),D=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")}),M=x=>{let L=[];return x.querySelectorAll(".--input").forEach(Z=>{L.push(Z.value);}),L.join("")},z=useCallback(x=>{let{required:Z}=D(x);if(Z){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let F=M(x);if(F==""||F.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 F=x.getAttribute("with");switch(F.includes("@")&&(F=F.split("@")[0],F=="match"&&(F=ke.MatchField)),F.toUpperCase()){case ke.IPV4:return _$1(x.value).isIPv4();case ke.IPV6:return _$1(x.value).isIPv6();case ke.Email:return _$1(x.value).isEmail();case ke.Uri:try{return new URL(x.value),!0}catch{return false}case ke.Password:return console.log("Add FORMVALIDATION.Password"),false;case ke.MatchField:let[K,te,J]=x.getAttribute("with").split("@"),j=document.querySelector(`[name=${te.trim()}]`);if(!j)return false;switch(J||"direct-match"){case "if-not-empty":if(j&&!_$1(j.value).isEmpty()&&j.value!=x.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&x.classList.contains("--otp")&&M(j)!=M(x))return false;if(j&&j.value!=x.value)return false;break}break;default:return true}}return true},[g.current]),E=useCallback(()=>{let x={},L={},Z=null,U=null;if(Array.from(N("[name]")).forEach(F=>{let{name:K,required:te,with:J}=D(F),j=true;(te||J)&&(j=z(F)),x[K]={valid:j,value:F.type=="checkbox"?F.checked==true?F.value:false:F.classList.contains("--otp")?M(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value},L[K]=F.type=="checkbox"?F.checked==true:F.classList.contains("--otp")?M(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value,j?F.classList.remove("input-with-error"):(Z==null&&s&&(Z=F,U=s[K]),F.classList.add("input-with-error"));}),Z){let F=Z;if(F.classList.contains("--otp"))for(let K of Array.from(F.querySelectorAll(".--input"))){let te=K;if(te.value==""){te.focus();break}}else F.focus();}return {error:Z!=null,errorMsg:U||"Fix errors to continue...",data:x,payload:L}},[g.current]),H=useCallback(()=>{let{error:x,errorMsg:L,payload:Z}=E();x?y.error(L):a?startTransition(async()=>{m&&m(Z),Tt(o)?o.setLoading(true):P(true),y.clearAll(),withPost(a,{...Z,...f||{}}).then(U=>{let F=U;Tt(o)?o.setLoading(false):P(false),d&&Array.from(N("[name]")).forEach(K=>{K instanceof HTMLInputElement&&(K.value="");}),l?l(F):(y.clearAll(),y.success(F.message||"Redirecting..."));}).catch(U=>{Tt(o)?o.setLoading(false):P(false),i?i(U):y.error(U.message||"We cannot process your request at this time.");});}):p&&p(Z);},[a,b.current,g.current]),V=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(L=>{L.addEventListener("click",H);});},[g.current]),G=useMemo(()=>addPropsToChildren(u,x=>x.props.type=="submit",x=>({ref:h})),[u]);return useImperativeHandle(e,()=>({setLoading(x){if(x){b.current?.hide();try{y.clearAll();}catch{}}P(x);},showError(x){typeof x=="string"?y.error(x):b.current.error(x,4);},hideError(){b.current.hide();try{y.clearAll();}catch{}},init(){V();},submit(){H();}})),useEffect(V,[]),jsxs(c,{ref:g,style:C,className:`--form flex rel ${S} ${t?`--form-${t.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!Tt(o)&&jsx(Re,{message:o?o.message||void 0:"working",spinner:r,color:o&&"color"in o?o.color:"#ffffff",when:I}),G]})};ms.displayName="Zuz.Form";var km=ms;var ps=e=>{let {ref:n,cols:t,rows:o,gap:r,gapX:s,gapY:a,align:u,justify:f,inline:m,flow:p,autoCols:i,autoRows:l,template:d,...T}=e;useRef(null);let {className:C,style:R,rest:I}=B(T),P=b=>typeof b=="number"?`repeat(${b}, 1fr)`:b,g={display:m?"inline-grid":"grid",gridTemplateColumns:P(t),gridTemplateRows:P(o),gap:r,columnGap:s,rowGap:a,alignItems:u,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:p,gridAutoColumns:i,gridAutoRows:l,gridTemplateAreas:d,...R};return jsx(c,{ref:n,as:`--grid ${C}`.trim(),style:g,...I})};ps.displayName="Zuz.Grid";var Hm=ps;var us=e=>typeof e=="string"&&e.includes("+"),fs={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"},ds={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 hs=forwardRef(({children:e,keys:n,as:t,className:o,variant:r},s)=>{let{variant:a}=Q(true),u=useMemo(()=>{if(us(n)){let f=null;return {keys:String(n).split("+").reduce((p,i,l,d)=>(d[l+1]?p.push(i):f=i.toUpperCase(),p),[]),children:f}}return {keys:n,children:String(e).toUpperCase()}},[n]);return jsxs(c,{as:`--keyboard-keys --${r||a||q.Small} flex aic ${t} ${o}`.trim(),children:[(Array.isArray(u.keys)?u.keys:[u.keys]).map(f=>jsx("abbr",{title:ds[f],children:fs[f]},f)),jsx(se,{children:u?.children??e})]})});hs.displayName="Zuz.KeyboardKeys";var Yo=hs;var bs=createContext(null),ot=()=>{let e=useContext(bs);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},Km=({ref:e,icons:n,children:t,...o})=>{let{playlist:r=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:u="No Track",defaultCover:f,onTrackChange:m,...p}=o,{className:i,style:l,rest:d}=B(p),T=useMediaPlayer(r,r[0]??void 0),S=useMemo(()=>({play:k.play,pause:k.pause,prev:k.prev,next:k.next,volumeHigh:k.volumeHigh,volumeMute:k.volumeMute,...n}),[n]),C=useMemo(()=>({...T,mode:s,icons:S}),[T,S]);return jsx(bs.Provider,{value:C,children:jsx(c,{className:`--zuz-media-player ${i}`,style:l,children:t})})},vs=Km;var ws=e=>{if(!e||isNaN(e))return "0:00";let n=Math.floor(e/60),t=Math.floor(e%60);return `${n}:${t.toString().padStart(2,"0")}`},Xt=e=>typeof e=="string"?jsx(ee,{name:e}):e,Ss=()=>{let{mediaRef:e,state:n,controls:t,mode:o}=ot();return jsxs(c,{as:`--mediaplayer-stage rel --mode-${o}`,children:[o==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),n.isLoading&&jsx(c,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Te,{})})]})},Cs=()=>{let{state:e,defaultArtist:n,defaultTitle:t,defaultCover:o}=ot();return jsxs(c,{as:"--track-info flex aic",children:[jsx(Ue,{src:e.currentItem?.cover||o||"",as:"--track-cover"}),jsxs(c,{as:"flex cols",children:[jsx(c,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(c,{as:"--track-artist",children:e.currentItem?.artist||n||"..."})]})]})},Ts=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(c,{as:"--mediaplayer-controls flex aic",children:[jsx(_,{onClick:n.prev,as:"--prev",children:Xt(t?.prev??k.prev)}),jsx(_,{onClick:n.togglePlay,as:"--play-pause",children:Xt(e.isPlaying?t?.pause??k.pause:t?.play??k.play)}),jsx(_,{onClick:n.next,as:"--next",children:Xt(t?.next??k.next)})]})},Ps=()=>{let{state:e,controls:n,mediaRef:t}=ot(),o=e.progress*(e.duration||0);return jsxs(c,{as:"--track-progress flex aic",children:[jsx(c,{as:"--track-current-duration",children:ws(o)}),jsx(Je,{value:e.progress,onClick:r=>{let s=r.currentTarget.getBoundingClientRect(),a=(r.clientX-s.left)/s.width;n.seek(a);}}),jsx(c,{as:"--track-total-duration",children:ws(e.duration)})]})},Is=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(c,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(_,{onClick:()=>n.setIsMuted(),children:Xt(e.isMuted?t?.volumeMute??k.volumeMute:t?.volumeHigh??k.volumeHigh)}),jsx(Je,{value:e.volume,className:"h:3 flex:1",onClick:o=>{let r=o.currentTarget.getBoundingClientRect();n.setVolume((o.clientX-r.left)/r.width);}})]})};var Wm=({ref:e,...n})=>jsx(vs,{...n,ref:e}),Gm=Object.assign(Wm,{Stage:Ss,TrackInfo:Cs,Controls:Ts,Progress:Ps,Volume:Is}),Um=Gm;var Ns=forwardRef((e,n)=>{let t=useNetworkStatus(),{onlineMessage:o,offlineMessage:r,variant:s}=e;return jsxs(c,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:Y.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||q.Small} fixed flex`,children:[jsx(c,{className:"--ico",children:t?k[Se.Success]:k[Se.Error]}),jsx($,{as:"--message",children:t?o||"internet connection restored :)":r||"no internet connection"})]})});Ns.displayName="Zuz.NetWorkManager";var Qm=Ns;var Es=forwardRef((e,n)=>{let{strenthMeter:t,onChange:o,...r}=e;"type"in r&&delete r.type;let{style:s,className:a,rest:u}=B(r),[f,m]=useState(false),[p,i]=useState(""),l=useMemo(()=>checkPasswordStrength(p),[p]),d=useDebounce(T=>{t&&i(T.target.value),o&&o(T);},100);return useEffect(()=>{},[]),jsxs(c,{as:"w:100% flex cols",children:[jsxs(c,{style:s,className:"--password flex aic rel",children:[jsx(ie,{ref:n,type:f?"text":"password",className:a,onChange:d,...u}),jsx(_,{tabIndex:-1,onClick:()=>m(T=>!T),className:"--toggle flex aic jcc abs",children:f?k.eye:k.eyeSlash})]}),t&&jsxs(c,{as:`flex aic --password-meter --pb-score-${l.score}`,style:s,children:[jsxs(c,{as:"--password-bars flex aic",children:[jsx(c,{as:`--pbar ${l.score>=1?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=2?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=3?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=4?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=5?"--pb-on":""}`.trim()})]}),jsx($,{as:"--password-meter-label","aria-hidden":true,children:l.result})]})]})});Es.displayName="Zuz.Password";var np=Es;var ks=forwardRef((e,n)=>{let{size:t,length:o,mask:r,...s}=e,a=useRef([]),u="pinput",f=false,m={};"with"in s&&(m={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(u=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:p}=B(s),i=l=>{let d=l.currentTarget,T=a.current[parseInt(d.dataset.index)+1],S=a.current[parseInt(d.dataset.index)-1];d.value.length===1&&T?T.focus():d.value.length===0&&S&&S.focus();};return useEffect(()=>{a.current=a.current.slice(0,t||o);},[t||o]),jsx(c,{name:u,style:p,className:"--otp flex aic rel","data-required":f,"data-size":t||o||4,...m,children:Array(t||o||4).fill(1).map((l,d)=>jsx(ie,{autoComplete:"new-password","data-index":d,ref:T=>{a.current[d]=T;},numeric:true,onChange:i,maxLength:1,placeholder:r?"\xB7":"0",type:r?"password":"text",...s},`pin-${d}`))})});ks.displayName="Zuz.PinInput";var lp=ks;var Ms=forwardRef((e,n)=>{let{children:t,className:o,name:r,required:s,type:a,value:u,variant:f,checked:m,onSwitch:p,...i}=e,[l,d]=useState(m||false),{variant:T}=Q(true),S=useRef(null);return jsxs(vt,{className:`${o} --${(a||ao.Default).toLowerCase()} --radio${!a||a==ao.Default?"":"card"} --${f||T||q.Small} flex aic rel`.trim(),...i,children:[jsx(ie,{ref:S,defaultChecked:l,value:u||"rd",type:"radio",className:"abs",name:r,required:s||false,onChange:C=>{p&&p(C.target.checked,u||"cb"),d(C.target.checked);}}),jsx(c,{className:"--dot rel",children:jsx(c,{className:"--rod abs abc"})}),jsx(c,{className:"--value",children:t})]})});Ms.displayName="Zuz.Radio";var up=Ms;var Os=forwardRef((e,n)=>{let{fx:t,withStyle:o,as:r,reverse:s=false,searchIcon:a=k.search,hideSearchIcon:u=false,clearIcon:f=k.close,hideClearIcon:m=false,onChange:p,onClear:i,...l}=e,{style:d,className:T}=B({as:e.as}),[S,C]=useState(""),{variant:R}=Q(true),I=useRef(null);"type"in e&&delete e.type;let P=b=>{C(b.target.value),p?.(b.target.value);},g=b=>{S.trim()!==""&&(C(""),p?.(""),I.current&&(I.current.value="",e.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>I.current?.focus(),value:()=>I.current?.value})),useEffect(()=>{},[]),jsxs(c,{style:d,className:`--search ${s?"--search-rev":""} --${e.variant||R||q.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[jsx(ie,{ref:I,onChange:P,...l}),e.shortcut&&jsx(Yo,{keys:e.shortcut,as:"abs"}),jsx(_,{tabIndex:-1,onClick:b=>g(),className:"--send flex aic jcc",variant:e.variant||q.Medium,children:S!==""?!m&&(typeof f=="string"?jsx(ee,{name:f,as:"--search-action"}):f):!u&&(typeof a=="string"?jsx(ee,{name:a,as:"--search-action"}):a)})]})});Os.displayName="Zuz.Search";var bp=Os;var Hs=({checkIcon:e,selected:n,updateValue:t,o})=>{let r=e?typeof e=="string"?jsx(ee,{name:"checkIcon"}):e:k.check,s=o.disabled===true;return jsxs(_,{onClick:a=>{s||(a.stopPropagation(),t(o));},disabled:s,as:`--select-option-item ${n?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ae,{children:[o.icon&&jsx(ee,{name:o.icon,as:`--select-option-icon --icon-${o.value}`,color:o.iconColor}),jsx($,{suppressHydrationWarning:true,children:typeof o=="string"?o:o.label})]}),n&&jsx(Ae,{aic:true,jcc:true,as:"--select-option-check --abs",children:r})]})};Hs.displayName="Option";var As=Hs;var $s=({ref:e,...n})=>{let{selected:t,options:o,label:r,name:s,variant:a,search:u,searchPlaceholder:f,maxHeight:m,arrowDownIcon:p=k.arrowDown,arrowUpIcon:i=k.arrowUp,expanded:l,multiple:d,tokenizer:T,wrapTokens:S,disabled:C,checkIcon:R,closeIcon:I,onChange:P,...g}=n,[b,h]=useState(()=>d||T?t?(Array.isArray(t)?t:[t]).map(W=>typeof W=="string"?o.find(re=>re.value===W):W):[]:t?typeof t=="string"?o.find(A=>A.value===t):t:o[0]),[y,N]=useState(false),[D,M]=useState(null),z=useRef(null),E=useRef(null),H=useRef(null),V=useId(),G=useMemo(()=>s||V,[]),{reposition:x}=ht(H,{direction:mt.Bottom,offset:2}),{variant:L}=Q(true),Z=I?typeof I=="string"?jsx(ee,{name:I}):I:k.close,{className:U,style:F,rest:K}=B(g,void 0),te=A=>Array.isArray(b)?b.some(W=>W.value===A.value):b?.value===A.value,J=A=>{if(!(C||A.disabled))if(d||T){let W=Array.isArray(b)?b:[],le=W.find(de=>de.value===A.value)?W.filter(de=>de.value!==A.value):[...W,A];h(le),P?.(le);}else h(A),N(false),P?.(A);},j=(A,W)=>{if(A.stopPropagation(),C)return;let re=b.filter(le=>le.value!==W.value);h(re),N(false),P?.(re);};return useImperativeHandle(e,()=>({setSelected:A=>{if(Array.isArray(A)){let W=A.map(re=>typeof re=="string"?o.find(le=>le.value===re):re).filter(Boolean);h(W);}else if(typeof A=="string"){let W=o.find(re=>re.value===A);W&&h(W);}else h(A);},getValue:()=>b||null}),[b,o]),useEffect(()=>{if(!y)return;let A=()=>{x();};return window.addEventListener("scroll",A,true),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,true),window.removeEventListener("resize",x);}},[y,x]),useEffect(()=>{if(!y){E.current&&(E.current.value=""),M(null);return}E.current?.focus(),x();let A=re=>{H.current&&!H.current.contains(re.target)&&N(false);},W=setTimeout(()=>{document.addEventListener("click",A);},0);return ()=>{clearTimeout(W),document.removeEventListener("click",A);}},[y,x]),jsxs(c,{className:`--select ${l==true?"--expanded":""} --${a||L} ${s?`--${s}`:""} ${C?"--disabled":""} rel`.trim(),name:G,children:[jsxs(_,{ref:z,disabled:C,className:`--select-display --selected flex aic rel ${U}`.trim(),withLabel:false,style:F,onClick:A=>{A.stopPropagation(),C||N(W=>!W);},...K,children:[jsx(Ae,{aic:true,as:"--label-wrapper",children:T&&Array.isArray(b)&&b.length>0?jsxs(Ae,{as:`--tokens-wrap${S===true?" --wrap":""}`,children:[b.map(A=>jsxs(Ae,{aic:true,as:"--token",children:[jsx($,{as:"--token-label",children:A.label}),jsx(c,{as:"--token-remove",onClick:W=>j(W,A),children:Z})]},A.value)),b.length<o.length&&jsx($,{as:"--label",children:r||"Choose"})]}):jsx($,{as:"--label",children:Array.isArray(b)?b.length>0?`${b.length} selected`:r||"Choose":b?.label||r||"Choose"})}),jsx(c,{className:"--svg-arrow rel flex aic jcc",children:y?typeof i=="string"?jsx(ee,{name:i,as:"--search-action"}):i:typeof p=="string"?jsx(ee,{name:p,as:"--search-action"}):p})]}),jsxs(c,{id:G,className:"--options-list -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!y,style:{maxHeight:m||"auto"},ref:H,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:y,duration:.05},children:[u&&jsx(c,{as:"--select-search --sticky",children:jsx(ie,{ref:E,onChange:A=>{M(A.target.value==""?null:A.target.value);},className:"--search-input",placeholder:f||"Search..."})}),o.filter(A=>!D||A.label.toLowerCase().includes(D.toLowerCase())).map(A=>jsx(As,{updateValue:J,checkIcon:R,selected:te(A),o:A},`option-${(typeof A=="string"?A:A.label).replace(/\s+/g,"-")}-${typeof A=="string"?A:A.value}`))]})]})};$s.displayName="Zuz.Select";var Tp=$s;var zs=forwardRef((e,n)=>jsx(wt,{type:Le.Switch,...e,ref:n}));zs.displayName="Zuz.Switch";var Ip=zs;var Fs=e=>{let{idx:n,id:t,as:o,weight:r,style:s,value:a,render:u,resize:f,sortBy:m,sortable:p,onSort:i}=e,[l,d]=useState(0),T=()=>{p&&(i?.(String(t),l==1?-1:1),d(S=>S==1?-1:1));};return jsxs(c,{style:{flex:r||1,...s},as:`--col flex aic ${o||""} ${p?"--sortable":""}`,onClick:T,children:[jsx(c,{children:a}),n==-1&&p&&m==t&&jsx(c,{as:"--arrow flex aib",children:l==1?k.arrowUp:k.arrowDown})]})};Fs.displayName="Zuz.Column";var Jt=Fs;var Ks=e=>{let{index:n,pubsub:t,schema:o,data:r,ids:s,styles:a,animate:u,sortBy:f,selectable:m,tableRef:p,loading:i,rowClassName:l,onSort:d,onRowClick:T,onSelect:S,onContextMenu:C}=e,R=useDelayed(),I=useMemo(()=>({transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(n+1)}),[]),P=useRef(null),g=(h,y)=>{n==-1?t.emit(`ALL_ROWS_${h?"CHECKED":"UNCHECKED"}`,h):(S&&S(r,h),t.emit(`ROW_${h?"CHECKED":"UNCHECKED"}`,h,y));},b=(h,y,N)=>jsx(Jt,{idx:h,id:y,as:"--selector",pubsub:t,value:jsx(wt,{value:N,ref:P,onSwitch:g,type:Le.Default})});return useEffect(()=>{let h=(M,z)=>{P.current?.setChecked(M,false);},y=(M,z)=>{let E=false;p?.current&&p.current.querySelectorAll(".--row").forEach(H=>{let V=H;if(!V.classList.contains("--row-head")){let G=V.querySelector(".--selector input[type=checkbox]");G&&G.checked&&!E&&(E=G.checked);}}),P.current.setChecked(E,false);},N=M=>{P.current?.setChecked(M,false),S&&S(r,M);},D=M=>{P.current?.setChecked(M,false),S&&S(r,M);};return n==-1?(t.on("ROW_CHECKED",h),t.on("ROW_UNCHECKED",y),()=>{t.off("ROW_CHECKED",h),t.off("ROW_UNCHECKED",y);}):(t.on("ALL_ROWS_CHECKED",N),t.on("ALL_ROWS_UNCHECKED",D),()=>{t.off("ALL_ROWS_CHECKED",N),t.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(c,{onContextMenu:h=>C?C(h,r):null,onClick:h=>T?T(h,e.data):()=>{},...u?{fx:{...I,when:R}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${n==-1?"--row-head":""} ${l||""}`,children:[n==-1&&o.map((h,y)=>{let{renderWhenHeader:N,render:D,value:M,...z}=h;return jsxs(Fragment,{children:[m&&y==0&&b(-1,`--selector-${h.id}`,"all"),jsx(Jt,{idx:-1,onSort:d,sortBy:f,value:M,...z,pubsub:t,style:a[h.id]})]},`--col-${h.id}`)}),i&&n>-1&&jsx(c,{as:"--col",children:jsx($,{as:"opacity:0",children:"..."})}),!i&&n>-1&&s&&r&&o.map((h,y)=>jsxs(Fragment,{children:[m&&y==0&&b(y,`--selector-${h.id}`,h.id.toString()),s.includes(String(h.id))?jsx(Jt,{pubsub:t,idx:y,id:String(h.id),style:a[String(h.id)],value:h.render?h.render(r,n):r[String(h.id).includes(".")?String(h.id).split(".").reverse()[0]:h.id]}):null]},`--${String(h.id)}-val-${y}`))]})};Ks.displayName="Zuz.Row";var eo=Ks;var qs=(e,n)=>{let{schema:t,rows:o,rowCount:r,rowsPerPage:s,currentPage:a,pagination:u,paginationHash:f,showPaginationOnZeroPageCount:m,animateRows:p,header:i,rowClassName:l,selectableRows:d,hoverable:T,sortBy:S,loading:C,loadingRowCount:R,loadingMessage:I,spinner:P,emptyMessage:g,onSort:b,onRowClick:h,onRowSelectToggle:y,onPageChange:N,onRowContextMenu:D,...M}=e,z=useRef(null),E=useMemo(()=>t.reduce((ce,oe)=>(ce[oe.id]={flex:oe.weight||1,...oe.w&&{width:oe.w},...oe.maxW&&{maxWidth:oe.maxW},...oe.minW&&{minWidth:oe.minW},...oe.h&&{height:oe.h},...oe.maxH&&{maxHeight:oe.maxH},...oe.minH&&{minHeight:oe.minH}},ce),{}),[t]),H=useMemo(()=>Object.keys(E),[t]),V=useMemo(()=>i??true,[i]),{style:G,className:x,rest:L}=B(M),Z=useRef(null),U=useMemo(()=>new PubSub,[]),F=useRef(o.map(()=>uuid(8))),[K,te]=useState(S||null),[J,j]=useState(I||"loading"),A=useMemo(()=>!C&&o&&o.length==0,[C,o]),W=useCallback(()=>g?typeof g=="function"?jsx(g,{}):g:jsx($,{as:"tac s:18 mt:75",children:"No Record Found"}),[C,o]);useEffect(()=>{F.current=o.map(()=>uuid(8));},[o]);let re=(ce,oe)=>{te(ce),b?.(ce,oe);},le=(r||(o?o.length:0))/(s||10),de=useMemo(()=>m||le>1?jsx(bt,{hash:f,ref:z,renderOnZeroPageCount:m,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:r||(o?o.length:0),itemsPerPage:s||10}):null,[a,r]);return useImperativeHandle(n,()=>({setLoading(ce){}})),jsxs(c,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${x}`,ref:Z,children:[V==true&&jsx(eo,{sortBy:K,onSort:re,tableRef:Z,pubsub:U,selectable:d,index:-1,schema:t,loading:true,styles:E}),C&&jsxs(c,{as:"center-x flex aic --table-spinner",children:[jsx(Te,{type:P||fe.Simple}),J&&jsx($,{as:"--table-loading-message",children:J})]}),C&&Array(R||5).fill({}).map((ce,oe)=>jsx(eo,{tableRef:Z,index:oe,pubsub:U,schema:t,styles:E,loading:true,animate:p,onRowClick:h},`--trow-loading-${oe}-${t[0].id}`)),!C&&o&&o.map((ce,oe)=>jsx(eo,{tableRef:Z,pubsub:U,loading:false,index:oe,schema:t,ids:H,styles:E,animate:p,data:ce,onRowClick:h,rowClassName:l,selectable:d,onSelect:y,onContextMenu:D},`--trow-${F.current[oe]||oe}-${t[0].id}`)),A&&W(),u&&de&&jsx(c,{"aria-hidden":!u||!de,...p?{fx:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(o.length+1),when:!C&&o&&u&&de!=null}}:{},as:"--row flex aic --row-footer",children:de})]})};qs.displayName="Zuz.Table";var $p=forwardRef(qs),zp=$p;var Fp=({ref:e,...n})=>{let{title:t,items:o}=n,[r,s]=useState(0),a=(u,f,m)=>{u.preventDefault(),s(f),document.getElementById(m)?.scrollIntoView({behavior:"smooth"});};return jsxs(c,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx($,{as:"--toc-title",children:t}),jsx(Ge,{items:o.map((u,f)=>jsx("a",{className:r==f?"--toc-active":"",style:{anchorName:r===f?"--toc-active":"none",color:r==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:m=>a(m,f,u.tag),href:`#${u.tag}`,children:u.label}))})]})},Zp=Fp;var Xs=({isActive:e,transitionType:n,speed:t,width:o,render:r,content:s,onHeightChange:a})=>{let u=useRef(null),f=useResizeObserver(u);useEffect(()=>{e&&f.height>0&&a(f.height);},[e,f.height]);let p=useMemo(()=>{let i={width:o>0?`${o}px`:"100%",minWidth:o>0?`${o}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return n==="fade"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:n==="scale"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:i},[e,n,o,t]);return jsx(c,{ref:u,style:{...p},className:"--content",children:r||e?s:null})};Xs.displayName="Zuz.TabBody";var Ys=Xs;var Js=({ref:e,...n})=>{let{tabs:t,speed:o=.3,prerender:r=true,variant:s,tabStyle:a="fixed",onChange:u,transitionType:f="slide",...m}=n,[p,i]=useState(0),l=useRef(null),d=useResizeObserver(l),T=useMemo(()=>uuid(8),[]),[S,C]=useState("auto"),R=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(e,()=>({setTab:y=>i(y)}));let I=useMemo(()=>t.map(y=>({...y,key:y.key||uuid(8)})),[t]),{style:P,className:g,rest:b}=B({as:`flex cols w-full no-overflow ${m.as||""}`,...m}),h=()=>{if(!R)return {opacity:0};switch(f){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${I.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${p*d.width}px, 0, 0)`,transition:`transform ${o}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(c,{ref:l,style:P,className:`--tabview --${a} flex cols ${g}`,children:[jsx(St,{as:"--tabview-head",onSwitch:y=>{i(y.index);let N=I.find(D=>D.tag==y.tag);N&&N.onSelect&&(N.onSelect(N,y.index),u?.(N,y.index));},selected:p,items:I.reduce((y,N,D)=>(y.push({icon:N.icon,index:D,label:N.label,tag:N.tag}),y),[])}),jsx(c,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:S,transition:R?`height ${o}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(c,{className:"--track",style:{...h()},children:I.map((y,N)=>jsx(Ys,{isActive:N===p,transitionType:f,speed:o,width:d.width,render:r||N===p,onHeightChange:D=>N===p&&C(D),content:y.body},`tab-body-${y.key||N}-${T}`))})})]})};Js.displayName="Zuz.TabView";var Jp=Js;var ru=({ref:e,commands:n,onCommand:t,welcomeMessage:o="Welcome to Zuz Terminal v1.0.0",prompt:r="zuz ~ ",variant:s,...a})=>{let[u,f]=useState([{type:"output",content:o}]),[m,p]=useState(""),i=useRef(null),l=useRef(null),{variant:d}=Q(true);useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight);},[u]);let T=g=>{let b=typeof g=="string"?{type:"output",content:g}:g;f(h=>{let y=[...h,b];return y.length>1e3?y.slice(-1e3):y});},S=()=>f([]);useImperativeHandle(e,()=>({write:T,clear:S}));let C=async g=>{let[b,...h]=g.split(" "),y=b.toLowerCase();return n&&n[y]?await n[y](h):t?await t(g):`command not found: ${b}`},R=g=>{let b=/\u001b\[(\d+)m/g,h=[],y={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",M=false,z;for(;(z=b.exec(g))!==null;){let H=g.slice(N,z.index);H&&h.push({text:H,color:D,bold:M});let V=z[1];V==="0"?(D="#d4d4d4",M=false):V==="1"?M=true:y[V]&&(D=y[V]),N=b.lastIndex;}let E=g.slice(N);return E&&h.push({text:E,color:D,bold:M}),h},I=(g,b)=>g.includes("\x1B")?R(g).map((h,y)=>jsx(se,{style:{color:h.color||"#d4d4d4",fontWeight:h.bold?"bold":"normal"},children:h.text},`--terminal-msg-${y}-${h.text.replace(/\S+/g,"-")}`)):jsx(se,{style:{color:b==="error"?"#ff5f56":b==="command"?"#00ff00":"#d4d4d4"},children:g}),P=async g=>{if(g.key==="Enter"&&m.trim()){let b=m.trim(),h=[...u,{type:"command",content:`${r}${b}`}];p(""),f(h);let y=await C(b);f(N=>[...N,{type:"output",content:y}]);}};return jsxs(c,{as:`--zuz-terminal --${s||d||q.Medium} flex cols ${a.className}`,onClick:()=>l.current?.focus(),children:[jsx(c,{ref:i,className:"--terminal-log",children:u.map((g,b)=>jsx(c,{children:jsx($,{children:I(g.content,g.type)})},b))}),jsxs(c,{as:"flex aic --terminal-input",children:[jsx($,{as:"--terminal-prompt",children:r}),jsx(ie,{ref:l,className:"--zuz-term-input",autoFocus:true,value:m,variant:s||d||q.Medium,onChange:g=>p(g.target.value),onKeyDown:P})]})]})},nu=ru;var su=({meta:e})=>jsxs(_,{as:"flex aic --command-item",children:[e.icon&&jsx(ee,{name:e.icon,as:"--command-icon"}),jsx($,{children:e.label})]}),au=({position:e,onSelect:n,commands:t,visible:o})=>jsx(c,{"aria-hidden":!o,fx:{transition:X.SlideInBottom,duration:.1,when:o},className:"--command-box abs grid",style:{...e},children:t.map(r=>jsx(su,{meta:r},`cmd-${r.label.replace(/\s+/,"-")}`))}),ra=au;var aa=forwardRef((e,n)=>{let{autoResize:t,maxHeight:o,variant:r,resize:s="none",command:a,commands:u,onInput:f,cmd:m,renderDropdown:p,value:i,defaultValue:l,...d}=e,T=useRef(null),S=useRef(null),{variant:C}=Q(true),{style:R,className:I,rest:P}=B(d),{showDropdown:g,dropdownPosition:b,handleKeyDown:h,handleInput:y,handleCommandSelect:N}=useCommandActions({command:a,commands:u,cmd:m,ref:T}),D=useCallback(()=>{let z=T.current;!z||!t||(S.current&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{z.style.height="auto";let E=z.scrollHeight;if(o){let H=parseInt(o.toString(),10);isNaN(H)||(E=Math.min(E,H));}z.style.height=`${E}px`,z.style.overflowY=o&&E>=parseInt(o.toString(),10)?"auto":"hidden";}));},[t,o]),M=z=>{f?.(z),y(z),D();};return useEffect(()=>{D();},[i,l,D]),useEffect(()=>{t&&T.current&&D();},[t,D]),useEffect(()=>()=>{S.current&&cancelAnimationFrame(S.current);},[]),jsxs(c,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${r||C||q.Medium} flex ${I}`.trim(),style:{...R,resize:s,height:t?"auto":R?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:h,onInput:M,ref:z=>{typeof n=="function"?n(z):n&&(n.current=z),T.current=z;},value:i,defaultValue:l,...P}),p?p({show:g,position:b,commands:u||[],onSelect:N}):u&&u.length>0&&jsx(ra,{visible:g,commands:u,onSelect:N,position:b})]})});aa.displayName="Zuz.TextArea";var pu=aa;var la=forwardRef((e,n)=>{let{as:t,value:o,color:r,direction:s,...a}=e,u=useRef(null),[f,m]=useState(o||0);return useImperativeHandle(n,()=>({updateValue(p){f.toString().length!==p.toString().length&&m(p);},setValue(p){if(this.updateValue(p),u.current){let i=p.toString().split("");u.current.querySelectorAll(".--wheel-char").forEach((l,d)=>{let T=i[d];if(l instanceof HTMLElement){l.setAttribute("data-value",T);let S=l.querySelector(".--wheel-char-track");S instanceof HTMLElement&&(S.style.setProperty("--v",T),S.offsetWidth);}});}}})),useEffect(()=>{m(o||0);},[o]),jsxs(c,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:u,...a,children:[(f||0).toString().split("").map((p,i)=>isNaN(parseInt(p,10))?jsx(se,{className:"--wheel-char wheel-char-symbol grid",children:p},`wheel-char-symbol-${i}`):jsx(se,{"data-value":p,className:`--wheel-char grid ${i>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(se,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":p},children:[jsx(se,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((l,d)=>jsx(se,{children:l},`${i}--${d}`)),jsx(se,{children:!s||s==="down"?9:0})]})},`wheel-char-${i}`)),r&&jsx(c,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${r}, transparent, transparent, transparent, ${r})`}})]})});la.displayName="Zuz.TextWheel";var xu=la;var sr=forwardRef((e,n)=>{let{as:t,meta:o,nodes:r,icons:s,onSelect:a,treeTag:u,selected:f,roots:m,expanded:p,...i}=e,{tag:l,label:d,icon:T,under:S,isHead:C}=o,R=useMemo(()=>m.includes(l),[m]),[I,P]=useState(p),g=()=>{localStorage.setItem(`--tn${u}-${l}`,I?"0":"1"),P(!I);};useEffect(()=>{p||R&&!localStorage.getItem(`--tn${u}-${l}`)?(localStorage.setItem(`--tn${u}-${l}`,"1"),P(true)):P(localStorage.getItem(`--tn${u}-${l}`)=="1");},[]);let b=useMemo(()=>r.filter(h=>h.under==l),[r,l]);return jsxs(c,{className:`--treenode ${R?"--is-root":""} --treenode-${l} flex cols`,children:[jsxs(c,{className:`--node --node-${l} flex aic ${f==l?" --selected":""}`,children:[jsx(_,{skeleton:i.skeleton,onClick:g,className:"--node-aro-btn",disabled:b.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(ee,{skeleton:i.skeleton,className:"--node-aro-icon",name:b.length==0?s?.arrowDisabled||s?.arrowClose:I?s?.arrowOpen:s?.arrowClose}):b.length==0?k.chevronBottom:I?k.chevronBottom:k.chevronRight}),jsxs(_,{className:"--node-meta flex aic",onClick:h=>a(l),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(ee,{skeleton:i.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:T||(I?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx($,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:i.skeleton,children:d})]})]}),I&&b.length>0&&jsx(c,{className:`--sub-node tree-sub-node-${l} flex cols`,children:b.map(h=>jsx(sr,{treeTag:u,selected:f,onSelect:a,icons:s,roots:m,expanded:h.expanded||false,meta:h,nodes:r},`--node-${h.tag}`))})]})});sr.displayName="TreeItem";var ma=sr;var ua=forwardRef((e,n)=>{let{as:t,nodes:o,onNodeSelect:r,tag:s,icons:a,roots:u,selected:f,...m}=e,[p,i]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>p}),[r]);let l=d=>{i(d),r&&r(d);};return useEffect(()=>{p!=f&&i(f);},[f]),jsx(c,{className:"--treeview flex cols",children:o.filter(d=>u.includes(d.tag)).map(d=>jsx(ma,{treeTag:s?`-${s}`:"",selected:p,onSelect:T=>l(T),icons:a,meta:d,roots:u,expanded:d.expanded||false,skeleton:m.skeleton,nodes:o},`--node-${d.tag}`))})});ua.displayName="Zuz.TreeView";var Iu=ua;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
- export{Se as ALERT,mr as AVATAR,Yi as Accordion,ol as ActionBar,sl as Alert,Cl as AutoComplete,Ll as Avatar,Ml as Badge,c as Box,dc as Bubble,On as BubbleMediaType,Mn as BubbleStatus,_ as Button,Bn as CHART,Le as CHECKBOX,Eu as COLORTHEME,Oo as Calendar,nc as Carousel,pc as Chart,wt as CheckBox,Pc as CodeBlock,zc as ColorScheme,ho as ContextMenu,Kc as CookiesConsent,Re as Cover,nm as CropShape,om as Cropper,am as Crumb,Mu as DATATYPE,Qe as DIALOG,pr as DIALOG_ACTION_POSITION,he as DRAWER_SIDE,mm as DatePicker,wo as Dialog,Po as Drawer,Bt as FILTER,ke as FORMVALIDATION,Ou as FORMVALIDATION_STYLE,dm as Fab,ym as Filters,Ae as Flex,km as Form,Hm as Grid,yo as Group,ee as Icon,Ue as Image,ie as Input,Yo as KeyboardKeys,ds as KeysLabelMap,fs as KeysMap,vt as Label,fo as LayersProvider,Ge as List,Um as MediaPlayer,Qm as NetworkStatus,pt as ORIGIN,Lu as OriginType,Fe as Overlay,mt as POSITION,Hu as PROGRESS,bt as Pagination,Kt as PaginationStyle,np as Password,lp as PinInput,pe as Position,Ke as ProgressBar,ao as RADIO,up as Radio,Ce as SHEET,no as SHEET_ACTION_POSITION,Bu as SKELETON,so as SLIDER,ku as SORT,fe as SPINNER,So as ScrollView,bp as Search,Tp as Select,St as SelectTabs,Cm as Sheet,Je as Slider,Vt as SnackPosition,qr as SnackStyle,At as SnackType,se as Span,Te as Spinner,Du as Status,Ip as Switch,X as TRANSITIONS,Y as TRANSITION_CURVES,Jp as TabView,zp as Table,Zp as TableOfContents,nu as Terminal,$ as Text,xu as TextWheel,pu as Textarea,Sa as ThemeProvider,Xr as ToastDefaultTitle,Vt as ToastPosition,Io as ToastProvider,qr as ToastStyle,At as ToastType,Fo as ToolTip,Iu as TreeView,q as Variant,ut as animationTransition,io as buildClassString,dr as buildWithStyles,tf as css,lo as getAnimationCurve,of as getAnimationTransition,ga as getZuzMap,us as isKeyCombination,fr as setZuzMap,B as useBase,Ii as useContextMenu,Bi as useDialog,ki as useDrawer,ue as useFx,Di as useMorph,ht as usePosition,Fi as useSnack,Ro as useToast};
8
+ document.documentElement.style.colorScheme = theme;`}}),jsx(go,{children:e})]})},xr=(e,n)=>{if(wa)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||n};var vr=({ref:e,...n})=>{let{style:t,...o}=n,{style:r,className:s,rest:a}=B(o);return jsx("span",{ref:e,style:t,className:s,...a})};vr.displayName="Zuz.Span";var se=vr;var Sr=forwardRef((e,n)=>{let{name:t,pathCount:o,variant:r,color:s,size:a,...u}=e,{variant:f}=Q(true),{className:m,style:p,rest:i}=B(u);return jsx("div",{style:{color:s,...p,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${r||f||q.Small} ${m}`.trim(),ref:n,...i,children:Array(o||0).fill(0).map((l,d)=>jsx(se,{className:`path${d+1}`},`${t}-layer-${d}`))})});Sr.displayName="Zuz.Icon";var ee=Sr;var fe={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Cr=e=>{let{type:n,variant:t,color:o,...r}=e,{className:s,style:a,rest:u}=B(r),{spinner:f}=Q(true),m=()=>{switch(n||f?.type||fe.Simple){case fe.Simple:return null;case fe.Wave:return jsxs(Fragment$1,{children:[jsx(c,{as:"--bar --bar1"}),jsx(c,{as:"--bar --bar2"}),jsx(c,{as:"--bar --bar3"})]});case fe.Roller:return null}};return jsx(c,{className:`${s} --spinner --${(n||f?.type||fe.Simple).toLowerCase()} --${t||f?.variant||q.Small}`.trim(),style:{...a},...u,children:m()})};Cr.displayName="Zuz.Spinner";var Te=Cr;var Mt={Loading:"loading",Normal:"normal"};var Pr=({ref:e,...n})=>{let{reset:t,kind:o="solid",variant:r,icon:s,iconSize:a,children:u,withLabel:f,spinner:m,state:p,disabled:i,...l}=n,{style:d,className:C,rest:T}=B(l),{variant:b}=Q(true);return jsxs("button",{className:removeDuplicateWords(`--button --${o} --${r||b} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${C}`).trim().replace(/\s+/g," "),style:d,ref:e,disabled:p==Mt.Loading||n.skeleton?.enabled||i,...T,children:[p==Mt.Loading&&jsx(Te,{variant:r||b,type:m||fe.Simple}),(!p||p==Mt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(ee,{variant:a,name:s}),f===true?jsx(se,{children:u}):u]})]})};Pr.displayName="Zuz.Button";var $=Pr;var Rr=forwardRef((e,n)=>{let{h:t,html:o,children:r,lines:s,...a}=e,{style:u,className:f,rest:m}=B(a),p=`h${e.h||1}`;return jsx(p,{ref:n,style:u,className:f,...m,children:o?jsx(se,{dangerouslySetInnerHTML:{__html:o}}):r})});Rr.displayName="Zuz.Text";var _=Rr;var La=e=>{let{label:n,labelColor:t,icon:o,iconColor:r,index:s,className:a,onSelect:u}=e;return n=="-"?jsx(c,{className:"--line"}):jsxs($,{reset:true,onClick:f=>u?.(e),className:`--item ${a||""}`.trim(),children:[jsx(c,{as:"--icon",children:jsx(ee,{name:o,className:"--ico",style:r?{color:r}:{}})}),jsx(_,{className:"--lbl flex aic",style:t?{color:t}:{},children:n})]})},Nr=La;var kr=({ref:e,...n})=>{let{id:t,as:o,fx:r,offsetX:s,offsetY:a,parent:u,event:f,arrow:m,when:p,items:i,header:l,footer:d,origin:C=pt.TopRight,...T}=n,[b,R]=useState(false),[P,I]=useState(i||[]),{position:g,targetRef:v,calculatedAnchor:h}=useAnchorPosition(u?.current,f,{offsetX:s,offsetY:a,preferredAnchor:C}),N=u&&g.top>u.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",D=useMemo(()=>{let G=h.toLowerCase();return G.includes("left")?"--arrow-left":G.includes("right")?"--arrow-right":"--arrow-center"},[h]),M=g.top!==0||g.left!==0;useEffect(()=>{p&&M?R(true):p||R(false);},[p,M]);let{className:A,style:E,rest:H}=B(T),z=ue({...r?.transition?{transition:r.transition??X.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:r?.curve??Y.EaseInOut,duration:r?.duration??.05,when:b&&M});return jsxs(c,{ref:v,className:`--contextmenu ${m||u!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!b,style:{...E,...z.style,top:g.top,left:g.left,visibility:M?"visible":"hidden",transformOrigin:h},...H,children:[typeof l=="function"?createElement(l):l,P.map((G,x)=>jsx(Nr,{...G,index:x},`context-${G.label.toLowerCase()}-${x}`)),typeof d=="function"?createElement(d):d]})};kr.displayName="Zuz.ContextMenu";var yo=kr;var Lr=forwardRef((e,n)=>{let{children:t,fx:o,when:r,fxDelay:s,fxStep:a,classToIgnore:u,...f}=e,m=Q(true),p=useDelayed(),i=o||m?.group?.fx,l=s||m?.group?.fxDelay,d=a||m?.group?.fxStep,C=u||m?.group?.classToIgnore||"-fx",T=useMemo(()=>i?addPropsToChildren(t,b=>{if(b.type===Fragment)return false;let R=b.props||{},P="fx"in R,I=R.as?Array.isArray(R.as)?R.as.join(" "):R.as:R.className||"",g=typeof I=="string"&&I.includes(C);return !P&&!g},b=>({fx:{...i,delay:(l||0)+b*(d||.1),when:r??(o?.when||p)}})):t,[t,r,p,i]);return jsx(c,{className:"--group",ref:n,...f,children:T})});Lr.displayName="Zuz.Group";var xo=Lr;var Or=forwardRef((e,n)=>{let{message:t,spinner:o,spinnerSize:r,color:s,when:a,hideMessage:u,...f}=e,{className:m,style:p,rest:i}=B(f),{spinner:l}=Q(true);return "when"in e&&e.when==false?null:jsxs(xo,{fx:{transition:X.SlideInBottom,curve:Y.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${m}`.trim(),style:{...p,backgroundColor:"var(--cover-bg)"},...i,children:[jsx(Te,{variant:r||l?.variant||q.Small,type:o||l?.type||fe.Simple}),!u&&jsx(_,{className:"--label",style:{color:"var(--cover-label)"},children:t||"loading"})]})});Or.displayName="Zuz.Cover";var Ne=Or;var bo=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(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(t=>t!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},Pe=new bo;var Dr=forwardRef((e,n)=>{let{when:t,...o}=e;return jsx(c,{ref:n,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:X.FadeIn,when:t},...o})});Dr.displayName="Zuz.Overlay";var Fe=Dr;var Xa=({action:e,render:n=true,message:t=""})=>jsx(c,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:n?t:null}),Hr=Xa;var Qa=({action:e,actionPosition:n,dialogID:t,variant:o})=>jsx(c,{as:`--footer flex aic rel ${n?n==pr.Center?"jcc":"":"jce"}`.trim(),children:e.map((r,s)=>jsx($,{variant:o,onClick:a=>r.handler?r.handler():r.onClick?r.onClick():console.log("onClick Handler missing"),as:"--action",children:r.label},`dialog-${t}-action-${r.key}`))}),Vr=Qa;var ja={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"})," "]}),[Se.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"})}),[Se.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"})}),[Se.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"})}),[Se.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"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),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"})]})},L=ja;var Ja=({title:e="Alert",onClose:n})=>jsxs(c,{as:"--head flex aic rel",children:[jsx(c,{as:`--${e?"title":"dot"} flex aic jcc rel`,children:e}),jsx($,{onClick:t=>n(),className:"--closer abs center-v",children:L.close})]}),zr=Ja;var Zr=({ref:e,...n})=>{let{index:t,id:o,title:r,message:s,transition:a,curve:u,speed:f,type:m,action:p,actionPosition:i,spinner:l,loadingMessage:d,variant:C,inBackground:T,forceClose:b,forceLoading:R,onClose:P,onShow:I,onHide:g,...v}=n,h=useMemo(()=>uuid(12),[]),[y,N]=useState(r||""),[D,M]=useState(s||""),[A,E]=useState(m||Qe.Dialog),[H,z]=useState(false),[G,x]=useState(true),[k,Z]=useState(p||null),[U,F]=useState(false),{variant:K,spinner:te,dialog:J}=Q(true),j=C||J?.variant||K||q.Small,{style:V,className:W,rest:re}=B(v),ce=useRef(null),de=ue({when:H,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:a||J?.transition||X.SlideInBottom,curve:u||J?.curve||Y.EaseInOut,watch:["scale","filter","transform"]}),ie=()=>{z(false),P(o);},oe=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(ie)&&ie();}}],[H]);useShortcuts(oe),useEffect(()=>{E(Qe.Dialog),M(s),N(y),k&&Z(k.reduce((ae,ve)=>(ae.push({...ve,key:ve.key||uuid(12)}),ae),[])),z(true),setTimeout(()=>I?I():()=>{},500);},[]),useEffect(()=>{b&&ie();},[b]),useEffect(()=>{R!=null&&F(R);},[R]),useEffect(()=>(H?Pe.push(ie):Pe.pop(ie),()=>Pe.pop(ie)),[H]);let ne=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Fe,{style:{zIndex:ne},when:H}),jsxs(c,{as:`--dialog --${(m??Qe.Default).toLowerCase()} ${H?"--visible":""} ${W} fixed abc`.trim(),style:{...de.style,zIndex:ne+1,pointerEvents:T==true?"none":"auto",...T==true?{scale:"0.92",filter:"blur(2px)"}:{}},...re,ref:ce,children:[jsx(zr,{title:y,onClose:ie}),jsx(Hr,{message:D,render:G,action:k}),k&&k.length>0&&jsx(Vr,{variant:j,action:k,dialogID:h,actionPosition:i}),jsx(Ne,{when:U,spinner:l||J?.spinner||te?.type||fe.Simple,message:d||J?.loadingMessage})]})]})};Zr.displayName="Zuz.Dialog";var wo=Zr;var Kr=forwardRef((e,n)=>{let{speed:t,style:o,...r}=e,{rootRef:s,containerRef:a,thumbY:u,thumbX:f,onScrollY:m,onScrollX:p}=useScrollbar(t||1),{style:i,className:l,rest:d}=B(r);return useEffect(()=>{let C=a.current;if(!C)return;let T=()=>{window.dispatchEvent(new Event("resize"));};return C.addEventListener("scroll",T),()=>C.removeEventListener("scroll",T)},[]),jsxs(c,{ref:s,className:l.trim(),as:"--scrollview rel",children:[jsx(c,{as:`--scroll-content ${l}`.trim(),ref:a,style:o||{},children:d.children}),jsx(c,{as:"--scroll-track --track-y --abs",children:jsx(c,{as:"--scroll-thumb --abs",ref:u,onMouseDown:m})}),jsx(c,{as:"--scroll-track --track-x --abs",children:jsx(c,{as:"--scroll-thumb --abs",ref:f,onMouseDown:p})})]})});Kr.displayName="Zuz.ScrollView";var So=Kr;var Wr=({ref:e,...n})=>{let{id:t,index:o,from:r,speed:s,children:a,margin:u,animation:f,prerender:m,inBackground:p,forceClose:i,forceLoading:l,onClose:d,...C}=n,{drawer:T}=Q(true),[b,R]=useState(a),[P,I]=useState(false),[g,v]=useState(m??(T?.prerender||true)),[h,y]=useState(false),N=()=>{I(false),d?.(t??-1);},{className:D,style:M,rest:A}=B(C),E=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Pe.isTop(N)&&N();}}],[P]);useShortcuts(E),useEffect(()=>{R(a);},[a]),useEffect(()=>(P?Pe.push(N):Pe.pop(N),()=>Pe.pop(N)),[P]),useEffect(()=>{I(true);},[]),useEffect(()=>{i&&N();},[i]),useEffect(()=>{l!=null&&y(l);},[l]);let H=r||T?.from||he.Left,z=useMemo(()=>{switch(H){case he.Left:return {from:{x:"-100vw"},to:{x:0}};case he.Right:return {from:{x:"100vw"},to:{x:0}};case he.Top:return {from:{y:"-100vh"},to:{y:0}};case he.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[r,T?.from]),G=ue({from:{...z.from,opacity:0},to:{...z.to,opacity:1},when:P,curve:f||T?.animation||Y.EaseInOut,duration:s||T?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(o||1)*10,[o]);return jsxs(Fragment$1,{children:[jsx(Fe,{onClick:k=>{P&&N();},when:P,style:{zIndex:x}}),jsxs(c,{ref:e,"aria-hidden":!P,className:`--drawer flex cols ${D} --${H.toLowerCase()} fixed`,style:{...M,...G.style,"--m":`${u||T?.margin||0}px`,zIndex:x+1,pointerEvents:p==true?"none":"auto",...p==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[r==he.Top||r==he.Bottom?jsx(c,{className:"--handle"}):null,jsx($,{as:"--close-drawer --abs",onClick:N,children:L.close}),jsxs(So,{as:"rel",children:[g||P?b:null,jsx(Ne,{when:h})]})]})]})};Wr.displayName="Zuz.Drawer";var Po=Wr;var Ur=forwardRef((e,n)=>{let{progress:t,type:o,animated:r,...s}=e,a=useRef(null);useImperativeHandle(n,()=>({setProgress:p=>{a.current.style.width=`${p*100}%`,a.current.setAttribute("data-value",p+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(r?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:u,style:f,rest:m}=B(s);return jsx(c,{className:`--progress ${r?"--animated":""} flex rel ${u}`.trim(),style:f,...m,children:jsx(c,{ref:a,className:"--bar rel"})})});Ur.displayName="Zuz.ProgressBar";var Ke=Ur;var Vt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Vt||{}),$t=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))($t||{}),qr=(t=>(t.Stack="stack",t.Individual="individual",t))(qr||{}),Xr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var hi=e=>{let{index:n,id:t,type:o,icon:r,title:s,message:a,duration:u,sticky:f=false,actions:m=[],position:p,style:i,isHovered:l,total:d,progress:C,forceClose:T,variant:b,onClick:R,onClose:P}=e,[I,g]=useState(false),[v,h]=useState(false),{toast:y}=Q(true),N=v||T,D=p||y?.position||"TopCenter",M=o||y?.type||"default",A=i||y?.style||"stack",E=u||y?.duration||4,H=C||y?.progress||false,z=useRef(E*1e3),G=useRef(void 0),x=useRef(void 0),k=useRef(null),Z=ue({when:I&&!N,duration:.3,transition:y?.transition||(D.includes("Top")?X.SlideInTop:D.includes("Bottom")?X.SlideInBottom:D.includes("Left")?X.SlideInLeft:X.SlideInRight),curve:y?.curve||Y.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{g(true);let W=re=>{if(x.current!==void 0){let ce=re-x.current;if(!l&&!f&&!N&&(z.current-=ce,k.current)){let de=Math.max(0,z.current/(E*1e3)*100);k.current?.setProgress?.(de/100);}}x.current=re,z.current<=0?h(true):G.current=requestAnimationFrame(W);};return G.current=requestAnimationFrame(W),()=>{G.current&&cancelAnimationFrame(G.current);}},[l,f,N,E]),useEffect(()=>{if(N){let W=setTimeout(()=>{P?.(t);},350);return ()=>clearTimeout(W)}},[N,t]);let U=A==="stack",F=l?n*65:n*8,K=l?1:Math.max(.85,1-n*.05),te=l?1:Math.max(.4,1-n*.2),J=()=>{R?R():(!m||m.length===0)&&h(true);},j=Z.style.transform||"translate(0, 0)",V=N?j:`${j} translateY(${D.includes("Top")?F:-F}px) scale(${K})`;return jsxs(c,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${b||y?.variant||q.Medium} --${M} --${D.toLowerCase()} abs flex aic`,style:{...Z.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?Z.style.opacity:te,transform:V,filter:!N&&U&&!l&&n>0?"blur(1px)":"none",cursor:!m||m.length===0?"pointer":"default",transition:`${Z.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(c,{as:"--ico flex aic jcc",children:r?jsx(ee,{name:r}):jsx(c,{as:"--no-icon"})}),jsxs(c,{as:"--meta flex cols",children:[jsx(_,{as:"--tt",children:s||Xr[o]}),jsx(_,{as:"--tm",children:a})]}),m&&m.length>0&&jsx(c,{as:"--actions flex gap:5",children:m.map((W,re)=>jsx($,{as:"--snack-btn bold",onClick:ce=>{ce.stopPropagation(),W.onClick();},children:W.label},re))}),H&&jsx(Ke,{as:"abs",ref:k})]})},Io=hi;var ye=createContext(null),Si=({ref:e,...n})=>{let o=useContext(ye)?.depth??0,[r,s]=useState(null),[a,u]=useState(null),[f,m]=useState(false),[p,i]=useState([]),l=useDelayed(),d=useRef(0),C=()=>++d.current,T=()=>{m(false),setTimeout(()=>u(null),200);};useImperativeHandle(e,()=>({add(g){let v=C(),h={id:v,...g};return i(y=>[...y,h]),v},openMenu(g){m(false),setTimeout(()=>{u({id:C(),type:"menu",props:g}),m(true);},16);},remove(g){i(v=>v.map(h=>h.id===g?{...h,props:{...h.props,forceClose:true}}:h)),a?.id===g&&T();},loading(g,v){i(h=>h.map(y=>y.id===g?{...y,props:{...y.props,forceLoading:v}}:y)),a?.id===g&&T();},clear(g){i(p.filter(v=>v.type!=g));}})),useEffect(()=>{if(a&&f){let g=()=>T();return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}},[a,f,T]);let b=g=>{setTimeout(()=>{i(v=>v.filter(h=>h.id!==g)),a?.id===g&&u(null);},250);},R=useMemo(()=>[...p.filter(g=>g.type!="toast")],[p]);if(!l)return null;let P=p.filter(g=>g.type=="toast").reverse(),I=Object.values($t);return createPortal(jsxs(c,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+o},children:[R.map((g,v)=>{let h=v<R.length-1;return g.type==="dialog"?jsx(wo,{onClose:b,index:v,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):g.type==="drawer"?jsx(Po,{onClose:b,index:v,id:g.id,...g.props,inBackground:h},`layer-${g.type}-${g.id}`):null}),I.map(g=>{let v=P.filter(h=>(h.props.position||"TopCenter")===g);return v.length===0?null:jsx(c,{onMouseEnter:()=>s(g),onMouseLeave:()=>s(null),as:`--toast-container fixed --${g.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:v.map((h,y)=>jsx(Io,{index:y,total:v.length,isHovered:r===g,onClose:b,id:h.id,...h.props},h.id))},g)}),a&&jsx(c,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(yo,{onClose:T,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},Ci=({children:e})=>{let n=useContext(ye),t=n?n.depth+1:0,o=useRef(null),r=useMemo(()=>({add:s=>o.current?.add(s),openMenu:s=>o.current?.openMenu(s),remove:s=>o.current?.remove(s),loading:(s,a)=>o.current?.loading(s,a),clear:s=>o.current?.clear(s),depth:t,isSubLayer:!!n}),[n]);return jsxs(ye.Provider,{value:r,children:[e,jsx(Si,{ref:o})]})},go=Ci;var Pi=()=>{let e=useContext(ye);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(o,r,s)=>{o.preventDefault(),e.openMenu({event:o,items:r,origin:s});},showMenu:(o,{items:r,origin:s,offsetX:a,offsetY:u,transition:f,curve:m,arrow:p,duration:i,header:l,footer:d})=>{e.openMenu({fx:{transition:f,curve:m,duration:i},parent:o,items:r,origin:s||pt.TopCenter,offsetX:a,offsetY:u,arrow:p,header:l,footer:d});},hide:e.clear}},Ii=Pi;var Ni=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("dialog"),t=s=>e.remove(s),o=(s,a)=>e.loading(s,a);return {clearAll:n,show:s=>{let a=e.add({type:"dialog",props:{...s,type:Qe.Dialog}});return {id:a,setLoading:u=>o(a,u),hide:()=>t(a)}},hide:t}},Bi=Ni;var ki=()=>{let e=useContext(ye);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>e.clear("drawer"),t=s=>e.remove(s),o=(s,a)=>e.loading(s,a),r=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:u=>o(a,u),close:()=>t(a)}};return {clearAll:n,open:s=>r({children:s}),right:s=>r({children:s,from:he.Right}),left:s=>r({children:s,from:he.Left}),top:s=>r({children:s,from:he.Top}),bottom:s=>r({children:s,from:he.Bottom}),close:t}},Li=ki;var Oi=(e,n,t={})=>{let[o,r]=useState(null),[s,a]=useState(false),{duration:u=.25,curve:f=Y.EaseOutBack,borderRadius:m={from:40,to:24},targetWidth:p=320}=t;return useLayoutEffect(()=>{n&&e.current?(r(e.current.getBoundingClientRect()),a(true)):n||a(false);},[n,e]),{style:ue({from:{opacity:0,width:o?.width,height:o?.height,borderRadius:m.from},to:{opacity:1,width:p,height:"auto",borderRadius:m.to},curve:f,duration:u,when:s&&n}).style,isMeasured:s,sourceRect:o}},Di=Oi;var $i=(e,n={})=>{let{offset:t=8,direction:o="bottom",container:r=null,triggerRef:s=null}=n,a=useRef(null),u=useCallback(()=>{let f=e.current;if(!f)return;let m=s?.current||f.parentElement;if(!m){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let p=f.getBoundingClientRect(),i=m.getBoundingClientRect(),l,d;r?(l=r.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(f).position==="fixed"?d="fixed":d="absolute",d==="fixed"?l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:l={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==d&&(f.style.position=d),a.current=d;let b=0,R=0;switch(o){case "top":b=i.top-p.height-t,R=i.left,b<l.top&&i.bottom+p.height+t<=l.bottom&&(b=i.bottom+t);break;case "bottom":b=i.bottom+t,R=i.left,b+p.height>l.bottom&&i.top-p.height-t>=l.top&&(b=i.top-p.height-t);break;case "left":b=i.top,R=i.left-p.width-t,R<l.left&&i.right+p.width+t<=l.right&&(R=i.right+t);break;case "right":b=i.top,R=i.right+t,R+p.width>l.right&&i.left-p.width-t>=l.left&&(R=i.left-p.width-t);break}if(b=Math.max(l.top,Math.min(b,l.bottom-p.height)),R=Math.max(l.left,Math.min(R,l.right-p.width)),a.current==="fixed")f.style.top=`${b}px`,f.style.left=`${R}px`;else {let P;f.offsetParent?P=f.offsetParent.getBoundingClientRect():P={top:0,left:0};let I=b-P.top+window.scrollY,g=R-P.left+window.scrollX;f.style.top=`${I}px`,f.style.left=`${g}px`;}},[e,s,t,o,r]);return useEffect(()=>{let f=e.current;if(!f)return;let m=s?.current||f.parentElement;if(!m){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let p=new ResizeObserver(u);return p.observe(f),m&&p.observe(m),u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,true),()=>{p.disconnect(),m&&p.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true);}},[e,o,t,r,s]),{postion:a.current,reposition:u}},ht=$i;var _i=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(i,l)=>e.add({type:"toast",props:{...l,type:i}}),o=i=>e.remove(i),m=(i,l,d)=>{let C=n(i,{...l,sticky:l.sticky??false,actions:[{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),o(C);}}]});return C},p=(i,l,d,C)=>{let T=n(i,{...l,sticky:true,actions:[{label:C?.label||"Cancel",onClick:()=>{C?.onClick?.(),o(T);}},{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),o(T);}}]});return T};return {ok:(i,l)=>m("default",i,l),success:(i,l)=>m("success",i,l),error:(i,l)=>m("error",i,l),confirm:(i,l,d)=>p("default",i,l,d),warn:(i,l)=>m("warn",i,l)}},Fi=_i;var Ki=()=>{let e=useContext(ye);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let n=(m,p)=>e.add({type:"toast",props:{...p,type:m}});return {show:(m,p,i,l)=>n("default",{title:m,message:p,icon:i,duration:l}),hide:m=>e.remove(m),success:(m,p,i,l)=>n("success",{title:m,message:p,icon:i,duration:l}),error:(m,p,i,l)=>n("error",{title:m,message:p,icon:i,duration:l}),warn:(m,p,i,l)=>n("warn",{title:m,message:p,icon:i,duration:l}),promise:(m,p,i,l)=>n("promise",{title:m,message:p,icon:i,duration:l}),clearAll:()=>e.clear("toast")}},Ro=Ki;var nn=({ref:e,style:n,...t})=>{let o=useRef(null),r=useMemo(()=>e&&typeof e!="function"&&e.current?e:o,[e]),{style:s,className:a,rest:u}=B(t,r);return jsx("div",{ref:e||o,style:{...s,...n||{}},className:a,...u})};nn.displayName="Zuz.Box";var c=nn;var an=forwardRef((e,n)=>{let{title:t,message:o,...r}=e,[s,a]=useState(false);return jsxs(c,{className:"--accordion flex cols",...r,children:[jsxs($,{onClick:u=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(_,{className:"--label flex",children:t}),jsx(c,{className:"--arrow flex",children:s?L.arrowUp:L.arrowDown})]}),s&&jsx(c,{className:"--detail",children:o})]})});an.displayName="Zuz.Accordion";var Yi=an;var Qi=({label:e,icon:n,onClick:t,idx:o,selected:r})=>jsx($,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${o}`),className:`--action ${r?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(ee,{name:n}):n}),cn=Qi;var mn=forwardRef((e,n)=>{let{items:t,name:o,selected:r,position:s,...a}=e,u=useRef(null),[f,m]=useState(r||t[0].tag||0),p=useCallback(({x:b,y:R})=>{if(u.current){let P=u.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${b-P.left}`),document.documentElement.style.setProperty("--tip-y",`${R-P.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),i=useCallback(()=>{u.current&&(u.current.removeEventListener("pointerleave",i),u.current.removeEventListener("pointermove",p),document.documentElement.style.setProperty("--tip-s","0"));},[]),l=useCallback(()=>{u.current&&(u.current.addEventListener("pointerleave",i),u.current.addEventListener("pointermove",p));},[]);useEffect(()=>{u.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((b,R)=>R.label.length>b.length?R.label:b,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),u.current?.addEventListener("pointerenter",l));},[]);let{className:d,style:C,rest:T}=B(a);return jsxs(c,{ref:u,style:C,className:[`--actionbar flex aic ${d}`,`${!s||s==pe.Auto?"rel":`--${s}`}`].join(" ").trim(),...T,children:[t.map((b,R)=>jsx(cn,{selected:f===b.tag||r==R,...b,idx:R},`actionbar-action-${b.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(c,{className:"--tip abs",children:jsx(c,{className:"--track flex aic",children:t.map(({label:b})=>jsx(c,{className:"--lb",children:b},`tool-tip-${b.toLowerCase().replace(/\s+/g,"-")}`))})})]})});mn.displayName="Zuz.ActionBar";var ol=mn;var un=forwardRef((e,n)=>{let{type:t,icon:o,title:r,message:s,iconSize:a,...u}=e,{className:f,style:m,rest:p}=B(u);return jsxs(c,{className:`--alert --${t||Se.Info} flex aic ${f}`.trim(),style:m,...p,children:[jsx(c,{className:`--icon icon-${o||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!o&&L[t||Se.Info]}),jsxs(c,{className:"--meta flex cols",children:[jsx(_,{className:`--title ${s?"--tm":""}`,children:r||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(_,{className:"--message",h:2,children:s})]})]})});un.displayName="Zuz.Alert";var sl=un;var fn=({ref:e,...n})=>{let{variant:t,numeric:o,onConfirm:r,...s}=n,{style:a,className:u,rest:f}=B(s),{variant:m}=Q(true),p=i=>{o&&(i.currentTarget.value=i.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${t||m} flex ${u}`.trim(),style:a,onInput:p,onKeyDown:i=>{i.key=="Enter"&&r?.(i.currentTarget.value);},ref:e,...f})};fn.displayName="Zuz.Input";var le=fn;var gn=e=>{let{meta:n,children:t}=e,o=useDelayed(),{label:r,icon:s,...a}=isValidElement(n)?{}:n,{className:u,style:f,rest:m}=B({...a,...a.animate?{animate:{...a.animate,when:o}}:{}});return isValidElement(n)?jsx("li",{style:f,className:u,children:n}):jsxs("li",{style:f,className:u,...m,children:[t,typeof n=="string"?n:r]})};gn.displayName="Zuz.ListItem";var hn=gn;var xn=forwardRef((e,n)=>{let{items:t,variant:o,direction:r,seperator:s,ol:a,...u}=e,{className:f,style:m,rest:p}=B(u),i=a==true?"ol":"ul";return createElement(i,{className:`--list --${o||q.Small} flex ${r??"cols"} ${f}`.trim(),style:m,ref:n,...p,children:t.map((l,d,C)=>{let T=`${typeof l=="string"?`li-${String(l)}`:isValidElement(l)?`li-${l.key}`||`${d}-${MD5(l.toString())}`:l.label}-${d}`;return jsxs(Fragment,{children:[jsx(hn,{meta:l}),s&&C[d+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${d+1}-${T}`):null]},T)})})});xn.displayName="Zuz.List";var Ge=xn;var vn=forwardRef((e,n)=>{let{fx:t,action:o,data:r,withStyle:s,onChange:a,...u}=e,{className:f}=B({as:s||""}),{style:m}=B(u),[p,i]=useState(false),[l,d]=useState(r||[]),C=useRef(null),T=useRef(null),b=useRef(null),R=useMemo(()=>u.name||uuid(12),[]),[P,I]=useState(null),[g,v]=useState(null),[h,y]=useState([]),D=useDebounce(x=>{x.target.value==""?(i(false),d([])):o&&x.target.value.trim()!=""&&withPost(o,{query:x.target.value}).then(k=>{"items"in k&&_$1(k.items).isArray()?(d(k.items),v(x.target.value),y(k.items)):console.error("Action Response should contain items array"),I(null);}).catch(k=>{I(null),d([]);});},250),M=()=>{if(T.current){let x=T.current.getBoundingClientRect(),k=window.innerHeight-x.bottom,Z=x.top;if(b.current){let U=b.current;k<U.offsetHeight&&Z>k?(U.style.top="auto",U.style.bottom=`${x.height}px`,U.style.maxHeight=`${Z-150}px`):(U.style.top=`${x.height+5}px`,U.style.bottom="auto",U.style.maxHeight=`${k-150}px`);}}},A=x=>{if(l.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")I(null),i(false),d([]);else if(x.key==="ArrowDown")I(k=>{let Z=k===null||k===l.length-1?0:k+1;return H(Z),Z});else if(x.key==="ArrowUp")I(k=>{let Z=k===null||k===0?l.length-1:k-1;return H(Z),Z});else if(x.key==="Enter"&&P!==null){let k=l[P];C.current&&(C.current.value=k,i(false),d([]));}}},E=x=>{C.current&&(C.current.value=x,i(false),d([]));},H=x=>{let k=l[x];if(k&&C.current&&(C.current.value=k,C.current.setSelectionRange(k.length,k.length)),b.current){let U=b.current.children[x];U&&U.scrollIntoView({block:"nearest"});}},z=x=>{T.current&&!T.current.contains(x.target)&&(i(false),d([]));},G=()=>{C.current&&C.current.value===g&&(d(h),I(null),M());};return useEffect(()=>(window.addEventListener("resize",M),window.addEventListener("scroll",M,true),document.addEventListener("mousedown",z),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true),document.removeEventListener("mousedown",z);}),[]),useEffect(()=>{M();},[l]),jsxs(c,{style:m,ref:T,className:`--autocomplete --${e.size||q.Small} flex aic rel ${f}`.trim(),children:[jsx(le,{ref:C,autoComplete:"off",onChange:D,onKeyDown:A,onFocus:G,...u}),jsx(c,{className:"--arrow rel flex aic jcc",children:l.length>0?L.arrowUp:L.arrowDown}),l.length>0&&jsx(Ge,{id:R,ref:b,className:"--suggestion-list flex cols abs",items:l.map((x,k)=>({label:x,onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),E(x);},className:P===k?"--current":"",animate:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:clamp(.02*k,.02,.5)}}))})]})});vn.displayName="Zuz.AutoComplete";var Cl=vn;var wn=forwardRef((e,n)=>{let t=useRef(null),o=useMemo(()=>n&&typeof n!="function"&&n.current?n:t,[n]),{style:r,className:s,rest:a}=B(e,o);return !a.src||a.src==""?null:jsx("img",{ref:o,style:r,className:`${s} flex`,...a})});wn.displayName="Zuz.Image";var Ue=wn;var Sn=forwardRef((e,n)=>{let{src:t,variant:o,type:r,crossOrigin:s,referrerPolicy:a,fx:u,as:f,alt:m,color:p,style:i,...l}=e,[d,C,T]=useImage(t??"",s,a),{className:b,style:R,rest:P}=B({fx:u,as:f});return jsx(c,{className:`--avatar --${o||q.Small} --${(r||mr.Circle).toLowerCase()} rel flex aic jcc ${b}`.trim(),style:{background:p||"var(--primary)",...i,...R},...P,children:t?jsx(Ue,{src:d,crossOrigin:s,referrerPolicy:a,...l}):jsx(_,{className:"--avatar-label",children:(m?m.charAt(0):"A").toUpperCase()})})});Sn.displayName="Zuz.Avatar";var kl=Sn;var Ll=({size:e=5,type:n="dead",label:t="",variant:o=q.Small,loading:r=false,spinner:s,...a})=>{let{style:u,className:f,rest:m}=B(a);return jsxs(c,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...u},as:`--badge --${o} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(c,{fx:{transition:X.FadeIn,curve:Y.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(Te,{type:s})}),_$1(t).isEmpty()?jsx(c,{as:`--dot --${n}`}):jsx(_,{as:"--label",children:t})]})},Ml=Ll;var Ul=[{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 e=new Date,n=e.getDay();return addDays(e,(6-n)%7||6)},getDateFormat:()=>{let e=new Date,n=e.getDay();return format(addDays(e,(6-n)%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)}],ql=e=>{let n=new Set;return e.filter(t=>{if(t.label=="Later")return true;let o=t.getDate().toISOString().split("T")[0];return n.has(o)?false:(n.add(o),true)})},Tn=forwardRef((e,n)=>{let{defaultValue:t,variant:o,onChange:r,...s}=e,{style:a,className:u,rest:f}=B(s),[m,p]=useState(t||new Date),i=startOfMonth(m),l=endOfMonth(m),d=startOfWeek(i),C=endOfWeek(l),T=useMemo(()=>eachDayOfInterval({start:d,end:C}),[d,C]),b=I=>{r?.(I),p(I);},R=()=>{p(I=>new Date(I.getFullYear(),I.getMonth()-1));},P=()=>{p(I=>new Date(I.getFullYear(),I.getMonth()+1));};return jsxs(c,{as:`--calendar flex --${o||"sm"} ${u}`,style:a,children:[jsx(c,{as:"--calendar-quick-select flex cols flex:1",children:ql(Ul).map(I=>{let g=I.getDate();return jsxs($,{onClick:()=>b(g),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(_,{as:"flex:1",children:I.label}),jsx(_,{as:"tar",children:I.getDateFormat()})]},`--dtp-option-label-${I.label}`)})}),jsxs(c,{as:"--calendar-selector flex cols flex:1",children:[jsxs(c,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(_,{as:"flex:1 --calendar-cm bold",children:format(m,"MMMM yyyy")}),jsx($,{onClick:R,as:"--calendar-chevron",children:L.chevronUpOutline}),jsx($,{onClick:P,as:"--calendar-chevron",children:L.chevronDownOutline})]}),jsxs(c,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(I=>jsx(_,{as:"--calendar-day",children:I},`--calendar-hd-${I}`)),T.map((I,g)=>{let v=isSameMonth(I,m),h=isSameDay(I,m),y=isToday(I);return jsx($,{disabled:!v,onClick:()=>b(I),as:["--calendar-day --calendar-dd",`${h?"--calendar-dd-selected":""}`,`${y?"--calendar-dd-current":""}`],children:format(I,"d")},`--calendar-day-${g}-${I.getFullYear()}-${I.getMonth()}-${I.getDay()}`)})]})]})]})});Tn.displayName="Zuz.Calendar";var Oo=Tn;var Wt=(t=>(t.Table="table",t.Gooey="gooey",t))(Wt||{});var Nn=({ref:e,...n})=>{let{itemCount:t,itemsPerPage:o,startPage:r,pageRange:s,paginationStyle:a,breakLabel:u,prevLabel:f,nextLabel:m,hash:p,loading:i,seperator:l,renderOnZeroPageCount:d,asDots:C,progressBar:T,onPageChange:b,...R}=n,P=useRef(null),I=useMemo(()=>toHash(numberInRange(4,8)),[]),g=useCallback(x=>`${toHash(x,p||6,I)}${l||""}${I}`,[I]),v=useMemo(()=>u||"...",[u]),h=useRef(null),[y,N]=useState({id:p?r?typeof r=="number"?g(r):r:1:r||1,label:r||1});useImperativeHandle(e,()=>({setPage:x=>N(x),getPage:x=>y,setProgress:x=>h.current?.setProgress?.(x),getProgress:()=>h.current?.getProgress?.()??0}),[h.current]);let{style:D,className:M,rest:A}=B(R),E=useCallback(x=>typeof x=="number"?x:+x.label,[]);if(!t)throw new Error('"itemCount" prop is required');let H=useMemo(()=>Math.ceil(t/o),[t,o]),z=useMemo(()=>{let x=[],k=Math.max(E(y)-(s||2),1),Z=Math.min(E(y)+(s||2),H);k>1&&x.push({id:p?g(1):1,label:1}),k>2&&x.push({id:-1,label:v});for(let U=k;U<=Z;U++)x.push({id:p?g(U):U,label:U});return Z<H-1&&x.push({id:-1,label:v}),Z<H&&x.push({id:p?g(H):H,label:H}),x},[y]),G=useCallback(x=>{let k=x;+k.label<1||+k.label>H||(N(k),b?.(k));},[t,o,y]);return z.length<=1&&(d??false)===false?null:jsxs(c,{ref:P,as:`--pagination ${C===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${M}`,children:[jsx(c,{as:"flex flex:1 aic --pgt-btns",children:(z.length>1?z:[{id:1,label:1},{id:-1,label:v}]).map((x,k,Z)=>{let U=(typeof x=="string"?x:x.label)==E(y);return jsx($,{disabled:x.id==-1||E(y)==+x.label,className:U?"--current-page":"",onClick:F=>G(x),children:C===true?T===true&&U?jsx(Ke,{ref:h}):"":typeof x=="string"?x:x.label},`--pg-${k}-${x.id}`)})}),jsx(c,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(y)-1)*o+1} - `,`${Math.min(E(y)*o,t)} of ${t} items`].join(" ")}),jsxs(c,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx($,{disabled:E(y)<=1,onClick:x=>G({id:p?g(E(y)-1):E(y)-1,label:E(y)-1}),children:L.chevronLeftOutline}),jsx($,{disabled:z.length<=1||E(y)==E(z[z.length-1]),onClick:x=>G({id:p?g(E(y)+1):E(y)+1,label:E(y)+1}),children:L.chevronRightOutline})]})]})};Nn.displayName="Zuz.Pagination";var bt=Nn;function oc(e,n){let{items:t,renderItem:o,effect:r="slide",loop:s=true,loopMode:a="infinite",startIndex:u=0,useKeys:f=true,useWheel:m=true,spacing:p=160,rotation:i=20,scaleStep:l=.15,blur:d=4,animation:C="power",showDots:T=false,autoPlay:b=false,autoPlaySpeed:R=3,onChange:P,...I}=e,{className:g,style:v}=B(I),h=useRef(null),y=R/(R>=1e3?1e3:1),N=useCarousel({total:t.length,initialIndex:u,loop:s,useKeys:f,useWheel:m,onChange:H=>{h.current?.setPage({id:H+1,label:H+1}),h.current?.setProgress(0),P?.(H);}}),{pause:D,resume:M,reset:A}=useTimer({duration:y,autoStart:b===true,onProgress:H=>{b===true&&h.current?.setProgress(1-H);},onExpired:()=>{b===true&&N.next(),A();}}),E={...v,"--carousel-spacing":`${p}px`,"--carousel-rotation":`${i}deg`,"--carousel-blur":`${d}px`,"--carousel-scale-step":l,"--active-index":N.index,"--carousel-transition":`var(--${C})`};return jsxs(c,{ref:n,className:`--carousel --effect-${r} --loop-${a} flex cols aic jcc ${g}`.trim(),style:E,children:[jsx(c,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((H,z)=>{let G=z-N.index;if(a==="infinite"){let k=t.length;G=((G+k/2)%k+k)%k-k/2;}let x=z===N.index;return jsx(c,{onMouseEnter:()=>x&&D(),onMouseLeave:()=>x&&M(),className:`--carousel-item-wrapper abs ${x?"--is-active":""}`,style:{"--offset":G,zIndex:x?100:100-Math.abs(G),display:Math.abs(G)>5?"none":"flex"},children:o(H,z,N.index)},z)})}),T&&jsx(bt,{ref:h,itemCount:t.length,itemsPerPage:1,startPage:u+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:H=>N.goTo(+H.label-1),asDots:true,progressBar:true})]})}var rc=forwardRef(oc),nc=rc;var Bn=(n=>(n.Line="line",n))(Bn||{});var Ln=forwardRef((e,n)=>{let{data:t,width:o,height:r,lineColor:s,strokeWidth:a=2,gradientStartColor:u,gradientEndColor:f,animated:m,animDuration:p=2,animDelay:i=0,padding:l=0,type:d,...C}=e,{className:T,style:b,rest:R}=B(C),P=useRef(null),I=useResizeObserver(P.current?.parentElement||P),g=typeof o=="number"?o:I.width,v=typeof r=="number"?r:I.height,h={width:g,height:v},y=useId(),{pathD:N,areaPathD:D}=useLineChart(t,h,l+(a||2)),M=useRef(null),A=useRef(null),[E,H]=useState(0),[z,G]=useState(0);return useEffect(()=>{m&&(M.current&&H(M.current.getTotalLength()),A.current&&G(A.current.getTotalLength()));},[m,N,D,g,v]),jsx(c,{ref:P,as:`--chart --${d||"line"}-chart ${T}`.trim(),style:{...b,width:o,height:r},...R,children:g>0&&v>0&&jsxs("svg",{viewBox:`0 0 ${g} ${v}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:u}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:A,d:D,fill:`url(#${y})`,stroke:"none",style:m?{strokeDasharray:z,strokeDashoffset:z}:{},children:m&&jsx("animate",{attributeName:"stroke-dashoffset",from:z,to:"0",dur:`${p||2}s`,begin:`${i||0}s`,fill:"freeze"})}),jsx("path",{ref:M,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:m?{strokeDasharray:E,strokeDashoffset:E}:{},children:m&&jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${p||2}s`,begin:`${i||0}s`,fill:"freeze"})})]})})});Ln.displayName="Zuz.Chart";var pc=Ln;var Mn=(r=>(r[r.Sending=0]="Sending",r[r.Sent=1]="Sent",r[r.Delivered=2]="Delivered",r[r.Read=3]="Read",r))(Mn||{}),On=(m=>(m.Image="img",m.Video="vid",m.Audio="audio",m.Link="link",m.Document="doc",m.Location="loc",m.Contact="contact",m.Event="event",m.Poll="poll",m))(On||{});var Dn=forwardRef((e,n)=>{let{text:t,media:o,side:r="me",status:s=1,timeStamp:a=Date.now(),arrow:u=true,...f}=e,{className:m,style:p,rest:i}=B(f);return jsx(c,{className:`--bubble-wrapper flex --bw-${r}`.trim(),children:jsxs(c,{className:`--bubble --bubble-${r} ${o?`--with-media --bma-${o.type}`:""} rel flex cols ${u==true?"--b-arrow":""} ${m}`.trim(),style:{...p},...i,children:[t&&jsx(_,{className:"--bubble-text",children:t}),o?o.type=="audio"?jsxs(c,{as:"flex aic --bubble-audio",children:[jsx(se,{className:"--bm-action",children:L.play}),jsx(Ke,{progress:.7}),jsx(_,{className:"--bm-dur",children:o.duration??"00:13"})]}):o.type=="img"?jsx(c,{as:"--bubble-image",children:jsx(Ue,{src:o.source})}):null:null,jsxs(c,{as:"flex aie jce --bubble-stats",children:[jsx(_,{className:"--bubble-stamp tar",children:timeSince(a)}),r=="me"&&jsx(se,{className:`--bubble-status --bs-${s}`,children:s==0?L.pending:s==1?L.done:s==2?L.doneAll:L.doneAll})]})]})})});Dn.displayName="Zuz.Bubble";var dc=Dn;var Hn=forwardRef((e,n)=>{let{style:t,className:o,rest:r}=B(e);return jsx("label",{ref:n,style:t,className:o,...r})});Hn.displayName="Zuz.Label";var vt=Hn;var An=forwardRef((e,n)=>{let{name:t,required:o,type:r,value:s,size:a,variant:u,checked:f,onSwitch:m,...p}=e,[i,l]=useState(f||false),d=useRef(null),{variant:C}=Q(true);return useImperativeHandle(n,()=>({setChecked(T,b=true){l(T),d.current&&(d.current.checked=T),b&&m&&m(T,s||"cb");},toggle(T=true){d.current&&(d.current.checked=!i),T&&m&&m&&m(!i,s||"cb"),l(!i);}})),jsxs(vt,{className:`--${(r||Le.Default).toLowerCase()} ${!r||r==Le.Default?"--checkbox":"--switch"} --${u||C||q.Small} flex aic jcc ${i?"is-checked":""} rel`.trim(),...p,children:[(!r||r==Le.Default)&&L.check,jsx(le,{ref:d,defaultChecked:i,value:s||"cb",type:"checkbox",className:"abs",name:t,required:o||false,onChange:T=>{m&&m(T.target.checked,s||"cb"),l(T.target.checked);}})]})});An.displayName="Zuz.CheckBox";var wt=An;var Pc=({ref:e,...n})=>{let{code:t,copy:o,lang:r="tsx",showLines:s=false,highlight:a="",as:u,fx:f,...m}=n,p=useRef(null),{className:i,style:l,rest:d}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:f},p),C=useMemo(()=>{let b=new Set;return a.split(",").forEach(R=>{if(R.includes("-")){let[P,I]=R.split("-").map(Number);for(let g=P;g<=I;g++)b.add(g);}else R&&b.add(Number(R));}),b},[a]),T=useMemo(()=>{let b=t.split(`
9
+ `);for(;b.length>0&&b[0].trim()==="";)b.shift();for(;b.length>0&&b[b.length-1].trim()==="";)b.pop();let R=b[0]?.match(/^\s*/)?.[0].length||0,P=b.map(g=>{let v=g.match(/^\s*/)?.[0].length||0,h=Math.min(v,R);return g.slice(h)}),I=[{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:/(&lt;\/?[A-Z][\w\.]*|&gt;)/g},{name:"var",re:/(?<!&lt;\/|&lt;)\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((g,v)=>{let h=g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),y=C.has(v+1);if(r!="plain"){let N=[];I.forEach(D=>{h=h.replace(D.re,M=>{let A=`ZUZ_ID_${N.length}_ZUZ`;return N.push(`<span class="--token-${D.name}">${M}</span>`),A});});for(let D=N.length-1;D>=0;D--)h=h.replace(`ZUZ_ID_${D}_ZUZ`,N[D]);}return `<div class="--code-line ${s==true?"--with-ln":""} ${y?"--is-highlighted":""}">
10
+ ${s==true?`<span class="--line-number">${v+1}</span>`:""}
11
+ <span class="--line-content">${h||" "}</span>
12
+ </div>`}).join("")},[t,C]);return jsxs(c,{as:`--code-block rel ${i}`,style:l,...m,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:T}})}),o&&jsx($,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),o.onCopy?.();},children:"Copy"})]})},Ic=Pc;var $n=({onSelect:e,meta:n,selected:t,disabled:o=false})=>{let r=useRef(null),{index:s,icon:a,label:u}=n,[f,m]=useState({x:0,width:0}),p=useDelayed();return useLayoutEffect(()=>{if(p&&r.current){let{width:i,x:l}=r.current.getBoundingClientRect();m({x:l,width:i}),t&&e(s,i,l,n,true);}},[p,r.current]),useEffect(()=>{t&&e(s,f.width,f.x,n,false);},[t]),jsxs($,{disabled:o,onClick:()=>e(s,f.width,f.x,n,false),ref:r,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(ee,{name:a,as:"--segment-icon"}):jsx(c,{as:"--segment-icon flex aic jcc",children:a}):null,u&&String(u).trim()!=""&&jsx(c,{className:"--segment-label",children:u||`Item ${s}`})]})};$n.displayName="SelectTabItem";var zn=$n;var Fn=forwardRef((e,n)=>{let{fx:t,items:o,selected:r,variant:s,disabled:a=false,onSwitch:u,...f}=e,[m,p]=useState(r||0),i=useDelayed(50),l=useRef(m),{className:d,style:C,rest:T}=B(f),b=useRef(null),R=useRef(null),{variant:P}=Q(true),I=(g,v,h,y,N)=>{if((N||m!=g&&m!=-2)&&(p(g),l.current=m,queueMicrotask(()=>{i&&u?.(y);})),b.current){let D=R.current?.getBoundingClientRect();b.current.style.setProperty("--w",`${v}px`),b.current.style.setProperty("--x",`${D?h-D.left:h}px`);}};return useImperativeHandle(n,()=>({setSelected:g=>{typeof g=="number"&&g!=m&&p(g);}}),[m]),jsxs(c,{ref:R,"data-selected":m,className:`${d} --segmented --${s||P||q.Medium} flex aic rel`,style:C,...T,children:[jsx(c,{ref:b,className:`--segment-tab --${a?"disabled":"abled"} abs`}),o.map((g,v)=>jsx(zn,{disabled:a,onSelect:I,selected:m==v,meta:{...g,index:v}},`segment-${g.label}-${v}`))]})});Fn.displayName="Zuz.SelectTabs";var St=Fn;var Wn=forwardRef((e,n)=>{let{type:t,...o}=e,r=useDelayed(),{colorScheme:s,setColorScheme:a}=fo(),u=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:m}=B(o),p=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:L.colorSchemeLight},{tag:"system",index:1,label:"",icon:L.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:L.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:L.colorSchemeLight},{tag:"dark",index:2,label:"",icon:L.colorSchemeDark}],[]),i=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !r||i==-1?null:t=="system"||t=="switch"?jsx(St,{className:`--color-scheme --${t}`,onSwitch:({tag:l})=>{a(l);},selected:i,items:p,...o}):jsx($,{onClick:u,style:m,as:`--color-scheme-switch --${o.variant||q.Small} ${f}`.trim(),children:s=="system"?L.colorSchemeSystem:s=="light"?L.colorSchemeLight:L.colorSchemeDark})});Wn.displayName="Zuz.ColorScheme";var Fc=Wn;var Un=forwardRef((e,n)=>{let[t,o]=useState("wait"),{title:r,message:s,acceptLabel:a,rejectLabel:u,position:f}=e,m=async p=>{o(p==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(p));};return useEffect(()=>{let p=localStorage.getItem("--ccnt");o(p?p=="1"?"accepted":"rejected":"pending");},[]),jsxs(c,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:Y.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${f||pe.Left} flex cols`,children:[jsx(_,{as:"--title",children:r||"This site uses cookies"}),jsx(_,{as:"--message",children:s||"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(c,{as:"--footer flex aic",children:[jsx($,{onClick:p=>m(1),as:"--accept",children:a||"Accept All"}),jsx($,{onClick:p=>m(0),as:"--reject",children:u||"Cancel"})]})]})});Un.displayName="Zuz.CookiesConsent";var Gc=Un;var Yn=({ref:e,...n})=>{let {title:t,position:o,margin:r=4,anchorName:s="--tooltip-anchor",children:a,show:u,variant:f,...m}=n,{style:p,className:i,rest:l}=B(m),d=o||pe.Top;useRef(null);let [T,b]=useState(false);useRef(6);let P=u===true||T,g=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:v}=Q(true),h=useMemo(()=>{let N=false;return addPropsToChildren(a,D=>{let M=D.props.className?.includes(s);return M&&(N=true),M||!N},(D,M)=>{let A=M.props.className?.includes(s),E=D===0,H={};return (A||E)&&(H.style={...M.props.style,anchorName:g}),E&&(H.onMouseEnter=z=>{b(true),M.props.onMouseEnter?.(z);},H.onMouseLeave=z=>{b(false),M.props.onMouseLeave?.(z);}),H})},[a,s,g]),y=ue({transition:d==pe.Top?X.SlideInTop:d==pe.Bottom?X.SlideInBottom:d==pe.Left?X.SlideInLeft:X.SlideInRight,when:P,duration:.2,offset:r+6,margin:d==pe.Top||d==pe.Left?-r:r,curve:v?.curve||Y.EaseInOut});return useImperativeHandle(e,()=>({show:()=>b(true),hide:()=>b(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[h,jsx(c,{style:{positionAnchor:g,...y.style,...d===pe.Top||d===pe.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${P} --${f||v?.variant||q.Small} --${d} abs ${i}`.trim(),children:typeof t=="string"?jsx(_,{as:"--text rel",children:t}):t})]})};Yn.displayName="Zuz.ToolTip";var Fo=Yn;var Qn=({ref:e,...n})=>{let {type:t,value:o=0,min:r=0,max:s=1,step:a=.01,onChange:u,showGhostBar:f,showKnobOnHover:m,showToolTip:p,roundValue:i,formatValue:l,...d}=n,{className:C,style:T,rest:b}=B(d),R=useRef(a||.01).current,P=useRef(r||0).current,I=useRef(s||1).current,g=useRef(o||0).current,v=useRef(null),h=useRef(null),y=useRef(null),N=useRef(null);useRef(null);let M=useRef(null),A=useRef(null),E=useRef(null),H=useRef(null),z=(ne,ae,ve)=>(ne-ae)/(ve-ae)*100,G=ne=>{if(h.current){let ae=parseFloat(ne.currentTarget.value);j(ae);let ve=z(ae,parseFloat(ne.currentTarget.min),parseFloat(ne.currentTarget.max));h.current.style.setProperty("--value",`${ve}`),h.current.setAttribute("data-value",`${ae}`),u&&u(i?+ae.toFixed(2):ae);}},[x,k]=useState(false),[Z,U]=useState(0),[F,K]=useState(0),[te,J]=useState(false),j=async ne=>{let ae=l?l(+ne):i?(+ne).toFixed(2):Math.round(+ne);E.current&&(E.current.textContent=String(ae));},W=ne=>{if(x){let ae=ne.clientX-Z,ve=I-P,Re=ae/200*ve,ge=Math.max(P,Math.min(F+Re,I));if(ge=Math.round(ge/R)*R,j(ge),h.current){let ct=z(ge,P,I);h.current.style.setProperty("--value",`${ct}`),h.current.setAttribute("data-value",`${ge}`),A.current&&(A.current.textContent=i?ge.toFixed(2):ge.toString()),u&&u(ge);}}},re=()=>{k(false),document.body.style.cursor="auto";},ce=ne=>(ne-P)/(I-P)*100,de=ne=>{if(!h.current)return;let ae=h.current.getBoundingClientRect(),ve=ne.clientX-ae.left,lt=Math.max(0,Math.min(100,ve/ae.width*100));if(p&&E.current){let Re=v.current?+v.current.value:o;j(Re*100);}if(f){let Re=ce(v.current?+v.current.value:o),ge=Math.min(Re,lt),ct=Math.abs(lt-Re);h.current.style.setProperty("--ghost-start",`${ge}`),h.current.style.setProperty("--ghost-width",`${ct}`);}};useEffect(()=>{h.current&&h.current.style.setProperty("--value",v.current?`${z(parseFloat(v.current.value),parseFloat(v.current.min),parseFloat(v.current.max))}`:g.toString());},[]),useEffect(()=>(x?(document.addEventListener("mousemove",W),document.addEventListener("mouseup",re)):(document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",re)),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",re);}),[x]),useEffect(()=>{let ne=z(o,P,I);h.current?.style.setProperty("--value",`${ne}`),j(o);},[o,P,I,E.current]);let oe=()=>jsxs(c,{ref:h,onMouseEnter:()=>J(true),onMouseLeave:()=>J(false),onMouseMove:de,className:`--slider --${t||ao.Default} ${m?"--knob-hover":""} flex rel ${C}`.trim(),style:{...T},children:[jsx(c,{ref:M,className:"--slider-track abs fill"}),f&&jsx(c,{ref:N,className:"--slider-ghost abs fill"}),jsx(c,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(c,{ref:y,className:"--slider-knob --tooltip-knob abs"}),jsx(le,{ref:v,onInput:G,className:"abs fill",tabIndex:0,type:t||ao.Default,defaultValue:g||0,step:R,max:I,min:P})]});if(p===true){let ne=l?l(o):i?o.toFixed(2):o;return jsx(Fo,{ref:H,show:x,position:mt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(se,{ref:E,children:ne}),children:oe()})}return oe()};Qn.displayName="Zuz.Slider";var Je=Qn;var Jn=forwardRef((e,n)=>{let{src:t,shape:o,size:r,...s}=e,{style:a,className:u,rest:f}=B(s),{canvasRef:m,crop:p,setScale:i,handleMouseDown:l,handleMouseUp:d,handleMouseMove:C}=useImageCropper(t,r||200,o||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return p()},setScale(T){i(T);}})),jsxs(c,{as:`--cropper --${o||CropShape.Circle} ${u}`,style:a,...f,children:[jsx("canvas",{ref:m,width:r||200,height:r||200,onMouseDown:l,onMouseUp:d,onMouseLeave:d,onMouseMove:C}),jsx(c,{as:"--cropper-slider",children:jsx(Je,{onChange:T=>i(T),min:0,max:1,step:.01,value:1})})]})});Jn.displayName="Zuz.Cropper";var nm=Jn;var am=(t=>(t.Circle="circle",t.Square="square",t))(am||{});var ts=forwardRef((e,n)=>{let{items:t,maxItems:o}=e,r=useMemo(()=>{let u=typeof t=="string",f=u?[]:t;return u&&t.split(",").forEach(m=>{f.push({label:m});}),f},[t]),a=useMemo(()=>o&&o>0&&r.length>o-1,[r,o])?[...r.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...r.slice(-o)]:r;return jsx(Ge,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(c,{as:"--crumb-chevron",children:L.chevronRightOutline}),items:a.map((u,f,m)=>u.ID=="."?jsx(c,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(c,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs($,{onClick:()=>u.action?.(),className:"--crumb-item",disabled:!m[f+1],children:[u.icon&&jsx(ee,{as:"--crumb-icon",name:u.icon}),jsx(_,{as:"--crumb-label",children:u.label})]},`${u.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});ts.displayName="Zuz.Crumb";var lm=ts;var ns=forwardRef((e,n)=>{let{icon:t,defaultValue:o,value:r,size:s,variant:a,numeric:u,type:f,onConfirm:m,...p}=e,[i,l]=useState(false),[d,C]=useState(o||null),{style:T,className:b,rest:R}=B(p),P=useRef(null),I=useRef(null),{reposition:g}=ht(I,{direction:pe.Bottom,offset:2}),v=y=>{u&&(y.currentTarget.value=y.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let y=N=>{let D=N.target,M=P.current?.contains(D),A=I.current?.contains(D);!M&&!A&&l(false);};return i&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[i]),useEffect(()=>{let y=N=>{N.key==="Escape"&&i&&(l(false),P.current?.focus());};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[i]);let h=()=>{l(true);};return useEffect(()=>{i&&g();},[i,g]),jsx(Fragment$1,{children:jsxs(c,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${b}`,"data-value":d?d.toISOString():"",children:[t?typeof t=="string"?jsx(ee,{as:"mr:10 c:#666",name:t}):t:jsx(se,{as:"--date-picker-icon flex aic jcc",children:L.calendar}),jsx("input",{ref:P,value:d?format(d,"EEE, MMM d YYY hh:mm a"):r||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:T,onFocus:h,onInput:v,autoComplete:"new-password",onKeyDown:y=>{y.key=="Enter"&&m?.(y.currentTarget.value);},...R}),jsx(c,{"aria-hidden":!i,ref:I,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:i,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(Oo,{defaultValue:d,onChange:y=>{C(y),l(false);}})})]})})});ns.displayName="Zuz.DatePicker";var um=ns;var ss=forwardRef((e,n)=>{let{icon:t,variant:o,position:r}=e;return jsx($,{className:`--fab fixed --${o||q.Large} --${r||"bottomright"}`,children:t||L.plus})});ss.displayName="Zuz.Fab";var hm=ss;var as=e=>{let{names:n,strength:t}=e,o={[Bt.Gooey]:r=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:r||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-${Bt.Gooey}`)};return useEffect(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[Bt.Gooey]).map(r=>o[r](t))})})};as.displayName="Zuz.Filters";var bm=as;var is=({cols:e,gap:n,aic:t,jcc:o,className:r="",style:s,...a})=>{let u=["--flex",e?"--cols":"",t?"--aic":"",o?"--jcc":"",r].filter(Boolean).join(" "),f={...s,gap:typeof n=="number"?`${n}px`:n};return jsx(c,{...a,className:u,style:f})};is.displayName="Zuz.FlexBox";var Ve=is;var $e=null,be=null,cs=forwardRef((e,n)=>{let{title:t,message:o,transition:r,curve:s,speed:a,type:u,actionPosition:f,spinner:m,loadingMessage:p,onShow:i,onHide:l,...d}=e,{className:C,style:T,rest:b}=B(d),[R,P]=useState(t||""),[I,g]=useState(o||""),[v,h]=useState(null),[y,N]=useState(u||Ce.Default),D=useMemo(()=>uuid(12),[]),[M,A]=useState(false),E=useRef(null),H=useRef(null),[z,G]=useState(false),[x,k]=useState(true),Z=useRef(null),U=I;useImperativeHandle(n,()=>({setLoading(K){G(K);},showDialog(K,te,J,j){$e&&(clearTimeout($e),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),te&&g(te),K&&P(K),J&&h(J.reduce((V,W)=>(V.push({...W,key:W.key||uuid(12)}),V),[])),A(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(K,te,J,j){$e&&(clearTimeout($e),be&&clearTimeout(be),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),be=null;},500)),N(Ce.Dialog),g(te),P(K),J&&h(J.reduce((V,W)=>(V.push({...W,key:W.key||uuid(12)}),V),[])),A(true),setTimeout(()=>j?j():()=>{},1e3);},error(K,te){this.show(K,te,Ce.Error);},warn(K,te){this.show(K,te,Ce.Warn);},success(K,te){this.show(K,te,Ce.Success);},show(K,te,J){$e&&(clearTimeout($e),be&&clearTimeout(be),H.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${H.current} scale(.9)`.trim();},50),be=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=H.current||"",be=null;},500)),$e=setTimeout(()=>{A(false),$e=null,be=null;},(te||4)*1e3),N(J||Ce.Default),g(K),A(true),i?.();},hide(){A(false),l?.();}}));let F=useMemo(()=>{let K={when:M,duration:a||.3,delay:.1};if(y==Ce.Dialog){if(r){let{from:te,to:J}=ut(r,20);return {from:te,to:J,curve:s||Y.EaseInOut,...K}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Y.Spring,...K}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Y.Spring,...K}},[M,y]);return useEffect(()=>{Z.current&&clearTimeout(Z.current),M?k(true):Z.current=setTimeout(()=>k(false),1e3);},[M]),y==Ce.Dialog?jsxs(Fragment$1,{children:[jsx(Fe,{when:M}),jsxs(c,{className:`--sheet --sheet-${y.toLowerCase()} ${M?"is-visible":""} ${C} fixed`.trim(),style:T,fx:F,...b,ref:E,children:[jsx(Ne,{when:z,spinner:m,message:p}),jsxs(c,{className:"--head flex aic rel",children:[jsx(c,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx($,{onClick:K=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(c,{className:`--body flex aic rel ${v?"":"--no-action"}`.trim(),children:x?U:null}),v&&jsx(c,{className:`--footer flex aic rel ${f?f==so.Center?"jcc":"":"jce"}`.trim(),children:v.map((K,te)=>jsx($,{onClick:J=>K.handler?K.handler():K.onClick?K.onClick():console.log("onClick Handler missing"),className:"--action",children:K.label},`sheet-${D}-action-${K.key}`))})]})]}):jsx(c,{className:`--sheet --sheet-${y.toLowerCase()} ${C} abs`.trim(),style:T,...b,fx:F,ref:E,children:M?I:null})}),Tt=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;cs.displayName="Zuz.Sheet";var Pm=cs;var ms=({ref:e,...n})=>{let{name:t,cover:o,spinner:r,errors:s,action:a,children:u,withData:f,beforeSubmit:m,onSubmit:p,onError:i,onSuccess:l,resetOnSuccess:d,...C}=n,{className:T,style:b,rest:R}=B(C),[P,I]=useState(false),g=useRef(null),v=useRef(null),h=useRef(null),y=Ro(),N=useCallback(x=>g.current?g.current.querySelectorAll(x):[],[g.current]),D=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")}),M=x=>{let k=[];return x.querySelectorAll(".--input").forEach(Z=>{k.push(Z.value);}),k.join("")},A=useCallback(x=>{let{required:Z}=D(x);if(Z){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let F=M(x);if(F==""||F.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 F=x.getAttribute("with");switch(F.includes("@")&&(F=F.split("@")[0],F=="match"&&(F=Me.MatchField)),F.toUpperCase()){case Me.IPV4:return _$1(x.value).isIPv4();case Me.IPV6:return _$1(x.value).isIPv6();case Me.Email:return _$1(x.value).isEmail();case Me.Uri:try{return new URL(x.value),!0}catch{return false}case Me.Password:return console.log("Add FORMVALIDATION.Password"),false;case Me.MatchField:let[K,te,J]=x.getAttribute("with").split("@"),j=document.querySelector(`[name=${te.trim()}]`);if(!j)return false;switch(J||"direct-match"){case "if-not-empty":if(j&&!_$1(j.value).isEmpty()&&j.value!=x.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&x.classList.contains("--otp")&&M(j)!=M(x))return false;if(j&&j.value!=x.value)return false;break}break;default:return true}}return true},[g.current]),E=useCallback(()=>{let x={},k={},Z=null,U=null;if(Array.from(N("[name]")).forEach(F=>{let{name:K,required:te,with:J}=D(F),j=true;(te||J)&&(j=A(F)),x[K]={valid:j,value:F.type=="checkbox"?F.checked==true?F.value:false:F.classList.contains("--otp")?M(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value},k[K]=F.type=="checkbox"?F.checked==true:F.classList.contains("--otp")?M(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value,j?F.classList.remove("input-with-error"):(Z==null&&s&&(Z=F,U=s[K]),F.classList.add("input-with-error"));}),Z){let F=Z;if(F.classList.contains("--otp"))for(let K of Array.from(F.querySelectorAll(".--input"))){let te=K;if(te.value==""){te.focus();break}}else F.focus();}return {error:Z!=null,errorMsg:U||"Fix errors to continue...",data:x,payload:k}},[g.current]),H=useCallback(()=>{let{error:x,errorMsg:k,payload:Z}=E();x?y.error(k):a?startTransition(async()=>{m&&m(Z),Tt(o)?o.setLoading(true):I(true),y.clearAll(),withPost(a,{...Z,...f||{}}).then(U=>{let F=U;Tt(o)?o.setLoading(false):I(false),d&&Array.from(N("[name]")).forEach(K=>{K instanceof HTMLInputElement&&(K.value="");}),l?l(F):(y.clearAll(),y.success(F.message||"Redirecting..."));}).catch(U=>{Tt(o)?o.setLoading(false):I(false),i?i(U):y.error(U.message||"We cannot process your request at this time.");});}):p&&p(Z);},[a,v.current,g.current]),z=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(k=>{k.addEventListener("click",H);});},[g.current]),G=useMemo(()=>addPropsToChildren(u,x=>x.props.type=="submit",x=>({ref:h})),[u]);return useImperativeHandle(e,()=>({setLoading(x){if(x){v.current?.hide();try{y.clearAll();}catch{}}I(x);},showError(x){typeof x=="string"?y.error(x):v.current.error(x,4);},hideError(){v.current.hide();try{y.clearAll();}catch{}},init(){z();},submit(){H();}})),useEffect(z,[]),jsxs(c,{ref:g,style:b,className:`--form flex rel ${T} ${t?`--form-${t.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!Tt(o)&&jsx(Ne,{message:o?o.message||void 0:"working",spinner:r,color:o&&"color"in o?o.color:"#ffffff",when:P}),G]})};ms.displayName="Zuz.Form";var Om=ms;var ps=e=>{let {ref:n,cols:t,rows:o,gap:r,gapX:s,gapY:a,align:u,justify:f,inline:m,flow:p,autoCols:i,autoRows:l,template:d,...C}=e;useRef(null);let {className:b,style:R,rest:P}=B(C),I=v=>typeof v=="number"?`repeat(${v}, 1fr)`:v,g={display:m?"inline-grid":"grid",gridTemplateColumns:I(t),gridTemplateRows:I(o),gap:r,columnGap:s,rowGap:a,alignItems:u,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:p,gridAutoColumns:i,gridAutoRows:l,gridTemplateAreas:d,...R};return jsx(c,{ref:n,as:`--grid ${b}`.trim(),style:g,...P})};ps.displayName="Zuz.Grid";var Vm=ps;var us=e=>typeof e=="string"&&e.includes("+"),fs={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"},ds={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 hs=forwardRef(({children:e,keys:n,as:t,className:o,variant:r},s)=>{let{variant:a}=Q(true),u=useMemo(()=>{if(us(n)){let f=null;return {keys:String(n).split("+").reduce((p,i,l,d)=>(d[l+1]?p.push(i):f=i.toUpperCase(),p),[]),children:f}}return {keys:n,children:String(e).toUpperCase()}},[n]);return jsxs(c,{as:`--keyboard-keys --${r||a||q.Small} flex aic ${t} ${o}`.trim(),children:[(Array.isArray(u.keys)?u.keys:[u.keys]).map(f=>jsx("abbr",{title:ds[f],children:fs[f]},f)),jsx(se,{children:u?.children??e})]})});hs.displayName="Zuz.KeyboardKeys";var Yo=hs;var bs=createContext(null),ot=()=>{let e=useContext(bs);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},Gm=({ref:e,icons:n,children:t,...o})=>{let{playlist:r=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:u="No Track",defaultCover:f,onTrackChange:m,...p}=o,{className:i,style:l,rest:d}=B(p),C=useMediaPlayer(r,r[0]??void 0),T=useMemo(()=>({play:L.play,pause:L.pause,prev:L.prev,next:L.next,volumeHigh:L.volumeHigh,volumeMute:L.volumeMute,...n}),[n]),b=useMemo(()=>({...C,mode:s,icons:T}),[C,T]);return jsx(bs.Provider,{value:b,children:jsx(c,{className:`--zuz-media-player ${i}`,style:l,children:t})})},vs=Gm;var ws=e=>{if(!e||isNaN(e))return "0:00";let n=Math.floor(e/60),t=Math.floor(e%60);return `${n}:${t.toString().padStart(2,"0")}`},Yt=e=>typeof e=="string"?jsx(ee,{name:e}):e,Ss=()=>{let{mediaRef:e,state:n,controls:t,mode:o}=ot();return jsxs(c,{as:`--mediaplayer-stage rel --mode-${o}`,children:[o==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),n.isLoading&&jsx(c,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Te,{})})]})},Cs=()=>{let{state:e,defaultArtist:n,defaultTitle:t,defaultCover:o}=ot();return jsxs(c,{as:"--track-info flex aic",children:[jsx(Ue,{src:e.currentItem?.cover||o||"",as:"--track-cover"}),jsxs(c,{as:"flex cols",children:[jsx(c,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(c,{as:"--track-artist",children:e.currentItem?.artist||n||"..."})]})]})},Ts=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(c,{as:"--mediaplayer-controls flex aic",children:[jsx($,{onClick:n.prev,as:"--prev",children:Yt(t?.prev??L.prev)}),jsx($,{onClick:n.togglePlay,as:"--play-pause",children:Yt(e.isPlaying?t?.pause??L.pause:t?.play??L.play)}),jsx($,{onClick:n.next,as:"--next",children:Yt(t?.next??L.next)})]})},Ps=()=>{let{state:e,controls:n,mediaRef:t}=ot(),o=e.progress*(e.duration||0);return jsxs(c,{as:"--track-progress flex aic",children:[jsx(c,{as:"--track-current-duration",children:ws(o)}),jsx(Je,{value:e.progress,onClick:r=>{let s=r.currentTarget.getBoundingClientRect(),a=(r.clientX-s.left)/s.width;n.seek(a);}}),jsx(c,{as:"--track-total-duration",children:ws(e.duration)})]})},Is=()=>{let{state:e,controls:n,icons:t}=ot();return jsxs(c,{as:"--volume-control flex aic gap:8 w:120",children:[jsx($,{onClick:()=>n.setIsMuted(),children:Yt(e.isMuted?t?.volumeMute??L.volumeMute:t?.volumeHigh??L.volumeHigh)}),jsx(Je,{value:e.volume,className:"h:3 flex:1",onClick:o=>{let r=o.currentTarget.getBoundingClientRect();n.setVolume((o.clientX-r.left)/r.width);}})]})};var Um=({ref:e,...n})=>jsx(vs,{...n,ref:e}),qm=Object.assign(Um,{Stage:Ss,TrackInfo:Cs,Controls:Ts,Progress:Ps,Volume:Is}),Xm=qm;var Ns=forwardRef((e,n)=>{let t=useNetworkStatus(),{onlineMessage:o,offlineMessage:r,variant:s}=e;return jsxs(c,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:Y.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||q.Small} fixed flex`,children:[jsx(c,{className:"--ico",children:t?L[Se.Success]:L[Se.Error]}),jsx(_,{as:"--message",children:t?o||"internet connection restored :)":r||"no internet connection"})]})});Ns.displayName="Zuz.NetWorkManager";var Jm=Ns;var Es=forwardRef((e,n)=>{let{strenthMeter:t,onChange:o,...r}=e;"type"in r&&delete r.type;let{style:s,className:a,rest:u}=B(r),[f,m]=useState(false),[p,i]=useState(""),l=useMemo(()=>checkPasswordStrength(p),[p]),d=useDebounce(C=>{t&&i(C.target.value),o&&o(C);},100);return useEffect(()=>{},[]),jsxs(c,{as:"w:100% flex cols",children:[jsxs(c,{style:s,className:"--password flex aic rel",children:[jsx(le,{ref:n,type:f?"text":"password",className:a,onChange:d,...u}),jsx($,{tabIndex:-1,onClick:()=>m(C=>!C),className:"--toggle flex aic jcc abs",children:f?L.eye:L.eyeSlash})]}),t&&jsxs(c,{as:`flex aic --password-meter --pb-score-${l.score}`,style:s,children:[jsxs(c,{as:"--password-bars flex aic",children:[jsx(c,{as:`--pbar ${l.score>=1?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=2?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=3?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=4?"--pb-on":""}`.trim()}),jsx(c,{as:`--pbar ${l.score>=5?"--pb-on":""}`.trim()})]}),jsx(_,{as:"--password-meter-label","aria-hidden":true,children:l.result})]})]})});Es.displayName="Zuz.Password";var ap=Es;var Ls=forwardRef((e,n)=>{let{size:t,length:o,mask:r,...s}=e,a=useRef([]),u="pinput",f=false,m={};"with"in s&&(m={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(u=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:p}=B(s),i=l=>{let d=l.currentTarget,C=a.current[parseInt(d.dataset.index)+1],T=a.current[parseInt(d.dataset.index)-1];d.value.length===1&&C?C.focus():d.value.length===0&&T&&T.focus();};return useEffect(()=>{a.current=a.current.slice(0,t||o);},[t||o]),jsx(c,{name:u,style:p,className:"--otp flex aic rel","data-required":f,"data-size":t||o||4,...m,children:Array(t||o||4).fill(1).map((l,d)=>jsx(le,{autoComplete:"new-password","data-index":d,ref:C=>{a.current[d]=C;},numeric:true,onChange:i,maxLength:1,placeholder:r?"\xB7":"0",type:r?"password":"text",...s},`pin-${d}`))})});Ls.displayName="Zuz.PinInput";var mp=Ls;var Ms=forwardRef((e,n)=>{let{children:t,className:o,name:r,required:s,type:a,value:u,variant:f,checked:m,onSwitch:p,...i}=e,[l,d]=useState(m||false),{variant:C}=Q(true),T=useRef(null);return jsxs(vt,{className:`${o} --${(a||io.Default).toLowerCase()} --radio${!a||a==io.Default?"":"card"} --${f||C||q.Small} flex aic rel`.trim(),...i,children:[jsx(le,{ref:T,defaultChecked:l,value:u||"rd",type:"radio",className:"abs",name:r,required:s||false,onChange:b=>{p&&p(b.target.checked,u||"cb"),d(b.target.checked);}}),jsx(c,{className:"--dot rel",children:jsx(c,{className:"--rod abs abc"})}),jsx(c,{className:"--value",children:t})]})});Ms.displayName="Zuz.Radio";var dp=Ms;var Os=forwardRef((e,n)=>{let{fx:t,withStyle:o,as:r,reverse:s=false,searchIcon:a=L.search,hideSearchIcon:u=false,clearIcon:f=L.close,hideClearIcon:m=false,onChange:p,onClear:i,...l}=e,{style:d,className:C}=B({as:e.as}),[T,b]=useState(""),{variant:R}=Q(true),P=useRef(null);"type"in e&&delete e.type;let I=v=>{b(v.target.value),p?.(v.target.value);},g=v=>{T.trim()!==""&&(b(""),p?.(""),P.current&&(P.current.value="",e.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>P.current?.focus(),value:()=>P.current?.value})),useEffect(()=>{},[]),jsxs(c,{style:d,className:`--search ${s?"--search-rev":""} --${e.variant||R||q.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${C}`.trim(),children:[jsx(le,{ref:P,onChange:I,...l}),e.shortcut&&jsx(Yo,{keys:e.shortcut,as:"abs"}),jsx($,{tabIndex:-1,onClick:v=>g(),className:"--send flex aic jcc",variant:e.variant||q.Medium,children:T!==""?!m&&(typeof f=="string"?jsx(ee,{name:f,as:"--search-action"}):f):!u&&(typeof a=="string"?jsx(ee,{name:a,as:"--search-action"}):a)})]})});Os.displayName="Zuz.Search";var wp=Os;var Hs=({checkIcon:e,selected:n,updateValue:t,o})=>{let r=e?typeof e=="string"?jsx(ee,{name:"checkIcon"}):e:L.check,s=o.disabled===true;return jsxs($,{onClick:a=>{s||(a.stopPropagation(),t(o));},disabled:s,as:`--select-option-item ${n?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ve,{children:[o.icon&&jsx(ee,{name:o.icon,as:`--select-option-icon --icon-${o.value}`,color:o.iconColor}),jsx(_,{suppressHydrationWarning:true,children:typeof o=="string"?o:o.label})]}),n&&jsx(Ve,{aic:true,jcc:true,as:"--select-option-check --abs",children:r})]})};Hs.displayName="Option";var As=Hs;var $s=({ref:e,...n})=>{let{selected:t,options:o,label:r,name:s,variant:a,search:u,searchPlaceholder:f,maxHeight:m,arrowDownIcon:p=L.arrowDown,arrowUpIcon:i=L.arrowUp,expanded:l,multiple:d,tokenizer:C,wrapTokens:T,disabled:b,checkIcon:R,closeIcon:P,onChange:I,...g}=n,[v,h]=useState(()=>d||C?t?(Array.isArray(t)?t:[t]).map(W=>typeof W=="string"?o.find(re=>re.value===W):W):[]:t?typeof t=="string"?o.find(V=>V.value===t):t:o[0]),[y,N]=useState(false),[D,M]=useState(null),A=useRef(null),E=useRef(null),H=useRef(null),z=useId(),G=useMemo(()=>s||z,[]),{reposition:x}=ht(H,{direction:mt.Bottom,offset:2}),{variant:k}=Q(true),Z=P?typeof P=="string"?jsx(ee,{name:P}):P:L.close,{className:U,style:F,rest:K}=B(g,void 0),te=V=>Array.isArray(v)?v.some(W=>W.value===V.value):v?.value===V.value,J=V=>{if(!(b||V.disabled))if(d||C){let W=Array.isArray(v)?v:[],ce=W.find(de=>de.value===V.value)?W.filter(de=>de.value!==V.value):[...W,V];h(ce),I?.(ce);}else h(V),N(false),I?.(V);},j=(V,W)=>{if(V.stopPropagation(),b)return;let re=v.filter(ce=>ce.value!==W.value);h(re),N(false),I?.(re);};return useImperativeHandle(e,()=>({setSelected:V=>{if(Array.isArray(V)){let W=V.map(re=>typeof re=="string"?o.find(ce=>ce.value===re):re).filter(Boolean);h(W);}else if(typeof V=="string"){let W=o.find(re=>re.value===V);W&&h(W);}else h(V);},getValue:()=>v||null}),[v,o]),useEffect(()=>{if(!y)return;let V=()=>{x();};return window.addEventListener("scroll",V,true),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,true),window.removeEventListener("resize",x);}},[y,x]),useEffect(()=>{if(!y){E.current&&(E.current.value=""),M(null);return}E.current?.focus(),x();let V=re=>{H.current&&!H.current.contains(re.target)&&N(false);},W=setTimeout(()=>{document.addEventListener("click",V);},0);return ()=>{clearTimeout(W),document.removeEventListener("click",V);}},[y,x]),jsxs(c,{className:`--select ${l==true?"--expanded":""} --${a||k} ${s?`--${s}`:""} ${b?"--disabled":""} rel`.trim(),name:G,children:[jsxs($,{ref:A,disabled:b,className:`--select-display --selected flex aic rel ${U}`.trim(),withLabel:false,style:F,onClick:V=>{V.stopPropagation(),b||N(W=>!W);},...K,children:[jsx(Ve,{aic:true,as:"--label-wrapper",children:C&&Array.isArray(v)&&v.length>0?jsxs(Ve,{as:`--tokens-wrap${T===true?" --wrap":""}`,children:[v.map(V=>jsxs(Ve,{aic:true,as:"--token",children:[jsx(_,{as:"--token-label",children:V.label}),jsx(c,{as:"--token-remove",onClick:W=>j(W,V),children:Z})]},V.value)),v.length<o.length&&jsx(_,{as:"--label",children:r||"Choose"})]}):jsx(_,{as:"--label",children:Array.isArray(v)?v.length>0?`${v.length} selected`:r||"Choose":v?.label||r||"Choose"})}),jsx(c,{className:"--svg-arrow rel flex aic jcc",children:y?typeof i=="string"?jsx(ee,{name:i,as:"--search-action"}):i:typeof p=="string"?jsx(ee,{name:p,as:"--search-action"}):p})]}),jsxs(c,{id:G,className:"--options-list -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!y,style:{maxHeight:m||"auto"},ref:H,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:y,duration:.05},children:[u&&jsx(c,{as:"--select-search --sticky",children:jsx(le,{ref:E,onChange:V=>{M(V.target.value==""?null:V.target.value);},className:"--search-input",placeholder:f||"Search..."})}),o.filter(V=>!D||V.label.toLowerCase().includes(D.toLowerCase())).map(V=>jsx(As,{updateValue:J,checkIcon:R,selected:te(V),o:V},`option-${(typeof V=="string"?V:V.label).replace(/\s+/g,"-")}-${typeof V=="string"?V:V.value}`))]})]})};$s.displayName="Zuz.Select";var Ip=$s;var zs=forwardRef((e,n)=>jsx(wt,{type:Le.Switch,...e,ref:n}));zs.displayName="Zuz.Switch";var Np=zs;var Fs=e=>{let{idx:n,id:t,as:o,weight:r,style:s,value:a,render:u,resize:f,sortBy:m,sortable:p,onSort:i}=e,[l,d]=useState(0),C=()=>{p&&(i?.(String(t),l==1?-1:1),d(T=>T==1?-1:1));};return jsxs(c,{style:{flex:r||1,...s},as:`--col flex aic ${o||""} ${p?"--sortable":""}`,onClick:C,children:[jsx(c,{children:a}),n==-1&&p&&m==t&&jsx(c,{as:"--arrow flex aib",children:l==1?L.arrowUp:L.arrowDown})]})};Fs.displayName="Zuz.Column";var eo=Fs;var Ks=e=>{let{index:n,pubsub:t,schema:o,data:r,ids:s,styles:a,animate:u,sortBy:f,selectable:m,tableRef:p,loading:i,rowClassName:l,onSort:d,onRowClick:C,onSelect:T,onContextMenu:b}=e,R=useDelayed(),P=useMemo(()=>({transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(n+1)}),[]),I=useRef(null),g=(h,y)=>{n==-1?t.emit(`ALL_ROWS_${h?"CHECKED":"UNCHECKED"}`,h):(T&&T(r,h),t.emit(`ROW_${h?"CHECKED":"UNCHECKED"}`,h,y));},v=(h,y,N)=>jsx(eo,{idx:h,id:y,as:"--selector",pubsub:t,value:jsx(wt,{value:N,ref:I,onSwitch:g,type:Le.Default})});return useEffect(()=>{let h=(M,A)=>{I.current?.setChecked(M,false);},y=(M,A)=>{let E=false;p?.current&&p.current.querySelectorAll(".--row").forEach(H=>{let z=H;if(!z.classList.contains("--row-head")){let G=z.querySelector(".--selector input[type=checkbox]");G&&G.checked&&!E&&(E=G.checked);}}),I.current.setChecked(E,false);},N=M=>{I.current?.setChecked(M,false),T&&T(r,M);},D=M=>{I.current?.setChecked(M,false),T&&T(r,M);};return n==-1?(t.on("ROW_CHECKED",h),t.on("ROW_UNCHECKED",y),()=>{t.off("ROW_CHECKED",h),t.off("ROW_UNCHECKED",y);}):(t.on("ALL_ROWS_CHECKED",N),t.on("ALL_ROWS_UNCHECKED",D),()=>{t.off("ALL_ROWS_CHECKED",N),t.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(c,{onContextMenu:h=>b?b(h,r):null,onClick:h=>C?C(h,e.data):()=>{},...u?{fx:{...P,when:R}}:{},as:`--row flex aic ${C?"--row-clickable":""} ${n==-1?"--row-head":""} ${l||""}`,children:[n==-1&&o.map((h,y)=>{let{renderWhenHeader:N,render:D,value:M,...A}=h;return jsxs(Fragment,{children:[m&&y==0&&v(-1,`--selector-${h.id}`,"all"),jsx(eo,{idx:-1,onSort:d,sortBy:f,value:M,...A,pubsub:t,style:a[h.id]})]},`--col-${h.id}`)}),i&&n>-1&&jsx(c,{as:"--col",children:jsx(_,{as:"opacity:0",children:"..."})}),!i&&n>-1&&s&&r&&o.map((h,y)=>jsxs(Fragment,{children:[m&&y==0&&v(y,`--selector-${h.id}`,h.id.toString()),s.includes(String(h.id))?jsx(eo,{pubsub:t,idx:y,id:String(h.id),style:a[String(h.id)],value:h.render?h.render(r,n):r[String(h.id).includes(".")?String(h.id).split(".").reverse()[0]:h.id]}):null]},`--${String(h.id)}-val-${y}`))]})};Ks.displayName="Zuz.Row";var to=Ks;var qs=(e,n)=>{let{schema:t,rows:o,rowCount:r,rowsPerPage:s,currentPage:a,pagination:u,paginationHash:f,showPaginationOnZeroPageCount:m,animateRows:p,header:i,rowClassName:l,selectableRows:d,hoverable:C,sortBy:T,loading:b,loadingRowCount:R,loadingMessage:P,spinner:I,emptyMessage:g,onSort:v,onRowClick:h,onRowSelectToggle:y,onPageChange:N,onRowContextMenu:D,...M}=e,A=useRef(null),E=useMemo(()=>t.reduce((ie,oe)=>(ie[oe.id]={flex:oe.weight||1,...oe.w&&{width:oe.w},...oe.maxW&&{maxWidth:oe.maxW},...oe.minW&&{minWidth:oe.minW},...oe.h&&{height:oe.h},...oe.maxH&&{maxHeight:oe.maxH},...oe.minH&&{minHeight:oe.minH}},ie),{}),[t]),H=useMemo(()=>Object.keys(E),[t]),z=useMemo(()=>i??true,[i]),{style:G,className:x,rest:k}=B(M),Z=useRef(null),U=useMemo(()=>new PubSub,[]),F=useRef(o.map(()=>uuid(8))),[K,te]=useState(T||null),[J,j]=useState(P||"loading"),V=useMemo(()=>!b&&o&&o.length==0,[b,o]),W=useCallback(()=>g?typeof g=="function"?jsx(g,{}):g:jsx(_,{as:"tac s:18 mt:75",children:"No Record Found"}),[b,o]);useEffect(()=>{F.current=o.map(()=>uuid(8));},[o]);let re=(ie,oe)=>{te(ie),v?.(ie,oe);},ce=(r||(o?o.length:0))/(s||10),de=useMemo(()=>m||ce>1?jsx(bt,{hash:f,ref:A,renderOnZeroPageCount:m,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:r||(o?o.length:0),itemsPerPage:s||10}):null,[a,r]);return useImperativeHandle(n,()=>({setLoading(ie){}})),jsxs(c,{as:`--table ${C??true?"--hoverable":""} flex cols rel ${x}`,ref:Z,children:[z==true&&jsx(to,{sortBy:K,onSort:re,tableRef:Z,pubsub:U,selectable:d,index:-1,schema:t,loading:true,styles:E}),b&&jsxs(c,{as:"center-x flex aic --table-spinner",children:[jsx(Te,{type:I||fe.Simple}),J&&jsx(_,{as:"--table-loading-message",children:J})]}),b&&Array(R||5).fill({}).map((ie,oe)=>jsx(to,{tableRef:Z,index:oe,pubsub:U,schema:t,styles:E,loading:true,animate:p,onRowClick:h},`--trow-loading-${oe}-${t[0].id}`)),!b&&o&&o.map((ie,oe)=>jsx(to,{tableRef:Z,pubsub:U,loading:false,index:oe,schema:t,ids:H,styles:E,animate:p,data:ie,onRowClick:h,rowClassName:l,selectable:d,onSelect:y,onContextMenu:D},`--trow-${F.current[oe]||oe}-${t[0].id}`)),V&&W(),u&&de&&jsx(c,{"aria-hidden":!u||!de,...p?{fx:{transition:X.SlideInBottom,curve:Y.EaseInOut,delay:.02*(o.length+1),when:!b&&o&&u&&de!=null}}:{},as:"--row flex aic --row-footer",children:de})]})};qs.displayName="Zuz.Table";var _p=forwardRef(qs),Fp=_p;var Kp=({ref:e,...n})=>{let{title:t,items:o}=n,[r,s]=useState(0),a=(u,f,m)=>{u.preventDefault(),s(f),document.getElementById(m)?.scrollIntoView({behavior:"smooth"});};return jsxs(c,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(_,{as:"--toc-title",children:t}),jsx(Ge,{items:o.map((u,f)=>jsx("a",{className:r==f?"--toc-active":"",style:{anchorName:r===f?"--toc-active":"none",color:r==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:m=>a(m,f,u.tag),href:`#${u.tag}`,children:u.label}))})]})},Wp=Kp;var Xs=({isActive:e,transitionType:n,speed:t,width:o,render:r,content:s,onHeightChange:a})=>{let u=useRef(null),f=useResizeObserver(u);useEffect(()=>{e&&f.height>0&&a(f.height);},[e,f.height]);let p=useMemo(()=>{let i={width:o>0?`${o}px`:"100%",minWidth:o>0?`${o}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return n==="fade"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:n==="scale"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:i},[e,n,o,t]);return jsx(c,{ref:u,style:{...p},className:"--content",children:r||e?s:null})};Xs.displayName="Zuz.TabBody";var Ys=Xs;var Js=({ref:e,...n})=>{let{tabs:t,speed:o=.3,prerender:r=true,variant:s,tabStyle:a="fixed",onChange:u,transitionType:f="slide",...m}=n,[p,i]=useState(0),l=useRef(null),d=useResizeObserver(l),C=useMemo(()=>uuid(8),[]),[T,b]=useState("auto"),R=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(e,()=>({setTab:y=>i(y)}));let P=useMemo(()=>t.map(y=>({...y,key:y.key||uuid(8)})),[t]),{style:I,className:g,rest:v}=B({as:`flex cols w-full no-overflow ${m.as||""}`,...m}),h=()=>{if(!R)return {opacity:0};switch(f){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${P.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${p*d.width}px, 0, 0)`,transition:`transform ${o}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(c,{ref:l,style:I,className:`--tabview --${a} flex cols ${g}`,children:[jsx(St,{as:"--tabview-head",onSwitch:y=>{i(y.index);let N=P.find(D=>D.tag==y.tag);N&&N.onSelect&&(N.onSelect(N,y.index),u?.(N,y.index));},selected:p,items:P.reduce((y,N,D)=>(y.push({icon:N.icon,index:D,label:N.label,tag:N.tag}),y),[])}),jsx(c,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:T,transition:R?`height ${o}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(c,{className:"--track",style:{...h()},children:P.map((y,N)=>jsx(Ys,{isActive:N===p,transitionType:f,speed:o,width:d.width,render:r||N===p,onHeightChange:D=>N===p&&b(D),content:y.body},`tab-body-${y.key||N}-${C}`))})})]})};Js.displayName="Zuz.TabView";var tu=Js;var su=({ref:e,commands:n,onCommand:t,welcomeMessage:o="Welcome to Zuz Terminal v1.0.0",prompt:r="zuz ~ ",variant:s,...a})=>{let[u,f]=useState([{type:"output",content:o}]),[m,p]=useState(""),i=useRef(null),l=useRef(null),{variant:d}=Q(true);useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight);},[u]);let C=g=>{let v=typeof g=="string"?{type:"output",content:g}:g;f(h=>{let y=[...h,v];return y.length>1e3?y.slice(-1e3):y});},T=()=>f([]);useImperativeHandle(e,()=>({write:C,clear:T}));let b=async g=>{let[v,...h]=g.split(" "),y=v.toLowerCase();return n&&n[y]?await n[y](h):t?await t(g):`command not found: ${v}`},R=g=>{let v=/\u001b\[(\d+)m/g,h=[],y={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",M=false,A;for(;(A=v.exec(g))!==null;){let H=g.slice(N,A.index);H&&h.push({text:H,color:D,bold:M});let z=A[1];z==="0"?(D="#d4d4d4",M=false):z==="1"?M=true:y[z]&&(D=y[z]),N=v.lastIndex;}let E=g.slice(N);return E&&h.push({text:E,color:D,bold:M}),h},P=(g,v)=>g.includes("\x1B")?R(g).map((h,y)=>jsx(se,{style:{color:h.color||"#d4d4d4",fontWeight:h.bold?"bold":"normal"},children:h.text},`--terminal-msg-${y}-${h.text.replace(/\S+/g,"-")}`)):jsx(se,{style:{color:v==="error"?"#ff5f56":v==="command"?"#00ff00":"#d4d4d4"},children:g}),I=async g=>{if(g.key==="Enter"&&m.trim()){let v=m.trim(),h=[...u,{type:"command",content:`${r}${v}`}];p(""),f(h);let y=await b(v);f(N=>[...N,{type:"output",content:y}]);}};return jsxs(c,{as:`--zuz-terminal --${s||d||q.Medium} flex cols ${a.className}`,onClick:()=>l.current?.focus(),children:[jsx(c,{ref:i,className:"--terminal-log",children:u.map((g,v)=>jsx(c,{children:jsx(_,{children:P(g.content,g.type)})},v))}),jsxs(c,{as:"flex aic --terminal-input",children:[jsx(_,{as:"--terminal-prompt",children:r}),jsx(le,{ref:l,className:"--zuz-term-input",autoFocus:true,value:m,variant:s||d||q.Medium,onChange:g=>p(g.target.value),onKeyDown:I})]})]})},au=su;var iu=({meta:e})=>jsxs($,{as:"flex aic --command-item",children:[e.icon&&jsx(ee,{name:e.icon,as:"--command-icon"}),jsx(_,{children:e.label})]}),lu=({position:e,onSelect:n,commands:t,visible:o})=>jsx(c,{"aria-hidden":!o,fx:{transition:X.SlideInBottom,duration:.1,when:o},className:"--command-box abs grid",style:{...e},children:t.map(r=>jsx(iu,{meta:r},`cmd-${r.label.replace(/\s+/,"-")}`))}),ra=lu;var aa=forwardRef((e,n)=>{let{autoResize:t,maxHeight:o,variant:r,resize:s="none",command:a,commands:u,onInput:f,cmd:m,renderDropdown:p,value:i,defaultValue:l,...d}=e,C=useRef(null),T=useRef(null),{variant:b}=Q(true),{style:R,className:P,rest:I}=B(d),{showDropdown:g,dropdownPosition:v,handleKeyDown:h,handleInput:y,handleCommandSelect:N}=useCommandActions({command:a,commands:u,cmd:m,ref:C}),D=useCallback(()=>{let A=C.current;!A||!t||(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{A.style.height="auto";let E=A.scrollHeight;if(o){let H=parseInt(o.toString(),10);isNaN(H)||(E=Math.min(E,H));}A.style.height=`${E}px`,A.style.overflowY=o&&E>=parseInt(o.toString(),10)?"auto":"hidden";}));},[t,o]),M=A=>{f?.(A),y(A),D();};return useEffect(()=>{D();},[i,l,D]),useEffect(()=>{t&&C.current&&D();},[t,D]),useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current);},[]),jsxs(c,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${r||b||q.Medium} flex ${P}`.trim(),style:{...R,resize:s,height:t?"auto":R?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:h,onInput:M,ref:A=>{typeof n=="function"?n(A):n&&(n.current=A),C.current=A;},value:i,defaultValue:l,...I}),p?p({show:g,position:v,commands:u||[],onSelect:N}):u&&u.length>0&&jsx(ra,{visible:g,commands:u,onSelect:N,position:v})]})});aa.displayName="Zuz.TextArea";var fu=aa;var la=forwardRef((e,n)=>{let{as:t,value:o,color:r,direction:s,...a}=e,u=useRef(null),[f,m]=useState(o||0);return useImperativeHandle(n,()=>({updateValue(p){f.toString().length!==p.toString().length&&m(p);},setValue(p){if(this.updateValue(p),u.current){let i=p.toString().split("");u.current.querySelectorAll(".--wheel-char").forEach((l,d)=>{let C=i[d];if(l instanceof HTMLElement){l.setAttribute("data-value",C);let T=l.querySelector(".--wheel-char-track");T instanceof HTMLElement&&(T.style.setProperty("--v",C),T.offsetWidth);}});}}})),useEffect(()=>{m(o||0);},[o]),jsxs(c,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:u,...a,children:[(f||0).toString().split("").map((p,i)=>isNaN(parseInt(p,10))?jsx(se,{className:"--wheel-char wheel-char-symbol grid",children:p},`wheel-char-symbol-${i}`):jsx(se,{"data-value":p,className:`--wheel-char grid ${i>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(se,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":p},children:[jsx(se,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((l,d)=>jsx(se,{children:l},`${i}--${d}`)),jsx(se,{children:!s||s==="down"?9:0})]})},`wheel-char-${i}`)),r&&jsx(c,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${r}, transparent, transparent, transparent, ${r})`}})]})});la.displayName="Zuz.TextWheel";var vu=la;var sr=forwardRef((e,n)=>{let{as:t,meta:o,nodes:r,icons:s,onSelect:a,treeTag:u,selected:f,roots:m,expanded:p,...i}=e,{tag:l,label:d,icon:C,under:T,isHead:b}=o,R=useMemo(()=>m.includes(l),[m]),[P,I]=useState(p),g=()=>{localStorage.setItem(`--tn${u}-${l}`,P?"0":"1"),I(!P);};useEffect(()=>{p||R&&!localStorage.getItem(`--tn${u}-${l}`)?(localStorage.setItem(`--tn${u}-${l}`,"1"),I(true)):I(localStorage.getItem(`--tn${u}-${l}`)=="1");},[]);let v=useMemo(()=>r.filter(h=>h.under==l),[r,l]);return jsxs(c,{className:`--treenode ${R?"--is-root":""} --treenode-${l} flex cols`,children:[jsxs(c,{className:`--node --node-${l} flex aic ${f==l?" --selected":""}`,children:[jsx($,{skeleton:i.skeleton,onClick:g,className:"--node-aro-btn",disabled:v.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(ee,{skeleton:i.skeleton,className:"--node-aro-icon",name:v.length==0?s?.arrowDisabled||s?.arrowClose:P?s?.arrowOpen:s?.arrowClose}):v.length==0?L.chevronBottom:P?L.chevronBottom:L.chevronRight}),jsxs($,{className:"--node-meta flex aic",onClick:h=>a(l),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(ee,{skeleton:i.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:C||(P?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx(_,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:i.skeleton,children:d})]})]}),P&&v.length>0&&jsx(c,{className:`--sub-node tree-sub-node-${l} flex cols`,children:v.map(h=>jsx(sr,{treeTag:u,selected:f,onSelect:a,icons:s,roots:m,expanded:h.expanded||false,meta:h,nodes:r},`--node-${h.tag}`))})]})});sr.displayName="TreeItem";var ma=sr;var ua=forwardRef((e,n)=>{let{as:t,nodes:o,onNodeSelect:r,tag:s,icons:a,roots:u,selected:f,...m}=e,[p,i]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>p}),[r]);let l=d=>{i(d),r&&r(d);};return useEffect(()=>{p!=f&&i(f);},[f]),jsx(c,{className:"--treeview flex cols",children:o.filter(d=>u.includes(d.tag)).map(d=>jsx(ma,{treeTag:s?`-${s}`:"",selected:p,onSelect:C=>l(C),icons:a,meta:d,roots:u,expanded:d.expanded||false,skeleton:m.skeleton,nodes:o},`--node-${d.tag}`))})});ua.displayName="Zuz.TreeView";var Nu=ua;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
+ export{Se as ALERT,mr as AVATAR,Yi as Accordion,ol as ActionBar,sl as Alert,Cl as AutoComplete,kl as Avatar,Ml as Badge,c as Box,dc as Bubble,On as BubbleMediaType,Mn as BubbleStatus,$ as Button,Bn as CHART,Le as CHECKBOX,Lu as COLORTHEME,Oo as Calendar,nc as Carousel,pc as Chart,wt as CheckBox,Ic as CodeBlock,Fc as ColorScheme,yo as ContextMenu,Gc as CookiesConsent,Ne as Cover,am as CropShape,nm as Cropper,lm as Crumb,Du as DATATYPE,Qe as DIALOG,pr as DIALOG_ACTION_POSITION,he as DRAWER_SIDE,um as DatePicker,wo as Dialog,Po as Drawer,Bt as FILTER,Me as FORMVALIDATION,Hu as FORMVALIDATION_STYLE,hm as Fab,bm as Filters,Ve as Flex,Om as Form,Vm as Grid,xo as Group,ee as Icon,Ue as Image,le as Input,Yo as KeyboardKeys,ds as KeysLabelMap,fs as KeysMap,vt as Label,go as LayersProvider,Ge as List,Xm as MediaPlayer,Jm as NetworkStatus,pt as ORIGIN,Mu as OriginType,Fe as Overlay,mt as POSITION,Vu as PROGRESS,bt as Pagination,Wt as PaginationStyle,ap as Password,mp as PinInput,pe as Position,Ke as ProgressBar,io as RADIO,dp as Radio,Ce as SHEET,so as SHEET_ACTION_POSITION,ku as SKELETON,ao as SLIDER,Ou as SORT,fe as SPINNER,So as ScrollView,wp as Search,Ip as Select,St as SelectTabs,Pm as Sheet,Je as Slider,$t as SnackPosition,qr as SnackStyle,Vt as SnackType,se as Span,Te as Spinner,Au as Status,Np as Switch,X as TRANSITIONS,Y as TRANSITION_CURVES,tu as TabView,Fp as Table,Wp as TableOfContents,au as Terminal,_ as Text,vu as TextWheel,fu as Textarea,Sa as ThemeProvider,Xr as ToastDefaultTitle,$t as ToastPosition,Io as ToastProvider,qr as ToastStyle,Vt as ToastType,Fo as ToolTip,Nu as TreeView,q as Variant,ut as animationTransition,lo as buildClassString,dr as buildWithStyles,rf as css,co as getAnimationCurve,nf as getAnimationTransition,ga as getZuzMap,us as isKeyCombination,fr as setZuzMap,B as useBase,Ii as useContextMenu,Bi as useDialog,Li as useDrawer,ue as useFx,Di as useMorph,ht as usePosition,Fi as useSnack,Ro as useToast};