@zuzjs/ui 1.0.69 → 1.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +4 -4
- package/dist/bin.js +1 -1
- package/dist/{chunk-3NHJM7EJ.js → chunk-BWLQSC4Y.js} +3 -3
- package/dist/{chunk-6WVMHXAS.cjs → chunk-DZAIAT3J.cjs} +2 -2
- package/dist/css/styles.css +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +98 -18
- package/dist/index.d.ts +98 -18
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f
|
|
1
|
+
import {f,e,g,d,h,c}from'./chunk-BWLQSC4Y.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-BWLQSC4Y.js';import {createContext,forwardRef,useMemo,Fragment,useState,useRef,useImperativeHandle,useEffect,useCallback,isValidElement,createElement,useId,memo,useLayoutEffect,useContext,useSyncExternalStore,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useIntersectionObserver,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts,useCommandActions}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {uuid,MD5,withPost,_,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 xi="1.0.69",bi=xi;var Ur={Circle:"CIRCLE",Square:"SQUARE"},ed={Default:"DEFAULT",Circle:"CIRCLE"},td={Light:"light",Dark:"dark",System:"system"},Ue={Default:"DEFAULT",Switch:"SWITCH"},Tt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},ve=Tt,Pt=AnchorType,od=Pt,rd={Top:"top",TopStart:"top-start",TopCenter:"top-center",TopEnd:"top-end",Bottom:"bottom",BottomStart:"bottom-start",BottomCenter:"bottom-center",BottomEnd:"bottom-end",Left:"left",LeftStart:"left-start",LeftCenter:"left-center",LeftEnd:"left-end",Right:"right",RightStart:"right-start",RightCenter:"right-center",RightEnd:"right-end"},q={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},nd={Asc:"ASC",Desc:"DESC"},sd={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},ad={Dots:"DOTS"},ot={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN",NotEmpty:"NOT_EMPTY",NotMinusOne:"NOT_MINUS_ONE"},Me={Success:"success",Error:"error",Warning:"warning",Info:"info"},oe={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},Q={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInTopScale:"SLIDE_FROM_BOTTOM_SCALE",SlideInBottomScale:"SLIDE_FROM_BOTTOM_SCALE",SlideInLeft:"SLIDE_FROM_LEFT"},id={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},Oe={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE",Confirm:"CONFIRM"},rt=Oe,Mo={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},qr=Mo,ld={Bar:"BAR",Ring:"RING"},Oo={Default:"range",Text:"number"},Vo={Default:"DEFAULT",Card:"CARD"},Xt={Gooey:"gooey"},Re={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Xr=Symbol.for("zuz.global.map"),Yr=e=>{globalThis[Xr]=e;},Si=()=>globalThis[Xr]||{},Do=e$1=>{let o=Array.isArray(e$1)?e$1.join(" "):e$1;if(!o||typeof o!="string")return "";let t=Si();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(o).filter(Boolean).map(r=>{let s=r.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,i,u]=s;return g(u).map(l=>{let c=`${i}(${l})`;return t[c]||l}).join(" ")}return t[r]||r}).join(" ")},Id=e=>{let o=Array.isArray(e)?e.join(" "):e;return !o||typeof o!="string"?"":Do(o)},jr=e=>{let o={};for(let t in e){let n=e[t];if(t.startsWith("--")){o[t]=n;continue}let r=d[t]?.toString()??t;if(r==="x"||r==="translateX"){let s=o.translate?.split(" ")??["0px","0px"];o.translate=`${h.addUnitsSafely(t,n)} ${s[1]??"0px"}`;}else if(r==="y"||r==="translateY"){let s=o.translate?.split(" ")??["0px","0px"];o.translate=`${s[0]??"0px"} ${h.addUnitsSafely(t,n)}`;}else c.includes(r)?o[r]=h.addUnitsSafely(t,n):o[r]=n;}return o},Ho=e=>{if(!e)return "linear";switch(e.toUpperCase()){case oe.Bounce:return "var(--bounce)";case oe.Liquid:return "var(--liquid)";case oe.Spring:return "var(--spring)";case oe.EaseInOut:return "ease-in-out";case oe.EaseOutBack:return "ease-out-back";default:return "linear"}},Rt=(e,o=0,t=0)=>{let n={},r={},s=o||20,a=t||0;switch(e){case Q.SlideInLeft:case Q.SlideInRight:n={"--fx-x":e===Q.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},r={"--fx-x":`${a}px`,opacity:1};break;case Q.SlideInTop:case Q.SlideInBottom:n={"--fx-y":e===Q.SlideInTop?`-${s}px`:`${s}px`,opacity:0},r={"--fx-y":`${a}px`,opacity:1};break;case Q.SlideInTopScale:case Q.SlideInBottomScale:n={"--fx-y":e===Q.SlideInTopScale?`-${s}px`:`${s}px`,scale:1.1},r={"--fx-y":`${a}px`,scale:1};break;case Q.ScaleIn:n={scale:0,opacity:0},r={scale:1,opacity:1};break;case Q.FadeIn:n={opacity:0},r={opacity:1};break}return {from:n,to:r}},Ed=(e,o,t)=>{let{from:n,to:r}=Rt(e);return o?{...n,...r}:t?n:r};var Ci=(e,o)=>{let t=useRef([]),n=useRef(false);return useEffect(()=>{e?.when||(n.current=false);},[e?.transition]),useEffect(()=>{let r=o?.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(i=>r.style.removeProperty(i)));};return r.addEventListener("transitionend",s),()=>r.removeEventListener("transitionend",s)},[e,o]),useEffect(()=>{if(typeof window>"u"||!o?.current)return;let r=o.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?Ho(e.curve):"var(--spring)"}`);},[e,o]),useMemo(()=>{if(!e)return {style:{}};let{transition:r,from:s,to:a,exit:i,when:u,duration:l=.3,delay:c=0,curve:d,margin:f=0,offset:p=20,watch:y=[]}=e,w=u===false&&!n.current;u===true&&(n.current=true);let x={},{from:C,to:v}=r?Rt(r,p,f):{from:s||{},to:a||{}};x=u===void 0?{...C,...v}:u?{...v}:i||C;let T=Ho(d),h=[],S=jr(x);t.current=Object.keys(S);let g={...S};return Object.keys(S).forEach(b=>{let E=b.startsWith("--")?"all":b;h.includes(E)||h.push(`${E} ${l}s ${T} ${c}s`);}),y.forEach(b=>{h.includes(b)||h.push(`${b} 0.1s ${T} 0s`);}),{style:{...g,transition:w?"none":h.join(", "),opacity:w?0:g.opacity,pointerEvents:w?"none":g.pointerEvents}}},[e,e?.when,e?.watch])},Se=Ci;var Yt=null,It=e=>{if(e!=null)return typeof e=="number"?`${e}px`:e},Ti=(e,o)=>{let{as:t,fx:n,busy:r=false,stripes:s,transition:a,skeleton:i,className:u,propsToRemove:l,draggable:c,dragOptions:d,style:f$1,...p}=e||{},y=typeof window<"u",w={},x={};if(c&&y&&!Yt&&(import('@zuzjs/hooks').then(g=>{Yt=g.useDrag;}).catch(g=>{console.error("Error loading useDrag:",g);}),Yt)){let g=Yt(d);w={onMouseDown:g.onMouseDown},x={transform:`translate(${g.position.x}px, ${g.position.y}px)`};}let C=[u,r===true?"--is-busy":"",s?`--has-stripes --stripes-${s}`:""].filter(Boolean).join(" "),v=a?{transition:a,duration:.3}:n||{},{style:T}=Se(v,o),h={};if(i?.enabled){let g=It(i.size),b=It(i.width),E=It(i.height),V=It(i.defaultSize),I=It(i.radius);g?(h["--skeleton-width"]=g,h["--skeleton-height"]=g):(b&&(h["--skeleton-width"]=b),E&&(h["--skeleton-height"]=E),V&&(h["--skeleton-default-size"]=V)),I&&(h["--skeleton-radius"]=I);}let S=Do(t??"");return {style:{...h,...f$1,...T,...x},className:[C,S||"",i?.enabled?"--skeleton":"",i?.enabled&&i?.type==="CIRCLE"?"--skeleton-circle":"",c?"--draggable":""].join(" ").trim(),rest:{...w,...f(p,l?[...l,"skeleton"]:["skeleton"])}}},M=Ti;var en="(prefers-color-scheme: dark)",Ii=typeof window>"u",on=createContext(void 0),zo=e=>{let o=useContext(on);if(!o){if(e===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return o},j=zo,Ei=({children:e,storageKey:o="--ucs",forceTheme:t,zuzMap:n,...r})=>(n&&Yr(n),jsx(Bi,{storageKey:o,forceTheme:t,...r,children:e})),Bi=({children:e,storageKey:o,forceTheme:t,...n})=>{let[r,s]=useState(()=>t||tn(o,"system")),[a,i]=useState(()=>t||tn(o)),u=f=>(f||(f=window.matchMedia(en)),f.matches?"dark":"light"),l=useCallback(f=>{let p=f=="system"?u():f,y=document.documentElement;y.setAttribute("color-scheme",p),y.style.colorScheme=p,i(p);},[u]),c=useCallback(f=>{s(f),localStorage.setItem(o,f),l(f);},[r]),d=useCallback(f=>{let p=u(f);i(p),r==="system"&&l("system");},[r]);return useEffect(()=>{r==null&&window.localStorage.getItem(o);},[r]),useEffect(()=>{window.matchMedia(en).addEventListener("change",d);},[d]),useEffect(()=>{let f=p=>{p.key==o&&(p.newValue?c(p.newValue):c("system"));};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)},[c]),useEffect(()=>{l(t||r||"system");},[r]),jsxs(on,{value:{colorScheme:r,resolvedScheme:a,setColorScheme:c,...n},children:[t?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
2
2
|
const themes = ['light', 'dark']
|
|
3
|
-
let theme = localStorage.getItem(\`${
|
|
3
|
+
let theme = localStorage.getItem(\`${o}\`) || "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(Vo,{children:e})]})},Ur=(e,r)=>{if(gi)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||r};var Xr=({ref:e,...r})=>{let{style:t,...n}=r,{style:o,className:s,rest:a}=B(n);return jsx("span",{ref:e,style:t,className:s,...a})};Xr.displayName="Zuz.Span";var ce=Xr;var jr=forwardRef((e,r)=>{let{name:t,pathCount:n,variant:o,color:s,size:a,...i}=e,{variant:p}=j(true),{className:l,style:c,rest:d}=B(i);return jsx("div",{style:{color:s,...c,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${o||p||q.Small} ${l}`.trim(),ref:r,...d,children:Array(n||0).fill(0).map((u,m)=>jsx(ce,{className:`path${m+1}`},`${t}-layer-${m}`))})});jr.displayName="Zuz.Icon";var te=jr;var Se={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Qr=e=>{let{type:r,variant:t,color:n,...o}=e,{className:s,style:a,rest:i}=B(o),{spinner:p}=j(true),l=()=>{switch(r||p?.type||Se.Simple){case Se.Simple:return null;case Se.Wave:return jsxs(Fragment$1,{children:[jsx(f,{as:"--bar --bar1"}),jsx(f,{as:"--bar --bar2"}),jsx(f,{as:"--bar --bar3"})]});case Se.Roller:return null}};return jsx(f,{className:`${s} --spinner --${(r||p?.type||Se.Simple).toLowerCase()} --${t||p?.variant||q.Small}`.trim(),style:{...a},...i,children:l()})};Qr.displayName="Zuz.Spinner";var Re=Qr;var Jr=({ref:e,...r})=>{let{h:t,html:n,children:o,lines:s,tfx:a,delay:i=0,duration:p=.5,stagger:l=.05,repeat:c=true,reveal:d=false,hover:u=false,...m}=r,{style:h,className:T,rest:x}=B(m),P=useRef(null),[v,R]=useState(false),[y]=useIntersectionObserver([P],{threshold:[1]}),S=useMemo(()=>{if(h?.opacity!==void 0)return h.opacity;if(typeof r.as=="string"){let A=r.as.match(/opacity:([\d.]+)/);if(A)return A[1]}return 1},[r.as,h?.opacity]),g=useMemo(()=>a?u?v:d?y===1:true:false,[a,u,v,d,y]);useEffect(()=>{e&&(typeof e=="function"?e(P.current):e.current=P.current);},[e]);let b=`h${r.h||1}`,E=useMemo(()=>typeof o=="string"?o:Array.isArray(o)&&o.length===1&&typeof o[0]=="string"?o[0]:null,[o]),F=useMemo(()=>{let A=Array.isArray(r.as)?r.as.join(" "):r.as||"";return typeof A=="string"&&A.includes("text-clip")},[r.as]);useLayoutEffect(()=>{if(!F||!P.current||E===null)return;let A=P.current,L=0,O=0,$=()=>{let k=A.getBoundingClientRect(),U=getComputedStyle(A).backgroundImage,X=k.width;A.querySelectorAll(".--fx-char").forEach(z=>{let W=z.getBoundingClientRect().left-k.left;z.style.backgroundImage=U,z.style.backgroundRepeat="no-repeat",z.style.backgroundSize=`${X}px 100%`,z.style.backgroundPosition=`-${W}px 0`,z.style.backgroundClip="text",z.style.webkitBackgroundClip="text",z.style.color="transparent";});},Z=()=>{cancelAnimationFrame(L),cancelAnimationFrame(O),L=requestAnimationFrame(()=>{O=requestAnimationFrame($);});};Z();let I=new ResizeObserver(Z);return I.observe(A),typeof document<"u"&&"fonts"in document&&document.fonts?.ready.then(Z),window.addEventListener("resize",Z),()=>{cancelAnimationFrame(L),cancelAnimationFrame(O),I.disconnect(),window.removeEventListener("resize",Z);}},[F,E,a,g]);let M=useMemo(()=>n?jsx(ce,{dangerouslySetInnerHTML:{__html:n}}):a&&E!==null?E.split("").map((A,L)=>{let O=A===" ",Z=["typewriter","reveal","fog","slide","pop"].includes(a)?"1":c?"infinite":"1";return jsx(ce,{"data-char":A,className:`--fx-char -fx ${g?`--fx-${a}`:""}`,style:{"--delay":`${i+L*l}s`,"--duration":`${p}s`,"--iteration":Z,"--target-opacity":S,display:O?"inline":"inline-block",whiteSpace:"pre",opacity:!g&&a==="typewriter"?0:void 0},children:A},L)}):o,[o,n,a,E,g,i,l,p,c]);return jsx(b,{ref:P,onMouseEnter:()=>u&&R(true),onMouseLeave:()=>u&&R(false),style:a?{...h,display:a?"flex":h?.display,flexWrap:a?"wrap":h?.flexWrap,opacity:a&&!g?0:a?1:h?.opacity,transition:a?"opacity 0.4s ease":void 0}:h,className:`${T} ${a?"--text-fx -fx":""}`.trim(),...x,children:M})};Jr.displayName="Zuz.Text";var _=Jr;var on=({ref:e,...r})=>{let {title:t,position:n,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:i,variant:p,...l}=r,{style:c,className:d,rest:u}=B(l),m=n||be.Top;useRef(null);let [T,x]=useState(false);useRef(6);let v=i===true||T,y=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:S}=j(true),g=useMemo(()=>{let E=false;return addPropsToChildren(a,F=>{let M=F.props.className?.includes(s);return M&&(E=true),M||!E},(F,M)=>{let A=M.props.className?.includes(s),L=F===0,O={};return (A||L)&&(O.style={...M.props.style,anchorName:y}),L&&(O.onMouseEnter=$=>{x(true),M.props.onMouseEnter?.($);},O.onMouseLeave=$=>{x(false),M.props.onMouseLeave?.($);}),O})},[a,s,y]),b=ve({transition:m==be.Top?Q.SlideInTop:m==be.Bottom?Q.SlideInBottom:m==be.Left?Q.SlideInLeft:Q.SlideInRight,when:v,duration:.2,offset:o+6,margin:m==be.Top||m==be.Left?-o:o,curve:S?.curve||oe.EaseInOut});return useImperativeHandle(e,()=>({show:()=>x(true),hide:()=>x(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[g,jsx(f,{style:{positionAnchor:y,...b.style,...m===be.Top||m===be.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${v} --${p||S?.variant||q.Small} --${m} abs ${d}`.trim(),children:typeof t=="string"?jsx(_,{as:"--text rel",children:t}):t})]})};on.displayName="Zuz.ToolTip";var Pt=on;var qt={Loading:"loading",Normal:"normal"};var nn=({ref:e,...r})=>{let{reset:t,kind:n="solid",variant:o,tooltip:s,tooltipProps:a,icon:i,iconSize:p,children:l,withLabel:c,spinner:d,state:u,disabled:m,...h}=r,{style:T,className:x,rest:P}=B(h),{variant:v}=j(true),R=jsxs("button",{className:removeDuplicateWords(`--button ${s?"--tooltip-anchor":""} --${n} --${o||v} flex aic ${t?"":"jcc"} ${i?"--with-icon":""} ${x}`).trim().replace(/\s+/g," "),style:T,ref:e,disabled:u==qt.Loading||r.skeleton?.enabled||m,...P,children:[u==qt.Loading&&jsx(Re,{variant:o||v,type:d||Se.Simple}),(!u||u==qt.Normal)&&jsxs(Fragment$1,{children:[i&&jsx(te,{variant:p,name:i}),c===true?jsx(ce,{children:l}):l]})]});return s?jsx(Pt,{title:s,...a,children:R}):R};nn.displayName="Zuz.Button";var K=nn;var Hi=e=>{let{label:r,labelColor:t,icon:n,iconColor:o,index:s,className:a,onSelect:i}=e;return r=="-"?jsx(f,{className:"--line"}):jsxs(K,{reset:true,onClick:p=>i?.(e),className:`--item ${a||""}`.trim(),children:[jsx(f,{as:"--icon",children:jsx(te,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(_,{className:"--lbl flex aic",style:t?{color:t}:{},children:r})]})},sn=Hi;var cn=({ref:e,...r})=>{let {id:t,as:n,fx:o,offsetX:s,offsetY:a,parent:i,event:p,arrow:l,when:c,items:d,header:u,footer:m,origin:h=wt.TopRight,...T}=r,[x,P]=useState(false),[v,R]=useState(d||[]),{position:y,targetRef:S,calculatedAnchor:g}=useAnchorPosition(i?.current,p,{offsetX:s,offsetY:a,preferredAnchor:h}),b=g.toLowerCase(),E=b.includes("top");b.includes("bottom");let M=E?"--arrow-top":"--arrow-bottom",A=useMemo(()=>b.includes("left")?"--arrow-left":b.includes("right")?"--arrow-right":"--arrow-center",[b]),L=y.top!==0||y.left!==0;useEffect(()=>{c&&L?P(true):c||P(false);},[c,L]);let{className:O,style:$,rest:Z}=B(T),I=ve({...o?.transition?{transition:o.transition??Q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??oe.EaseInOut,duration:o?.duration??.05,when:x&&L});return jsxs(f,{ref:S,className:`--contextmenu ${l||i!=null?`--has-arrow ${M} ${A}`:""} abs flex cols ${O}`.trim(),"aria-hidden":!x,style:{...$,...I.style,top:y.top,left:y.left,visibility:L?"visible":"hidden",transformOrigin:g},...Z,children:[typeof u=="function"?createElement(u):u,v.map((k,U)=>jsx(sn,{...k,index:U},`context-${k.label.toLowerCase()}-${U}`)),typeof m=="function"?createElement(m):m]})};cn.displayName="Zuz.ContextMenu";var Ho=cn;var mn=forwardRef((e,r)=>{let{children:t,fx:n,when:o,fxDelay:s,fxStep:a,classToIgnore:i,...p}=e,l=j(true),c=useDelayed(),d=n||l?.group?.fx,u=s||l?.group?.fxDelay,m=a||l?.group?.fxStep,h=i||l?.group?.classToIgnore||"-fx",T=useMemo(()=>d?addPropsToChildren(t,x=>{if(x.type===Fragment)return false;let P=x.props||{},v="fx"in P,R="tfx"in P,y=P.as?Array.isArray(P.as)?P.as.join(" "):P.as:P.className||"";return !(typeof y=="string"&&y.includes(h))&&(!v||R)},(x,P)=>{let v=(u??0)+x*(m??.1),R=P.props||{};return "tfx"in R?{delay:(R.delay??0)+v}:{fx:{...d,delay:v,when:o??(n?.when||c)}}}):t,[t,o,c,d,u,m,h,n]);return jsx(f,{className:"--group",ref:r,...p,children:T})});mn.displayName="Zuz.Group";var Ao=mn;var un=forwardRef((e,r)=>{let{message:t,spinner:n,spinnerSize:o,color:s,when:a,hideMessage:i,...p}=e,{className:l,style:c,rest:d}=B(p),{spinner:u}=j(true);return "when"in e&&e.when==false?null:jsxs(Ao,{fx:{transition:Q.SlideInBottom,curve:oe.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...d,children:[jsx(Re,{variant:o||u?.variant||q.Small,type:n||u?.type||Se.Simple}),!i&&jsx(_,{className:"--label",tfx:"fade",style:{color:"var(--cover-label)"},children:t||"loading"})]})});un.displayName="Zuz.Cover";var $e=un;var jt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(jt||{}),Qt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Qt||{}),fn=(t=>(t.Stack="stack",t.Individual="individual",t))(fn||{}),dn={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Ji=()=>{let e=useContext(Ie);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(l,c)=>e.add({type:"toast",props:{...c,type:l}});return {show:(l,c,d,u)=>r("default",{title:l,message:c,icon:d,duration:u}),hide:l=>e.remove(l),success:(l,c,d,u)=>r("success",{title:l,message:c,icon:d,duration:u}),error:(l,c,d,u)=>r("error",{title:l,message:c,icon:d,duration:u}),warn:(l,c,d,u)=>r("warn",{title:l,message:c,icon:d,duration:u}),promise:(l,c,d,u)=>r("promise",{title:l,message:c,icon:d,duration:u}),clearAll:()=>e.clear("toast")}},$o=Ji;var gn=forwardRef((e,r)=>{let{when:t,...n}=e;return jsx(f,{ref:r,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:Q.FadeIn,when:t},...n})});gn.displayName="Zuz.Overlay";var tt=gn;var We=null,Ee=null,yn=forwardRef((e,r)=>{let{title:t,message:n,transition:o,curve:s,speed:a,type:i,actionPosition:p,spinner:l,loadingMessage:c,onShow:d,onHide:u,...m}=e,{className:h,style:T,rest:x}=B(m),[P,v]=useState(t||""),[R,y]=useState(n||""),[S,g]=useState(null),[b,E]=useState(i||Le.Default),F=useMemo(()=>uuid(12),[]),[M,A]=useState(false),L=useRef(null),O=useRef(null),[$,Z]=useState(false),[I,k]=useState(true),U=useRef(null),X=R;useImperativeHandle(r,()=>({setLoading(z){Z(z);},showDialog(z,G,W,re){We&&(clearTimeout(We),Ee&&clearTimeout(Ee),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),Ee=setTimeout(()=>{L.current.classList.remove("--wobble"),Ee=null;},500)),E(Le.Dialog),G&&y(G),z&&v(z),W&&g(W.reduce((J,le)=>(J.push({...le,key:le.key||uuid(12)}),J),[])),A(true),setTimeout(()=>re?re():()=>{},1e3);},dialog(z,G,W,re){We&&(clearTimeout(We),Ee&&clearTimeout(Ee),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),Ee=setTimeout(()=>{L.current.classList.remove("--wobble"),Ee=null;},500)),E(Le.Dialog),y(G),v(z),W&&g(W.reduce((J,le)=>(J.push({...le,key:le.key||uuid(12)}),J),[])),A(true),setTimeout(()=>re?re():()=>{},1e3);},error(z,G){this.show(z,G,Le.Error);},warn(z,G){this.show(z,G,Le.Warn);},success(z,G){this.show(z,G,Le.Success);},show(z,G,W){We&&(clearTimeout(We),Ee&&clearTimeout(Ee),O.current=L.current.style.transform,L.current.style.transform="",L.current.classList.remove("--wobble"),setTimeout(()=>{L.current.classList.add("--wobble"),L.current.style.transform=`${O.current} scale(.9)`.trim();},50),Ee=setTimeout(()=>{L.current.classList.remove("--wobble"),L.current.style.transform=O.current||"",Ee=null;},500)),We=setTimeout(()=>{A(false),We=null,Ee=null;},(G||4)*1e3),E(W||Le.Default),y(z),A(true),d?.();},hide(){A(false),u?.();}}));let H=useMemo(()=>{let z={when:M,duration:a||.3,delay:.1};if(b==Le.Dialog){if(o){let{from:G,to:W}=Ct(o,20);return {from:G,to:W,curve:s||oe.EaseInOut,...z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:oe.Spring,...z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:oe.Spring,...z}},[M,b]);return useEffect(()=>{U.current&&clearTimeout(U.current),M?k(true):U.current=setTimeout(()=>k(false),1e3);},[M]),b==Le.Dialog?jsxs(Fragment$1,{children:[jsx(tt,{when:M}),jsxs(f,{className:`--sheet --sheet-${b.toLowerCase()} ${M?"is-visible":""} ${h} fixed`.trim(),style:T,fx:H,...x,ref:L,children:[jsx($e,{when:$,spinner:l,message:c}),jsxs(f,{className:"--head flex aic rel",children:[jsx(f,{className:`--${P?"title":"dot"} flex aic rel`,children:P||""}),jsx(K,{onClick:z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(f,{className:`--body flex aic rel ${S?"":"--no-action"}`.trim(),children:I?X:null}),S&&jsx(f,{className:`--footer flex aic rel ${p?p==Ro.Center?"jcc":"":"jce"}`.trim(),children:S.map((z,G)=>jsx(K,{onClick:W=>z.handler?z.handler():z.onClick?z.onClick():console.log("onClick Handler missing"),className:"--action",children:z.label},`sheet-${F}-action-${z.key}`))})]})]}):jsx(f,{className:`--sheet --sheet-${b.toLowerCase()} ${h} abs`.trim(),style:T,...x,fx:H,ref:L,children:M?R:null})}),xn=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;yn.displayName="Zuz.Sheet";var sl=yn;var Rt=createContext(null),Wo=()=>{let e=useContext(Rt);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},It=()=>useContext(Rt),vn=()=>()=>{},Sn=e=>{let r=useContext(Rt);return useSyncExternalStore(r?.subscribe??vn,()=>{if(!(!r||!e))return r.getSnapshot().values?.[e]},()=>{})},wn=e=>{let r=useContext(Rt);return useSyncExternalStore(r?.subscribe??vn,()=>!r||!e?null:r.getSnapshot().errors?.[e]??null,()=>null)},lt=()=>{let e=It(),r=Wo();return {...e,...r}},Cn=({children:e,initialValues:r={}})=>{let t=useRef({values:r,errors:{},touched:{}}),n=useRef(new Set(Object.keys(r))),o=useRef(new Set),s=useCallback(()=>t.current,[]),a=useCallback(l=>(o.current.add(l),()=>o.current.delete(l)),[]),i=()=>{o.current.forEach(l=>l());};useEffect(()=>{if(!r||Object.keys(r).length===0)return;let l=new Set(Object.keys(r)),c=[...n.current].filter(P=>!l.has(P)),d={...t.current.values};c.forEach(P=>delete d[P]);let u={...d,...r},m=t.current.values||{},h=Object.entries(u),T=Object.entries(m),x=h.length!==T.length||h.some(([P,v])=>m[P]!==v);n.current=l,x&&(t.current={...t.current,values:u},i());},[r]);let p=useMemo(()=>({subscribe:a,getSnapshot:s,setFieldValue:(l,c)=>{t.current.values[l]!==c&&(t.current={...t.current,values:{...t.current.values,[l]:c}},i());},deleteFieldValue:l=>{if(!(l in t.current.values))return;let{[l]:c,...d}=t.current.values;t.current={...t.current,values:d},i();},setFieldError:(l,c)=>{t.current={...t.current,errors:{...t.current.errors,[l]:c}},i();},reset:()=>{t.current={values:{},errors:{},touched:{}},i();}}),[]);return jsx(Rt.Provider,{value:p,children:e})};var yl=e=>{let r={};for(let t in e){let n=t.split(/[\[\]]+/).filter(Boolean);n.reduce((o,s,a)=>{if(a===n.length-1)o[s]=e[t];else {let i=!isNaN(Number(n[a+1]));o[s]=o[s]||(i?[]:{});}return o[s]},r);}return r},Tn=({ref:e,...r})=>{let {schema:t,name:n,cover:o,spinner:s,errors:a,action:i,children:p,withData:l,beforeSubmit:c,onSubmit:d,onError:u,onSuccess:m,resetOnSuccess:h,...T}=r,{className:x,style:P,rest:v}=B(T),[R,y]=useState(false),S=useRef(null),g=$o(),b=It();Wo();let F=useRef(null),M=useCallback(H=>S.current?S.current.querySelectorAll(H):[],[S.current]),A=H=>({name:H.name||H.getAttribute("name")||H.getAttribute("data-name"),required:H.required?true:H.getAttribute("data-required")?H.getAttribute("data-required")=="true":false,with:H.with||H.getAttribute("with")}),L=H=>{let z=[];return H.querySelectorAll(".--input").forEach(G=>{z.push(G.value);}),z.join("")},O=H=>H.classList.contains("--otp")?L(H):H.classList.contains("--select")?H.querySelector("button.--selected")?.dataset.value:H.classList.contains("--checkbox")||H.getAttribute("type")==="checkbox"?H.checked:H.value,$=useCallback(H=>{let{name:z,required:G,with:W}=A(H),re=O(H);if(t&&t[z]&&b?.getSnapshot()){let J=t[z](re,b.getSnapshot().values);if(J===false||typeof J=="string")return typeof J=="string"&&b?.setFieldError(z,J),false}if(G&&(H.type==="checkbox"&&!H.checked||H.classList.contains("--select")&&(re==="-1"||!re)||!re||re===""))return false;if(W)switch((W.includes("@")?W.split("@")[0]=="match"?Je.MatchField:W.split("@")[0]:W).toUpperCase()){case Je.IPV4:return _$1(re).isIPv4();case Je.IPV6:return _$1(re).isIPv6();case Je.Email:return _$1(re).isEmail();case Je.Uri:try{return new URL(re),!0}catch{return false}case Je.MatchField:let[le,me,we]=W.split("@"),ie=document.querySelector(`[name=${me.trim()}]`);if(!ie)return false;switch(we||"direct-match"){case "if-not-empty":if(ie&&!_$1(ie.value).isEmpty()&&ie.value!=H.value)return false;break;case "direct-match":if(ie&&ie.classList.contains("--otp")&&H.classList.contains("--otp")&&L(ie)!=L(H))return false;if(ie&&ie.value!=H.value)return false;break}break}return true},[t,b]),Z=useCallback(()=>{let H={},z={...b?.getSnapshot().values||{}},G=null,W=null;if(M("[name]").forEach(J=>{let{name:le,required:me,with:we}=A(J),ie=me||we?$(J):true,pe=O(J);H[le]={valid:ie,value:pe},z[le]=pe,b?.setFieldError(le,ie?null:a?.[le]||"Invalid"),ie?J.classList.remove("--with-error"):(J.classList.add("--with-error"),G||(G=J),W=a?.[le]);}),G){let J=G;if(J.classList.contains("--otp"))for(let le of Array.from(J.querySelectorAll(".--input"))){let me=le;if(me.value==""){me.focus();break}}else J.focus();}let re=yl(z);return {error:G!=null,errorMsg:W||"Fix errors to continue...",data:H,payload:re}},[S.current,b]),I=useCallback((H={})=>{let{error:z,errorMsg:G,payload:W,data:re}=Z();if(z){g.error(G);return}i?startTransition(async()=>{y(true),withPost(i,{...l,...W,...H}).then(J=>{y(false),h&&b?.reset(),m?.(J,{...l,...W,...H}),m||g.success(J.message||"Redirecting...");}).catch(J=>{y(false),u?u(J):g.error(J.message);});}):d?.(W,re);},[Z,i,l,m,u,h,d]),k=useCallback(()=>{let H=M("[type=submit]");!H||H.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):H.forEach(z=>{z.addEventListener("click",I);});},[S.current]),U=useMemo(()=>addPropsToChildren(p,H=>H.props.type=="submit",H=>({ref:F})),[p]),X=useRef(I);return useImperativeHandle(e,()=>({setLoading:H=>y(H),submit:H=>X.current(H),init:k,hideError:()=>g.clearAll()}),[I,k]),useEffect(k,[]),useEffect(()=>{X.current=I;},[I]),useEffect(()=>{let H=M("[type=submit]"),z=Array.from(H).map(G=>{let W=G;return W.addEventListener("click",I),()=>W.removeEventListener("click",I)});return ()=>z.forEach(G=>G())},[I,M]),jsxs(f,{ref:S,style:P,className:`--form flex rel ${x}`,children:[!xn(o)&&jsx($e,{when:R,spinner:s,...o}),U]})};Tn.displayName="Zuz.FormInternal";var Pn=e=>jsx(Cn,{initialValues:e.withData,children:jsx(Tn,{...e})});Pn.displayName="Zuz.Form";var Xo=Pn;var Yo=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(r){return this.stack[this.stack.length-1]===r}push(r){this.stack.includes(r)||(this.stack.push(r),this.updateScrollLock());}pop(r){this.stack=this.stack.filter(t=>t!==r),this.updateScrollLock();}handleEscape(){let r=this.stack[this.stack.length-1];return r?(r(),true):false}get count(){return this.stack.length}},Ve=new Yo;var bl=({action:e,render:r=true,message:t=""})=>jsx(f,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:r?t:null}),Rn=bl;var In=({cols:e,gap:r,ais:t,aic:n,aie:o,jcs:s,jcc:a,jce:i,className:p="",style:l,...c})=>{let d=["--flex",e?"--cols":"",t?"--ais":"",n?"--aic":"",o?"--aie":"",s?"--jcs":"",a?"--jcc":"",i?"--jce":"",p].filter(Boolean).join(" "),u={...l,gap:typeof r=="number"?`${r}px`:r};return jsx(f,{...c,className:d,style:u})};In.displayName="Zuz.FlexBox";var Ce=In;var wl=({useForm:e,action:r,actionPosition:t,dialogID:n,variant:o})=>jsx(Ce,{aic:true,as:`--footer rel ${t?t==Fr.Center?"--jcc":"":"--jce"}`.trim(),children:r.map((s,a)=>jsx(K,{variant:o,kind:s.kind,type:s.type||"button",onClick:()=>{if(!(e===true&&s.type==="submit")){if(s.handler)return s.handler();if(s.onClick)return s.onClick();console.log("onClick Handler missing");}},as:"--action",children:s.label},`dialog-${n}-action-${s.key||a}`))}),Nn=wl;var Cl={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"})," "]}),[ke.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"})}),[ke.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"})}),[ke.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"})}),[ke.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"})]})},V=Cl;var Tl=({title:e="Alert",description:r,titlePosition:t="center",onClose:n})=>jsxs(Ce,{as:"--head rel",children:[jsxs(Ce,{cols:true,as:[`--${e?"title":"dot"} rel`,`--position-${t}`],children:[jsx(_,{children:e}),r&&jsx(_,{as:"--description",children:r})]}),jsx(K,{onClick:o=>n(),className:`--closer abs ${t=="center"?"center-v":""}`,children:V.close})]}),kn=Tl;var On=({ref:e,...r})=>{let{index:t,id:n,title:o,description:s,titleAlignment:a,message:i,content:p,transition:l,curve:c,speed:d,type:u,width:m,action:h,actionPosition:T,spinner:x,loadingMessage:P,variant:v,inBackground:R,forceClose:y,forceLoading:S,useForm:g,formProps:b,onConfirm:E,onCancel:F,onClose:M,onShow:A,onHide:L,...O}=r,$=useMemo(()=>uuid(12),[]),[Z,I]=useState(o||""),[k,U]=useState(s||""),[X,H]=useState(p||i||""),[z,G]=useState(u||et.Dialog),[W,re]=useState(false),[J,le]=useState(true),[me,we]=useState(()=>h?h.map(Oe=>({...Oe,key:Oe.key||uuid(12)})):null),[ie,pe]=useState(false),{variant:Y,spinner:se,dialog:ne}=j(true),ge=v||ne?.variant||Y||q.Small,{style:He,className:Te,rest:he}=B(O),Me=useRef(null),ae=ve({when:W,duration:d||ne?.speed||.3,delay:ne?.delay||.1,transition:l||ne?.transition||Q.SlideInBottom,curve:c||ne?.curve||oe.EaseInOut,watch:["scale","filter","transform"]}),xe=()=>{re(false),M(n);},zt=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ve.isTop(xe)&&xe();}}],[W]);useShortcuts(zt),useEffect(()=>{G(et.Dialog),H(p||i),I(Z),U(k),re(true),setTimeout(()=>A?A():()=>{},500);},[]),useEffect(()=>{y&&xe();},[y]),useEffect(()=>{S!=null&&pe(S);},[S]),useEffect(()=>(W?Ve.push(xe):Ve.pop(xe),()=>Ve.pop(xe)),[W]);let _t=useMemo(()=>1e4+t*10,[t]),Ae=jsxs(f,{as:`--dialog --${(u??et.Default).toLowerCase()} ${W?"--visible":""} ${Te} fixed abc`.trim(),style:{...ae.style,zIndex:_t+1,pointerEvents:R==true?"none":"auto",width:m||"auto",...R==true?{scale:"0.92",filter:"blur(2px)"}:{}},...he,ref:Me,children:[jsx(kn,{title:Z,description:s,titlePosition:a||ne?.titleAlignment||"center",onClose:xe}),jsx(Rn,{message:X,render:J,action:me}),me&&me.length>0&&jsx(Nn,{variant:ge,action:me,dialogID:$,useForm:g,actionPosition:T}),jsx($e,{when:ie,spinner:x||ne?.spinner||se?.type||Se.Simple,message:P||ne?.loadingMessage})]});return jsxs(Fragment$1,{children:[jsx(tt,{style:{zIndex:_t},when:W}),g?jsx(Xo,{onSubmit:((Oe,Co)=>{E?.(Oe,Co);}),...b,children:Ae}):Ae]})};On.displayName="Zuz.Dialog";var Jo=On;var Vn=forwardRef((e,r)=>{let{speed:t,smooth:n=false,breakpoints:o={},style:s,...a}=e,{rootRef:i,containerRef:p,thumbY:l,thumbX:c,onScrollY:d,onScrollX:u}=useScrollbar(t||1,o,n),{style:m,className:h,rest:T}=B(a);return useEffect(()=>{let x=p.current;if(!x)return;let P=()=>{window.dispatchEvent(new Event("resize"));},v=R=>{let y=R.target;if(y.closest(".--allow-scroll")){let g=y.closest(".--allow-scroll"),{scrollTop:b,scrollHeight:E,clientHeight:F}=g,M=R.deltaY<0,A=R.deltaY>0;(M&&b>0||A&&b+F<E)&&R.stopPropagation();}};return x.addEventListener("scroll",P),x.addEventListener("wheel",v,{passive:true}),()=>{x.removeEventListener("scroll",P),x.removeEventListener("wheel",v);}},[p]),jsxs(f,{ref:i,className:h.trim(),as:"--scrollview rel",children:[jsx(f,{as:`--scroll-content ${h}`.trim(),ref:p,style:s||{},children:T.children}),jsx(f,{as:"--scroll-track --track-y --abs",children:jsx(f,{as:"--scroll-thumb --abs --round",ref:l,onMouseDown:d})}),jsx(f,{as:"--scroll-track --track-x --abs",children:jsx(f,{as:"--scroll-thumb --abs --round",ref:c,onMouseDown:u})})]})});Vn.displayName="Zuz.ScrollView";var er=Vn;var Dn=({ref:e,...r})=>{let{id:t,index:n,from:o,speed:s,children:a,margin:i,animation:p,prerender:l,inBackground:c,forceClose:d,forceLoading:u,onClose:m,...h}=r,{drawer:T}=j(true),[x,P]=useState(a),[v,R]=useState(false),[y,S]=useState(l??(T?.prerender||true)),[g,b]=useState(false),E=()=>{R(false),m?.(t??-1);},{className:F,style:M,rest:A}=B(h),L=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ve.isTop(E)&&E();}}],[v]);useShortcuts(L),useEffect(()=>{P(a);},[a]),useEffect(()=>(v?Ve.push(E):Ve.pop(E),()=>Ve.pop(E)),[v]),useEffect(()=>{R(true);},[]),useEffect(()=>{d&&E();},[d]),useEffect(()=>{u!=null&&b(u);},[u]);let O=o||T?.from||Pe.Left,$=useMemo(()=>{switch(O){case Pe.Left:return {from:{x:"-100vw"},to:{x:0}};case Pe.Right:return {from:{x:"100vw"},to:{x:0}};case Pe.Top:return {from:{y:"-100vh"},to:{y:0}};case Pe.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,T?.from]),Z=ve({from:{...$.from,opacity:0},to:{...$.to,opacity:1},when:v,curve:p||T?.animation||oe.EaseInOut,duration:s||T?.speed||.5,watch:["scale","filter"]}),I=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(tt,{onClick:k=>{v&&E();},when:v,style:{zIndex:I}}),jsxs(f,{ref:e,"aria-hidden":!v,className:`--drawer flex cols ${F} --${O.toLowerCase()} fixed`,style:{...M,...Z.style,"--m":`${i||T?.margin||0}px`,zIndex:I+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==Pe.Top||o==Pe.Bottom?jsx(f,{className:"--handle"}):null,jsx(K,{as:"--close-drawer --abs",onClick:E,children:V.close}),jsxs(er,{as:"rel",children:[y||v?x:null,jsx($e,{when:g})]})]})]})};Dn.displayName="Zuz.Drawer";var rr=Dn;var An=forwardRef((e,r)=>{let{progress:t,type:n,animated:o,...s}=e,a=useRef(null);useImperativeHandle(r,()=>({setProgress:c=>{a.current.style.width=`${c*100}%`,a.current.setAttribute("data-value",c+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(o?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:i,style:p,rest:l}=B(s);return jsx(f,{className:`--progress ${o?"--animated":""} flex rel ${i}`.trim(),style:p,...l,children:jsx(f,{ref:a,className:"--bar rel"})})});An.displayName="Zuz.ProgressBar";var rt=An;var Fl=e=>{let{index:r,id:t,type:n,icon:o,busy:s,width:a,title:i,message:p,duration:l,sticky:c=false,actions:d=[],position:u,style:m,isHovered:h,total:T,progress:x,progressValue:P,forceClose:v,variant:R,onClick:y,onClose:S}=e,[g,b]=useState(false),[E,F]=useState(false),{toast:M}=j(true),A=typeof P=="number",L=A?Math.max(0,Math.min(1,P)):void 0,O=E||v,$=u??M?.position??"TopCenter",Z=n??M?.type??"default",I=m??M?.style??"stack",k=l??M?.duration??4,U=x??M?.progress??false,X=useRef(k*1e3),H=useRef(void 0),z=useRef(void 0),G=useRef(null),W=ve({when:g&&!O,duration:.3,transition:M?.transition||($.includes("Top")?Q.SlideInTop:$.includes("Bottom")?Q.SlideInBottom:$.includes("Left")?Q.SlideInLeft:Q.SlideInRight),curve:M?.curve||oe.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{b(true);let Y=se=>{if(z.current!==void 0){let ne=se-z.current;if(!A&&!h&&!c&&!O&&(X.current-=ne,G.current)){let ge=Math.max(0,X.current/(k*1e3)*100);G.current?.setProgress?.(ge/100);}}z.current=se,X.current<=0?F(true):H.current=requestAnimationFrame(Y);};return H.current=requestAnimationFrame(Y),()=>{H.current&&cancelAnimationFrame(H.current);}},[h,c,O,k]),useEffect(()=>{if(O){let Y=setTimeout(()=>{S?.(t);},350);return ()=>clearTimeout(Y)}},[O,t]);let re=I==="stack",J=h?r*65:r*8,le=h?1:Math.max(.85,1-r*.05),me=h?1:Math.max(.4,1-r*.2),we=Y=>{y?y(Y):s!==true&&(!d||d.length===0)&&F(true);},ie=W.style.transform||"translate(0, 0)",pe=O?ie:`${ie} translateY(${$.includes("Top")?J:-J}px) scale(${le})`;return jsxs(f,{onClick:we,as:`--snack --${O?"hidden":"visible"} --${R||M?.variant||q.Medium} --${Z} --${$.toLowerCase()} abs flex aic`,style:{...W.style,zIndex:1e3-r,pointerEvents:O?"none":"auto",opacity:O?W.style.opacity:me,transform:pe,filter:!O&&re&&!h&&r>0?"blur(1px)":"none",cursor:!d||d.length===0?"pointer":"default",transition:`${W.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsxs(f,{as:"--ico flex aic jcc rel",children:[o?jsx(te,{name:o}):jsx(f,{as:"--no-icon"}),s===true&&jsx(Re,{as:"abs abc"})]}),jsxs(f,{as:"--meta flex cols",style:a?{width:a,minWidth:a,maxWidth:a}:void 0,children:[jsx(_,{as:"--tt",children:i||dn[n]}),jsx(_,{as:"--tm",children:p})]}),d&&d.length>0&&jsx(f,{as:"--actions flex gap:5",children:d.map((Y,se)=>jsx(K,{as:"--snack-btn bold",variant:q.XSmall,onClick:ne=>{ne.stopPropagation(),Y.onClick(ne);},children:Y.label},se))}),(U||A)&&jsx(rt,{as:"abs",progress:L,ref:G})]})},sr=Fl;var Ie=createContext(null),Gl=({ref:e,...r})=>{let n=useContext(Ie)?.depth??0,[o,s]=useState(null),[a,i]=useState(null),[p,l]=useState(false),[c,d]=useState([]),u=useDelayed(),m=useRef(0),h=()=>++m.current,T=()=>{l(false),setTimeout(()=>i(null),200);};useImperativeHandle(e,()=>({add(y){let S=h(),g={id:S,...y};return d(b=>[...b,g]),S},openMenu(y){l(false),setTimeout(()=>{i({id:h(),type:"menu",props:y}),l(true);},16);},update(y,S){d(g=>g.map(b=>b.id!==y?b:{...b,props:{...b.props,...S}}));},remove(y){d(S=>S.map(g=>g.id===y?{...g,props:{...g.props,forceClose:true}}:g)),a?.id===y&&T();},loading(y,S){d(g=>g.map(b=>b.id===y?{...b,props:{...b.props,forceLoading:S}}:b)),a?.id===y&&T();},clear(y){d(c.filter(S=>S.type!=y));}})),useEffect(()=>{if(a&&p){let y=()=>T();return document.addEventListener("click",y),()=>document.removeEventListener("click",y)}},[a,p,T]);let x=y=>{setTimeout(()=>{d(S=>S.filter(g=>g.id!==y)),a?.id===y&&i(null);},250);},P=useMemo(()=>[...c.filter(y=>y.type!="toast")],[c]);if(!u)return null;let v=c.filter(y=>y.type=="toast").reverse(),R=Object.values(Qt);return createPortal(jsxs(f,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[P.map((y,S)=>{let g=S<P.length-1;return y.type==="dialog"?jsx(Jo,{onClose:x,index:S,id:y.id,...y.props,inBackground:g},`layer-${y.type}-${y.id}`):y.type==="drawer"?jsx(rr,{onClose:x,index:S,id:y.id,...y.props,inBackground:g},`layer-${y.type}-${y.id}`):null}),R.map(y=>{let S=v.filter(g=>(g.props.position||"TopCenter")===y);return S.length===0?null:jsx(f,{onMouseEnter:()=>s(y),onMouseLeave:()=>s(null),as:`--toast-container fixed --${y.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:S.map((g,b)=>jsx(sr,{index:b,total:S.length,isHovered:o===y,onClose:x,id:g.id,...g.props},g.id))},y)}),a&&jsx(f,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Ho,{onClose:T,when:p,...a.props},`menu-${a.id}`)})]}),document.body)},Ul=({children:e})=>{let r=useContext(Ie),t=r?r.depth+1:0,n=useRef(null),o=useMemo(()=>({add:s=>n.current?.add(s),openMenu:s=>n.current?.openMenu(s),update:(s,a)=>n.current?.update(s,a),remove:s=>n.current?.remove(s),loading:(s,a)=>n.current?.loading(s,a),clear:s=>n.current?.clear(s),depth:t,isSubLayer:!!r}),[r]);return jsxs(Ie.Provider,{value:o,children:[e,jsx(Gl,{ref:n})]})},Vo=Ul;var Xl=()=>{let e=useContext(Ie);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,s)=>{n.preventDefault(),e.openMenu({event:n,items:o,origin:s});},showMenu:(n,{items:o,origin:s,offsetX:a,offsetY:i,transition:p,curve:l,arrow:c,duration:d,header:u,footer:m})=>{e.openMenu({fx:{transition:p,curve:l,duration:d},parent:n,items:o,origin:s||wt.TopCenter,offsetX:a,offsetY:i,arrow:c,header:u,footer:m});},hide:e.clear}},Yl=Xl;var Ql=()=>{let e=useContext(Ie);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("dialog"),t=a=>e.remove(a),n=(a,i)=>e.loading(a,i);return {clearAll:r,show:a=>{let i=e.add({type:"dialog",props:{...a,type:et.Dialog}});return {id:i,setLoading:p=>n(i,p),hide:()=>t(i)}},confirm:a=>{let i=e.add({type:"dialog",props:{...a,type:et.Confirm,action:a.action??[{label:a.cancelLabel??"Cancel",kind:"ghost",onClick:()=>{a.onCancel?.(),t(i);}},{label:a.confirmLabel??"Confirm",kind:"solid",type:"submit",onClick:p=>{a.onConfirm?.(p);}}]}});return {id:i,setLoading:p=>n(i,p),hide:()=>t(i)}},hide:t}},Jl=Ql;var tc=()=>{let e=useContext(Ie);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("drawer"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a),o=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:i=>n(a,i),close:()=>t(a)}};return {clearAll:r,open:s=>o({children:s}),right:s=>o({children:s,from:Pe.Right}),left:s=>o({children:s,from:Pe.Left}),top:s=>o({children:s,from:Pe.Top}),bottom:s=>o({children:s,from:Pe.Bottom}),close:t}},oc=tc;var nc=(e,r,t={})=>{let[n,o]=useState(null),[s,a]=useState(false),{duration:i=.25,curve:p=oe.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=t;return useLayoutEffect(()=>{r&&e.current?(o(e.current.getBoundingClientRect()),a(true)):r||a(false);},[r,e]),{style:ve({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:p,duration:i,when:s&&r}).style,isMeasured:s,sourceRect:n}},sc=nc;var cc=(e,r={})=>{let{offset:t=8,direction:n="bottom",container:o=null,triggerRef:s=null}=r,a=useRef(null),i=useCallback(()=>{let p=e.current;if(!p)return;let l=s?.current||p.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=p.getBoundingClientRect(),d=l.getBoundingClientRect(),u,m;o?(u=o.getBoundingClientRect(),m="absolute"):(window.getComputedStyle(p).position==="fixed"?m="fixed":m="absolute",m==="fixed"?u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),p.style.position!==m&&(p.style.position=m),a.current=m;let x=0,P=0;switch(n){case "top":x=d.top-c.height-t,P=d.left,x<u.top&&d.bottom+c.height+t<=u.bottom&&(x=d.bottom+t);break;case "bottom":x=d.bottom+t,P=d.left,x+c.height>u.bottom&&d.top-c.height-t>=u.top&&(x=d.top-c.height-t);break;case "left":x=d.top,P=d.left-c.width-t,P<u.left&&d.right+c.width+t<=u.right&&(P=d.right+t);break;case "right":x=d.top,P=d.right+t,P+c.width>u.right&&d.left-c.width-t>=u.left&&(P=d.left-c.width-t);break}if(x=Math.max(u.top,Math.min(x,u.bottom-c.height)),P=Math.max(u.left,Math.min(P,u.right-c.width)),a.current==="fixed")p.style.top=`${x}px`,p.style.left=`${P}px`;else {let v;p.offsetParent?v=p.offsetParent.getBoundingClientRect():v={top:0,left:0};let R=x-v.top+window.scrollY,y=P-v.left+window.scrollX;p.style.top=`${R}px`,p.style.left=`${y}px`;}},[e,s,t,n,o]);return useEffect(()=>{let p=e.current;if(!p)return;let l=s?.current||p.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(i);return c.observe(p),l&&c.observe(l),i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,true);}},[e,n,t,o,s]),{postion:a.current,reposition:i}},kt=cc;var pc=()=>{let e=useContext(Ie);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(m,h)=>e.add({type:"toast",props:{...h,type:m}}),t=()=>e.clear("toast"),n=m=>e.remove(m),o=(m,h)=>e.update(m,h),s=m=>({id:m,update:h=>o(m,h),setType:h=>o(m,{type:h}),setProgress:h=>o(m,{progress:true,progressValue:h}),setBusy:h=>o(m,{busy:h}),success:()=>o(m,{type:"success"}),error:()=>o(m,{type:"error"}),warn:()=>o(m,{type:"warn"}),promise:()=>o(m,{type:"promise"}),default:()=>o(m,{type:"default"}),hide:()=>n(m)}),a=m=>s(r("default",m)),i=m=>s(r("success",m)),p=m=>s(r("error",m)),l=m=>s(r("warn",m)),c=m=>s(r("promise",m)),d=(m,h,T)=>{let x=r(m,{...h,sticky:h.sticky??false,actions:[{label:T?.label||"Ok",onClick:P=>{T?.onClick?.(P),n(x);}}]});return s(x)},u=(m,h,T,x)=>{let P=r(m,{...h,sticky:true,actions:[{label:T?.label||"Ok",onClick:v=>{T?.onClick?.(v),(T?.hide??false)===true&&n(P);}},{label:x?.label||"Cancel",onClick:v=>{x?.onClick?.(v),(x?.hide??true)===true&&n(P);}}]});return s(P)};return {show:a,hide:n,promise:c,clearAll:t,ok:(m,h)=>d("default",m,h),success:(m,h)=>h?d("success",m,h):i(m),error:(m,h)=>h?d("error",m,h):p(m),confirm:(m,h,T)=>u("default",m,h,T),warn:(m,h)=>h?d("warn",m,h):l(m),succes:(m,h)=>h?d("success",m,h):i(m)}},uc=pc;var Gn=({ref:e,style:r,...t})=>{let n=useRef(null),o=useMemo(()=>e&&typeof e!="function"&&e.current?e:n,[e]),{style:s,className:a,rest:i}=B(t,o);return jsx("div",{ref:e||n,style:{...s,...r||{}},className:a,...i})};Gn.displayName="Zuz.Box";var f=Gn;var qn=forwardRef((e,r)=>{let{title:t,message:n,...o}=e,[s,a]=useState(false);return jsxs(f,{className:"--accordion flex cols",...o,children:[jsxs(K,{onClick:i=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(_,{className:"--label flex",children:t}),jsx(f,{className:"--arrow flex",children:s?V.arrowUp:V.arrowDown})]}),s&&jsx(f,{className:"--detail",children:n})]})});qn.displayName="Zuz.Accordion";var xc=qn;var bc=({label:e,icon:r,onClick:t,idx:n,selected:o})=>jsx(K,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof r=="string"?jsx(te,{name:r}):r}),Yn=bc;var jn=forwardRef((e,r)=>{let{items:t,name:n,selected:o,position:s,...a}=e,i=useRef(null),[p,l]=useState(o||t[0].tag||0),c=useCallback(({x,y:P})=>{if(i.current){let v=i.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${x-v.left}`),document.documentElement.style.setProperty("--tip-y",`${P-v.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),d=useCallback(()=>{i.current&&(i.current.removeEventListener("pointerleave",d),i.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),u=useCallback(()=>{i.current&&(i.current.addEventListener("pointerleave",d),i.current.addEventListener("pointermove",c));},[]);useEffect(()=>{i.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((x,P)=>P.label.length>x.length?P.label:x,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),i.current?.addEventListener("pointerenter",u));},[]);let{className:m,style:h,rest:T}=B(a);return jsxs(f,{ref:i,style:h,className:[`--actionbar flex aic ${m}`,`${!s||s==be.Auto?"rel":`--${s}`}`].join(" ").trim(),...T,children:[t.map((x,P)=>jsx(Yn,{selected:p===x.tag||o==P,...x,idx:P},`actionbar-action-${x.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(f,{className:"--tip abs",children:jsx(f,{className:"--track flex aic",children:t.map(({label:x})=>jsx(f,{className:"--lb",children:x},`tool-tip-${x.toLowerCase().replace(/\s+/g,"-")}`))})})]})});jn.displayName="Zuz.ActionBar";var Tc=jn;var Jn=forwardRef((e,r)=>{let{type:t,icon:n,title:o,message:s,iconSize:a,...i}=e,{className:p,style:l,rest:c}=B(i);return jsxs(f,{className:`--alert --${t||ke.Info} flex aic ${p}`.trim(),style:l,...c,children:[jsx(f,{className:`--icon icon-${n||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!n&&V[t||ke.Info]}),jsxs(f,{className:"--meta flex cols",children:[jsx(_,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(_,{className:"--message",h:2,children:s})]})]})});Jn.displayName="Zuz.Alert";var Ic=Jn;var ts=({ref:e,...r})=>{let{variant:t,numeric:n,name:o,onConfirm:s,...a}=r,{style:i,className:p,rest:l}=B(a),{variant:c}=j(true),d=useRef(null),u=lt(),m=o?u.errors?.[o]:null,h=o&&u.values&&u.setFieldValue,T=h?u.values?.[o]:void 0,x=useDebounce(v=>{h&&u.setFieldValue?.(o,v);},500),P=v=>{let R=v.currentTarget.value;n&&(R=R.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),v.currentTarget.value=R),x(R),r.onInput?.(v);};return useEffect(()=>{d.current&&o&&T!==void 0&&d.current.value!==String(T)&&(d.current.value=String(T));},[T,o]),useEffect(()=>()=>{h&&u.deleteFieldValue?.(o);},[]),jsx("input",{name:o,className:`--input --${t||c} ${m?"--has-error":""} --flex ${p}`.trim(),style:i,defaultValue:T??r.defaultValue??"",onInput:P,onKeyDown:v=>{v.key=="Enter"&&s?.(v.currentTarget.value);},ref:v=>{d.current=v,typeof e=="function"?e(v):e&&(e.current=v);},...l})};ts.displayName="Zuz.Input";var fe=ts;var rs=e=>{let{meta:r,children:t}=e,n=useDelayed(),{label:o,icon:s,...a}=isValidElement(r)?{}:r,{className:i,style:p,rest:l}=B({...a,...a.animate?{animate:{...a.animate,when:n}}:{}});return isValidElement(r)?jsx("li",{style:p,className:i,children:r}):jsxs("li",{style:p,className:i,...l,children:[t,typeof r=="string"?r:o]})};rs.displayName="Zuz.ListItem";var ns=rs;var as=forwardRef((e,r)=>{let{items:t,variant:n,direction:o,seperator:s,ol:a,...i}=e,{className:p,style:l,rest:c}=B(i),d=a==true?"ol":"ul";return createElement(d,{className:`--list --${n||q.Small} flex ${o??"cols"} ${p}`.trim(),style:l,ref:r,...c,children:t.map((u,m,h)=>{let T=`${typeof u=="string"?`li-${String(u)}`:isValidElement(u)?`li-${u.key}`||`${m}-${MD5(u.toString())}`:u.label}-${m}`;return jsxs(Fragment,{children:[jsx(ns,{meta:u}),s&&h[m+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${m+1}-${T}`):null]},T)})})});as.displayName="Zuz.List";var ze=as;var ls=forwardRef((e,r)=>{let{fx:t,action:n,data:o,withStyle:s,onChange:a,...i}=e,{className:p}=B({as:s||""}),{style:l}=B(i),[c,d]=useState(false),[u,m]=useState(o||[]),h=useRef(null),T=useRef(null),x=useRef(null),P=useMemo(()=>i.name||uuid(12),[]),[v,R]=useState(null),[y,S]=useState(null),[g,b]=useState([]),F=useDebounce(I=>{I.target.value==""?(d(false),m([])):n&&I.target.value.trim()!=""&&withPost(n,{query:I.target.value}).then(k=>{"items"in k&&_$1(k.items).isArray()?(m(k.items),S(I.target.value),b(k.items)):console.error("Action Response should contain items array"),R(null);}).catch(k=>{R(null),m([]);});},250),M=()=>{if(T.current){let I=T.current.getBoundingClientRect(),k=window.innerHeight-I.bottom,U=I.top;if(x.current){let X=x.current;k<X.offsetHeight&&U>k?(X.style.top="auto",X.style.bottom=`${I.height}px`,X.style.maxHeight=`${U-150}px`):(X.style.top=`${I.height+5}px`,X.style.bottom="auto",X.style.maxHeight=`${k-150}px`);}}},A=I=>{if(u.length>0){if((I.key==="ArrowDown"||I.key==="ArrowUp")&&(I.preventDefault(),I.stopPropagation()),I.key==="Escape")R(null),d(false),m([]);else if(I.key==="ArrowDown")R(k=>{let U=k===null||k===u.length-1?0:k+1;return O(U),U});else if(I.key==="ArrowUp")R(k=>{let U=k===null||k===0?u.length-1:k-1;return O(U),U});else if(I.key==="Enter"&&v!==null){let k=u[v];h.current&&(h.current.value=k,d(false),m([]));}}},L=I=>{h.current&&(h.current.value=I,d(false),m([]));},O=I=>{let k=u[I];if(k&&h.current&&(h.current.value=k,h.current.setSelectionRange(k.length,k.length)),x.current){let X=x.current.children[I];X&&X.scrollIntoView({block:"nearest"});}},$=I=>{T.current&&!T.current.contains(I.target)&&(d(false),m([]));},Z=()=>{h.current&&h.current.value===y&&(m(g),R(null),M());};return useEffect(()=>(window.addEventListener("resize",M),window.addEventListener("scroll",M,true),document.addEventListener("mousedown",$),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true),document.removeEventListener("mousedown",$);}),[]),useEffect(()=>{M();},[u]),jsxs(f,{style:l,ref:T,className:`--autocomplete --${e.size||q.Small} flex aic rel ${p}`.trim(),children:[jsx(fe,{ref:h,autoComplete:"off",onChange:F,onKeyDown:A,onFocus:Z,...i}),jsx(f,{className:"--arrow rel flex aic jcc",children:u.length>0?V.arrowUp:V.arrowDown}),u.length>0&&jsx(ze,{id:P,ref:x,className:"--suggestion-list flex cols abs",items:u.map((I,k)=>({label:I,onClick:U=>{U.preventDefault(),U.stopPropagation(),L(I);},className:v===k?"--current":"",animate:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:clamp(.02*k,.02,.5)}}))})]})});ls.displayName="Zuz.AutoComplete";var Uc=ls;var cs=forwardRef((e,r)=>{let t=useRef(null),n=useMemo(()=>r&&typeof r!="function"&&r.current?r:t,[r]),{style:o,className:s,rest:a}=B(e,n);return !a.src||a.src==""?null:jsx("img",{ref:n,style:o,className:`${s} flex`,...a})});cs.displayName="Zuz.Image";var st=cs;var ms=forwardRef((e,r)=>{let{src:t,variant:n,type:o,crossOrigin:s,referrerPolicy:a,fx:i,as:p,alt:l,color:c,style:d,...u}=e,[m,h,T]=useImage(t??"",s,a),{className:x,style:P,rest:v}=B({fx:i,as:p});return jsx(f,{className:`--avatar --${n||q.Small} --${(o||$r.Circle).toLowerCase()} rel flex aic jcc ${x}`.trim(),style:{background:c||"var(--avatar-bg, var(--primary))",...d,...P},...v,children:t?jsx(st,{src:m,crossOrigin:s,referrerPolicy:a,...u}):jsx(_,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});ms.displayName="Zuz.Avatar";var tm=ms;var om=({size:e=5,type:r="dead",label:t="",variant:n=q.Small,loading:o=false,spinner:s,...a})=>{let{style:i,className:p,rest:l}=B(a);return jsxs(f,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...i},as:`--badge --${n} --${r} rel flex aic jcc ${p}`.trim(),children:[jsx(f,{fx:{transition:Q.FadeIn,curve:oe.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(Re,{type:s})}),_$1(t).isEmpty()?jsx(f,{as:`--dot --${r}`}):jsx(_,{as:"--label",children:t})]})},rm=om;var ym=[{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,r=e.getDay();return addDays(e,(6-r)%7||6)},getDateFormat:()=>{let e=new Date,r=e.getDay();return format(addDays(e,(6-r)%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)}],xm=e=>{let r=new Set;return e.filter(t=>{if(t.label=="Later")return true;let n=t.getDate().toISOString().split("T")[0];return r.has(n)?false:(r.add(n),true)})},us=forwardRef((e,r)=>{let{defaultValue:t,variant:n,onChange:o,...s}=e,{style:a,className:i,rest:p}=B(s),[l,c]=useState(t||new Date),d=startOfMonth(l),u=endOfMonth(l),m=startOfWeek(d),h=endOfWeek(u),T=useMemo(()=>eachDayOfInterval({start:m,end:h}),[m,h]),x=R=>{o?.(R),c(R);},P=()=>{c(R=>new Date(R.getFullYear(),R.getMonth()-1));},v=()=>{c(R=>new Date(R.getFullYear(),R.getMonth()+1));};return jsxs(f,{as:`--calendar flex --${n||"sm"} ${i}`,style:a,children:[jsx(f,{as:"--calendar-quick-select flex cols flex:1",children:xm(ym).map(R=>{let y=R.getDate();return jsxs(K,{onClick:()=>x(y),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(_,{as:"flex:1",children:R.label}),jsx(_,{as:"tar",children:R.getDateFormat()})]},`--dtp-option-label-${R.label}`)})}),jsxs(f,{as:"--calendar-selector flex cols flex:1",children:[jsxs(f,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(_,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(K,{onClick:P,as:"--calendar-chevron",children:V.chevronUpOutline}),jsx(K,{onClick:v,as:"--calendar-chevron",children:V.chevronDownOutline})]}),jsxs(f,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(R=>jsx(_,{as:"--calendar-day",children:R},`--calendar-hd-${R}`)),T.map((R,y)=>{let S=isSameMonth(R,l),g=isSameDay(R,l),b=isToday(R);return jsx(K,{disabled:!S,onClick:()=>x(R),as:["--calendar-day --calendar-dd",`${g?"--calendar-dd-selected":""}`,`${b?"--calendar-dd-current":""}`],children:format(R,"d")},`--calendar-day-${y}-${R.getFullYear()}-${R.getMonth()}-${R.getDay()}`)})]})]})]})});us.displayName="Zuz.Calendar";var ur=us;var co=(t=>(t.Table="table",t.Gooey="gooey",t))(co||{});var hs=({ref:e,...r})=>{let{itemCount:t,itemsPerPage:n,startPage:o,pageRange:s,paginationStyle:a,breakLabel:i,prevLabel:p,nextLabel:l,hash:c,loading:d,seperator:u,renderOnZeroPageCount:m,asDots:h,progressBar:T,onPageChange:x,...P}=r,v=useRef(null),R=useMemo(()=>toHash(numberInRange(4,8)),[]),y=useCallback(I=>`${toHash(I,c||6,R)}${u||""}${R}`,[R]),S=useMemo(()=>i||"...",[i]),g=useRef(null),[b,E]=useState({id:c?o?typeof o=="number"?y(o):o:1:o||1,label:o||1});useImperativeHandle(e,()=>({setPage:I=>E(I),getPage:I=>b,setProgress:I=>g.current?.setProgress?.(I),getProgress:()=>g.current?.getProgress?.()??0}),[g.current]);let{style:F,className:M,rest:A}=B(P),L=useCallback(I=>typeof I=="number"?I:+I.label,[]);if(!t)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(t/n),[t,n]),$=useMemo(()=>{let I=[],k=Math.max(L(b)-(s||2),1),U=Math.min(L(b)+(s||2),O);k>1&&I.push({id:c?y(1):1,label:1}),k>2&&I.push({id:-1,label:S});for(let X=k;X<=U;X++)I.push({id:c?y(X):X,label:X});return U<O-1&&I.push({id:-1,label:S}),U<O&&I.push({id:c?y(O):O,label:O}),I},[b]),Z=useCallback(I=>{let k=I;+k.label<1||+k.label>O||(E(k),x?.(k));},[t,n,b]);return $.length<=1&&(m??false)===false?null:jsxs(f,{ref:v,as:`--pagination ${h===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${M}`,children:[jsx(f,{as:"flex flex:1 aic --pgt-btns",children:($.length>1?$:[{id:1,label:1},{id:-1,label:S}]).map((I,k,U)=>{let X=(typeof I=="string"?I:I.label)==L(b);return jsx(K,{disabled:I.id==-1||L(b)==+I.label,className:X?"--current-page":"",onClick:H=>Z(I),children:h===true?T===true&&X?jsx(rt,{ref:g}):"":typeof I=="string"?I:I.label},`--pg-${k}-${I.id}`)})}),jsx(f,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(L(b)-1)*n+1} - `,`${Math.min(L(b)*n,t)} of ${t} items`].join(" ")}),jsxs(f,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(K,{disabled:L(b)<=1,onClick:I=>Z({id:c?y(L(b)-1):L(b)-1,label:L(b)-1}),children:V.chevronLeftOutline}),jsx(K,{disabled:$.length<=1||L(b)==L($[$.length-1]),onClick:I=>Z({id:c?y(L(b)+1):L(b)+1,label:L(b)+1}),children:V.chevronRightOutline})]})]})};hs.displayName="Zuz.Pagination";var Ot=hs;function Rm(e,r){let{items:t,renderItem:n,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:i=0,useKeys:p=true,useWheel:l=true,spacing:c=160,rotation:d=20,scaleStep:u=.15,blur:m=4,animation:h="power",showDots:T=false,autoPlay:x=false,autoPlaySpeed:P=3,onChange:v,...R}=e,{className:y,style:S}=B(R),g=useRef(null),b=P/(P>=1e3?1e3:1),E=useCarousel({total:t.length,initialIndex:i,loop:s,useKeys:p,useWheel:l,onChange:O=>{g.current?.setPage({id:O+1,label:O+1}),g.current?.setProgress(0),v?.(O);}}),{pause:F,resume:M,reset:A}=useTimer({duration:b,autoStart:x===true,onProgress:O=>{x===true&&g.current?.setProgress(1-O);},onExpired:()=>{x===true&&E.next(),A();}}),L={...S,"--carousel-spacing":`${c}px`,"--carousel-rotation":`${d}deg`,"--carousel-blur":`${m}px`,"--carousel-scale-step":u,"--active-index":E.index,"--carousel-transition":`var(--${h})`};return jsxs(f,{ref:r,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${y}`.trim(),style:L,children:[jsx(f,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((O,$)=>{let Z=$-E.index;if(a==="infinite"){let k=t.length;Z=((Z+k/2)%k+k)%k-k/2;}let I=$===E.index;return jsx(f,{onMouseEnter:()=>I&&F(),onMouseLeave:()=>I&&M(),className:`--carousel-item-wrapper abs ${I?"--is-active":""}`,style:{"--offset":Z,zIndex:I?100:100-Math.abs(Z),display:Math.abs(Z)>5?"none":"flex"},children:n(O,$,E.index)},$)})}),T&&jsx(Ot,{ref:g,itemCount:t.length,itemsPerPage:1,startPage:i+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:O=>E.goTo(+O.label-1),asDots:true,progressBar:true})]})}var Im=forwardRef(Rm),Em=Im;var ys=(r=>(r.Line="line",r))(ys||{});var vs=forwardRef((e,r)=>{let{data:t,width:n,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:i,gradientEndColor:p,animated:l,animDuration:c=2,animDelay:d=0,padding:u=0,type:m,...h}=e,{className:T,style:x,rest:P}=B(h),v=useRef(null),R=useResizeObserver(v.current?.parentElement||v),y=typeof n=="number"?n:R.width,S=typeof o=="number"?o:R.height,g={width:y,height:S},b=useId(),{pathD:E,areaPathD:F}=useLineChart(t,g,u+(a||2)),M=useRef(null),A=useRef(null),[L,O]=useState(0),[$,Z]=useState(0);return useEffect(()=>{l&&(M.current&&O(M.current.getTotalLength()),A.current&&Z(A.current.getTotalLength()));},[l,E,F,y,S]),jsx(f,{ref:v,as:`--chart --${m||"line"}-chart ${T}`.trim(),style:{...x,width:n,height:o},...P,children:y>0&&S>0&&jsxs("svg",{viewBox:`0 0 ${y} ${S}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:b,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:i}),jsx("stop",{offset:"100%",stopColor:p})]})}),jsx("path",{ref:A,d:F,fill:`url(#${b})`,stroke:"none",style:l?{strokeDasharray:$,strokeDashoffset:$}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:$,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})}),jsx("path",{ref:M,d:E,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:L,strokeDashoffset:L}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:L,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})})]})})});vs.displayName="Zuz.Chart";var Vm=vs;var Ss=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(Ss||{}),ws=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(ws||{});var Cs=forwardRef((e,r)=>{let{text:t,media:n,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:i=true,...p}=e,{className:l,style:c,rest:d}=B(p);return jsx(f,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(f,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${i==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...d,children:[t&&jsx(_,{className:"--bubble-text",children:t}),n?n.type=="audio"?jsxs(f,{as:"flex aic --bubble-audio",children:[jsx(ce,{className:"--bm-action",children:V.play}),jsx(rt,{progress:.7}),jsx(_,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(f,{as:"--bubble-image",children:jsx(st,{src:n.source})}):null:null,jsxs(f,{as:"flex aie jce --bubble-stats",children:[jsx(_,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(ce,{className:`--bubble-status --bs-${s}`,children:s==0?V.pending:s==1?V.done:s==2?V.doneAll:V.doneAll})]})]})})});Cs.displayName="Zuz.Bubble";var yr=Cs;var Am=({messages:e})=>jsx(ze,{items:e.map((r,t)=>jsx(yr,{...r},r.id||t))}),$m=Am;var Ps=forwardRef((e,r)=>{let{style:t,className:n,rest:o}=B(e);return jsx("label",{ref:r,style:t,className:n,...o})});Ps.displayName="Zuz.Label";var Vt=Ps;var Is=({ref:e,...r})=>{let {name:t,required:n,type:o,value:s,size:a,variant:i,checked:p,disabled:l,onSwitch:c,...d}=r,u=lt(),m=!!(t&&u.values);m?u.errors?.[t]:null;let T=m?u.values?.[t]:void 0,[x,P]=useState(p||false),v=useRef(null),{variant:R}=j(true),y=useMemo(()=>m&&T!=null?typeof T=="string"?T.toLowerCase()!=="false"&&T!=="":!!T:x,[T,x,m]);useEffect(()=>{v.current&&v.current.checked!==y&&(v.current.checked=y);},[y]),useEffect(()=>{p!==void 0&&P(p);},[p]);let S=g=>{let b=!!g;m&&u.setFieldValue?.(t,b),P(b),c?.(b,s||"cb");};return useImperativeHandle(e,()=>({setChecked(g,b=true){S(g);},toggle(g=true){S(!y);}})),jsxs(Vt,{"aria-hidden":l,className:[`--${(o||Ze.Default).toLowerCase()}`,`${!o||o===Ze.Default?"--checkbox":"--switch"}`,`--${i||R||q.Small}`,`flex aic jcc ${y?"is-checked":""} rel`,`${l?"--disabled":""}`].join(" ").trim(),...d,children:[(!o||o==Ze.Default)&&V.check,jsx(fe,{ref:g=>{v.current=g,e&&(e.current=g);},defaultChecked:y,type:"checkbox",className:"abs",name:t,required:n||false,onChange:g=>{g.stopPropagation(),S(g.target.checked);},disabled:l})]})};Is.displayName="Zuz.CheckBox";var Dt=Is;var Ym=({ref:e,...r})=>{let{code:t,copy:n,lang:o="tsx",showLines:s=false,highlight:a="",as:i,fx:p,...l}=r,c=useRef(null),{className:d,style:u,rest:m}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${i}`,fx:p},c),h=useMemo(()=>{let x=new Set;return a.split(",").forEach(P=>{if(P.includes("-")){let[v,R]=P.split("-").map(Number);for(let y=v;y<=R;y++)x.add(y);}else P&&x.add(Number(P));}),x},[a]),T=useMemo(()=>{let x=t.split(`
|
|
9
|
-
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let
|
|
8
|
+
document.documentElement.style.colorScheme = theme;`}}),jsx(_o,{children:e})]})},tn=(e,o)=>{if(Ii)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||o};var rn=({ref:e,...o})=>{let{style:t,...n}=o,{style:r,className:s,rest:a}=M(n);return jsx("span",{ref:e,style:t,className:s,...a})};rn.displayName="Zuz.Span";var ae=rn;var sn=forwardRef((e,o)=>{let{name:t,pathCount:n,variant:r,color:s,size:a,...i}=e,{variant:u}=j(true),{className:l,style:c,rest:d}=M(i);return jsx("div",{style:{color:s,...c,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${r||u||q.Small} ${l}`.trim(),ref:o,...d,children:Array(n||0).fill(0).map((f,p)=>jsx(ae,{className:`path${p+1}`},`${t}-layer-${p}`))})});sn.displayName="Zuz.Icon";var te=sn;var we={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var an=e=>{let{type:o,variant:t,color:n,...r}=e,{className:s,style:a,rest:i}=M(r),{spinner:u}=j(true),l=()=>{switch(o||u?.type||we.Simple){case we.Simple:return null;case we.Wave:return jsxs(Fragment$1,{children:[jsx(m,{as:"--bar --bar1"}),jsx(m,{as:"--bar --bar2"}),jsx(m,{as:"--bar --bar3"})]});case we.Roller:return null}};return jsx(m,{className:`${s} --spinner --${(o||u?.type||we.Simple).toLowerCase()} --${t||u?.variant||q.Small}`.trim(),style:{...a},...i,children:l()})};an.displayName="Zuz.Spinner";var Ie=an;var ln=({ref:e,...o})=>{let{h:t,html:n,children:r,lines:s,tfx:a,delay:i=0,duration:u=.5,stagger:l=.05,repeat:c=true,reveal:d=false,hover:f=false,...p}=o,{style:y,className:w,rest:x}=M(p),C=useRef(null),[v,T]=useState(false),[h]=useIntersectionObserver([C],{threshold:[1]}),S=useMemo(()=>{if(y?.opacity!==void 0)return y.opacity;if(typeof o.as=="string"){let D=o.as.match(/opacity:([\d.]+)/);if(D)return D[1]}return 1},[o.as,y?.opacity]),g=useMemo(()=>a?f?v:d?h===1:true:false,[a,f,v,d,h]);useEffect(()=>{e&&(typeof e=="function"?e(C.current):e.current=C.current);},[e]);let b=`h${o.h||1}`,E=useMemo(()=>typeof r=="string"?r:Array.isArray(r)&&r.length===1&&typeof r[0]=="string"?r[0]:null,[r]),V=useMemo(()=>{let D=Array.isArray(o.as)?o.as.join(" "):o.as||"";return typeof D=="string"&&D.includes("text-clip")},[o.as]);useLayoutEffect(()=>{if(!V||!C.current||E===null)return;let D=C.current,N=0,k=0,F=()=>{let O=D.getBoundingClientRect(),U=getComputedStyle(D).backgroundImage,X=O.width;D.querySelectorAll(".--fx-char").forEach(Z=>{let W=Z.getBoundingClientRect().left-O.left;Z.style.backgroundImage=U,Z.style.backgroundRepeat="no-repeat",Z.style.backgroundSize=`${X}px 100%`,Z.style.backgroundPosition=`-${W}px 0`,Z.style.backgroundClip="text",Z.style.webkitBackgroundClip="text",Z.style.color="transparent";});},_=()=>{cancelAnimationFrame(N),cancelAnimationFrame(k),N=requestAnimationFrame(()=>{k=requestAnimationFrame(F);});};_();let B=new ResizeObserver(_);return B.observe(D),typeof document<"u"&&"fonts"in document&&document.fonts?.ready.then(_),window.addEventListener("resize",_),()=>{cancelAnimationFrame(N),cancelAnimationFrame(k),B.disconnect(),window.removeEventListener("resize",_);}},[V,E,a,g]);let I=useMemo(()=>n?jsx(ae,{dangerouslySetInnerHTML:{__html:n}}):a&&E!==null?E.split("").map((D,N)=>{let k=D===" ",_=["typewriter","reveal","fog","slide","pop"].includes(a)?"1":c?"infinite":"1";return jsx(ae,{"data-char":D,className:`--fx-char -fx ${g?`--fx-${a}`:""}`,style:{"--delay":`${i+N*l}s`,"--duration":`${u}s`,"--iteration":_,"--target-opacity":S,display:k?"inline":"inline-block",whiteSpace:"pre",opacity:!g&&a==="typewriter"?0:void 0},children:D},N)}):r,[r,n,a,E,g,i,l,u,c]);return jsx(b,{ref:C,onMouseEnter:()=>f&&T(true),onMouseLeave:()=>f&&T(false),style:a?{...y,display:a?"flex":y?.display,flexWrap:a?"wrap":y?.flexWrap,opacity:a&&!g?0:a?1:y?.opacity,transition:a?"opacity 0.4s ease":void 0}:y,className:`${w} ${a?"--text-fx -fx":""}`.trim(),...x,children:I})};ln.displayName="Zuz.Text";var $=ln;var pn=({ref:e,...o})=>{let {title:t,position:n,margin:r=4,anchorName:s="--tooltip-anchor",children:a,show:i,variant:u,...l}=o,{style:c,className:d,rest:f}=M(l),p=n||ve.Top;useRef(null);let [w,x]=useState(false);useRef(6);let v=i===true||w,h=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:S}=j(true),g=useMemo(()=>{let E=false;return addPropsToChildren(a,V=>{let I=V.props.className?.includes(s);return I&&(E=true),I||!E},(V,I)=>{let D=I.props.className?.includes(s),N=V===0,k={};return (D||N)&&(k.style={...I.props.style,anchorName:h}),N&&(k.onMouseEnter=F=>{x(true),I.props.onMouseEnter?.(F);},k.onMouseLeave=F=>{x(false),I.props.onMouseLeave?.(F);}),k})},[a,s,h]),b=Se({transition:p==ve.Top?Q.SlideInTop:p==ve.Bottom?Q.SlideInBottom:p==ve.Left?Q.SlideInLeft:Q.SlideInRight,when:v,duration:.2,offset:r+6,margin:p==ve.Top||p==ve.Left?-r:r,curve:S?.curve||oe.EaseInOut});return useImperativeHandle(e,()=>({show:()=>x(true),hide:()=>x(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[g,jsx(m,{style:{positionAnchor:h,...b.style,...p===ve.Top||p===ve.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${v} --${u||S?.variant||q.Small} --${p} abs ${d}`.trim(),children:typeof t=="string"?jsx($,{as:"--text rel",children:t}):t})]})};pn.displayName="Zuz.ToolTip";var Bt=pn;var Jt={Loading:"loading",Normal:"normal"};var fn=({ref:e,...o})=>{let{reset:t,kind:n="solid",variant:r,tooltip:s,tooltipProps:a,icon:i,iconSize:u,children:l,withLabel:c,spinner:d,state:f,disabled:p,...y}=o,{style:w,className:x,rest:C}=M(y),{variant:v}=j(true),T=jsxs("button",{className:removeDuplicateWords(`--button ${s?"--tooltip-anchor":""} --${n} --${r||v} flex aic ${t?"":"jcc"} ${i?"--with-icon":""} ${x}`).trim().replace(/\s+/g," "),style:w,ref:e,disabled:f==Jt.Loading||o.skeleton?.enabled||p,...C,children:[f==Jt.Loading&&jsx(Ie,{variant:r||v,type:d||we.Simple}),(!f||f==Jt.Normal)&&jsxs(Fragment$1,{children:[i&&jsx(te,{variant:u,name:i}),c===true?jsx(ae,{children:l}):l]})]});return s?jsx(Bt,{title:s,...a,children:T}):T};fn.displayName="Zuz.Button";var K=fn;var Xi=e=>{let{label:o,labelColor:t,icon:n,iconColor:r,index:s,className:a,onSelect:i}=e;return o=="-"?jsx(m,{className:"--line"}):jsxs(K,{reset:true,onClick:u=>i?.(e),className:`--item ${a||""}`.trim(),children:[jsx(m,{as:"--icon",children:jsx(te,{name:n,className:"--ico",style:r?{color:r}:{}})}),jsx($,{className:"--lbl flex aic",style:t?{color:t}:{},children:o})]})},dn=Xi;var yn=({ref:e,...o})=>{let {id:t,as:n,fx:r,offsetX:s,offsetY:a,parent:i,event:u,arrow:l,when:c,items:d,header:f,footer:p,origin:y=Pt.TopRight,...w}=o,[x,C]=useState(false),[v,T]=useState(d||[]),{position:h,targetRef:S,calculatedAnchor:g}=useAnchorPosition(i?.current,u,{offsetX:s,offsetY:a,preferredAnchor:y}),b=g.toLowerCase(),E=b.includes("top");b.includes("bottom");let I=E?"--arrow-top":"--arrow-bottom",D=useMemo(()=>b.includes("left")?"--arrow-left":b.includes("right")?"--arrow-right":"--arrow-center",[b]),N=h.top!==0||h.left!==0;useEffect(()=>{c&&N?C(true):c||C(false);},[c,N]);let{className:k,style:F,rest:_}=M(w),B=Se({...r?.transition?{transition:r.transition??Q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:r?.curve??oe.EaseInOut,duration:r?.duration??.05,when:x&&N});return jsxs(m,{ref:S,className:`--contextmenu ${l||i!=null?`--has-arrow ${I} ${D}`:""} abs flex cols ${k}`.trim(),"aria-hidden":!x,style:{...F,...B.style,top:h.top,left:h.left,visibility:N?"visible":"hidden",transformOrigin:g},..._,children:[typeof f=="function"?createElement(f):f,v.map((O,U)=>jsx(dn,{...O,index:U},`context-${O.label.toLowerCase()}-${U}`)),typeof p=="function"?createElement(p):p]})};yn.displayName="Zuz.ContextMenu";var Ko=yn;var xn=forwardRef((e,o)=>{let{children:t,fx:n,when:r,fxDelay:s,fxStep:a,classToIgnore:i,...u}=e,l=j(true),c=useDelayed(),d=n||l?.group?.fx,f=s||l?.group?.fxDelay,p=a||l?.group?.fxStep,y=i||l?.group?.classToIgnore||"-fx",w=useMemo(()=>d?addPropsToChildren(t,x=>{if(x.type===Fragment)return false;let C=x.props||{},v="fx"in C,T="tfx"in C,h=C.as?Array.isArray(C.as)?C.as.join(" "):C.as:C.className||"";return !(typeof h=="string"&&h.includes(y))&&(!v||T)},(x,C)=>{let v=(f??0)+x*(p??.1),T=C.props||{};return "tfx"in T?{delay:(T.delay??0)+v}:{fx:{...d,delay:v,when:r??(n?.when||c)}}}):t,[t,r,c,d,f,p,y,n]);return jsx(m,{className:"--group",ref:o,...u,children:w})});xn.displayName="Zuz.Group";var Wo=xn;var vn=forwardRef((e,o)=>{let{message:t,spinner:n,spinnerSize:r,color:s,when:a,hideMessage:i,...u}=e,{className:l,style:c,rest:d}=M(u),{spinner:f}=j(true);return "when"in e&&e.when==false?null:jsxs(Wo,{fx:{transition:Q.SlideInBottom,curve:oe.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...d,children:[jsx(Ie,{variant:r||f?.variant||q.Small,type:n||f?.type||we.Simple}),!i&&jsx($,{className:"--label",tfx:"fade",style:{color:"var(--cover-label)"},children:t||"loading"})]})});vn.displayName="Zuz.Cover";var _e=vn;var oo=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(oo||{}),ro=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(ro||{}),Sn=(t=>(t.Stack="stack",t.Individual="individual",t))(Sn||{}),wn={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var pl=()=>{let e=useContext(Ee);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let o=(l,c)=>e.add({type:"toast",props:{...c,type:l}});return {show:(l,c,d,f)=>o("default",{title:l,message:c,icon:d,duration:f}),hide:l=>e.remove(l),success:(l,c,d,f)=>o("success",{title:l,message:c,icon:d,duration:f}),error:(l,c,d,f)=>o("error",{title:l,message:c,icon:d,duration:f}),warn:(l,c,d,f)=>o("warn",{title:l,message:c,icon:d,duration:f}),promise:(l,c,d,f)=>o("promise",{title:l,message:c,icon:d,duration:f}),clearAll:()=>e.clear("toast")}},Go=pl;var Cn=forwardRef((e,o)=>{let{when:t,...n}=e;return jsx(m,{ref:o,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:Q.FadeIn,when:t},...n})});Cn.displayName="Zuz.Overlay";var nt=Cn;var qe=null,Be=null,Pn=forwardRef((e,o)=>{let{title:t,message:n,transition:r,curve:s,speed:a,type:i,actionPosition:u,spinner:l,loadingMessage:c,onShow:d,onHide:f,...p}=e,{className:y,style:w,rest:x}=M(p),[C,v]=useState(t||""),[T,h]=useState(n||""),[S,g]=useState(null),[b,E]=useState(i||Oe.Default),V=useMemo(()=>uuid(12),[]),[I,D]=useState(false),N=useRef(null),k=useRef(null),[F,_]=useState(false),[B,O]=useState(true),U=useRef(null),X=T;useImperativeHandle(o,()=>({setLoading(Z){_(Z);},showDialog(Z,G,W,re){qe&&(clearTimeout(qe),Be&&clearTimeout(Be),N.current.classList.remove("--wobble"),setTimeout(()=>N.current.classList.add("--wobble"),50),Be=setTimeout(()=>{N.current.classList.remove("--wobble"),Be=null;},500)),E(Oe.Dialog),G&&h(G),Z&&v(Z),W&&g(W.reduce((J,ce)=>(J.push({...ce,key:ce.key||uuid(12)}),J),[])),D(true),setTimeout(()=>re?re():()=>{},1e3);},dialog(Z,G,W,re){qe&&(clearTimeout(qe),Be&&clearTimeout(Be),N.current.classList.remove("--wobble"),setTimeout(()=>N.current.classList.add("--wobble"),50),Be=setTimeout(()=>{N.current.classList.remove("--wobble"),Be=null;},500)),E(Oe.Dialog),h(G),v(Z),W&&g(W.reduce((J,ce)=>(J.push({...ce,key:ce.key||uuid(12)}),J),[])),D(true),setTimeout(()=>re?re():()=>{},1e3);},error(Z,G){this.show(Z,G,Oe.Error);},warn(Z,G){this.show(Z,G,Oe.Warn);},success(Z,G){this.show(Z,G,Oe.Success);},show(Z,G,W){qe&&(clearTimeout(qe),Be&&clearTimeout(Be),k.current=N.current.style.transform,N.current.style.transform="",N.current.classList.remove("--wobble"),setTimeout(()=>{N.current.classList.add("--wobble"),N.current.style.transform=`${k.current} scale(.9)`.trim();},50),Be=setTimeout(()=>{N.current.classList.remove("--wobble"),N.current.style.transform=k.current||"",Be=null;},500)),qe=setTimeout(()=>{D(false),qe=null,Be=null;},(G||4)*1e3),E(W||Oe.Default),h(Z),D(true),d?.();},hide(){D(false),f?.();}}));let z=useMemo(()=>{let Z={when:I,duration:a||.3,delay:.1};if(b==Oe.Dialog){if(r){let{from:G,to:W}=Rt(r,20);return {from:G,to:W,curve:s||oe.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:oe.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:oe.Spring,...Z}},[I,b]);return useEffect(()=>{U.current&&clearTimeout(U.current),I?O(true):U.current=setTimeout(()=>O(false),1e3);},[I]),b==Oe.Dialog?jsxs(Fragment$1,{children:[jsx(nt,{when:I}),jsxs(m,{className:`--sheet --sheet-${b.toLowerCase()} ${I?"is-visible":""} ${y} fixed`.trim(),style:w,fx:z,...x,ref:N,children:[jsx(_e,{when:F,spinner:l,message:c}),jsxs(m,{className:"--head flex aic rel",children:[jsx(m,{className:`--${C?"title":"dot"} flex aic rel`,children:C||""}),jsx(K,{onClick:Z=>D(false),className:"--closer abs",children:"\xD7"})]}),jsx(m,{className:`--body flex aic rel ${S?"":"--no-action"}`.trim(),children:B?X:null}),S&&jsx(m,{className:`--footer flex aic rel ${u?u==Mo.Center?"jcc":"":"jce"}`.trim(),children:S.map((Z,G)=>jsx(K,{onClick:W=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${V}-action-${Z.key}`))})]})]}):jsx(m,{className:`--sheet --sheet-${b.toLowerCase()} ${y} abs`.trim(),style:w,...x,fx:z,ref:N,children:I?T:null})}),Rn=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;Pn.displayName="Zuz.Sheet";var yl=Pn;var Nt=createContext(null),Qo=()=>{let e=useContext(Nt);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},kt=()=>useContext(Nt),En=()=>()=>{},Bn=e=>{let o=useContext(Nt);return useSyncExternalStore(o?.subscribe??En,()=>{if(!(!o||!e))return o.getSnapshot().values?.[e]},()=>{})},Nn=e=>{let o=useContext(Nt);return useSyncExternalStore(o?.subscribe??En,()=>!o||!e?null:o.getSnapshot().errors?.[e]??null,()=>null)},mt=()=>{let e=kt(),o=Qo();return {...e,...o}},kn=({children:e,initialValues:o={}})=>{let t=useRef({values:o,errors:{},touched:{}}),n=useRef(new Set(Object.keys(o))),r=useRef(new Set),s=useCallback(()=>t.current,[]),a=useCallback(l=>(r.current.add(l),()=>r.current.delete(l)),[]),i=()=>{r.current.forEach(l=>l());};useEffect(()=>{if(!o||Object.keys(o).length===0)return;let l=new Set(Object.keys(o)),c=[...n.current].filter(C=>!l.has(C)),d={...t.current.values};c.forEach(C=>delete d[C]);let f={...d,...o},p=t.current.values||{},y=Object.entries(f),w=Object.entries(p),x=y.length!==w.length||y.some(([C,v])=>p[C]!==v);n.current=l,x&&(t.current={...t.current,values:f},i());},[o]);let u=useMemo(()=>({subscribe:a,getSnapshot:s,setFieldValue:(l,c)=>{t.current.values[l]!==c&&(t.current={...t.current,values:{...t.current.values,[l]:c}},i());},deleteFieldValue:l=>{if(!(l in t.current.values))return;let{[l]:c,...d}=t.current.values;t.current={...t.current,values:d},i();},setFieldError:(l,c)=>{t.current={...t.current,errors:{...t.current.errors,[l]:c}},i();},reset:()=>{t.current={values:{},errors:{},touched:{}},i();}}),[]);return jsx(Nt.Provider,{value:u,children:e})};var Bl=e=>{let o={};for(let t in e){let n=t.split(/[\[\]]+/).filter(Boolean);n.reduce((r,s,a)=>{if(a===n.length-1)r[s]=e[t];else {let i=!isNaN(Number(n[a+1]));r[s]=r[s]||(i?[]:{});}return r[s]},o);}return o},Ln=({ref:e,...o})=>{let {schema:t,name:n,cover:r,spinner:s,errors:a,action:i,children:u,withData:l,beforeSubmit:c,onSubmit:d,onError:f,onSuccess:p,resetOnSuccess:y,...w}=o,{className:x,style:C,rest:v}=M(w),[T,h]=useState(false),S=useRef(null),g=Go(),b=kt();Qo();let V=useRef(null),I=useCallback(z=>S.current?S.current.querySelectorAll(z):[],[S.current]),D=z=>({name:z.name||z.getAttribute("name")||z.getAttribute("data-name"),required:z.required?true:z.getAttribute("data-required")?z.getAttribute("data-required")=="true":false,with:z.with||z.getAttribute("with")}),N=z=>{let Z=[];return z.querySelectorAll(".--input").forEach(G=>{Z.push(G.value);}),Z.join("")},k=z=>z.classList.contains("--otp")?N(z):z.classList.contains("--select")?z.querySelector("button.--selected")?.dataset.value:z.classList.contains("--checkbox")||z.getAttribute("type")==="checkbox"?z.checked:z.value,F=useCallback(z=>{let{name:Z,required:G,with:W}=D(z),re=k(z);if(t&&t[Z]&&b?.getSnapshot()){let J=t[Z](re,b.getSnapshot().values);if(J===false||typeof J=="string")return typeof J=="string"&&b?.setFieldError(Z,J),false}if(G&&(z.type==="checkbox"&&!z.checked||z.classList.contains("--select")&&(re==="-1"||!re)||!re||re===""))return false;if(W)switch((W.includes("@")?W.split("@")[0]=="match"?ot.MatchField:W.split("@")[0]:W).toUpperCase()){case ot.IPV4:return _(re).isIPv4();case ot.IPV6:return _(re).isIPv6();case ot.Email:return _(re).isEmail();case ot.Uri:try{return new URL(re),!0}catch{return false}case ot.MatchField:let[ce,pe,Ce]=W.split("@"),le=document.querySelector(`[name=${pe.trim()}]`);if(!le)return false;switch(Ce||"direct-match"){case "if-not-empty":if(le&&!_(le.value).isEmpty()&&le.value!=z.value)return false;break;case "direct-match":if(le&&le.classList.contains("--otp")&&z.classList.contains("--otp")&&N(le)!=N(z))return false;if(le&&le.value!=z.value)return false;break}break}return true},[t,b]),_$1=useCallback(()=>{let z={},Z={...b?.getSnapshot().values||{}},G=null,W=null;if(I("[name]").forEach(J=>{let{name:ce,required:pe,with:Ce}=D(J),le=pe||Ce?F(J):true,ue=k(J);z[ce]={valid:le,value:ue},Z[ce]=ue,b?.setFieldError(ce,le?null:a?.[ce]||"Invalid"),le?J.classList.remove("--with-error"):(J.classList.add("--with-error"),G||(G=J),W=a?.[ce]);}),G){let J=G;if(J.classList.contains("--otp"))for(let ce of Array.from(J.querySelectorAll(".--input"))){let pe=ce;if(pe.value==""){pe.focus();break}}else J.focus();}let re=Bl(Z);return {error:G!=null,errorMsg:W||"Fix errors to continue...",data:z,payload:re}},[S.current,b]),B=useCallback((z={})=>{let{error:Z,errorMsg:G,payload:W,data:re}=_$1();if(Z){g.error(G);return}i?startTransition(async()=>{h(true),withPost(i,{...l,...W,...z}).then(J=>{h(false),y&&b?.reset(),p?.(J,{...l,...W,...z}),p||g.success(J.message||"Redirecting...");}).catch(J=>{h(false),f?f(J):g.error(J.message);});}):d?.(W,re);},[_$1,i,l,p,f,y,d]),O=useCallback(()=>{let z=I("[type=submit]");!z||z.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):z.forEach(Z=>{Z.addEventListener("click",B);});},[S.current]),U=useMemo(()=>addPropsToChildren(u,z=>z.props.type=="submit",z=>({ref:V})),[u]),X=useRef(B);return useImperativeHandle(e,()=>({setLoading:z=>h(z),submit:z=>X.current(z),init:O,hideError:()=>g.clearAll()}),[B,O]),useEffect(O,[]),useEffect(()=>{X.current=B;},[B]),useEffect(()=>{let z=I("[type=submit]"),Z=Array.from(z).map(G=>{let W=G;return W.addEventListener("click",B),()=>W.removeEventListener("click",B)});return ()=>Z.forEach(G=>G())},[B,I]),jsxs(m,{ref:S,style:C,className:`--form flex rel ${x}`,children:[!Rn(r)&&jsx(_e,{when:T,spinner:s,...r}),U]})};Ln.displayName="Zuz.FormInternal";var Mn=e=>jsx(kn,{initialValues:e.withData,children:jsx(Ln,{...e})});Mn.displayName="Zuz.Form";var or=Mn;var rr=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(o){return this.stack[this.stack.length-1]===o}push(o){this.stack.includes(o)||(this.stack.push(o),this.updateScrollLock());}pop(o){this.stack=this.stack.filter(t=>t!==o),this.updateScrollLock();}handleEscape(){let o=this.stack[this.stack.length-1];return o?(o(),true):false}get count(){return this.stack.length}},He=new rr;var kl=({action:e,render:o=true,message:t=""})=>jsx(m,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:o?t:null}),On=kl;var Vn=({cols:e,gap:o,ais:t,aic:n,aie:r,jcs:s,jcc:a,jce:i,className:u="",style:l,...c})=>{let d=["--flex",e?"--cols":"",t?"--ais":"",n?"--aic":"",r?"--aie":"",s?"--jcs":"",a?"--jcc":"",i?"--jce":"",u].filter(Boolean).join(" "),f={...l,gap:typeof o=="number"?`${o}px`:o};return jsx(m,{...c,className:d,style:f})};Vn.displayName="Zuz.FlexBox";var Te=Vn;var Ol=({useForm:e,action:o,actionPosition:t,dialogID:n,variant:r})=>jsx(Te,{aic:true,as:`--footer rel ${t?t==qr.Center?"--jcc":"":"--jce"}`.trim(),children:o.map((s,a)=>jsx(K,{variant:r,kind:s.kind,type:s.type||"button",onClick:()=>{if(!(e===true&&s.type==="submit")){if(s.handler)return s.handler();if(s.onClick)return s.onClick();console.log("onClick Handler missing");}},as:"--action",children:s.label},`dialog-${n}-action-${s.key||a}`))}),Hn=Ol;var Vl={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"})," "]}),[Me.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"})}),[Me.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"})}),[Me.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"})}),[Me.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"})]})},H=Vl;var Dl=({title:e="Alert",description:o,titlePosition:t="center",onClose:n})=>jsxs(Te,{as:"--head rel",children:[jsxs(Te,{cols:true,as:[`--${e?"title":"dot"} rel`,`--position-${t}`],children:[jsx($,{children:e}),o&&jsx($,{as:"--description",children:o})]}),jsx(K,{onClick:r=>n(),className:`--closer abs ${t=="center"?"center-v":""}`,children:H.close})]}),$n=Dl;var _n=({ref:e,...o})=>{let{index:t,id:n,title:r,description:s,titleAlignment:a,message:i,content:u,transition:l,curve:c,speed:d,type:f,width:p,action:y,actionPosition:w,spinner:x,loadingMessage:C,variant:v,inBackground:T,forceClose:h,forceLoading:S,useForm:g,formProps:b,onConfirm:E,onCancel:V,onClose:I,onShow:D,onHide:N,...k}=o,F=useMemo(()=>uuid(12),[]),[_,B]=useState(r||""),[O,U]=useState(s||""),[X,z]=useState(u||i||""),[Z,G]=useState(f||rt.Dialog),[W,re]=useState(false),[J,ce]=useState(true),[pe,Ce]=useState(()=>y?y.map(De=>({...De,key:De.key||uuid(12)})):null),[le,ue]=useState(false),{variant:Y,spinner:se,dialog:ne}=j(true),he=v||ne?.variant||Y||q.Small,{style:Fe,className:Pe,rest:ye}=M(k),Ve=useRef(null),ie=Se({when:W,duration:d||ne?.speed||.3,delay:ne?.delay||.1,transition:l||ne?.transition||Q.SlideInBottom,curve:c||ne?.curve||oe.EaseInOut,watch:["scale","filter","transform"]}),be=()=>{re(false),I(n);},Gt=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{He.isTop(be)&&be();}}],[W]);useShortcuts(Gt),useEffect(()=>{G(rt.Dialog),z(u||i),B(_),U(O),re(true),setTimeout(()=>D?D():()=>{},500);},[]),useEffect(()=>{h&&be();},[h]),useEffect(()=>{S!=null&&ue(S);},[S]),useEffect(()=>(W?He.push(be):He.pop(be),()=>He.pop(be)),[W]);let Ut=useMemo(()=>1e4+t*10,[t]),ze=jsxs(m,{as:`--dialog --${(f??rt.Default).toLowerCase()} ${W?"--visible":""} ${Pe} fixed abc`.trim(),style:{...ie.style,zIndex:Ut+1,pointerEvents:T==true?"none":"auto",width:p||"auto",...T==true?{scale:"0.92",filter:"blur(2px)"}:{}},...ye,ref:Ve,children:[jsx($n,{title:_,description:s,titlePosition:a||ne?.titleAlignment||"center",onClose:be}),jsx(On,{message:X,render:J,action:pe}),pe&&pe.length>0&&jsx(Hn,{variant:he,action:pe,dialogID:F,useForm:g,actionPosition:w}),jsx(_e,{when:le,spinner:x||ne?.spinner||se?.type||we.Simple,message:C||ne?.loadingMessage})]});return jsxs(Fragment$1,{children:[jsx(nt,{style:{zIndex:Ut},when:W}),g?jsx(or,{onSubmit:((De,No)=>{E?.(De,No);}),...b,children:ze}):ze]})};_n.displayName="Zuz.Dialog";var ar=_n;var Zn=forwardRef((e,o)=>{let{speed:t,smooth:n=false,breakpoints:r={},style:s,...a}=e,{rootRef:i,containerRef:u,thumbY:l,thumbX:c,onScrollY:d,onScrollX:f}=useScrollbar(t||1,r,n),{style:p,className:y,rest:w}=M(a);return useEffect(()=>{let x=u.current;if(!x)return;let C=()=>{window.dispatchEvent(new Event("resize"));},v=T=>{let h=T.target;if(h.closest(".--allow-scroll")){let g=h.closest(".--allow-scroll"),{scrollTop:b,scrollHeight:E,clientHeight:V}=g,I=T.deltaY<0,D=T.deltaY>0;(I&&b>0||D&&b+V<E)&&T.stopPropagation();}};return x.addEventListener("scroll",C),x.addEventListener("wheel",v,{passive:true}),()=>{x.removeEventListener("scroll",C),x.removeEventListener("wheel",v);}},[u]),jsxs(m,{ref:i,className:y.trim(),as:"--scrollview rel",children:[jsx(m,{as:`--scroll-content ${y}`.trim(),ref:u,style:s||{},children:w.children}),jsx(m,{as:"--scroll-track --track-y --abs",children:jsx(m,{as:"--scroll-thumb --abs --round",ref:l,onMouseDown:d})}),jsx(m,{as:"--scroll-track --track-x --abs",children:jsx(m,{as:"--scroll-thumb --abs --round",ref:c,onMouseDown:f})})]})});Zn.displayName="Zuz.ScrollView";var Ot=Zn;var Kn=({ref:e,...o})=>{let{id:t,index:n,from:r,speed:s,children:a,margin:i,animation:u,prerender:l,inBackground:c,forceClose:d,forceLoading:f,onClose:p,...y}=o,{drawer:w}=j(true),[x,C]=useState(a),[v,T]=useState(false),[h,S]=useState(l??(w?.prerender||true)),[g,b]=useState(false),E=()=>{T(false),p?.(t??-1);},{className:V,style:I,rest:D}=M(y),N=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{He.isTop(E)&&E();}}],[v]);useShortcuts(N),useEffect(()=>{C(a);},[a]),useEffect(()=>(v?He.push(E):He.pop(E),()=>He.pop(E)),[v]),useEffect(()=>{T(true);},[]),useEffect(()=>{d&&E();},[d]),useEffect(()=>{f!=null&&b(f);},[f]);let k=r||w?.from||Re.Left,F=useMemo(()=>{switch(k){case Re.Left:return {from:{x:"-100vw"},to:{x:0}};case Re.Right:return {from:{x:"100vw"},to:{x:0}};case Re.Top:return {from:{y:"-100vh"},to:{y:0}};case Re.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[r,w?.from]),_=Se({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:v,curve:u||w?.animation||oe.EaseInOut,duration:s||w?.speed||.5,watch:["scale","filter"]}),B=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(nt,{onClick:O=>{v&&E();},when:v,style:{zIndex:B}}),jsxs(m,{ref:e,"aria-hidden":!v,className:`--drawer flex cols ${V} --${k.toLowerCase()} fixed`,style:{...I,..._.style,"--m":`${i||w?.margin||0}px`,zIndex:B+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...D,children:[r==Re.Top||r==Re.Bottom?jsx(m,{className:"--handle"}):null,jsx(K,{as:"--close-drawer --abs",onClick:E,children:H.close}),jsxs(Ot,{as:"rel",children:[h||v?x:null,jsx(_e,{when:g})]})]})]})};Kn.displayName="Zuz.Drawer";var cr=Kn;var Gn=forwardRef((e,o)=>{let{progress:t,type:n,animated:r,...s}=e,a=useRef(null);useImperativeHandle(o,()=>({setProgress:c=>{a.current.style.width=`${c*100}%`,a.current.setAttribute("data-value",c+"");},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:i,style:u,rest:l}=M(s);return jsx(m,{className:`--progress ${r?"--animated":""} flex rel ${i}`.trim(),style:u,...l,children:jsx(m,{ref:a,className:"--bar rel"})})});Gn.displayName="Zuz.ProgressBar";var at=Gn;var Ql=e=>{let{index:o,id:t,type:n,icon:r,busy:s,width:a,title:i,message:u,duration:l,sticky:c=false,actions:d=[],position:f,style:p,isHovered:y,total:w,progress:x,progressValue:C,forceClose:v,variant:T,onClick:h,onClose:S}=e,[g,b]=useState(false),[E,V]=useState(false),{toast:I}=j(true),D=typeof C=="number",N=D?Math.max(0,Math.min(1,C)):void 0,k=E||v,F=f??I?.position??"TopCenter",_=n??I?.type??"default",B=p??I?.style??"stack",O=l??I?.duration??4,U=x??I?.progress??false,X=useRef(O*1e3),z=useRef(void 0),Z=useRef(void 0),G=useRef(null),W=Se({when:g&&!k,duration:.3,transition:I?.transition||(F.includes("Top")?Q.SlideInTop:F.includes("Bottom")?Q.SlideInBottom:F.includes("Left")?Q.SlideInLeft:Q.SlideInRight),curve:I?.curve||oe.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{b(true);let Y=se=>{if(Z.current!==void 0){let ne=se-Z.current;if(!D&&!y&&!c&&!k&&(X.current-=ne,G.current)){let he=Math.max(0,X.current/(O*1e3)*100);G.current?.setProgress?.(he/100);}}Z.current=se,X.current<=0?V(true):z.current=requestAnimationFrame(Y);};return z.current=requestAnimationFrame(Y),()=>{z.current&&cancelAnimationFrame(z.current);}},[y,c,k,O]),useEffect(()=>{if(k){let Y=setTimeout(()=>{S?.(t);},350);return ()=>clearTimeout(Y)}},[k,t]);let re=B==="stack",J=y?o*65:o*8,ce=y?1:Math.max(.85,1-o*.05),pe=y?1:Math.max(.4,1-o*.2),Ce=Y=>{h?h(Y):s!==true&&(!d||d.length===0)&&V(true);},le=W.style.transform||"translate(0, 0)",ue=k?le:`${le} translateY(${F.includes("Top")?J:-J}px) scale(${ce})`;return jsxs(m,{onClick:Ce,as:`--snack --${k?"hidden":"visible"} --${T||I?.variant||q.Medium} --${_} --${F.toLowerCase()} abs flex aic`,style:{...W.style,zIndex:1e3-o,pointerEvents:k?"none":"auto",opacity:k?W.style.opacity:pe,transform:ue,filter:!k&&re&&!y&&o>0?"blur(1px)":"none",cursor:!d||d.length===0?"pointer":"default",transition:`${W.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsxs(m,{as:"--ico flex aic jcc rel",children:[r?jsx(te,{name:r}):jsx(m,{as:"--no-icon"}),s===true&&jsx(Ie,{as:"abs abc"})]}),jsxs(m,{as:"--meta flex cols",style:a?{width:a,minWidth:a,maxWidth:a}:void 0,children:[jsx($,{as:"--tt",children:i||wn[n]}),jsx($,{as:"--tm",children:u})]}),d&&d.length>0&&jsx(m,{as:"--actions flex gap:5",children:d.map((Y,se)=>jsx(K,{as:"--snack-btn bold",variant:q.XSmall,onClick:ne=>{ne.stopPropagation(),Y.onClick(ne);},children:Y.label},se))}),(U||D)&&jsx(at,{as:"abs",progress:N,ref:G})]})},pr=Ql;var Ee=createContext(null),nc=({ref:e,...o})=>{let n=useContext(Ee)?.depth??0,[r,s]=useState(null),[a,i]=useState(null),[u,l]=useState(false),[c,d]=useState([]),f=useDelayed(),p=useRef(0),y=()=>++p.current,w=()=>{l(false),setTimeout(()=>i(null),200);};useImperativeHandle(e,()=>({add(h){let S=y(),g={id:S,...h};return d(b=>[...b,g]),S},openMenu(h){l(false),setTimeout(()=>{i({id:y(),type:"menu",props:h}),l(true);},16);},update(h,S){d(g=>g.map(b=>b.id!==h?b:{...b,props:{...b.props,...S}}));},remove(h){d(S=>S.map(g=>g.id===h?{...g,props:{...g.props,forceClose:true}}:g)),a?.id===h&&w();},loading(h,S){d(g=>g.map(b=>b.id===h?{...b,props:{...b.props,forceLoading:S}}:b)),a?.id===h&&w();},clear(h){d(c.filter(S=>S.type!=h));}})),useEffect(()=>{if(a&&u){let h=()=>w();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[a,u,w]);let x=h=>{setTimeout(()=>{d(S=>S.filter(g=>g.id!==h)),a?.id===h&&i(null);},250);},C=useMemo(()=>[...c.filter(h=>h.type!="toast")],[c]);if(!f)return null;let v=c.filter(h=>h.type=="toast").reverse(),T=Object.values(ro);return createPortal(jsxs(m,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[C.map((h,S)=>{let g=S<C.length-1;return h.type==="dialog"?jsx(ar,{onClose:x,index:S,id:h.id,...h.props,inBackground:g},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(cr,{onClose:x,index:S,id:h.id,...h.props,inBackground:g},`layer-${h.type}-${h.id}`):null}),T.map(h=>{let S=v.filter(g=>(g.props.position||"TopCenter")===h);return S.length===0?null:jsx(m,{onMouseEnter:()=>s(h),onMouseLeave:()=>s(null),as:`--toast-container fixed --${h.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:S.map((g,b)=>jsx(pr,{index:b,total:S.length,isHovered:r===h,onClose:x,id:g.id,...g.props},g.id))},h)}),a&&jsx(m,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Ko,{onClose:w,when:u,...a.props},`menu-${a.id}`)})]}),document.body)},sc=({children:e})=>{let o=useContext(Ee),t=o?o.depth+1:0,n=useRef(null),r=useMemo(()=>({add:s=>n.current?.add(s),openMenu:s=>n.current?.openMenu(s),update:(s,a)=>n.current?.update(s,a),remove:s=>n.current?.remove(s),loading:(s,a)=>n.current?.loading(s,a),clear:s=>n.current?.clear(s),depth:t,isSubLayer:!!o}),[o]);return jsxs(Ee.Provider,{value:r,children:[e,jsx(nc,{ref:n})]})},_o=sc;var ic=()=>{let e=useContext(Ee);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,r,s)=>{n.preventDefault(),e.openMenu({event:n,items:r,origin:s});},showMenu:(n,{items:r,origin:s,offsetX:a,offsetY:i,transition:u,curve:l,arrow:c,duration:d,header:f,footer:p})=>{e.openMenu({fx:{transition:u,curve:l,duration:d},parent:n,items:r,origin:s||Pt.TopCenter,offsetX:a,offsetY:i,arrow:c,header:f,footer:p});},hide:e.clear}},lc=ic;var mc=()=>{let e=useContext(Ee);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let o=()=>e.clear("dialog"),t=a=>e.remove(a),n=(a,i)=>e.loading(a,i);return {clearAll:o,show:a=>{let i=e.add({type:"dialog",props:{...a,type:rt.Dialog}});return {id:i,setLoading:u=>n(i,u),hide:()=>t(i)}},confirm:a=>{let{confirmLabel:i,...u}=a,l=e.add({type:"dialog",props:{...u,type:rt.Confirm,action:a.action??[{label:a.cancelLabel??"Cancel",kind:"ghost",onClick:()=>{a.onCancel?.(),t(l);}},{label:a.confirmLabel??"Confirm",kind:"solid",type:"submit",onClick:c=>{a.onConfirm?.(c);}}]}});return {id:l,setLoading:c=>n(l,c),hide:()=>t(l)}},hide:t}},pc=mc;var fc=()=>{let e=useContext(Ee);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let o=()=>e.clear("drawer"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a),r=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:i=>n(a,i),close:()=>t(a)}};return {clearAll:o,open:s=>r({children:s}),right:s=>r({children:s,from:Re.Right}),left:s=>r({children:s,from:Re.Left}),top:s=>r({children:s,from:Re.Top}),bottom:s=>r({children:s,from:Re.Bottom}),close:t}},dc=fc;var hc=(e,o,t={})=>{let[n,r]=useState(null),[s,a]=useState(false),{duration:i=.25,curve:u=oe.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=t;return useLayoutEffect(()=>{o&&e.current?(r(e.current.getBoundingClientRect()),a(true)):o||a(false);},[o,e]),{style:Se({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:u,duration:i,when:s&&o}).style,isMeasured:s,sourceRect:n}},yc=hc;var Sc=(e,o={})=>{let{offset:t=8,direction:n="bottom",container:r=null,triggerRef:s=null}=o,a=useRef(null),i=useCallback(()=>{let u=e.current;if(!u)return;let l=s?.current||u.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=u.getBoundingClientRect(),d=l.getBoundingClientRect(),f,p;r?(f=r.getBoundingClientRect(),p="absolute"):(window.getComputedStyle(u).position==="fixed"?p="fixed":p="absolute",p==="fixed"?f={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:f={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),u.style.position!==p&&(u.style.position=p),a.current=p;let x=0,C=0;switch(n){case "top":x=d.top-c.height-t,C=d.left,x<f.top&&d.bottom+c.height+t<=f.bottom&&(x=d.bottom+t);break;case "bottom":x=d.bottom+t,C=d.left,x+c.height>f.bottom&&d.top-c.height-t>=f.top&&(x=d.top-c.height-t);break;case "left":x=d.top,C=d.left-c.width-t,C<f.left&&d.right+c.width+t<=f.right&&(C=d.right+t);break;case "right":x=d.top,C=d.right+t,C+c.width>f.right&&d.left-c.width-t>=f.left&&(C=d.left-c.width-t);break}if(x=Math.max(f.top,Math.min(x,f.bottom-c.height)),C=Math.max(f.left,Math.min(C,f.right-c.width)),a.current==="fixed")u.style.top=`${x}px`,u.style.left=`${C}px`;else {let v;u.offsetParent?v=u.offsetParent.getBoundingClientRect():v={top:0,left:0};let T=x-v.top+window.scrollY,h=C-v.left+window.scrollX;u.style.top=`${T}px`,u.style.left=`${h}px`;}},[e,s,t,n,r]);return useEffect(()=>{let u=e.current;if(!u)return;let l=s?.current||u.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(i);return c.observe(u),l&&c.observe(l),i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,true);}},[e,n,t,r,s]),{postion:a.current,reposition:i}},Dt=Sc;var Cc=()=>{let e=useContext(Ee);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let o=(p,y)=>e.add({type:"toast",props:{...y,type:p}}),t=()=>e.clear("toast"),n=p=>e.remove(p),r=(p,y)=>e.update(p,y),s=p=>({id:p,update:y=>r(p,y),setType:y=>r(p,{type:y}),setProgress:y=>r(p,{progress:true,progressValue:y}),setBusy:y=>r(p,{busy:y}),success:()=>r(p,{type:"success"}),error:()=>r(p,{type:"error"}),warn:()=>r(p,{type:"warn"}),promise:()=>r(p,{type:"promise"}),default:()=>r(p,{type:"default"}),hide:()=>n(p)}),a=p=>s(o("default",p)),i=p=>s(o("success",p)),u=p=>s(o("error",p)),l=p=>s(o("warn",p)),c=p=>s(o("promise",p)),d=(p,y,w)=>{let x=o(p,{...y,sticky:y.sticky??false,actions:[{label:w?.label||"Ok",onClick:C=>{w?.onClick?.(C),n(x);}}]});return s(x)},f=(p,y,w,x)=>{let C=o(p,{...y,sticky:true,actions:[{label:w?.label||"Ok",onClick:v=>{w?.onClick?.(v),(w?.hide??false)===true&&n(C);}},{label:x?.label||"Cancel",onClick:v=>{x?.onClick?.(v),(x?.hide??true)===true&&n(C);}}]});return s(C)};return {show:a,hide:n,promise:c,clearAll:t,ok:(p,y)=>d("default",p,y),success:(p,y)=>y?d("success",p,y):i(p),error:(p,y)=>y?d("error",p,y):u(p),confirm:(p,y,w)=>f("default",p,y,w),warn:(p,y)=>y?d("warn",p,y):l(p),succes:(p,y)=>y?d("success",p,y):i(p)}},Tc=Cc;var es=({ref:e,style:o,...t})=>{let n=useRef(null),r=useMemo(()=>e&&typeof e!="function"&&e.current?e:n,[e]),{style:s,className:a,rest:i}=M(t,r);return jsx("div",{ref:e||n,style:{...s,...o||{}},className:a,...i})};es.displayName="Zuz.Box";var m=es;var os=forwardRef((e,o)=>{let{title:t,message:n,...r}=e,[s,a]=useState(false);return jsxs(m,{className:"--accordion flex cols",...r,children:[jsxs(K,{onClick:i=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx($,{className:"--label flex",children:t}),jsx(m,{className:"--arrow flex",children:s?H.arrowUp:H.arrowDown})]}),s&&jsx(m,{className:"--detail",children:n})]})});os.displayName="Zuz.Accordion";var Nc=os;var kc=({label:e,icon:o,onClick:t,idx:n,selected:r})=>jsx(K,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${r?"--selected":""} aic jcc rel`.trim(),children:typeof o=="string"?jsx(te,{name:o}):o}),ns=kc;var ss=forwardRef((e,o)=>{let{items:t,name:n,selected:r,position:s,...a}=e,i=useRef(null),[u,l]=useState(r||t[0].tag||0),c=useCallback(({x,y:C})=>{if(i.current){let v=i.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${x-v.left}`),document.documentElement.style.setProperty("--tip-y",`${C-v.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),d=useCallback(()=>{i.current&&(i.current.removeEventListener("pointerleave",d),i.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),f=useCallback(()=>{i.current&&(i.current.addEventListener("pointerleave",d),i.current.addEventListener("pointermove",c));},[]);useEffect(()=>{i.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((x,C)=>C.label.length>x.length?C.label:x,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),i.current?.addEventListener("pointerenter",f));},[]);let{className:p,style:y,rest:w}=M(a);return jsxs(m,{ref:i,style:y,className:[`--actionbar flex aic ${p}`,`${!s||s==ve.Auto?"rel":`--${s}`}`].join(" ").trim(),...w,children:[t.map((x,C)=>jsx(ns,{selected:u===x.tag||r==C,...x,idx:C},`actionbar-action-${x.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(m,{className:"--tip abs",children:jsx(m,{className:"--track flex aic",children:t.map(({label:x})=>jsx(m,{className:"--lb",children:x},`tool-tip-${x.toLowerCase().replace(/\s+/g,"-")}`))})})]})});ss.displayName="Zuz.ActionBar";var Dc=ss;var is=forwardRef((e,o)=>{let{type:t,icon:n,title:r,message:s,iconSize:a,...i}=e,{className:u,style:l,rest:c}=M(i);return jsxs(m,{className:`--alert --${t||Me.Info} flex aic ${u}`.trim(),style:l,...c,children:[jsx(m,{className:`--icon icon-${n||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!n&&H[t||Me.Info]}),jsxs(m,{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})]})]})});is.displayName="Zuz.Alert";var $c=is;var cs=({ref:e,...o})=>{let{variant:t,numeric:n,name:r,onConfirm:s,...a}=o,{style:i,className:u,rest:l}=M(a),{variant:c}=j(true),d=useRef(null),f=mt(),p=r?f.errors?.[r]:null,y=r&&f.values&&f.setFieldValue,w=y?f.values?.[r]:void 0,x=useDebounce(v=>{y&&f.setFieldValue?.(r,v);},500),C=v=>{let T=v.currentTarget.value;n&&(T=T.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),v.currentTarget.value=T),x(T),o.onInput?.(v);};return useEffect(()=>{d.current&&r&&w!==void 0&&d.current.value!==String(w)&&(d.current.value=String(w));},[w,r]),useEffect(()=>()=>{y&&f.deleteFieldValue?.(r);},[]),jsx("input",{name:r,className:`--input --${t||c} ${p?"--has-error":""} --flex ${u}`.trim(),style:i,defaultValue:w??o.defaultValue??"",onInput:C,onKeyDown:v=>{v.key=="Enter"&&s?.(v.currentTarget.value);},ref:v=>{d.current=v,typeof e=="function"?e(v):e&&(e.current=v);},...l})};cs.displayName="Zuz.Input";var de=cs;var ps=e=>{let{meta:o,children:t}=e,n=useDelayed(),{label:r,icon:s,...a}=isValidElement(o)?{}:o,{className:i,style:u,rest:l}=M({...a,...a.animate?{animate:{...a.animate,when:n}}:{}});return isValidElement(o)?jsx("li",{style:u,className:i,children:o}):jsxs("li",{style:u,className:i,...l,children:[t,typeof o=="string"?o:r]})};ps.displayName="Zuz.ListItem";var us=ps;var gs=forwardRef((e,o)=>{let{items:t,variant:n,direction:r,seperator:s,ol:a,virtual:i,...u}=e,l=useRef(null),c=useRef(null),{className:d,style:f,rest:p}=M(u),y=a==true?"ol":"ul",{visibleRange:w,scrollTop:x}=useMemo(()=>{if(!i||typeof window>"u")return {visibleRange:{start:0,end:t.length},scrollTop:0};i.itemHeight??50;i.overscan??5;i.height??400;return {visibleRange:{start:0,end:t.length},scrollTop:0}},[t.length,i]),C=useCallback(()=>{let{start:v,end:T}=w;return t.slice(v,T).map((S,g)=>{let b=v+g,E=t,V=`${typeof S=="string"?`li-${String(S)}`:isValidElement(S)?`li-${S.key}`||`${b}-${MD5(S.toString())}`:S.label}-${b}`;return jsxs(Fragment,{children:[jsx(us,{meta:S}),s&&E[b+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${b+1}-${V}`):null]},V)})},[w,t,s]);return useEffect(()=>{let v=l.current;if(!v)return;let T=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{},100);};return v.addEventListener("scroll",T,{passive:true}),()=>{v.removeEventListener("scroll",T),c.current&&clearTimeout(c.current);}},[]),createElement(y,{className:`--list --${n||q.Small} flex ${r??"cols"} ${d}`.trim(),style:f,ref:v=>{l.current=v,typeof o=="function"?o(v):o&&(o.current=v);},...p,children:C()})});gs.displayName="Zuz.List";var Ke=gs;var ys=forwardRef((e,o)=>{let{fx:t,action:n,data:r,withStyle:s,onChange:a,...i}=e,{className:u}=M({as:s||""}),{style:l}=M(i),[c,d]=useState(false),[f,p]=useState(r||[]),y=useRef(null),w=useRef(null),x=useRef(null),C=useMemo(()=>i.name||uuid(12),[]),[v,T]=useState(null),[h,S]=useState(null),[g,b]=useState([]),V=useDebounce(B=>{B.target.value==""?(d(false),p([])):n&&B.target.value.trim()!=""&&withPost(n,{query:B.target.value}).then(O=>{"items"in O&&_(O.items).isArray()?(p(O.items),S(B.target.value),b(O.items)):console.error("Action Response should contain items array"),T(null);}).catch(O=>{T(null),p([]);});},250),I=()=>{if(w.current){let B=w.current.getBoundingClientRect(),O=window.innerHeight-B.bottom,U=B.top;if(x.current){let X=x.current;O<X.offsetHeight&&U>O?(X.style.top="auto",X.style.bottom=`${B.height}px`,X.style.maxHeight=`${U-150}px`):(X.style.top=`${B.height+5}px`,X.style.bottom="auto",X.style.maxHeight=`${O-150}px`);}}},D=B=>{if(f.length>0){if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),B.stopPropagation()),B.key==="Escape")T(null),d(false),p([]);else if(B.key==="ArrowDown")T(O=>{let U=O===null||O===f.length-1?0:O+1;return k(U),U});else if(B.key==="ArrowUp")T(O=>{let U=O===null||O===0?f.length-1:O-1;return k(U),U});else if(B.key==="Enter"&&v!==null){let O=f[v];y.current&&(y.current.value=O,d(false),p([]));}}},N=B=>{y.current&&(y.current.value=B,d(false),p([]));},k=B=>{let O=f[B];if(O&&y.current&&(y.current.value=O,y.current.setSelectionRange(O.length,O.length)),x.current){let X=x.current.children[B];X&&X.scrollIntoView({block:"nearest"});}},F=B=>{w.current&&!w.current.contains(B.target)&&(d(false),p([]));},_$1=()=>{y.current&&y.current.value===h&&(p(g),T(null),I());};return useEffect(()=>(window.addEventListener("resize",I),window.addEventListener("scroll",I,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{I();},[f]),jsxs(m,{style:l,ref:w,className:`--autocomplete --${e.size||q.Small} flex aic rel ${u}`.trim(),children:[jsx(de,{ref:y,autoComplete:"off",onChange:V,onKeyDown:D,onFocus:_$1,...i}),jsx(m,{className:"--arrow rel flex aic jcc",children:f.length>0?H.arrowUp:H.arrowDown}),f.length>0&&jsx(Ke,{id:C,ref:x,className:"--suggestion-list flex cols abs",items:f.map((B,O)=>({label:B,onClick:U=>{U.preventDefault(),U.stopPropagation(),N(B);},className:v===O?"--current":"",animate:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:clamp(.02*O,.02,.5)}}))})]})});ys.displayName="Zuz.AutoComplete";var lm=ys;var xs=forwardRef((e,o)=>{let t=useRef(null),n=useMemo(()=>o&&typeof o!="function"&&o.current?o:t,[o]),{style:r,className:s,rest:a}=M(e,n);return !a.src||a.src==""?null:jsx("img",{ref:n,style:r,className:`${s} flex`,...a})});xs.displayName="Zuz.Image";var We=xs;var bs=forwardRef((e,o)=>{let{src:t,variant:n,type:r,crossOrigin:s,referrerPolicy:a,fx:i,as:u,alt:l,color:c,style:d,...f}=e,[p,y,w]=useImage(t??"",s,a),{className:x,style:C,rest:v}=M({fx:i,as:u});return jsx(m,{className:`--avatar --${n||q.Small} --${(r||Ur.Circle).toLowerCase()} rel flex aic jcc ${x}`.trim(),style:{background:c||"var(--avatar-bg, var(--primary))",...d,...C},...v,children:t?jsx(We,{src:p,crossOrigin:s,referrerPolicy:a,...f}):jsx($,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});bs.displayName="Zuz.Avatar";var hm=bs;var ym=({size:e=5,type:o="dead",label:t="",variant:n=q.Small,loading:r=false,spinner:s,...a})=>{let{style:i,className:u,rest:l}=M(a);return jsxs(m,{style:{..._(t).isEmpty()?{"--badge-size":e}:{},...i},as:`--badge --${n} --${o} rel flex aic jcc ${u}`.trim(),children:[jsx(m,{fx:{transition:Q.FadeIn,curve:oe.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(Ie,{type:s})}),_(t).isEmpty()?jsx(m,{as:`--dot --${o}`}):jsx($,{as:"--label",children:t})]})},xm=ym;var Lm=[{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,o=e.getDay();return addDays(e,(6-o)%7||6)},getDateFormat:()=>{let e=new Date,o=e.getDay();return format(addDays(e,(6-o)%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)}],Mm=e=>{let o=new Set;return e.filter(t=>{if(t.label=="Later")return true;let n=t.getDate().toISOString().split("T")[0];return o.has(n)?false:(o.add(n),true)})},Ss=forwardRef((e,o)=>{let{defaultValue:t,variant:n,onChange:r,...s}=e,{style:a,className:i,rest:u}=M(s),[l,c]=useState(t||new Date),d=startOfMonth(l),f=endOfMonth(l),p=startOfWeek(d),y=endOfWeek(f),w=useMemo(()=>eachDayOfInterval({start:p,end:y}),[p,y]),x=T=>{r?.(T),c(T);},C=()=>{c(T=>new Date(T.getFullYear(),T.getMonth()-1));},v=()=>{c(T=>new Date(T.getFullYear(),T.getMonth()+1));};return jsxs(m,{as:`--calendar flex --${n||"sm"} ${i}`,style:a,children:[jsx(m,{as:"--calendar-quick-select flex cols flex:1",children:Mm(Lm).map(T=>{let h=T.getDate();return jsxs(K,{onClick:()=>x(h),as:["--calendar-quick-option flex aic gap:5"],children:[jsx($,{as:"flex:1",children:T.label}),jsx($,{as:"tar",children:T.getDateFormat()})]},`--dtp-option-label-${T.label}`)})}),jsxs(m,{as:"--calendar-selector flex cols flex:1",children:[jsxs(m,{as:"--calendar-head flex aic jcc gap:4",children:[jsx($,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(K,{onClick:C,as:"--calendar-chevron",children:H.chevronUpOutline}),jsx(K,{onClick:v,as:"--calendar-chevron",children:H.chevronDownOutline})]}),jsxs(m,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(T=>jsx($,{as:"--calendar-day",children:T},`--calendar-hd-${T}`)),w.map((T,h)=>{let S=isSameMonth(T,l),g=isSameDay(T,l),b=isToday(T);return jsx(K,{disabled:!S,onClick:()=>x(T),as:["--calendar-day --calendar-dd",`${g?"--calendar-dd-selected":""}`,`${b?"--calendar-dd-current":""}`],children:format(T,"d")},`--calendar-day-${h}-${T.getFullYear()}-${T.getMonth()}-${T.getDay()}`)})]})]})]})});Ss.displayName="Zuz.Calendar";var xr=Ss;var go=(t=>(t.Table="table",t.Gooey="gooey",t))(go||{});var Ps=({ref:e,...o})=>{let{itemCount:t,itemsPerPage:n,startPage:r,pageRange:s,paginationStyle:a,breakLabel:i,prevLabel:u,nextLabel:l,hash:c,loading:d,seperator:f,renderOnZeroPageCount:p,asDots:y,progressBar:w,onPageChange:x,...C}=o,v=useRef(null),T=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(B=>`${toHash(B,c||6,T)}${f||""}${T}`,[T]),S=useMemo(()=>i||"...",[i]),g=useRef(null),[b,E]=useState({id:c?r?typeof r=="number"?h(r):r:1:r||1,label:r||1});useImperativeHandle(e,()=>({setPage:B=>E(B),getPage:B=>b,setProgress:B=>g.current?.setProgress?.(B),getProgress:()=>g.current?.getProgress?.()??0}),[g.current]);let{style:V,className:I,rest:D}=M(C),N=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!t)throw new Error('"itemCount" prop is required');let k=useMemo(()=>Math.ceil(t/n),[t,n]),F=useMemo(()=>{let B=[],O=Math.max(N(b)-(s||2),1),U=Math.min(N(b)+(s||2),k);O>1&&B.push({id:c?h(1):1,label:1}),O>2&&B.push({id:-1,label:S});for(let X=O;X<=U;X++)B.push({id:c?h(X):X,label:X});return U<k-1&&B.push({id:-1,label:S}),U<k&&B.push({id:c?h(k):k,label:k}),B},[b]),_=useCallback(B=>{let O=B;+O.label<1||+O.label>k||(E(O),x?.(O));},[t,n,b]);return F.length<=1&&(p??false)===false?null:jsxs(m,{ref:v,as:`--pagination ${y===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${I}`,children:[jsx(m,{as:"flex flex:1 aic --pgt-btns",children:(F.length>1?F:[{id:1,label:1},{id:-1,label:S}]).map((B,O,U)=>{let X=(typeof B=="string"?B:B.label)==N(b);return jsx(K,{disabled:B.id==-1||N(b)==+B.label,className:X?"--current-page":"",onClick:z=>_(B),children:y===true?w===true&&X?jsx(at,{ref:g}):"":typeof B=="string"?B:B.label},`--pg-${O}-${B.id}`)})}),jsx(m,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(b)-1)*n+1} - `,`${Math.min(N(b)*n,t)} of ${t} items`].join(" ")}),jsxs(m,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(K,{disabled:N(b)<=1,onClick:B=>_({id:c?h(N(b)-1):N(b)-1,label:N(b)-1}),children:H.chevronLeftOutline}),jsx(K,{disabled:F.length<=1||N(b)==N(F[F.length-1]),onClick:B=>_({id:c?h(N(b)+1):N(b)+1,label:N(b)+1}),children:H.chevronRightOutline})]})]})};Ps.displayName="Zuz.Pagination";var $t=Ps;function zm(e,o){let{items:t,renderItem:n,effect:r="slide",loop:s=true,loopMode:a="infinite",startIndex:i=0,useKeys:u=true,useWheel:l=true,spacing:c=160,rotation:d=20,scaleStep:f=.15,blur:p=4,animation:y="power",showDots:w=false,autoPlay:x=false,autoPlaySpeed:C=3,onChange:v,...T}=e,{className:h,style:S}=M(T),g=useRef(null),b=C/(C>=1e3?1e3:1),E=useCarousel({total:t.length,initialIndex:i,loop:s,useKeys:u,useWheel:l,onChange:k=>{g.current?.setPage({id:k+1,label:k+1}),g.current?.setProgress(0),v?.(k);}}),{pause:V,resume:I,reset:D}=useTimer({duration:b,autoStart:x===true,onProgress:k=>{x===true&&g.current?.setProgress(1-k);},onExpired:()=>{x===true&&E.next(),D();}}),N={...S,"--carousel-spacing":`${c}px`,"--carousel-rotation":`${d}deg`,"--carousel-blur":`${p}px`,"--carousel-scale-step":f,"--active-index":E.index,"--carousel-transition":`var(--${y})`};return jsxs(m,{ref:o,className:`--carousel --effect-${r} --loop-${a} flex cols aic jcc ${h}`.trim(),style:N,children:[jsx(m,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((k,F)=>{let _=F-E.index;if(a==="infinite"){let O=t.length;_=((_+O/2)%O+O)%O-O/2;}let B=F===E.index;return jsx(m,{onMouseEnter:()=>B&&V(),onMouseLeave:()=>B&&I(),className:`--carousel-item-wrapper abs ${B?"--is-active":""}`,style:{"--offset":_,zIndex:B?100:100-Math.abs(_),display:Math.abs(_)>5?"none":"flex"},children:n(k,F,E.index)},F)})}),w&&jsx($t,{ref:g,itemCount:t.length,itemsPerPage:1,startPage:i+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:k=>E.goTo(+k.label-1),asDots:true,progressBar:true})]})}var _m=forwardRef(zm),Zm=_m;var Rs=(o=>(o.Line="line",o))(Rs||{});var Bs=forwardRef((e,o)=>{let{data:t,width:n,height:r,lineColor:s,strokeWidth:a=2,gradientStartColor:i,gradientEndColor:u,animated:l,animDuration:c=2,animDelay:d=0,padding:f=0,type:p,...y}=e,{className:w,style:x,rest:C}=M(y),v=useRef(null),T=useResizeObserver(v.current?.parentElement||v),h=typeof n=="number"?n:T.width,S=typeof r=="number"?r:T.height,g={width:h,height:S},b=useId(),{pathD:E,areaPathD:V}=useLineChart(t,g,f+(a||2)),I=useRef(null),D=useRef(null),[N,k]=useState(0),[F,_]=useState(0);return useEffect(()=>{l&&(I.current&&k(I.current.getTotalLength()),D.current&&_(D.current.getTotalLength()));},[l,E,V,h,S]),jsx(m,{ref:v,as:`--chart --${p||"line"}-chart ${w}`.trim(),style:{...x,width:n,height:r},...C,children:h>0&&S>0&&jsxs("svg",{viewBox:`0 0 ${h} ${S}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:b,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:i}),jsx("stop",{offset:"100%",stopColor:u})]})}),jsx("path",{ref:D,d:V,fill:`url(#${b})`,stroke:"none",style:l?{strokeDasharray:F,strokeDashoffset:F}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})}),jsx("path",{ref:I,d:E,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:N,strokeDashoffset:N}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:N,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})})]})})});Bs.displayName="Zuz.Chart";var Ym=Bs;var Ns=(r=>(r[r.Sending=0]="Sending",r[r.Sent=1]="Sent",r[r.Delivered=2]="Delivered",r[r.Read=3]="Read",r))(Ns||{}),ks=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(ks||{}),Ls=(s=>(s.File="file",s.Image="image",s.Video="video",s.Audio="audio",s.Link="link",s))(Ls||{});var Os=memo(forwardRef((e,o)=>{let{text:t,media:n,side:r="me",stylePreset:s="default",status:a=1,timeStamp:i=Date.now(),arrow:u=true,attachments:l,autoFetchLinkPreview:c=false,linkPreviewFetcher:d,replyTo:f,reactions:p,forwarded:y,...w}=e,[x,C]=useState(null),[v,T]=useState(false),{className:h,style:S,rest:g}=M(w),b=useMemo(()=>{if(!t||!c)return null;let I=/(https?:\/\/[^\s]+)/g;return t.match(I)?.[0]},[t,c]);useEffect(()=>{if(!b||!c)return;let I=new AbortController,N=setTimeout(async()=>{T(true);try{if(d){let k=await d(b);C(k||null);}else (await fetch(`https://r.jina.ai/http://${b.replace(/^https?:\/\//,"")}`,{method:"GET",signal:I.signal})).ok&&C({title:b,description:"Preview available",url:b});}catch(k){k.name!=="AbortError"&&console.warn("Failed to fetch link preview:",k);}finally{T(false);}},500);return ()=>{I.abort(),clearTimeout(N);}},[b,c,d]);let E=useMemo(()=>n?n.type==="audio"?jsxs(m,{as:"flex aic --bubble-audio",children:[jsx(ae,{className:"--bm-action",children:H.play}),jsx(at,{progress:.7}),jsx($,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type==="img"?jsx(m,{as:"--bubble-image",children:jsx(We,{src:n.source,alt:"Chat image"})}):n.type==="vid"?jsx(m,{as:"--bubble-video",children:jsx("video",{src:n.source,controls:true,style:{maxWidth:"200px",borderRadius:"var(--bubble-radius)"}})}):null:null,[n]),V=useMemo(()=>!l||l.length===0?null:jsx(m,{as:"--bubble-attachments flex cols gap:6 mt:8",children:l.map((I,D)=>{let N=I.id||`${I.name}-${D}`;return (I.type==="image"||/\.(png|jpg|jpeg|webp|gif|svg)$/i.test(I.name))&&(I.preview||I.url)?jsxs(m,{as:"--bubble-attachment --att-image",children:[jsx(We,{src:I.preview||I.url,alt:I.name}),jsxs(m,{as:"--att-meta flex aic jbs",children:[jsx($,{as:"s:xs bold",children:I.name}),I.size&&jsx($,{as:"s:xs dim-75",children:I.size})]})]},N):jsx("a",{className:"--bubble-attachment --att-file",href:I.url,target:"_blank",rel:"noreferrer",children:jsxs(m,{as:"flex aic gap:8",children:[jsx(ae,{className:"--att-icon",children:H.layers}),jsxs(m,{as:"flex cols",children:[jsx($,{as:"s:sm bold",children:I.name}),I.size&&jsx($,{as:"s:xs dim-75",children:I.size})]})]})},N)})}),[l]);return jsxs(m,{className:`--bubble-wrapper flex --bw-${r}`.trim(),children:[f&&jsxs(m,{as:"--bubble-reply-to pl:8 bl:2 opacity:0.7",style:{borderLeftColor:"currentColor"},children:[jsx($,{as:"s:sm bold opacity:0.8",children:f.author}),jsx($,{as:"s:xs",children:f.text})]}),y&&jsx($,{as:"s:xs opacity:0.7 italic",children:"Forwarded"}),jsxs(m,{ref:o,className:`--bubble --bubble-enter --bubble-${r} --bubble-style-${s} ${n?`--with-media --bma-${n.type}`:""} ${u?"":"--bubble-grouped"} rel flex cols ${u===true?"--b-arrow":""} ${h}`.trim(),style:{...S,contain:"layout style paint"},...g,children:[t&&jsx($,{className:"--bubble-text",children:t}),x&&!v&&jsxs(m,{as:"--bubble-link-preview mt:8 p:8 br:6 opacity:0.85",style:{border:"1px solid currentColor",borderRadius:"6px",marginTop:"8px",cursor:"pointer"},onClick:()=>x.url&&window.open(x.url,"_blank"),children:[x.image&&jsx(We,{src:x.image,alt:"Link preview",style:{maxWidth:"100%",borderRadius:"4px",marginBottom:"6px"}}),x.title&&jsx($,{as:"s:sm bold",children:x.title}),x.description&&jsx($,{as:"s:xs",children:x.description})]}),E,V,p&&p.length>0&&jsx(m,{as:"flex gap:4 mt:6",children:p.map((I,D)=>jsx(ae,{style:{fontSize:"1.2em"},children:I},D))}),jsxs(m,{as:"flex aie jce --bubble-stats",children:[jsx($,{className:"--bubble-stamp tar",children:timeSince(i)}),r==="me"&&jsx(ae,{className:`--bubble-status --bs-${a}`,children:a===0?H.pending:a===1?H.done:a===2?H.doneAll:H.doneAll})]})]})]})}),(e,o)=>e.text===o.text&&e.side===o.side&&e.status===o.status&&e.timeStamp===o.timeStamp&&e.stylePreset===o.stylePreset&&e.media===o.media&&e.attachments===o.attachments&&e.reactions===o.reactions);Os.displayName="Zuz.Bubble";var Cr=Os;var op={today:"Today",yesterday:"Yesterday"},Ds=memo(({messages:e,autoScroll:o=true,onScrollTop:t,typing:n,dateLabels:r,locale:s,formatDateLabel:a})=>{let i=useRef(null),u=useRef(null),l=useRef(null),c=useRef(false),d=useRef(false),[f,p]=useState(0),[y,w]=useState(false),x=useRef(e.length),C=useMemo(()=>({...op,...r||{}}),[r]),v=useCallback(()=>i.current?.querySelector(".--scroll-content"),[]),T=useCallback(E=>{let V=E||Date.now(),I=new Date(V),D=new Date,N=new Date(D.getFullYear(),D.getMonth(),D.getDate()),k=new Date(I.getFullYear(),I.getMonth(),I.getDate()),F=Math.floor((N.getTime()-k.getTime())/864e5),_=`${I.getFullYear()}-${I.getMonth()+1}-${I.getDate()}`,B=C,O=a?a(V,{date:I,dayDiff:F,locale:s,labels:B}):F===0?B.today:F===1?B.yesterday:I.toLocaleDateString(s);return {key:_,label:O}},[a,s,C]),h=useMemo(()=>e.flatMap((E,V)=>{let I=e[V-1],D=T(E.timeStamp),N=I?T(I.timeStamp):null,k=V===0||D.key!==N?.key,F=V===0||I?.side!==E.side||D.key!==N?.key,_=[];return k&&_.push(jsx(m,{as:"flex aic jcc p:8,0",children:jsx($,{as:"s:xs dim-50",children:D.label})},`date-${D.key}-${V}`)),_.push(jsx(Cr,{...E,arrow:E.arrow??F},E.id||V)),_}),[e,T]),S=useMemo(()=>n?[...h,jsx(m,{as:"flex jcs p:4,8",children:jsxs(m,{as:"--bubble --bubble-you --typing-indicator rel flex cols",children:[jsx($,{as:"s:xs dim-75",children:typeof n=="string"?n:"Typing"}),jsxs(m,{as:"flex aic gap:4",children:[jsx(ae,{className:"--typing-dot"}),jsx(ae,{className:"--typing-dot"}),jsx(ae,{className:"--typing-dot"})]})]})},"typing-row")]:h,[h,n]);useEffect(()=>{let E=v();if(!E||!o)return;let V=e.length-x.current;V>0&&(x.current=e.length,c.current?(p(I=>I+V),w(true)):(requestAnimationFrame(()=>{E.scrollTop=E.scrollHeight;}),p(0),w(false)));},[e,o,v]);let g=useCallback(()=>{let E=v();if(!E)return;let V=E.scrollHeight-E.scrollTop-E.clientHeight<100,I=E.scrollTop<50;c.current=!V,w(!V),V&&(p(0),w(false)),I?d.current||(d.current=true,t?.()):d.current=false,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{c.current=false;},500);},[t,v]);useEffect(()=>{let E=v();if(E)return E.addEventListener("scroll",g,{passive:true}),()=>E.removeEventListener("scroll",g)},[g,v]);let b=useCallback(()=>{let E=v();E&&(E.scrollTop=E.scrollHeight,p(0),w(false));},[v]);return useEffect(()=>()=>{l.current&&clearTimeout(l.current);},[]),jsxs(m,{ref:i,as:"rel flex cols",style:{height:"100%",contain:"layout style paint"},children:[jsx(Ot,{as:"h:full",smooth:true,children:jsx(Ke,{ref:u,items:S})}),y&&f>0&&jsx(m,{as:"abs bottom:0 left:0 right:0 flex aic jcc",style:{padding:"12px",background:"linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%)"},children:jsx(K,{onClick:b,style:{padding:"8px 16px",borderRadius:"20px",fontSize:"12px"},children:jsxs($,{children:[f," new message",f!==1?"s":""]})})})]})},(e,o)=>e.messages.length===o.messages.length&&e.autoScroll===o.autoScroll&&e.onScrollTop===o.onScrollTop&&e.typing===o.typing&&e.locale===o.locale&&e.formatDateLabel===o.formatDateLabel&&e.dateLabels?.today===o.dateLabels?.today&&e.dateLabels?.yesterday===o.dateLabels?.yesterday);Ds.displayName="Zuz.ChatList";var rp=Ds;var Hs=forwardRef((e,o)=>{let{style:t,className:n,rest:r}=M(e);return jsx("label",{ref:o,style:t,className:n,...r})});Hs.displayName="Zuz.Label";var Ft=Hs;var $s=({ref:e,...o})=>{let {name:t,required:n,type:r,value:s,size:a,variant:i,checked:u,disabled:l,onSwitch:c,...d}=o,f=mt(),p=!!(t&&f.values);p?f.errors?.[t]:null;let w=p?f.values?.[t]:void 0,[x,C]=useState(u||false),v=useRef(null),{variant:T}=j(true),h=useMemo(()=>p&&w!=null?typeof w=="string"?w.toLowerCase()!=="false"&&w!=="":!!w:x,[w,x,p]);useEffect(()=>{v.current&&v.current.checked!==h&&(v.current.checked=h);},[h]),useEffect(()=>{u!==void 0&&C(u);},[u]);let S=g=>{let b=!!g;p&&f.setFieldValue?.(t,b),C(b),c?.(b,s||"cb");};return useImperativeHandle(e,()=>({setChecked(g,b=true){S(g);},toggle(g=true){S(!h);}})),jsxs(Ft,{"aria-hidden":l,className:[`--${(r||Ue.Default).toLowerCase()}`,`${!r||r===Ue.Default?"--checkbox":"--switch"}`,`--${i||T||q.Small}`,`flex aic jcc ${h?"is-checked":""} rel`,`${l?"--disabled":""}`].join(" ").trim(),...d,children:[(!r||r==Ue.Default)&&H.check,jsx(de,{ref:g=>{v.current=g,e&&(e.current=g);},defaultChecked:h,type:"checkbox",className:"abs",name:t,required:n||false,onChange:g=>{g.stopPropagation(),S(g.target.checked);},disabled:l})]})};$s.displayName="Zuz.CheckBox";var zt=$s;var dp=({ref:e,...o})=>{let{code:t,copy:n,lang:r="tsx",showLines:s=false,highlight:a="",as:i,fx:u,...l}=o,c=useRef(null),{className:d,style:f,rest:p}=M({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${i}`,fx:u},c),y=useMemo(()=>{let x=new Set;return a.split(",").forEach(C=>{if(C.includes("-")){let[v,T]=C.split("-").map(Number);for(let h=v;h<=T;h++)x.add(h);}else C&&x.add(Number(C));}),x},[a]),w=useMemo(()=>{let x=t.split(`
|
|
9
|
+
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let C=x[0]?.match(/^\s*/)?.[0].length||0,v=x.map(h=>{let S=h.match(/^\s*/)?.[0].length||0,g=Math.min(S,C);return h.slice(g)}),T=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(<\/?[A-Z][\w\.]*|>)/g},{name:"var",re:/(?<!<\/|<)\b[A-Z]\w*\b/g},{name:"fn",re:/\b([a-z_]\w*)(?=\s*\()/gi},{name:"prop",re:/\.([a-z_]\w*)\b/gi},{name:"num",re:/\b\d+\b(?![#|A-Z|a-z|_|ZUZ])/g}];return v.map((h,S)=>{let g=h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),b=y.has(S+1);if(r!="plain"){let E=[];T.forEach(V=>{g=g.replace(V.re,I=>{let D=`ZUZ_ID_${E.length}_ZUZ`;return E.push(`<span class="--token-${V.name}">${I}</span>`),D});});for(let V=E.length-1;V>=0;V--)g=g.replace(`ZUZ_ID_${V}_ZUZ`,E[V]);}return `<div class="--code-line ${s==true?"--with-ln":""} ${b?"--is-highlighted":""}">
|
|
10
10
|
${s==true?`<span class="--line-number">${S+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${g||" "}</span>
|
|
12
|
-
</div>`}).join("")},[t,h]);return jsxs(f,{as:`--code-block rel ${d}`,style:u,...l,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:T}})}),n&&jsx(K,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),n.onCopy?.();},children:"Copy"})]})},jm=Ym;var Ns=({onSelect:e,meta:r,selected:t,disabled:n=false})=>{let o=useRef(null),{index:s,icon:a,label:i}=r,[p,l]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&o.current){let{width:d,x:u}=o.current.getBoundingClientRect();l({x:u,width:d}),t&&e(s,d,u,r,true);}},[c,o.current]),useEffect(()=>{t&&e(s,p.width,p.x,r,false);},[t]),jsxs(K,{disabled:n,onClick:()=>e(s,p.width,p.x,r,false),ref:o,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(te,{name:a,as:"--segment-icon"}):jsx(f,{as:"--segment-icon flex aic jcc",children:a}):null,i&&String(i).trim()!=""&&jsx(f,{className:"--segment-label",children:i||`Item ${s}`})]})};Ns.displayName="SelectTabItem";var Bs=Ns;var Ls=forwardRef((e,r)=>{let{fx:t,items:n,selected:o,variant:s,disabled:a=false,onSwitch:i,...p}=e,[l,c]=useState(o||0),d=useDelayed(50),u=useRef(l),{className:m,style:h,rest:T}=B(p),x=useRef(null),P=useRef(null),{variant:v}=j(true),R=(y,S,g,b,E)=>{if((E||l!=y&&l!=-2)&&(c(y),u.current=l,queueMicrotask(()=>{d&&i?.(b);})),x.current){let F=P.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${S}px`),x.current.style.setProperty("--x",`${F?g-F.left:g}px`);}};return useImperativeHandle(r,()=>({setSelected:y=>{typeof y=="number"&&y!=l&&c(y);}}),[l]),jsxs(f,{ref:P,"data-selected":l,className:`${m} --segmented --${s||v||q.Medium} flex aic rel`,style:h,...T,children:[jsx(f,{ref:x,className:`--segment-tab --${a?"disabled":"abled"} abs`}),n.map((y,S)=>jsx(Bs,{disabled:a,onSelect:R,selected:l==S,meta:{...y,index:S}},`segment-${y.label}-${S}`))]})});Ls.displayName="Zuz.SelectTabs";var Ht=Ls;var Vs=forwardRef((e,r)=>{let{type:t,variant:n,...o}=e,s=useDelayed(),{colorScheme:a,setColorScheme:i}=Oo(),p=useCallback(()=>{i(a=="dark"?"light":a=="light"?"system":"dark");},[a]),{variant:l}=j(true),{className:c,style:d}=B(o),u=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"system",index:1,label:"",icon:V.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}],[]),m=useMemo(()=>["light","system","dark"].indexOf(a),[a]);return !s||m==-1?null:t=="system"||t=="switch"?jsx(Ht,{className:`--color-scheme --${t}`,onSwitch:({tag:h})=>{i(h);},selected:m,items:u,...o}):jsx(K,{onClick:p,style:d,variant:n,as:`--color-scheme-switch ${c}`.trim(),children:a=="system"?V.colorSchemeSystem:a=="light"?V.colorSchemeLight:V.colorSchemeDark})});Vs.displayName="Zuz.ColorScheme";var fp=Vs;var Hs=forwardRef((e,r)=>{let[t,n]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:i,position:p}=e,l=async c=>{n(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");n(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(f,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:oe.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${p||be.Left} flex cols`,children:[jsx(_,{as:"--title",children:o||"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(f,{as:"--footer flex aic",children:[jsx(K,{onClick:c=>l(1),as:"--accept",children:a||"Accept All"}),jsx(K,{onClick:c=>l(0),as:"--reject",children:i||"Cancel"})]})]})});Hs.displayName="Zuz.CookiesConsent";var yp=Hs;var As=({ref:e,...r})=>{let {type:t,value:n=0,min:o=0,max:s=1,step:a=.01,onChange:i,showGhostBar:p,showKnobOnHover:l,showToolTip:c,roundValue:d,formatValue:u,...m}=r,{className:h,style:T,rest:x}=B(m),P=useRef(a||.01).current,v=useRef(o||0).current,R=useRef(s||1).current,y=useRef(n||0).current,S=useRef(null),g=useRef(null),b=useRef(null),E=useRef(null);useRef(null);let M=useRef(null),A=useRef(null),L=useRef(null),O=useRef(null),$=(se,ne,ge)=>(se-ne)/(ge-ne)*100,Z=se=>{if(g.current){let ne=parseFloat(se.currentTarget.value);re(ne);let ge=$(ne,parseFloat(se.currentTarget.min),parseFloat(se.currentTarget.max));g.current.style.setProperty("--value",`${ge}`),g.current.setAttribute("data-value",`${ne}`),i&&i(d?+ne.toFixed(2):ne);}},[I,k]=useState(false),[U,X]=useState(0),[H,z]=useState(0),[G,W]=useState(false),re=async se=>{let ne=u?u(+se):d?(+se).toFixed(2):Math.round(+se);L.current&&(L.current.textContent=String(ne));},le=se=>{if(I){let ne=se.clientX-U,ge=R-v,Te=ne/200*ge,he=Math.max(v,Math.min(H+Te,R));if(he=Math.round(he/P)*P,re(he),g.current){let Me=$(he,v,R);g.current.style.setProperty("--value",`${Me}`),g.current.setAttribute("data-value",`${he}`),A.current&&(A.current.textContent=d?he.toFixed(2):he.toString()),i&&i(he);}}},me=()=>{k(false),document.body.style.cursor="auto";},we=se=>(se-v)/(R-v)*100,ie=se=>{if(!g.current)return;let ne=g.current.getBoundingClientRect(),ge=se.clientX-ne.left,He=Math.max(0,Math.min(100,ge/ne.width*100));if(c&&L.current){let Te=S.current?+S.current.value:n;re(Te*100);}if(p){let Te=we(S.current?+S.current.value:n),he=Math.min(Te,He),Me=Math.abs(He-Te);g.current.style.setProperty("--ghost-start",`${he}`),g.current.style.setProperty("--ghost-width",`${Me}`);}};useEffect(()=>{g.current&&g.current.style.setProperty("--value",S.current?`${$(parseFloat(S.current.value),parseFloat(S.current.min),parseFloat(S.current.max))}`:y.toString());},[]),useEffect(()=>(I?(document.addEventListener("mousemove",le),document.addEventListener("mouseup",me)):(document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",me)),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",me);}),[I]),useEffect(()=>{let se=$(n,v,R);g.current?.style.setProperty("--value",`${se}`),re(n);},[n,v,R,L.current]);let Y=()=>jsxs(f,{ref:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onMouseMove:ie,className:`--slider --${t||Io.Default} ${l?"--knob-hover":""} flex rel ${h}`.trim(),style:{...T},children:[jsx(f,{ref:M,className:"--slider-track abs fill"}),p&&jsx(f,{ref:E,className:"--slider-ghost abs fill"}),jsx(f,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(f,{ref:b,className:"--slider-knob --tooltip-knob abs"}),jsx(fe,{ref:S,onInput:Z,className:"abs fill",tabIndex:0,type:t||Io.Default,defaultValue:y||0,step:P,max:R,min:v})]});if(c===true){let se=u?u(n):d?n.toFixed(2):n;return jsx(Pt,{ref:O,show:I,position:St.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(ce,{ref:L,children:se}),children:Y()})}return Y()};As.displayName="Zuz.Slider";var pt=As;var Fs=forwardRef((e,r)=>{let{src:t,shape:n,size:o,...s}=e,{style:a,className:i,rest:p}=B(s),{canvasRef:l,crop:c,setScale:d,handleMouseDown:u,handleMouseUp:m,handleMouseMove:h}=useImageCropper(t,o||200,n||CropShape.Circle);return useImperativeHandle(r,()=>({getCropped(){return c()},setScale(T){d(T);}})),jsxs(f,{as:`--cropper --${n||CropShape.Circle} ${i}`,style:a,...p,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:u,onMouseUp:m,onMouseLeave:m,onMouseMove:h}),jsx(f,{as:"--cropper-slider",children:jsx(pt,{onChange:T=>d(T),min:0,max:1,step:.01,value:1})})]})});Fs.displayName="Zuz.Cropper";var wp=Fs;var Tp=(t=>(t.Circle="circle",t.Square="square",t))(Tp||{});var _s=forwardRef((e,r)=>{let{items:t,maxItems:n}=e,o=useMemo(()=>{let i=typeof t=="string",p=i?[]:t;return i&&t.split(",").forEach(l=>{p.push({label:l});}),p},[t]),a=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(ze,{ref:r,className:"--crumb flex aic",direction:"rows",seperator:jsx(f,{as:"--crumb-chevron",children:V.chevronRightOutline}),items:a.map((i,p,l)=>i.ID=="."?jsx(f,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(f,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${p}`))}):jsxs(K,{onClick:()=>i.action?.(),className:"--crumb-item",disabled:!l[p+1],children:[i.icon&&jsx(te,{as:"--crumb-icon",name:i.icon}),jsx(_,{as:"--crumb-label",children:i.label})]},`${i.label.replace(/\s+/g,"-").toLowerCase()}-${p}`))})});_s.displayName="Zuz.Crumb";var Rp=_s;var Ws=forwardRef((e,r)=>{let{icon:t,defaultValue:n,value:o,size:s,variant:a,numeric:i,type:p,onConfirm:l,...c}=e,[d,u]=useState(false),[m,h]=useState(n||null),{style:T,className:x,rest:P}=B(c),v=useRef(null),R=useRef(null),{reposition:y}=kt(R,{direction:be.Bottom,offset:2}),S=b=>{i&&(b.currentTarget.value=b.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let b=E=>{let F=E.target,M=v.current?.contains(F),A=R.current?.contains(F);!M&&!A&&u(false);};return d&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b);}},[d]),useEffect(()=>{let b=E=>{E.key==="Escape"&&d&&(u(false),v.current?.focus());};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);let g=()=>{u(true);};return useEffect(()=>{d&&y();},[d,y]),jsx(Fragment$1,{children:jsxs(f,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${x}`,"data-value":m?m.toISOString():"",children:[t?typeof t=="string"?jsx(te,{as:"mr:10 c:#666",name:t}):t:jsx(ce,{as:"--date-picker-icon flex aic jcc",children:V.calendar}),jsx("input",{ref:v,value:m?format(m,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:T,onFocus:g,onInput:S,autoComplete:"new-password",onKeyDown:b=>{b.key=="Enter"&&l?.(b.currentTarget.value);},...P}),jsx(f,{"aria-hidden":!d,ref:R,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:d,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(ur,{defaultValue:m,onChange:b=>{h(b),u(false);}})})]})})});Ws.displayName="Zuz.DatePicker";var Bp=Ws;var Gs=forwardRef((e,r)=>{let{icon:t,variant:n,position:o}=e;return jsx(K,{className:`--fab fixed --${n||q.Large} --${o||"bottomright"}`,children:t||V.plus})});Gs.displayName="Zuz.Fab";var Op=Gs;var Dp=({ref:e,children:r,...t})=>{let{legend:n,legendPlacement:o,variant:s,...a}=t,{variant:i}=j(true),{className:p,style:l,rest:c}=B(a);return jsxs(f,{as:`--fieldset --rel --flex --${s||i||q.Medium} ${p}`.trim(),style:l,children:[jsx(f,{as:`--legend --abs --${o||"top-start"}`,children:n&&typeof n=="string"?jsx("legend",{children:n}):n}),r]})},Hp=Dp;var qs=e=>{let{names:r,strength:t}=e,n={[Zt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${Zt.Gooey}`)};return useEffect(()=>{},[r]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(r||[Zt.Gooey]).map(o=>n[o](t))})})};qs.displayName="Zuz.Filters";var Fp=qs;var Xs=e=>typeof e=="number"?`repeat(${e}, 1fr)`:e,_p=e=>e==="between"?"space-between":e==="around"?"space-around":e,Ys=e=>{let{ref:r,cols:t,rows:n,columns:o,gap:s,gapX:a,gapY:i,columnGap:p,rowGap:l,align:c,alignItems:d,justify:u,justifyContent:m,inline:h,flow:T,autoFlow:x,autoCols:P,autoRows:v,autoColumns:R,autoRow:y,template:S,areas:g,...b}=e,{className:E,style:F,rest:M}=B(b),A=o??t,L=p??a??s,O=l??i??s,$=d??c,Z=m??u,I=x??T,k=R??P,U=y??v,X=g??S,H={...h?{display:"inline-grid"}:{},gridTemplateColumns:Xs(A),gridTemplateRows:Xs(n),columnGap:L,rowGap:O,alignItems:$,justifyContent:_p(Z),gridAutoFlow:I,gridAutoColumns:k,gridAutoRows:U,gridTemplateAreas:X,...F};return jsx(f,{ref:r,className:["--grid",E].filter(Boolean).join(" "),style:H,...M})};Ys.displayName="Zuz.Grid";var Kp=Ys;var js=e=>typeof e=="string"&&e.includes("+"),Qs={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"},Js={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 ta=forwardRef(({children:e,keys:r,as:t,className:n,variant:o},s)=>{let{variant:a}=j(true),i=useMemo(()=>{if(js(r)){let p=null;return {keys:String(r).split("+").reduce((c,d,u,m)=>(m[u+1]?c.push(d):p=d.toUpperCase(),c),[]),children:p}}return {keys:r,children:String(e).toUpperCase()}},[r]);return jsxs(f,{as:`--keyboard-keys --${o||a||q.Small} flex aic ${t} ${n}`.trim(),children:[(Array.isArray(i.keys)?i.keys:[i.keys]).map(p=>jsx("abbr",{title:Js[p],children:Qs[p]},p)),jsx(ce,{children:i?.children??e})]})});ta.displayName="Zuz.KeyboardKeys";var Tr=ta;var na=createContext(null),dt=()=>{let e=useContext(na);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},jp=({ref:e,icons:r,children:t,...n})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:i="No Track",defaultCover:p,onTrackChange:l,...c}=n,{className:d,style:u,rest:m}=B(c),h=useMediaPlayer(o,o[0]??void 0),T=useMemo(()=>({play:V.play,pause:V.pause,prev:V.prev,next:V.next,volumeHigh:V.volumeHigh,volumeMute:V.volumeMute,...r}),[r]),x=useMemo(()=>({...h,mode:s,icons:T}),[h,T]);return jsx(na.Provider,{value:x,children:jsx(f,{className:`--zuz-media-player ${d}`,style:u,children:t})})},sa=jp;var aa=e=>{if(!e||isNaN(e))return "0:00";let r=Math.floor(e/60),t=Math.floor(e%60);return `${r}:${t.toString().padStart(2,"0")}`},fo=e=>typeof e=="string"?jsx(te,{name:e}):e,ia=()=>{let{mediaRef:e,state:r,controls:t,mode:n}=dt();return jsxs(f,{as:`--mediaplayer-stage rel --mode-${n}`,children:[n==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),r.isLoading&&jsx(f,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Re,{})})]})},la=()=>{let{state:e,defaultArtist:r,defaultTitle:t,defaultCover:n}=dt();return jsxs(f,{as:"--track-info flex aic",children:[jsx(st,{src:e.currentItem?.cover||n||"",as:"--track-cover"}),jsxs(f,{as:"flex cols",children:[jsx(f,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(f,{as:"--track-artist",children:e.currentItem?.artist||r||"..."})]})]})},ca=()=>{let{state:e,controls:r,icons:t}=dt();return jsxs(f,{as:"--mediaplayer-controls flex aic",children:[jsx(K,{onClick:r.prev,as:"--prev",children:fo(t?.prev??V.prev)}),jsx(K,{onClick:r.togglePlay,as:"--play-pause",children:fo(e.isPlaying?t?.pause??V.pause:t?.play??V.play)}),jsx(K,{onClick:r.next,as:"--next",children:fo(t?.next??V.next)})]})},ma=()=>{let{state:e,controls:r,mediaRef:t}=dt(),n=e.progress*(e.duration||0);return jsxs(f,{as:"--track-progress flex aic",children:[jsx(f,{as:"--track-current-duration",children:aa(n)}),jsx(pt,{value:e.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;r.seek(a);}}),jsx(f,{as:"--track-total-duration",children:aa(e.duration)})]})},pa=()=>{let{state:e,controls:r,icons:t}=dt();return jsxs(f,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(K,{onClick:()=>r.setIsMuted(),children:fo(e.isMuted?t?.volumeMute??V.volumeMute:t?.volumeHigh??V.volumeHigh)}),jsx(pt,{value:e.volume,className:"h:3 flex:1",onClick:n=>{let o=n.currentTarget.getBoundingClientRect();r.setVolume((n.clientX-o.left)/o.width);}})]})};var Qp=Object.assign(sa,{Stage:ia,TrackInfo:la,Controls:ca,Progress:ma,Volume:pa}),Jp=Qp;var fa=forwardRef((e,r)=>{let t=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:s}=e;return jsxs(f,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:oe.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||q.Small} fixed flex`,children:[jsx(f,{className:"--ico",children:t?V[ke.Success]:V[ke.Error]}),jsx(_,{as:"--message",children:t?n||"internet connection restored :)":o||"no internet connection"})]})});fa.displayName="Zuz.NetWorkManager";var ou=fa;var ga=forwardRef((e,r)=>{let{strenthMeter:t,onChange:n,...o}=e;"type"in o&&delete o.type;let{style:s,className:a,rest:i}=B(o),[p,l]=useState(false),[c,d]=useState(""),u=useMemo(()=>checkPasswordStrength(c),[c]),m=useDebounce(h=>{t&&d(h.target.value),n&&n(h);},100);return useEffect(()=>{},[]),jsxs(f,{as:"w:100% flex cols",children:[jsxs(f,{style:s,className:"--password flex aic rel",children:[jsx(fe,{ref:r,type:p?"text":"password",className:a,onChange:m,...i}),jsx(K,{tabIndex:-1,onClick:()=>l(h=>!h),className:"--toggle flex aic jcc abs",children:p?V.eye:V.eyeSlash})]}),t&&jsxs(f,{as:`flex aic --password-meter --pb-score-${u.score}`,style:s,children:[jsxs(f,{as:"--password-bars flex aic",children:[jsx(f,{as:`--pbar ${u.score>=1?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=2?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=3?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=4?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=5?"--pb-on":""}`.trim()})]}),jsx(_,{as:"--password-meter-label","aria-hidden":true,children:u.result})]})]})});ga.displayName="Zuz.Password";var cu=ga;var ya=forwardRef((e,r)=>{let{size:t,length:n,mask:o,...s}=e,a=useRef([]),i="pinput",p=false,l={};"with"in s&&(l={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(i=s.name,delete s.name),"required"in s&&(p=true,delete s.required);let{style:c}=B(s),d=m=>{let h=m.currentTarget,T=a.current[parseInt(h.dataset.index)+1],x=a.current[parseInt(h.dataset.index)-1];h.value.length===1&&T?T.focus():h.value.length===0&&x&&x.focus();},{variant:u}=j(true);return useEffect(()=>{a.current=a.current.slice(0,t||n);},[t||n]),jsx(f,{name:i,style:c,className:`--otp --${s.variant??u??q.Medium} flex aic rel`,"data-required":p,"data-size":t||n||4,...l,children:Array(t||n||4).fill(1).map((m,h)=>jsx(fe,{autoComplete:"new-password","data-index":h,ref:T=>{a.current[h]=T;},numeric:true,onChange:d,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${h}`))})});ya.displayName="Zuz.PinInput";var fu=ya;var xa=forwardRef((e,r)=>{let{children:t,className:n,name:o,required:s,type:a,value:i,variant:p,checked:l,onSwitch:c,...d}=e,[u,m]=useState(l||false),{variant:h}=j(true),T=useRef(null);return jsxs(Vt,{className:`${n} --${(a||Eo.Default).toLowerCase()} --radio${!a||a==Eo.Default?"":"card"} --${p||h||q.Small} flex aic rel`.trim(),...d,children:[jsx(fe,{ref:T,defaultChecked:u,value:i||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:x=>{c&&c(x.target.checked,i||"cb"),m(x.target.checked);}}),jsx(f,{className:"--dot rel",children:jsx(f,{className:"--rod abs abc"})}),jsx(f,{className:"--value",children:t})]})});xa.displayName="Zuz.Radio";var yu=xa;var ba=forwardRef((e,r)=>{let{fx:t,withStyle:n,as:o,reverse:s=false,searchIcon:a=V.search,hideSearchIcon:i=false,clearIcon:p=V.close,hideClearIcon:l=false,onChange:c,onClear:d,...u}=e,{style:m,className:h}=B({as:e.as}),[T,x]=useState(""),{variant:P}=j(true),v=useRef(null);"type"in e&&delete e.type;let R=g=>{x(g.target.value),c?.(g.target.value);},y=g=>{T.trim()!==""&&(x(""),c?.(""),v.current&&(v.current.value="",e.onConfirm?.("")));};useImperativeHandle(r,()=>({focus:()=>v.current?.focus(),value:()=>v.current?.value})),useEffect(()=>{},[]);let S=jsx(K,{tabIndex:-1,onClick:g=>y(),className:"--send flex aic jcc",variant:e.variant||q.Medium,children:T!==""?!l&&(typeof p=="string"?jsx(te,{name:p,as:"--search-action"}):p):!i&&(typeof a=="string"?jsx(te,{name:a,as:"--search-action"}):a)});return jsxs(f,{style:m,className:`--search --no-shrink --${e.variant||P||q.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${h}`.trim(),children:[s&&S,jsx(fe,{ref:v,onChange:R,...u}),e.shortcut&&jsx(Tr,{keys:e.shortcut,as:"--abs"}),!s&&S]})});ba.displayName="Zuz.Search";var Pr=ba;var Pu=({label:e,icon:r})=>jsxs(f,{as:"--select-options-head --no-shrink --disabled".trim(),"aria-hidden":"true",children:[r&&jsx(te,{name:r}),jsx(_,{as:"--select-group-label",children:e})]}),Sa=Pu;var Ca=({checkIcon:e,selected:r,updateValue:t,o:n})=>{let o=e?typeof e=="string"?jsx(te,{name:"checkIcon"}):e:V.check,s=n.disabled===true;return jsxs(K,{onClick:a=>{s||(a.stopPropagation(),t(n));},disabled:s,as:`--select-option-item --no-shrink ${r?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ce,{as:"--option-item-meta --aic",children:[n.icon&&jsx(te,{name:n.icon,as:`--select-option-icon --icon-${n.value}`,color:n.iconColor}),jsx(_,{suppressHydrationWarning:true,children:typeof n=="string"?n:n.label})]}),r&&jsx(Ce,{aic:true,jcc:true,as:"--select-option-check --abs",children:o})]})};Ca.displayName="Option";var Ta=Ca;var Ra=(({ref:e,...r})=>{let{selected:t,options:n,label:o,name:s,variant:a,search:i,searchPlaceholder:p,maxHeight:l,arrowDownIcon:c=V.arrowDown,arrowUpIcon:d=V.arrowUp,expanded:u,multiple:m,tokenizer:h,wrapTokens:T,disabled:x,checkIcon:P,closeIcon:v,editable:R,editablePlaceholder:y,onChange:S,required:g,with:b,...E}=r,F=It(),M=!!(s&&F?.setFieldValue),A=wn(s),L=Sn(s),O=R===true&&m!==true&&h!==true,$=N=>typeof N=="string"||typeof N=="number",Z=N=>typeof N=="object"&&N!==null&&!Array.isArray(N)&&"value"in N&&"label"in N,I=N=>n.find(ee=>String(ee.value)===String(N)),k=N=>{if(N==null)return null;if(O&&N==="")return "";if(m||h)return (Array.isArray(N)?N:[N]).map(de=>$(de)?I(de):de).filter(de=>Z(de));if($(N)){let ee=I(N);return ee||(O?String(N):null)}return Z(N)?N:null},U=()=>{if(t!==void 0)return k(t);let N=n.find(ee=>String(ee.value)==="-1");return N||(O?"":null)},X=N=>Array.isArray(N)?N.map(ee=>ee.value):Z(N)?N.value:N,[H,z]=useState(()=>U()),[G,W]=useState(false),[re,J]=useState(null),le=useRef(null),me=useRef(null),we=useRef(null),ie=useId(),pe=useMemo(()=>s||ie,[s,ie]),{reposition:Y}=kt(we,{direction:St.Bottom,offset:2}),{variant:se}=j(true),ne=v?typeof v=="string"?jsx(te,{name:v}):v:V.close,{className:ge,style:He,rest:Te}=B(E,void 0),{onClick:he,...Me}=Te||{},ae=useMemo(()=>L!==void 0?k(L):H,[L,H,n,O,m,h]),xe=useMemo(()=>{if(!(!ae||Array.isArray(ae)||!Z(ae)))return ae},[ae]),zt=useMemo(()=>O?Z(ae)?String(ae.value??""):$(ae)?String(ae):"":"",[O,ae]),_t=N=>Array.isArray(ae)?ae.some(ee=>ee.value===N.value):Z(ae)?ae.value===N.value:O&&$(ae)?String(ae)===String(N.value):false,Ae=N=>{if(M&&F?.setFieldValue&&s){F.setFieldValue(s,X(N));return}z(N);},Oe=N=>{S?.(R===true&&N instanceof Option?String(N.value):N);},Co=N=>{if(!(x||N.disabled)){if(m||h){let ee=Array.isArray(ae)?ae:[],Be=ee.find(To=>To.value===N.value)?ee.filter(To=>To.value!==N.value):[...ee,N];Ae(Be),Oe(Be);return}Ae(N),W(false),Oe(N);}},ei=N=>{let ee=N.target.value,de=ee===""?null:I(ee),Be=de?de.value:ee;Ae(Be),Oe(Be);},ti=N=>{if(N.key==="Enter"&&(N.preventDefault(),O)){let ee=N.currentTarget.value.trim();if(!ee){W(false);return}let Be=I(ee)??ee;Ae(Be),Oe(Be),W(false);}},oi=(N,ee)=>{if(N.stopPropagation(),x)return;let de=ae.filter(Be=>Be.value!==ee.value);Ae(de),W(false),Oe(de);},ri=N=>{let ee=N.currentTarget,de=ee.scrollTop===0&&N.deltaY<0,Be=ee.scrollHeight-ee.scrollTop===ee.clientHeight&&N.deltaY>0;!de&&!Be||N.preventDefault(),N.stopPropagation();};useImperativeHandle(e,()=>({setSelected:N=>{Ae(k(N));},getValue:()=>ae??null}),[ae,n,O,m,h,M,s]),useEffect(()=>{M||t===void 0||z(k(t));},[t,M,n,O,m,h]),useEffect(()=>{if(!G)return;let N=()=>{Y();};return window.addEventListener("scroll",N,true),window.addEventListener("resize",Y),()=>{window.removeEventListener("scroll",N,true),window.removeEventListener("resize",Y);}},[G,Y]),useEffect(()=>{if(!G){me.current&&(me.current.value=""),J(null);return}me.current?.focus(),Y();let N=de=>{le.current&&!le.current.contains(de.target)&&W(false);},ee=setTimeout(()=>{document.addEventListener("click",N);},0);return ()=>{clearTimeout(ee),document.removeEventListener("click",N);}},[G,Y]);let ni=useDebounce(N=>J(N===""?null:N),300),si=useDebounce(ei,300);return jsxs(f,{ref:le,"data-required":g?"true":void 0,with:b,className:[`--select ${u==true?"--expanded":""}`,`--${a||se}`,`${s?`--${s}`:""}`,`${A?"--has-error":""}`,`${x?"--disabled":""} rel`].join(" ").trim(),name:pe,children:[O?jsxs(f,{"data-value":xe?.value??(zt||"-1"),className:`--select-display --selected --editable flex aic rel ${ge}`.trim(),style:He,onClick:N=>N.stopPropagation(),...Me,children:[xe?.icon&&jsx(te,{as:"--selected-icon",name:xe.icon}),jsx(Ce,{aic:true,as:"--label-wrapper",children:jsx(fe,{"aria-expanded":G,className:"--select-input",disabled:x,onChange:si,onClick:N=>{N.stopPropagation(),x||W(true);},onKeyDown:ti,placeholder:y||o||"Choose",type:"text",defaultValue:zt})}),jsx(K,{className:"--select-toggle rel flex aic jcc",disabled:x,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},tabIndex:-1,withLabel:false,children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}):jsxs(K,{disabled:x,variant:a||se,"data-value":xe?.value??"-1",className:`--select-display --selected flex aic rel ${ge}`.trim(),withLabel:false,style:He,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},...Me,children:[xe?.icon&&jsx(te,{as:"--selected-icon",name:xe.icon}),jsx(Ce,{aic:true,as:"--label-wrapper",children:h&&Array.isArray(ae)&&ae.length>0?jsxs(Ce,{as:`--tokens-wrap${T===true?" --wrap":""}`,children:[ae.map(N=>jsxs(Ce,{aic:true,as:"--token",children:[jsx(_,{as:"--token-label",children:N.label}),jsx(f,{as:"--token-remove",onClick:ee=>oi(ee,N),children:ne})]},N.value)),ae.length<n.length&&jsx(_,{as:"--label",children:o||"Choose"})]}):jsx(_,{as:"--label",children:Array.isArray(ae)?ae.length>0?`${ae.length} selected`:o||"Choose":xe?.label||o||"Choose"})}),jsx(f,{className:"--svg-arrow rel flex aic jcc",children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}),jsxs(f,{id:pe,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!G,onWheel:ri,style:{maxHeight:l||"auto"},ref:we,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:G,duration:.05},children:[i&&jsx(f,{as:"--select-search --no-shrink flex --sticky",children:jsx(Pr,{ref:me,variant:q.Small,placeholder:p||"Search...",onChange:ni})}),o&&jsx(Sa,{label:o}),n?.filter(N=>!re||N.label.toLowerCase().includes(re.toLowerCase()))?.map(N=>jsx(Ta,{updateValue:Co,checkIcon:P,selected:_t(N),o:N},`option-${N.label.replace(/\s+/g,"-")}-${N.value}`))]})]})});Ra.displayName="Zuz.Select";var Nu=Ra;var Ia=({ref:e,...r})=>jsx(Dt,{type:Ze.Switch,...r,ref:e});Ia.displayName="Zuz.Switch";var Bu=Ia;var Na=e=>{let{idx:r,id:t,as:n,weight:o,style:s,value:a,render:i,resize:p,sortBy:l,sortable:c,onSort:d}=e,[u,m]=useState(0),h=()=>{c&&(d?.(String(t),u==1?-1:1),m(T=>T==1?-1:1));};return jsxs(f,{style:{flex:o||1,...s},as:`--col flex aic ${n||""} ${c?"--sortable":""}`,onClick:h,children:[jsx(f,{as:"--colv",children:a}),r==-1&&c&&l==t&&jsx(f,{as:"--arrow flex aib",children:u==1?V.arrowUp:V.arrowDown})]})};Na.displayName="Zuz.Column";var bo=Na;var ka=e=>{let{index:r,pubsub:t,schema:n,data:o,ids:s,styles:a,animate:i,sortBy:p,selectable:l,tableRef:c,loading:d,rowClassName:u,onSort:m,onRowClick:h,onSelect:T,onContextMenu:x}=e,P=useDelayed(),v=useMemo(()=>({transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(r+1)}),[]),R=useRef(null),y=(g,b)=>{r==-1?t.emit(`ALL_ROWS_${g?"CHECKED":"UNCHECKED"}`,g):(T&&T(o,g),t.emit(`ROW_${g?"CHECKED":"UNCHECKED"}`,g,b));},S=(g,b,E)=>jsx(bo,{idx:g,id:b,as:"--selector",pubsub:t,value:jsx(Dt,{value:E,ref:R,onSwitch:y,type:Ze.Default})});return useEffect(()=>{let g=(M,A)=>{R.current?.setChecked(M,false);},b=(M,A)=>{let L=false;c?.current&&c.current.querySelectorAll(".--row").forEach(O=>{let $=O;if(!$.classList.contains("--row-head")){let Z=$.querySelector(".--selector input[type=checkbox]");Z&&Z.checked&&!L&&(L=Z.checked);}}),R.current.setChecked(L,false);},E=M=>{R.current?.setChecked(M,false),T&&T(o,M);},F=M=>{R.current?.setChecked(M,false),T&&T(o,M);};return r==-1?(t.on("ROW_CHECKED",g),t.on("ROW_UNCHECKED",b),()=>{t.off("ROW_CHECKED",g),t.off("ROW_UNCHECKED",b);}):(t.on("ALL_ROWS_CHECKED",E),t.on("ALL_ROWS_UNCHECKED",F),()=>{t.off("ALL_ROWS_CHECKED",E),t.off("ALL_ROWS_UNCHECKED",F);})},[]),jsxs(f,{onContextMenu:g=>x?x(g,o):null,onClick:g=>h?h(g,e.data):()=>{},...i?{fx:{...v,when:P}}:{},as:`--row flex aic ${h?"--row-clickable":""} ${r==-1?"--row-head":""} ${u||""}`,children:[r==-1&&n.map((g,b)=>{let{renderWhenHeader:E,render:F,value:M,...A}=g;return jsxs(Fragment,{children:[l&&b==0&&S(-1,`--selector-${g.id}`,"all"),jsx(bo,{idx:-1,onSort:m,sortBy:p,value:M,...A,pubsub:t,style:a[g.id]})]},`--col-${g.id}`)}),d&&r>-1&&jsx(f,{as:"--col",children:jsx(_,{as:"opacity:0",children:"..."})}),!d&&r>-1&&s&&o&&n.map((g,b)=>jsxs(Fragment,{children:[l&&b==0&&S(b,`--selector-${g.id}`,g.id.toString()),s.includes(String(g.id))?jsx(bo,{pubsub:t,idx:b,id:String(g.id),style:a[String(g.id)],value:g.render?g.render(o,r):o[String(g.id).includes(".")?String(g.id).split(".").reverse()[0]:g.id]}):null]},`--${String(g.id)}-val-${b}`))]})};ka.displayName="Zuz.Row";var vo=ka;var Va=(e,r)=>{let{schema:t,rows:n,rowCount:o,rowsPerPage:s,currentPage:a,pagination:i,paginationHash:p,showPaginationOnZeroPageCount:l,animateRows:c,header:d,rowClassName:u,selectableRows:m,hoverable:h,sortBy:T,loading:x,loadingRowCount:P,loadingMessage:v,spinner:R,emptyMessage:y,onSort:S,onRowClick:g,onRowSelectToggle:b,onPageChange:E,onRowContextMenu:F,...M}=e,A=useRef(null),L=useMemo(()=>t.reduce((pe,Y)=>(pe[Y.id]={flex:Y.weight||1,...Y.w&&{width:Y.w},...Y.maxW&&{maxWidth:Y.maxW},...Y.minW&&{minWidth:Y.minW},...Y.h&&{height:Y.h},...Y.maxH&&{maxHeight:Y.maxH},...Y.minH&&{minHeight:Y.minH}},pe),{}),[t]),O=useMemo(()=>Object.keys(L),[t]),$=useMemo(()=>d??true,[d]),{style:Z,className:I,rest:k}=B(M),U=useRef(null),X=useMemo(()=>new PubSub,[]),H=useRef(n.map(()=>uuid(8))),[z,G]=useState(T||null),[W,re]=useState(v||"loading"),J=useMemo(()=>!x&&n&&n.length==0,[x,n]),le=useCallback(()=>y?typeof y=="function"?jsx(y,{}):y:jsx(_,{as:"tac s:18 mt:75",children:"No Record Found"}),[x,n]);useEffect(()=>{n.length&&!H.current&&(H.current=n.map(()=>uuid(8)));},[n]);let me=(pe,Y)=>{G(pe),S?.(pe,Y);},we=(o||(n?n.length:0))/(s||10),ie=useMemo(()=>l||we>1?jsx(Ot,{hash:p,ref:A,renderOnZeroPageCount:l,onPageChange:E,paginationStyle:"table",startPage:a,itemCount:o||(n?n.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(r,()=>({setLoading(pe){}})),jsxs(f,{as:`--table ${h??true?"--hoverable":""} flex cols rel ${I}`,ref:U,children:[$==true&&jsx(vo,{sortBy:z,onSort:me,tableRef:U,pubsub:X,selectable:m,index:-1,schema:t,loading:true,styles:L}),x&&jsxs(f,{as:"center-x flex aic --table-spinner",children:[jsx(Re,{type:R||Se.Simple}),W&&jsx(_,{as:"--table-loading-message",children:W})]}),x&&Array(P||5).fill({}).map((pe,Y)=>jsx(vo,{tableRef:U,index:Y,pubsub:X,schema:t,styles:L,loading:true,animate:c,onRowClick:g},`--trow-loading-${Y}-${t[0].id}`)),!x&&n&&n.map((pe,Y)=>jsx(vo,{tableRef:U,pubsub:X,loading:false,index:Y,schema:t,ids:O,styles:L,animate:c,data:pe,onRowClick:g,rowClassName:u,selectable:m,onSelect:b,onContextMenu:F},`--trow-${H.current[Y]||Y}-${t[0].id}`)),J&&le(),i&&ie&&jsx(f,{"aria-hidden":!i||!ie,...c?{fx:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(n.length+1),when:!x&&n&&i&&ie!=null}}:{},as:"--row flex aic --row-footer",children:ie})]})};Va.displayName="Zuz.Table";var Ku=forwardRef(Va),Zu=Ku;var Gu=({ref:e,...r})=>{let{title:t,items:n}=r,[o,s]=useState(0),a=(i,p,l)=>{i.preventDefault(),s(p),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(f,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(_,{as:"--toc-title",children:t}),jsx(ze,{items:n.map((i,p)=>jsx("a",{className:o==p?"--toc-active":"",style:{anchorName:o===p?"--toc-active":"none",color:o==p?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>a(l,p,i.tag),href:`#${i.tag}`,children:i.label}))})]})},Uu=Gu;var Da=({isActive:e,transitionType:r,speed:t,width:n,render:o,content:s,onHeightChange:a})=>{let i=useRef(null),p=useResizeObserver(i);useEffect(()=>{e&&p.height>0&&a(p.height);},[e,p.height]);let c=useMemo(()=>{let d={width:n>0?`${n}px`:"100%",minWidth:n>0?`${n}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return r==="fade"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:r==="scale"?{...d,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}:d},[e,r,n,t]);return jsx(f,{ref:i,style:{...c},className:"--content",children:o||e?s:null})};Da.displayName="Zuz.TabBody";var Ha=Da;var Fa=({ref:e,...r})=>{let{tabs:t,speed:n=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:i,transitionType:p="slide",...l}=r,[c,d]=useState(0),u=useRef(null),m=useResizeObserver(u),h=useMemo(()=>uuid(8),[]),[T,x]=useState("auto"),P=useMemo(()=>m.width>0,[m.width]);useImperativeHandle(e,()=>({setTab:b=>d(b)}));let v=useMemo(()=>t.map(b=>({...b,key:b.key||uuid(8)})),[t]),{style:R,className:y,rest:S}=B({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),g=()=>{if(!P)return {opacity:0};switch(p){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${v.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${c*m.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(f,{ref:u,style:R,className:`--tabview --${a} flex cols ${y}`,children:[jsx(Ht,{as:"--tabview-head",onSwitch:b=>{d(b.index);let E=v.find(F=>F.tag==b.tag);E&&E.onSelect&&(E.onSelect(E,b.index),i?.(E,b.index));},selected:c,items:v.reduce((b,E,F)=>(b.push({icon:E.icon,index:F,label:E.label,tag:E.tag}),b),[])}),jsx(f,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:T,transition:P?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:P?1:0},children:jsx(f,{className:"--track",style:{...g()},children:v.map((b,E)=>jsx(Ha,{isActive:E===c,transitionType:p,speed:n,width:m.width,render:o||E===c,onHeightChange:F=>E===c&&x(F),content:b.body},`tab-body-${b.key||E}-${h}`))})})]})};Fa.displayName="Zuz.TabView";var rf=Fa;var lf=({ref:e,commands:r,onCommand:t,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[i,p]=useState([{type:"output",content:n}]),[l,c]=useState(""),d=useRef(null),u=useRef(null),{variant:m}=j(true);useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight);},[i]);let h=y=>{let S=typeof y=="string"?{type:"output",content:y}:y;p(g=>{let b=[...g,S];return b.length>1e3?b.slice(-1e3):b});},T=()=>p([]);useImperativeHandle(e,()=>({write:h,clear:T}));let x=async y=>{let[S,...g]=y.split(" "),b=S.toLowerCase();return r&&r[b]?await r[b](g):t?await t(y):`command not found: ${S}`},P=y=>{let S=/\u001b\[(\d+)m/g,g=[],b={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,F="#d4d4d4",M=false,A;for(;(A=S.exec(y))!==null;){let O=y.slice(E,A.index);O&&g.push({text:O,color:F,bold:M});let $=A[1];$==="0"?(F="#d4d4d4",M=false):$==="1"?M=true:b[$]&&(F=b[$]),E=S.lastIndex;}let L=y.slice(E);return L&&g.push({text:L,color:F,bold:M}),g},v=(y,S)=>y.includes("\x1B")?P(y).map((g,b)=>jsx(ce,{style:{color:g.color||"#d4d4d4",fontWeight:g.bold?"bold":"normal"},children:g.text},`--terminal-msg-${b}-${g.text.replace(/\S+/g,"-")}`)):jsx(ce,{style:{color:S==="error"?"#ff5f56":S==="command"?"#00ff00":"#d4d4d4"},children:y}),R=async y=>{if(y.key==="Enter"&&l.trim()){let S=l.trim(),g=[...i,{type:"command",content:`${o}${S}`}];c(""),p(g);let b=await x(S);p(E=>[...E,{type:"output",content:b}]);}};return jsxs(f,{as:`--zuz-terminal --${s||m||q.Medium} flex cols ${a.className}`,onClick:()=>u.current?.focus(),children:[jsx(f,{ref:d,className:"--terminal-log",children:i.map((y,S)=>jsx(f,{children:jsx(_,{children:v(y.content,y.type)})},S))}),jsxs(f,{as:"flex aic --terminal-input",children:[jsx(_,{as:"--terminal-prompt",children:o}),jsx(fe,{ref:u,className:"--zuz-term-input",autoFocus:true,value:l,variant:s||m||q.Medium,onChange:y=>c(y.target.value),onKeyDown:R})]})]})},cf=lf;var mf=({meta:e})=>jsxs(K,{as:"flex aic --command-item",children:[e.icon&&jsx(te,{name:e.icon,as:"--command-icon"}),jsx(_,{children:e.label})]}),pf=({position:e,onSelect:r,commands:t,visible:n})=>jsx(f,{"aria-hidden":!n,fx:{transition:Q.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...e},children:t.map(o=>jsx(mf,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Za=pf;var Ua=({ref:e,...r})=>{let {autoResize:t,maxHeight:n,variant:o,resize:s="none",command:a,commands:i,name:p,onInput:l,cmd:c,renderDropdown:d,value:u,defaultValue:m,...h}=r,T=useRef(null),x=useRef(null),{variant:P}=j(true),{style:v,className:R,rest:y}=B(h),S=lt();p?S.errors?.[p]:null;let b=p&&S.values&&S.setFieldValue,E=b?S.values?.[p]:void 0,F=useDebounce(k=>{b&&S.setFieldValue?.(p,k);},500),{showDropdown:M,dropdownPosition:A,handleKeyDown:L,handleInput:O,handleCommandSelect:$}=useCommandActions({command:a,commands:i,cmd:c,ref:T}),Z=useCallback(()=>{let k=T.current;!k||!t||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{k.style.height="auto";let U=k.scrollHeight;if(n){let X=parseInt(n.toString(),10);isNaN(X)||(U=Math.min(U,X));}k.style.height=`${U}px`,k.style.overflowY=n&&U>=parseInt(n.toString(),10)?"auto":"hidden";}));},[t,n]),I=k=>{F(k.currentTarget.value),l?.(k),O(k),Z();};return useEffect(()=>{T.current&&p&&E!==void 0&&T.current.value!==String(E)&&(T.current.value=String(E));},[E,p]),useEffect(()=>{Z();},[u,m,Z]),useEffect(()=>{t&&T.current&&Z();},[t,Z]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),useEffect(()=>()=>{b&&S.deleteFieldValue?.(p);},[]),jsxs(f,{as:"rel --flex w-full",children:[jsx("textarea",{name:p,className:`--input --textarea --${o||P||q.Medium} flex ${R}`.trim(),style:{...v,resize:s,height:t?"auto":v?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:L,onInput:I,ref:k=>{T.current=k,typeof e=="function"?e(k):e&&(e.current=k);},value:u,defaultValue:m,...y}),d?d({show:M,position:A,commands:i||[],onSelect:$}):i&&i.length>0&&jsx(Za,{visible:M,commands:i,onSelect:$,position:A})]})};Ua.displayName="Zuz.TextArea";var hf=Ua;var Xa=forwardRef((e,r)=>{let{as:t,value:n,color:o,direction:s,...a}=e,i=useRef(null),[p,l]=useState(n||0);return useImperativeHandle(r,()=>({updateValue(c){p.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),i.current){let d=c.toString().split("");i.current.querySelectorAll(".--wheel-char").forEach((u,m)=>{let h=d[m];if(u instanceof HTMLElement){u.setAttribute("data-value",h);let T=u.querySelector(".--wheel-char-track");T instanceof HTMLElement&&(T.style.setProperty("--v",h),T.offsetWidth);}});}}})),useEffect(()=>{l(n||0);},[n]),jsxs(f,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:i,...a,children:[(p||0).toString().split("").map((c,d)=>isNaN(parseInt(c,10))?jsx(ce,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${d}`):jsx(ce,{"data-value":c,className:`--wheel-char grid ${d>(p||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ce,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":c},children:[jsx(ce,{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((u,m)=>jsx(ce,{children:u},`${d}--${m}`)),jsx(ce,{children:!s||s==="down"?9:0})]})},`wheel-char-${d}`)),o&&jsx(f,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Xa.displayName="Zuz.TextWheel";var Cf=Xa;var Or=forwardRef((e,r)=>{let{as:t,meta:n,nodes:o,icons:s,onSelect:a,treeTag:i,selected:p,roots:l,expanded:c,...d}=e,{tag:u,label:m,icon:h,under:T,isHead:x}=n,P=useMemo(()=>l.includes(u),[l]),[v,R]=useState(c),y=()=>{localStorage.setItem(`--tn${i}-${u}`,v?"0":"1"),R(!v);};useEffect(()=>{c||P&&!localStorage.getItem(`--tn${i}-${u}`)?(localStorage.setItem(`--tn${i}-${u}`,"1"),R(true)):R(localStorage.getItem(`--tn${i}-${u}`)=="1");},[]);let S=useMemo(()=>o.filter(g=>g.under==u),[o,u]);return jsxs(f,{className:`--treenode ${P?"--is-root":""} --treenode-${u} flex cols`,children:[jsxs(f,{className:`--node --node-${u} flex aic ${p==u?" --selected":""}`,children:[jsx(K,{skeleton:d.skeleton,onClick:y,className:"--node-aro-btn",disabled:S.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(te,{skeleton:d.skeleton,className:"--node-aro-icon",name:S.length==0?s?.arrowDisabled||s?.arrowClose:v?s?.arrowOpen:s?.arrowClose}):S.length==0?V.chevronBottom:v?V.chevronBottom:V.chevronRight}),jsxs(K,{className:"--node-meta flex aic",onClick:g=>a(u),children:[(s?.nodeOpen&&s?.nodeClose||P&&s?.rootOpen&&s?.rootClose)&&jsx(te,{skeleton:d.skeleton,className:`--node-icon ${P?"--icon-root":""}`,name:h||(v?P&&s?.rootOpen||s.nodeOpen:P&&s?.rootClose||s?.nodeClose)}),jsx(_,{className:`--node-label ${P?"--node-label-root":""}`.trim(),skeleton:d.skeleton,children:m})]})]}),v&&S.length>0&&jsx(f,{className:`--sub-node tree-sub-node-${u} flex cols`,children:S.map(g=>jsx(Or,{treeTag:i,selected:p,onSelect:a,icons:s,roots:l,expanded:g.expanded||false,meta:g,nodes:o},`--node-${g.tag}`))})]})});Or.displayName="TreeItem";var ja=Or;var Ja=forwardRef((e,r)=>{let{as:t,nodes:n,onNodeSelect:o,tag:s,icons:a,roots:i,selected:p,...l}=e,[c,d]=useState(p);useImperativeHandle(r,()=>({getSelected:()=>c}),[o]);let u=m=>{d(m),o&&o(m);};return useEffect(()=>{c!=p&&d(p);},[p]),jsx(f,{className:"--treeview flex cols",children:n.filter(m=>i.includes(m.tag)).map(m=>jsx(ja,{treeTag:s?`-${s}`:"",selected:c,onSelect:h=>u(h),icons:a,meta:m,roots:i,expanded:m.expanded||false,skeleton:l.skeleton,nodes:n},`--node-${m.tag}`))})});Ja.displayName="Zuz.TreeView";var kf=Ja;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
-
export{
|
|
12
|
+
</div>`}).join("")},[t,y]);return jsxs(m,{as:`--code-block rel ${d}`,style:f,...l,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:w}})}),n&&jsx(K,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),n.onCopy?.();},children:"Copy"})]})},gp=dp;var zs=({onSelect:e,meta:o,selected:t,disabled:n=false})=>{let r=useRef(null),{index:s,icon:a,label:i}=o,[u,l]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&r.current){let{width:d,x:f}=r.current.getBoundingClientRect();l({x:f,width:d}),t&&e(s,d,f,o,true);}},[c,r.current]),useEffect(()=>{t&&e(s,u.width,u.x,o,false);},[t]),jsxs(K,{disabled:n,onClick:()=>e(s,u.width,u.x,o,false),ref:r,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(te,{name:a,as:"--segment-icon"}):jsx(m,{as:"--segment-icon flex aic jcc",children:a}):null,i&&String(i).trim()!=""&&jsx(m,{className:"--segment-label",children:i||`Item ${s}`})]})};zs.displayName="SelectTabItem";var _s=zs;var Ks=forwardRef((e,o)=>{let{fx:t,items:n,selected:r,variant:s,disabled:a=false,onSwitch:i,...u}=e,[l,c]=useState(r||0),d=useDelayed(50),f=useRef(l),{className:p,style:y,rest:w}=M(u),x=useRef(null),C=useRef(null),{variant:v}=j(true),T=(h,S,g,b,E)=>{if((E||l!=h&&l!=-2)&&(c(h),f.current=l,queueMicrotask(()=>{d&&i?.(b);})),x.current){let V=C.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${S}px`),x.current.style.setProperty("--x",`${V?g-V.left:g}px`);}};return useImperativeHandle(o,()=>({setSelected:h=>{typeof h=="number"&&h!=l&&c(h);}}),[l]),jsxs(m,{ref:C,"data-selected":l,className:`${p} --segmented --${s||v||q.Medium} flex aic rel`,style:y,...w,children:[jsx(m,{ref:x,className:`--segment-tab --${a?"disabled":"abled"} abs`}),n.map((h,S)=>jsx(_s,{disabled:a,onSelect:T,selected:l==S,meta:{...h,index:S}},`segment-${h.label}-${S}`))]})});Ks.displayName="Zuz.SelectTabs";var _t=Ks;var Us=forwardRef((e,o)=>{let{type:t,variant:n,...r}=e,s=useDelayed(),{colorScheme:a,setColorScheme:i}=zo(),u=useCallback(()=>{i(a=="dark"?"light":a=="light"?"system":"dark");},[a]),{variant:l}=j(true),{className:c,style:d}=M(r),f=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"system",index:1,label:"",icon:H.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(a),[a]);return !s||p==-1?null:t=="system"||t=="switch"?jsx(_t,{className:`--color-scheme --${t}`,onSwitch:({tag:y})=>{i(y);},selected:p,items:f,...r}):jsx(K,{onClick:u,style:d,variant:n,as:`--color-scheme-switch ${c}`.trim(),children:a=="system"?H.colorSchemeSystem:a=="light"?H.colorSchemeLight:H.colorSchemeDark})});Us.displayName="Zuz.ColorScheme";var kp=Us;var Xs=forwardRef((e,o)=>{let[t,n]=useState("wait"),{title:r,message:s,acceptLabel:a,rejectLabel:i,position:u}=e,l=async c=>{n(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");n(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(m,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:oe.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${u||ve.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(m,{as:"--footer flex aic",children:[jsx(K,{onClick:c=>l(1),as:"--accept",children:a||"Accept All"}),jsx(K,{onClick:c=>l(0),as:"--reject",children:i||"Cancel"})]})]})});Xs.displayName="Zuz.CookiesConsent";var Vp=Xs;var Ys=({ref:e,...o})=>{let {type:t,value:n=0,min:r=0,max:s=1,step:a=.01,onChange:i,showGhostBar:u,showKnobOnHover:l,showToolTip:c,roundValue:d,formatValue:f,...p}=o,{className:y,style:w,rest:x}=M(p),C=useRef(a||.01).current,v=useRef(r||0).current,T=useRef(s||1).current,h=useRef(n||0).current,S=useRef(null),g=useRef(null),b=useRef(null),E=useRef(null);useRef(null);let I=useRef(null),D=useRef(null),N=useRef(null),k=useRef(null),F=(se,ne,he)=>(se-ne)/(he-ne)*100,_=se=>{if(g.current){let ne=parseFloat(se.currentTarget.value);re(ne);let he=F(ne,parseFloat(se.currentTarget.min),parseFloat(se.currentTarget.max));g.current.style.setProperty("--value",`${he}`),g.current.setAttribute("data-value",`${ne}`),i&&i(d?+ne.toFixed(2):ne);}},[B,O]=useState(false),[U,X]=useState(0),[z,Z]=useState(0),[G,W]=useState(false),re=async se=>{let ne=f?f(+se):d?(+se).toFixed(2):Math.round(+se);N.current&&(N.current.textContent=String(ne));},ce=se=>{if(B){let ne=se.clientX-U,he=T-v,Pe=ne/200*he,ye=Math.max(v,Math.min(z+Pe,T));if(ye=Math.round(ye/C)*C,re(ye),g.current){let Ve=F(ye,v,T);g.current.style.setProperty("--value",`${Ve}`),g.current.setAttribute("data-value",`${ye}`),D.current&&(D.current.textContent=d?ye.toFixed(2):ye.toString()),i&&i(ye);}}},pe=()=>{O(false),document.body.style.cursor="auto";},Ce=se=>(se-v)/(T-v)*100,le=se=>{if(!g.current)return;let ne=g.current.getBoundingClientRect(),he=se.clientX-ne.left,Fe=Math.max(0,Math.min(100,he/ne.width*100));if(c&&N.current){let Pe=S.current?+S.current.value:n;re(Pe*100);}if(u){let Pe=Ce(S.current?+S.current.value:n),ye=Math.min(Pe,Fe),Ve=Math.abs(Fe-Pe);g.current.style.setProperty("--ghost-start",`${ye}`),g.current.style.setProperty("--ghost-width",`${Ve}`);}};useEffect(()=>{g.current&&g.current.style.setProperty("--value",S.current?`${F(parseFloat(S.current.value),parseFloat(S.current.min),parseFloat(S.current.max))}`:h.toString());},[]),useEffect(()=>(B?(document.addEventListener("mousemove",ce),document.addEventListener("mouseup",pe)):(document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",pe)),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",pe);}),[B]),useEffect(()=>{let se=F(n,v,T);g.current?.style.setProperty("--value",`${se}`),re(n);},[n,v,T,N.current]);let Y=()=>jsxs(m,{ref:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onMouseMove:le,className:`--slider --${t||Oo.Default} ${l?"--knob-hover":""} flex rel ${y}`.trim(),style:{...w},children:[jsx(m,{ref:I,className:"--slider-track abs fill"}),u&&jsx(m,{ref:E,className:"--slider-ghost abs fill"}),jsx(m,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(m,{ref:b,className:"--slider-knob --tooltip-knob abs"}),jsx(de,{ref:S,onInput:_,className:"abs fill",tabIndex:0,type:t||Oo.Default,defaultValue:h||0,step:C,max:T,min:v})]});if(c===true){let se=f?f(n):d?n.toFixed(2):n;return jsx(Bt,{ref:k,show:B,position:Tt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(ae,{ref:N,children:se}),children:Y()})}return Y()};Ys.displayName="Zuz.Slider";var dt=Ys;var Qs=forwardRef((e,o)=>{let{src:t,shape:n,size:r,...s}=e,{style:a,className:i,rest:u}=M(s),{canvasRef:l,crop:c,setScale:d,handleMouseDown:f,handleMouseUp:p,handleMouseMove:y}=useImageCropper(t,r||200,n||CropShape.Circle);return useImperativeHandle(o,()=>({getCropped(){return c()},setScale(w){d(w);}})),jsxs(m,{as:`--cropper --${n||CropShape.Circle} ${i}`,style:a,...u,children:[jsx("canvas",{ref:l,width:r||200,height:r||200,onMouseDown:f,onMouseUp:p,onMouseLeave:p,onMouseMove:y}),jsx(m,{as:"--cropper-slider",children:jsx(dt,{onChange:w=>d(w),min:0,max:1,step:.01,value:1})})]})});Qs.displayName="Zuz.Cropper";var Fp=Qs;var _p=(t=>(t.Circle="circle",t.Square="square",t))(_p||{});var ea=forwardRef((e,o)=>{let{items:t,maxItems:n}=e,r=useMemo(()=>{let i=typeof t=="string",u=i?[]:t;return i&&t.split(",").forEach(l=>{u.push({label:l});}),u},[t]),a=useMemo(()=>n&&n>0&&r.length>n-1,[r,n])?[...r.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...r.slice(-n)]:r;return jsx(Ke,{ref:o,className:"--crumb flex aic",direction:"rows",seperator:jsx(m,{as:"--crumb-chevron",children:H.chevronRightOutline}),items:a.map((i,u,l)=>i.ID=="."?jsx(m,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(m,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${u}`))}):jsxs(K,{onClick:()=>i.action?.(),className:"--crumb-item",disabled:!l[u+1],children:[i.icon&&jsx(te,{as:"--crumb-icon",name:i.icon}),jsx($,{as:"--crumb-label",children:i.label})]},`${i.label.replace(/\s+/g,"-").toLowerCase()}-${u}`))})});ea.displayName="Zuz.Crumb";var Kp=ea;var ra=forwardRef((e,o)=>{let{icon:t,defaultValue:n,value:r,size:s,variant:a,numeric:i,type:u,onConfirm:l,...c}=e,[d,f]=useState(false),[p,y]=useState(n||null),{style:w,className:x,rest:C}=M(c),v=useRef(null),T=useRef(null),{reposition:h}=Dt(T,{direction:ve.Bottom,offset:2}),S=b=>{i&&(b.currentTarget.value=b.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let b=E=>{let V=E.target,I=v.current?.contains(V),D=T.current?.contains(V);!I&&!D&&f(false);};return d&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b);}},[d]),useEffect(()=>{let b=E=>{E.key==="Escape"&&d&&(f(false),v.current?.focus());};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);let g=()=>{f(true);};return useEffect(()=>{d&&h();},[d,h]),jsx(Fragment$1,{children:jsxs(m,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${x}`,"data-value":p?p.toISOString():"",children:[t?typeof t=="string"?jsx(te,{as:"mr:10 c:#666",name:t}):t:jsx(ae,{as:"--date-picker-icon flex aic jcc",children:H.calendar}),jsx("input",{ref:v,value:p?format(p,"EEE, MMM d YYY hh:mm a"):r||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:w,onFocus:g,onInput:S,autoComplete:"new-password",onKeyDown:b=>{b.key=="Enter"&&l?.(b.currentTarget.value);},...C}),jsx(m,{"aria-hidden":!d,ref:T,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:d,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(xr,{defaultValue:p,onChange:b=>{y(b),f(false);}})})]})})});ra.displayName="Zuz.DatePicker";var qp=ra;var na=forwardRef((e,o)=>{let{icon:t,variant:n,position:r}=e;return jsx(K,{className:`--fab fixed --${n||q.Large} --${r||"bottomright"}`,children:t||H.plus})});na.displayName="Zuz.Fab";var Qp=na;var eu=({ref:e,children:o,...t})=>{let{legend:n,legendPlacement:r,variant:s,...a}=t,{variant:i}=j(true),{className:u,style:l,rest:c}=M(a);return jsxs(m,{as:`--fieldset --rel --flex --${s||i||q.Medium} ${u}`.trim(),style:l,children:[jsx(m,{as:`--legend --abs --${r||"top-start"}`,children:n&&typeof n=="string"?jsx("legend",{children:n}):n}),o]})},tu=eu;var aa=e=>{let{names:o,strength:t}=e,n={[Xt.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-${Xt.Gooey}`)};return useEffect(()=>{},[o]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(o||[Xt.Gooey]).map(r=>n[r](t))})})};aa.displayName="Zuz.Filters";var nu=aa;var ia=e=>typeof e=="number"?`repeat(${e}, 1fr)`:e,au=e=>e==="between"?"space-between":e==="around"?"space-around":e,la=e=>{let{ref:o,cols:t,rows:n,columns:r,gap:s,gapX:a,gapY:i,columnGap:u,rowGap:l,align:c,alignItems:d,justify:f,justifyContent:p,inline:y,flow:w,autoFlow:x,autoCols:C,autoRows:v,autoColumns:T,autoRow:h,template:S,areas:g,...b}=e,{className:E,style:V,rest:I}=M(b),D=r??t,N=u??a??s,k=l??i??s,F=d??c,_=p??f,B=x??w,O=T??C,U=h??v,X=g??S,z={...y?{display:"inline-grid"}:{},gridTemplateColumns:ia(D),gridTemplateRows:ia(n),columnGap:N,rowGap:k,alignItems:F,justifyContent:au(_),gridAutoFlow:B,gridAutoColumns:O,gridAutoRows:U,gridTemplateAreas:X,...V};return jsx(m,{ref:o,className:["--grid",E].filter(Boolean).join(" "),style:z,...I})};la.displayName="Zuz.Grid";var iu=la;var ca=e=>typeof e=="string"&&e.includes("+"),ma={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"},pa={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 fa=forwardRef(({children:e,keys:o,as:t,className:n,variant:r},s)=>{let{variant:a}=j(true),i=useMemo(()=>{if(ca(o)){let u=null;return {keys:String(o).split("+").reduce((c,d,f,p)=>(p[f+1]?c.push(d):u=d.toUpperCase(),c),[]),children:u}}return {keys:o,children:String(e).toUpperCase()}},[o]);return jsxs(m,{as:`--keyboard-keys --${r||a||q.Small} flex aic ${t} ${n}`.trim(),children:[(Array.isArray(i.keys)?i.keys:[i.keys]).map(u=>jsx("abbr",{title:pa[u],children:ma[u]},u)),jsx(ae,{children:i?.children??e})]})});fa.displayName="Zuz.KeyboardKeys";var Lr=fa;var ha=createContext(null),yt=()=>{let e=useContext(ha);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},gu=({ref:e,icons:o,children:t,...n})=>{let{playlist:r=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:i="No Track",defaultCover:u,onTrackChange:l,...c}=n,{className:d,style:f,rest:p}=M(c),y=useMediaPlayer(r,r[0]??void 0),w=useMemo(()=>({play:H.play,pause:H.pause,prev:H.prev,next:H.next,volumeHigh:H.volumeHigh,volumeMute:H.volumeMute,...o}),[o]),x=useMemo(()=>({...y,mode:s,icons:w}),[y,w]);return jsx(ha.Provider,{value:x,children:jsx(m,{className:`--zuz-media-player ${d}`,style:f,children:t})})},ya=gu;var xa=e=>{if(!e||isNaN(e))return "0:00";let o=Math.floor(e/60),t=Math.floor(e%60);return `${o}:${t.toString().padStart(2,"0")}`},So=e=>typeof e=="string"?jsx(te,{name:e}):e,ba=()=>{let{mediaRef:e,state:o,controls:t,mode:n}=yt();return jsxs(m,{as:`--mediaplayer-stage rel --mode-${n}`,children:[n==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),o.isLoading&&jsx(m,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Ie,{})})]})},va=()=>{let{state:e,defaultArtist:o,defaultTitle:t,defaultCover:n}=yt();return jsxs(m,{as:"--track-info flex aic",children:[jsx(We,{src:e.currentItem?.cover||n||"",as:"--track-cover"}),jsxs(m,{as:"flex cols",children:[jsx(m,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(m,{as:"--track-artist",children:e.currentItem?.artist||o||"..."})]})]})},Sa=()=>{let{state:e,controls:o,icons:t}=yt();return jsxs(m,{as:"--mediaplayer-controls flex aic",children:[jsx(K,{onClick:o.prev,as:"--prev",children:So(t?.prev??H.prev)}),jsx(K,{onClick:o.togglePlay,as:"--play-pause",children:So(e.isPlaying?t?.pause??H.pause:t?.play??H.play)}),jsx(K,{onClick:o.next,as:"--next",children:So(t?.next??H.next)})]})},wa=()=>{let{state:e,controls:o,mediaRef:t}=yt(),n=e.progress*(e.duration||0);return jsxs(m,{as:"--track-progress flex aic",children:[jsx(m,{as:"--track-current-duration",children:xa(n)}),jsx(dt,{value:e.progress,onClick:r=>{let s=r.currentTarget.getBoundingClientRect(),a=(r.clientX-s.left)/s.width;o.seek(a);}}),jsx(m,{as:"--track-total-duration",children:xa(e.duration)})]})},Ca=()=>{let{state:e,controls:o,icons:t}=yt();return jsxs(m,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(K,{onClick:()=>o.setIsMuted(),children:So(e.isMuted?t?.volumeMute??H.volumeMute:t?.volumeHigh??H.volumeHigh)}),jsx(dt,{value:e.volume,className:"h:3 flex:1",onClick:n=>{let r=n.currentTarget.getBoundingClientRect();o.setVolume((n.clientX-r.left)/r.width);}})]})};var hu=Object.assign(ya,{Stage:ba,TrackInfo:va,Controls:Sa,Progress:wa,Volume:Ca}),yu=hu;var Pa=forwardRef((e,o)=>{let t=useNetworkStatus(),{onlineMessage:n,offlineMessage:r,variant:s}=e;return jsxs(m,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:oe.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||q.Small} fixed flex`,children:[jsx(m,{className:"--ico",children:t?H[Me.Success]:H[Me.Error]}),jsx($,{as:"--message",children:t?n||"internet connection restored :)":r||"no internet connection"})]})});Pa.displayName="Zuz.NetWorkManager";var vu=Pa;var Ia=forwardRef((e,o)=>{let{strenthMeter:t,onChange:n,...r}=e;"type"in r&&delete r.type;let{style:s,className:a,rest:i}=M(r),[u,l]=useState(false),[c,d]=useState(""),f=useMemo(()=>checkPasswordStrength(c),[c]),p=useDebounce(y=>{t&&d(y.target.value),n&&n(y);},100);return useEffect(()=>{},[]),jsxs(m,{as:"w:100% flex cols",children:[jsxs(m,{style:s,className:"--password flex aic rel",children:[jsx(de,{ref:o,type:u?"text":"password",className:a,onChange:p,...i}),jsx(K,{tabIndex:-1,onClick:()=>l(y=>!y),className:"--toggle flex aic jcc abs",children:u?H.eye:H.eyeSlash})]}),t&&jsxs(m,{as:`flex aic --password-meter --pb-score-${f.score}`,style:s,children:[jsxs(m,{as:"--password-bars flex aic",children:[jsx(m,{as:`--pbar ${f.score>=1?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${f.score>=2?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${f.score>=3?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${f.score>=4?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${f.score>=5?"--pb-on":""}`.trim()})]}),jsx($,{as:"--password-meter-label","aria-hidden":true,children:f.result})]})]})});Ia.displayName="Zuz.Password";var Iu=Ia;var Ba=forwardRef((e,o)=>{let{size:t,length:n,mask:r,...s}=e,a=useRef([]),i="pinput",u=false,l={};"with"in s&&(l={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(i=s.name,delete s.name),"required"in s&&(u=true,delete s.required);let{style:c}=M(s),d=p=>{let y=p.currentTarget,w=a.current[parseInt(y.dataset.index)+1],x=a.current[parseInt(y.dataset.index)-1];y.value.length===1&&w?w.focus():y.value.length===0&&x&&x.focus();},{variant:f}=j(true);return useEffect(()=>{a.current=a.current.slice(0,t||n);},[t||n]),jsx(m,{name:i,style:c,className:`--otp --${s.variant??f??q.Medium} flex aic rel`,"data-required":u,"data-size":t||n||4,...l,children:Array(t||n||4).fill(1).map((p,y)=>jsx(de,{autoComplete:"new-password","data-index":y,ref:w=>{a.current[y]=w;},numeric:true,onChange:d,maxLength:1,placeholder:r?"\xB7":"0",type:r?"password":"text",...s},`pin-${y}`))})});Ba.displayName="Zuz.PinInput";var ku=Ba;var Na=forwardRef((e,o)=>{let{children:t,className:n,name:r,required:s,type:a,value:i,variant:u,checked:l,onSwitch:c,...d}=e,[f,p]=useState(l||false),{variant:y}=j(true),w=useRef(null);return jsxs(Ft,{className:`${n} --${(a||Vo.Default).toLowerCase()} --radio${!a||a==Vo.Default?"":"card"} --${u||y||q.Small} flex aic rel`.trim(),...d,children:[jsx(de,{ref:w,defaultChecked:f,value:i||"rd",type:"radio",className:"abs",name:r,required:s||false,onChange:x=>{c&&c(x.target.checked,i||"cb"),p(x.target.checked);}}),jsx(m,{className:"--dot rel",children:jsx(m,{className:"--rod abs abc"})}),jsx(m,{className:"--value",children:t})]})});Na.displayName="Zuz.Radio";var Vu=Na;var ka=forwardRef((e,o)=>{let{fx:t,withStyle:n,as:r,reverse:s=false,searchIcon:a=H.search,hideSearchIcon:i=false,clearIcon:u=H.close,hideClearIcon:l=false,onChange:c,onClear:d,...f}=e,{style:p,className:y}=M({as:e.as}),[w,x]=useState(""),{variant:C}=j(true),v=useRef(null);"type"in e&&delete e.type;let T=g=>{x(g.target.value),c?.(g.target.value);},h=g=>{w.trim()!==""&&(x(""),c?.(""),v.current&&(v.current.value="",e.onConfirm?.("")));};useImperativeHandle(o,()=>({focus:()=>v.current?.focus(),value:()=>v.current?.value})),useEffect(()=>{},[]);let S=jsx(K,{tabIndex:-1,onClick:g=>h(),className:"--send flex aic jcc",variant:e.variant||q.Medium,children:w!==""?!l&&(typeof u=="string"?jsx(te,{name:u,as:"--search-action"}):u):!i&&(typeof a=="string"?jsx(te,{name:a,as:"--search-action"}):a)});return jsxs(m,{style:p,className:`--search --no-shrink --${e.variant||C||q.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${y}`.trim(),children:[s&&S,jsx(de,{ref:v,onChange:T,...f}),e.shortcut&&jsx(Lr,{keys:e.shortcut,as:"--abs"}),!s&&S]})});ka.displayName="Zuz.Search";var Mr=ka;var Zu=({label:e,icon:o})=>jsxs(m,{as:"--select-options-head --no-shrink --disabled".trim(),"aria-hidden":"true",children:[o&&jsx(te,{name:o}),jsx($,{as:"--select-group-label",children:e})]}),Ma=Zu;var Va=({checkIcon:e,selected:o,updateValue:t,o:n})=>{let r=e?typeof e=="string"?jsx(te,{name:"checkIcon"}):e:H.check,s=n.disabled===true;return jsxs(K,{onClick:a=>{s||(a.stopPropagation(),t(n));},disabled:s,as:`--select-option-item --no-shrink ${o?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Te,{as:"--option-item-meta --aic",children:[n.icon&&jsx(te,{name:n.icon,as:`--select-option-icon --icon-${n.value}`,color:n.iconColor}),jsx($,{suppressHydrationWarning:true,children:typeof n=="string"?n:n.label})]}),o&&jsx(Te,{aic:true,jcc:true,as:"--select-option-check --abs",children:r})]})};Va.displayName="Option";var Da=Va;var Aa=(({ref:e,...o})=>{let{selected:t,options:n,label:r,name:s,variant:a,search:i,searchPlaceholder:u,maxHeight:l,arrowDownIcon:c=H.arrowDown,arrowUpIcon:d=H.arrowUp,expanded:f,multiple:p,tokenizer:y,wrapTokens:w,disabled:x,checkIcon:C,closeIcon:v,editable:T,editablePlaceholder:h,onChange:S,required:g,with:b,...E}=o,V=kt(),I=!!(s&&V?.setFieldValue),D=Nn(s),N=Bn(s),k=T===true&&p!==true&&y!==true,F=L=>typeof L=="string"||typeof L=="number",_=L=>typeof L=="object"&&L!==null&&!Array.isArray(L)&&"value"in L&&"label"in L,B=L=>n.find(ee=>String(ee.value)===String(L)),O=L=>{if(L==null)return null;if(k&&L==="")return "";if(p||y)return (Array.isArray(L)?L:[L]).map(ge=>F(ge)?B(ge):ge).filter(ge=>_(ge));if(F(L)){let ee=B(L);return ee||(k?String(L):null)}return _(L)?L:null},U=()=>{if(t!==void 0)return O(t);let L=n.find(ee=>String(ee.value)==="-1");return L||(k?"":null)},X=L=>Array.isArray(L)?L.map(ee=>ee.value):_(L)?L.value:L,[z,Z]=useState(()=>U()),[G,W]=useState(false),[re,J]=useState(null),ce=useRef(null),pe=useRef(null),Ce=useRef(null),le=useId(),ue=useMemo(()=>s||le,[s,le]),{reposition:Y}=Dt(Ce,{direction:Tt.Bottom,offset:2}),{variant:se}=j(true),ne=v?typeof v=="string"?jsx(te,{name:v}):v:H.close,{className:he,style:Fe,rest:Pe}=M(E,void 0),{onClick:ye,...Ve}=Pe||{},ie=useMemo(()=>N!==void 0?O(N):z,[N,z,n,k,p,y]),be=useMemo(()=>{if(!(!ie||Array.isArray(ie)||!_(ie)))return ie},[ie]),Gt=useMemo(()=>k?_(ie)?String(ie.value??""):F(ie)?String(ie):"":"",[k,ie]),Ut=L=>Array.isArray(ie)?ie.some(ee=>ee.value===L.value):_(ie)?ie.value===L.value:k&&F(ie)?String(ie)===String(L.value):false,ze=L=>{if(I&&V?.setFieldValue&&s){V.setFieldValue(s,X(L));return}Z(L);},De=L=>{S?.(T===true&&L instanceof Option?String(L.value):L);},No=L=>{if(!(x||L.disabled)){if(p||y){let ee=Array.isArray(ie)?ie:[],ke=ee.find(ko=>ko.value===L.value)?ee.filter(ko=>ko.value!==L.value):[...ee,L];ze(ke),De(ke);return}ze(L),W(false),De(L);}},ui=L=>{let ee=L.target.value,ge=ee===""?null:B(ee),ke=ge?ge.value:ee;ze(ke),De(ke);},fi=L=>{if(L.key==="Enter"&&(L.preventDefault(),k)){let ee=L.currentTarget.value.trim();if(!ee){W(false);return}let ke=B(ee)??ee;ze(ke),De(ke),W(false);}},di=(L,ee)=>{if(L.stopPropagation(),x)return;let ge=ie.filter(ke=>ke.value!==ee.value);ze(ge),W(false),De(ge);},gi=L=>{let ee=L.currentTarget,ge=ee.scrollTop===0&&L.deltaY<0,ke=ee.scrollHeight-ee.scrollTop===ee.clientHeight&&L.deltaY>0;!ge&&!ke||L.preventDefault(),L.stopPropagation();};useImperativeHandle(e,()=>({setSelected:L=>{ze(O(L));},getValue:()=>ie??null}),[ie,n,k,p,y,I,s]),useEffect(()=>{I||t===void 0||Z(O(t));},[t,I,n,k,p,y]),useEffect(()=>{if(!G)return;let L=()=>{Y();};return window.addEventListener("scroll",L,true),window.addEventListener("resize",Y),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",Y);}},[G,Y]),useEffect(()=>{if(!G){pe.current&&(pe.current.value=""),J(null);return}pe.current?.focus(),Y();let L=ge=>{ce.current&&!ce.current.contains(ge.target)&&W(false);},ee=setTimeout(()=>{document.addEventListener("click",L);},0);return ()=>{clearTimeout(ee),document.removeEventListener("click",L);}},[G,Y]);let hi=useDebounce(L=>J(L===""?null:L),300),yi=useDebounce(ui,300);return jsxs(m,{ref:ce,"data-required":g?"true":void 0,with:b,className:[`--select ${f==true?"--expanded":""}`,`--${a||se}`,`${s?`--${s}`:""}`,`${D?"--has-error":""}`,`${x?"--disabled":""} rel`].join(" ").trim(),name:ue,children:[k?jsxs(m,{"data-value":be?.value??(Gt||"-1"),className:`--select-display --selected --editable flex aic rel ${he}`.trim(),style:Fe,onClick:L=>L.stopPropagation(),...Ve,children:[be?.icon&&jsx(te,{as:"--selected-icon",name:be.icon}),jsx(Te,{aic:true,as:"--label-wrapper",children:jsx(de,{"aria-expanded":G,className:"--select-input",disabled:x,onChange:yi,onClick:L=>{L.stopPropagation(),x||W(true);},onKeyDown:fi,placeholder:h||r||"Choose",type:"text",defaultValue:Gt})}),jsx(K,{className:"--select-toggle rel flex aic jcc",disabled:x,onClick:L=>{L.stopPropagation(),x||W(ee=>!ee);},tabIndex:-1,withLabel:false,children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}):jsxs(K,{disabled:x,variant:a||se,"data-value":be?.value??"-1",className:`--select-display --selected flex aic rel ${he}`.trim(),withLabel:false,style:Fe,onClick:L=>{L.stopPropagation(),x||W(ee=>!ee);},...Ve,children:[be?.icon&&jsx(te,{as:"--selected-icon",name:be.icon}),jsx(Te,{aic:true,as:"--label-wrapper",children:y&&Array.isArray(ie)&&ie.length>0?jsxs(Te,{as:`--tokens-wrap${w===true?" --wrap":""}`,children:[ie.map(L=>jsxs(Te,{aic:true,as:"--token",children:[jsx($,{as:"--token-label",children:L.label}),jsx(m,{as:"--token-remove",onClick:ee=>di(ee,L),children:ne})]},L.value)),ie.length<n.length&&jsx($,{as:"--label",children:r||"Choose"})]}):jsx($,{as:"--label",children:Array.isArray(ie)?ie.length>0?`${ie.length} selected`:r||"Choose":be?.label||r||"Choose"})}),jsx(m,{className:"--svg-arrow rel flex aic jcc",children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}),jsxs(m,{id:ue,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!G,onWheel:gi,style:{maxHeight:l||"auto"},ref:Ce,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:G,duration:.05},children:[i&&jsx(m,{as:"--select-search --no-shrink flex --sticky",children:jsx(Mr,{ref:pe,variant:q.Small,placeholder:u||"Search...",onChange:hi})}),r&&jsx(Ma,{label:r}),n?.filter(L=>!re||L.label.toLowerCase().includes(re.toLowerCase()))?.map(L=>jsx(Da,{updateValue:No,checkIcon:C,selected:Ut(L),o:L},`option-${L.label.replace(/\s+/g,"-")}-${L.value}`))]})]})});Aa.displayName="Zuz.Select";var Uu=Aa;var $a=({ref:e,...o})=>jsx(zt,{type:Ue.Switch,...o,ref:e});$a.displayName="Zuz.Switch";var qu=$a;var za=e=>{let{idx:o,id:t,as:n,weight:r,style:s,value:a,render:i,resize:u,sortBy:l,sortable:c,onSort:d}=e,[f,p]=useState(0),y=()=>{c&&(d?.(String(t),f==1?-1:1),p(w=>w==1?-1:1));};return jsxs(m,{style:{flex:r||1,...s},as:`--col flex aic ${n||""} ${c?"--sortable":""}`,onClick:y,children:[jsx(m,{as:"--colv",children:a}),o==-1&&c&&l==t&&jsx(m,{as:"--arrow flex aib",children:f==1?H.arrowUp:H.arrowDown})]})};za.displayName="Zuz.Column";var Ro=za;var Za=e=>{let{index:o,pubsub:t,schema:n,data:r,ids:s,styles:a,animate:i,sortBy:u,selectable:l,tableRef:c,loading:d,rowClassName:f,onSort:p,onRowClick:y,onSelect:w,onContextMenu:x}=e,C=useDelayed(),v=useMemo(()=>({transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(o+1)}),[]),T=useRef(null),h=(g,b)=>{o==-1?t.emit(`ALL_ROWS_${g?"CHECKED":"UNCHECKED"}`,g):(w&&w(r,g),t.emit(`ROW_${g?"CHECKED":"UNCHECKED"}`,g,b));},S=(g,b,E)=>jsx(Ro,{idx:g,id:b,as:"--selector",pubsub:t,value:jsx(zt,{value:E,ref:T,onSwitch:h,type:Ue.Default})});return useEffect(()=>{let g=(I,D)=>{T.current?.setChecked(I,false);},b=(I,D)=>{let N=false;c?.current&&c.current.querySelectorAll(".--row").forEach(k=>{let F=k;if(!F.classList.contains("--row-head")){let _=F.querySelector(".--selector input[type=checkbox]");_&&_.checked&&!N&&(N=_.checked);}}),T.current.setChecked(N,false);},E=I=>{T.current?.setChecked(I,false),w&&w(r,I);},V=I=>{T.current?.setChecked(I,false),w&&w(r,I);};return o==-1?(t.on("ROW_CHECKED",g),t.on("ROW_UNCHECKED",b),()=>{t.off("ROW_CHECKED",g),t.off("ROW_UNCHECKED",b);}):(t.on("ALL_ROWS_CHECKED",E),t.on("ALL_ROWS_UNCHECKED",V),()=>{t.off("ALL_ROWS_CHECKED",E),t.off("ALL_ROWS_UNCHECKED",V);})},[]),jsxs(m,{onContextMenu:g=>x?x(g,r):null,onClick:g=>y?y(g,e.data):()=>{},...i?{fx:{...v,when:C}}:{},as:`--row flex aic ${y?"--row-clickable":""} ${o==-1?"--row-head":""} ${f||""}`,children:[o==-1&&n.map((g,b)=>{let{renderWhenHeader:E,render:V,value:I,...D}=g;return jsxs(Fragment,{children:[l&&b==0&&S(-1,`--selector-${g.id}`,"all"),jsx(Ro,{idx:-1,onSort:p,sortBy:u,value:I,...D,pubsub:t,style:a[g.id]})]},`--col-${g.id}`)}),d&&o>-1&&jsx(m,{as:"--col",children:jsx($,{as:"opacity:0",children:"..."})}),!d&&o>-1&&s&&r&&n.map((g,b)=>jsxs(Fragment,{children:[l&&b==0&&S(b,`--selector-${g.id}`,g.id.toString()),s.includes(String(g.id))?jsx(Ro,{pubsub:t,idx:b,id:String(g.id),style:a[String(g.id)],value:g.render?g.render(r,o):r[String(g.id).includes(".")?String(g.id).split(".").reverse()[0]:g.id]}):null]},`--${String(g.id)}-val-${b}`))]})};Za.displayName="Zuz.Row";var Io=Za;var Ua=(e,o)=>{let{schema:t,rows:n,rowCount:r,rowsPerPage:s,currentPage:a,pagination:i,paginationHash:u,showPaginationOnZeroPageCount:l,animateRows:c,header:d,rowClassName:f,selectableRows:p,hoverable:y,sortBy:w,loading:x,loadingRowCount:C,loadingMessage:v,spinner:T,emptyMessage:h,onSort:S,onRowClick:g,onRowSelectToggle:b,onPageChange:E,onRowContextMenu:V,...I}=e,D=useRef(null),N=useMemo(()=>t.reduce((ue,Y)=>(ue[Y.id]={flex:Y.weight||1,...Y.w&&{width:Y.w},...Y.maxW&&{maxWidth:Y.maxW},...Y.minW&&{minWidth:Y.minW},...Y.h&&{height:Y.h},...Y.maxH&&{maxHeight:Y.maxH},...Y.minH&&{minHeight:Y.minH}},ue),{}),[t]),k=useMemo(()=>Object.keys(N),[t]),F=useMemo(()=>d??true,[d]),{style:_,className:B,rest:O}=M(I),U=useRef(null),X=useMemo(()=>new PubSub,[]),z=useRef(n.map(()=>uuid(8))),[Z,G]=useState(w||null),[W,re]=useState(v||"loading"),J=useMemo(()=>!x&&n&&n.length==0,[x,n]),ce=useCallback(()=>h?typeof h=="function"?jsx(h,{}):h:jsx($,{as:"tac s:18 mt:75",children:"No Record Found"}),[x,n]);useEffect(()=>{n.length&&!z.current&&(z.current=n.map(()=>uuid(8)));},[n]);let pe=(ue,Y)=>{G(ue),S?.(ue,Y);},Ce=(r||(n?n.length:0))/(s||10),le=useMemo(()=>l||Ce>1?jsx($t,{hash:u,ref:D,renderOnZeroPageCount:l,onPageChange:E,paginationStyle:"table",startPage:a,itemCount:r||(n?n.length:0),itemsPerPage:s||10}):null,[a,r]);return useImperativeHandle(o,()=>({setLoading(ue){}})),jsxs(m,{as:`--table ${y??true?"--hoverable":""} flex cols rel ${B}`,ref:U,children:[F==true&&jsx(Io,{sortBy:Z,onSort:pe,tableRef:U,pubsub:X,selectable:p,index:-1,schema:t,loading:true,styles:N}),x&&jsxs(m,{as:"center-x flex aic --table-spinner",children:[jsx(Ie,{type:T||we.Simple}),W&&jsx($,{as:"--table-loading-message",children:W})]}),x&&Array(C||5).fill({}).map((ue,Y)=>jsx(Io,{tableRef:U,index:Y,pubsub:X,schema:t,styles:N,loading:true,animate:c,onRowClick:g},`--trow-loading-${Y}-${t[0].id}`)),!x&&n&&n.map((ue,Y)=>jsx(Io,{tableRef:U,pubsub:X,loading:false,index:Y,schema:t,ids:k,styles:N,animate:c,data:ue,onRowClick:g,rowClassName:f,selectable:p,onSelect:b,onContextMenu:V},`--trow-${z.current[Y]||Y}-${t[0].id}`)),J&&ce(),i&&le&&jsx(m,{"aria-hidden":!i||!le,...c?{fx:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(n.length+1),when:!x&&n&&i&&le!=null}}:{},as:"--row flex aic --row-footer",children:le})]})};Ua.displayName="Zuz.Table";var lf=forwardRef(Ua),cf=lf;var pf=({ref:e,...o})=>{let{title:t,items:n}=o,[r,s]=useState(0),a=(i,u,l)=>{i.preventDefault(),s(u),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(m,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx($,{as:"--toc-title",children:t}),jsx(Ke,{items:n.map((i,u)=>jsx("a",{className:r==u?"--toc-active":"",style:{anchorName:r===u?"--toc-active":"none",color:r==u?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>a(l,u,i.tag),href:`#${i.tag}`,children:i.label}))})]})},uf=pf;var qa=({isActive:e,transitionType:o,speed:t,width:n,render:r,content:s,onHeightChange:a})=>{let i=useRef(null),u=useResizeObserver(i);useEffect(()=>{e&&u.height>0&&a(u.height);},[e,u.height]);let c=useMemo(()=>{let d={width:n>0?`${n}px`:"100%",minWidth:n>0?`${n}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return o==="fade"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:o==="scale"?{...d,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}:d},[e,o,n,t]);return jsx(m,{ref:i,style:{...c},className:"--content",children:r||e?s:null})};qa.displayName="Zuz.TabBody";var Xa=qa;var Qa=({ref:e,...o})=>{let{tabs:t,speed:n=.3,prerender:r=true,variant:s,tabStyle:a="fixed",onChange:i,transitionType:u="slide",...l}=o,[c,d]=useState(0),f=useRef(null),p=useResizeObserver(f),y=useMemo(()=>uuid(8),[]),[w,x]=useState("auto"),C=useMemo(()=>p.width>0,[p.width]);useImperativeHandle(e,()=>({setTab:b=>d(b)}));let v=useMemo(()=>t.map(b=>({...b,key:b.key||uuid(8)})),[t]),{style:T,className:h,rest:S}=M({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),g=()=>{if(!C)return {opacity:0};switch(u){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${v.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${c*p.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(m,{ref:f,style:T,className:`--tabview --${a} flex cols ${h}`,children:[jsx(_t,{as:"--tabview-head",onSwitch:b=>{d(b.index);let E=v.find(V=>V.tag==b.tag);E&&E.onSelect&&(E.onSelect(E,b.index),i?.(E,b.index));},selected:c,items:v.reduce((b,E,V)=>(b.push({icon:E.icon,index:V,label:E.label,tag:E.tag}),b),[])}),jsx(m,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:w,transition:C?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:C?1:0},children:jsx(m,{className:"--track",style:{...g()},children:v.map((b,E)=>jsx(Xa,{isActive:E===c,transitionType:u,speed:n,width:p.width,render:r||E===c,onHeightChange:V=>E===c&&x(V),content:b.body},`tab-body-${b.key||E}-${y}`))})})]})};Qa.displayName="Zuz.TabView";var wf=Qa;var Rf=({ref:e,commands:o,onCommand:t,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:r="zuz ~ ",variant:s,...a})=>{let[i,u]=useState([{type:"output",content:n}]),[l,c]=useState(""),d=useRef(null),f=useRef(null),{variant:p}=j(true);useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight);},[i]);let y=h=>{let S=typeof h=="string"?{type:"output",content:h}:h;u(g=>{let b=[...g,S];return b.length>1e3?b.slice(-1e3):b});},w=()=>u([]);useImperativeHandle(e,()=>({write:y,clear:w}));let x=async h=>{let[S,...g]=h.split(" "),b=S.toLowerCase();return o&&o[b]?await o[b](g):t?await t(h):`command not found: ${S}`},C=h=>{let S=/\u001b\[(\d+)m/g,g=[],b={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,V="#d4d4d4",I=false,D;for(;(D=S.exec(h))!==null;){let k=h.slice(E,D.index);k&&g.push({text:k,color:V,bold:I});let F=D[1];F==="0"?(V="#d4d4d4",I=false):F==="1"?I=true:b[F]&&(V=b[F]),E=S.lastIndex;}let N=h.slice(E);return N&&g.push({text:N,color:V,bold:I}),g},v=(h,S)=>h.includes("\x1B")?C(h).map((g,b)=>jsx(ae,{style:{color:g.color||"#d4d4d4",fontWeight:g.bold?"bold":"normal"},children:g.text},`--terminal-msg-${b}-${g.text.replace(/\S+/g,"-")}`)):jsx(ae,{style:{color:S==="error"?"#ff5f56":S==="command"?"#00ff00":"#d4d4d4"},children:h}),T=async h=>{if(h.key==="Enter"&&l.trim()){let S=l.trim(),g=[...i,{type:"command",content:`${r}${S}`}];c(""),u(g);let b=await x(S);u(E=>[...E,{type:"output",content:b}]);}};return jsxs(m,{as:`--zuz-terminal --${s||p||q.Medium} flex cols ${a.className}`,onClick:()=>f.current?.focus(),children:[jsx(m,{ref:d,className:"--terminal-log",children:i.map((h,S)=>jsx(m,{children:jsx($,{children:v(h.content,h.type)})},S))}),jsxs(m,{as:"flex aic --terminal-input",children:[jsx($,{as:"--terminal-prompt",children:r}),jsx(de,{ref:f,className:"--zuz-term-input",autoFocus:true,value:l,variant:s||p||q.Medium,onChange:h=>c(h.target.value),onKeyDown:T})]})]})},If=Rf;var Ef=({meta:e})=>jsxs(K,{as:"flex aic --command-item",children:[e.icon&&jsx(te,{name:e.icon,as:"--command-icon"}),jsx($,{children:e.label})]}),Bf=({position:e,onSelect:o,commands:t,visible:n})=>jsx(m,{"aria-hidden":!n,fx:{transition:Q.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...e},children:t.map(r=>jsx(Ef,{meta:r},`cmd-${r.label.replace(/\s+/,"-")}`))}),oi=Bf;var si=({ref:e,...o})=>{let {autoResize:t,maxHeight:n,variant:r,resize:s="none",command:a,commands:i,name:u,onInput:l,cmd:c,renderDropdown:d,value:f,defaultValue:p,...y}=o,w=useRef(null),x=useRef(null),{variant:C}=j(true),{style:v,className:T,rest:h}=M(y),S=mt();u?S.errors?.[u]:null;let b=u&&S.values&&S.setFieldValue,E=b?S.values?.[u]:void 0,V=useDebounce(O=>{b&&S.setFieldValue?.(u,O);},500),{showDropdown:I,dropdownPosition:D,handleKeyDown:N,handleInput:k,handleCommandSelect:F}=useCommandActions({command:a,commands:i,cmd:c,ref:w}),_=useCallback(()=>{let O=w.current;!O||!t||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{O.style.height="auto";let U=O.scrollHeight;if(n){let X=parseInt(n.toString(),10);isNaN(X)||(U=Math.min(U,X));}O.style.height=`${U}px`,O.style.overflowY=n&&U>=parseInt(n.toString(),10)?"auto":"hidden";}));},[t,n]),B=O=>{V(O.currentTarget.value),l?.(O),k(O),_();};return useEffect(()=>{w.current&&u&&E!==void 0&&w.current.value!==String(E)&&(w.current.value=String(E));},[E,u]),useEffect(()=>{_();},[f,p,_]),useEffect(()=>{t&&w.current&&_();},[t,_]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),useEffect(()=>()=>{b&&S.deleteFieldValue?.(u);},[]),jsxs(m,{as:"rel --flex w-full",children:[jsx("textarea",{name:u,className:`--input --textarea --${r||C||q.Medium} flex ${T}`.trim(),style:{...v,resize:s,height:t?"auto":v?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:N,onInput:B,ref:O=>{w.current=O,typeof e=="function"?e(O):e&&(e.current=O);},value:f,defaultValue:p,...h}),d?d({show:I,position:D,commands:i||[],onSelect:F}):i&&i.length>0&&jsx(oi,{visible:I,commands:i,onSelect:F,position:D})]})};si.displayName="Zuz.TextArea";var Of=si;var ii=forwardRef((e,o)=>{let{as:t,value:n,color:r,direction:s,...a}=e,i=useRef(null),[u,l]=useState(n||0);return useImperativeHandle(o,()=>({updateValue(c){u.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),i.current){let d=c.toString().split("");i.current.querySelectorAll(".--wheel-char").forEach((f,p)=>{let y=d[p];if(f instanceof HTMLElement){f.setAttribute("data-value",y);let w=f.querySelector(".--wheel-char-track");w instanceof HTMLElement&&(w.style.setProperty("--v",y),w.offsetWidth);}});}}})),useEffect(()=>{l(n||0);},[n]),jsxs(m,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:i,...a,children:[(u||0).toString().split("").map((c,d)=>isNaN(parseInt(c,10))?jsx(ae,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${d}`):jsx(ae,{"data-value":c,className:`--wheel-char grid ${d>(u||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ae,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":c},children:[jsx(ae,{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((f,p)=>jsx(ae,{children:f},`${d}--${p}`)),jsx(ae,{children:!s||s==="down"?9:0})]})},`wheel-char-${d}`)),r&&jsx(m,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${r}, transparent, transparent, transparent, ${r})`}})]})});ii.displayName="Zuz.TextWheel";var zf=ii;var _r=forwardRef((e,o)=>{let{as:t,meta:n,nodes:r,icons:s,onSelect:a,treeTag:i,selected:u,roots:l,expanded:c,...d}=e,{tag:f,label:p,icon:y,under:w,isHead:x}=n,C=useMemo(()=>l.includes(f),[l]),[v,T]=useState(c),h=()=>{localStorage.setItem(`--tn${i}-${f}`,v?"0":"1"),T(!v);};useEffect(()=>{c||C&&!localStorage.getItem(`--tn${i}-${f}`)?(localStorage.setItem(`--tn${i}-${f}`,"1"),T(true)):T(localStorage.getItem(`--tn${i}-${f}`)=="1");},[]);let S=useMemo(()=>r.filter(g=>g.under==f),[r,f]);return jsxs(m,{className:`--treenode ${C?"--is-root":""} --treenode-${f} flex cols`,children:[jsxs(m,{className:`--node --node-${f} flex aic ${u==f?" --selected":""}`,children:[jsx(K,{skeleton:d.skeleton,onClick:h,className:"--node-aro-btn",disabled:S.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(te,{skeleton:d.skeleton,className:"--node-aro-icon",name:S.length==0?s?.arrowDisabled||s?.arrowClose:v?s?.arrowOpen:s?.arrowClose}):S.length==0?H.chevronBottom:v?H.chevronBottom:H.chevronRight}),jsxs(K,{className:"--node-meta flex aic",onClick:g=>a(f),children:[(s?.nodeOpen&&s?.nodeClose||C&&s?.rootOpen&&s?.rootClose)&&jsx(te,{skeleton:d.skeleton,className:`--node-icon ${C?"--icon-root":""}`,name:y||(v?C&&s?.rootOpen||s.nodeOpen:C&&s?.rootClose||s?.nodeClose)}),jsx($,{className:`--node-label ${C?"--node-label-root":""}`.trim(),skeleton:d.skeleton,children:p})]})]}),v&&S.length>0&&jsx(m,{className:`--sub-node tree-sub-node-${f} flex cols`,children:S.map(g=>jsx(_r,{treeTag:i,selected:u,onSelect:a,icons:s,roots:l,expanded:g.expanded||false,meta:g,nodes:r},`--node-${g.tag}`))})]})});_r.displayName="TreeItem";var ci=_r;var pi=forwardRef((e,o)=>{let{as:t,nodes:n,onNodeSelect:r,tag:s,icons:a,roots:i,selected:u,...l}=e,[c,d]=useState(u);useImperativeHandle(o,()=>({getSelected:()=>c}),[r]);let f=p=>{d(p),r&&r(p);};return useEffect(()=>{c!=u&&d(u);},[u]),jsx(m,{className:"--treeview flex cols",children:n.filter(p=>i.includes(p.tag)).map(p=>jsx(ci,{treeTag:s?`-${s}`:"",selected:c,onSelect:y=>f(y),icons:a,meta:p,roots:i,expanded:p.expanded||false,skeleton:l.skeleton,nodes:n},`--node-${p.tag}`))})});pi.displayName="Zuz.TreeView";var Xf=pi;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
+
export{Me as ALERT,Ur as AVATAR,Nc as Accordion,Dc as ActionBar,$c as Alert,lm as AutoComplete,hm as Avatar,xm as Badge,m as Box,Ls as BubbleAttachmentType,ks as BubbleMediaType,Ns as BubbleStatus,K as Button,Rs as CHART,Ue as CHECKBOX,td as COLORTHEME,xr as Calendar,Zm as Carousel,Ym as Chart,Cr as ChatBubble,rp as ChatList,zt as CheckBox,gp as CodeBlock,kp as ColorScheme,Ko as ContextMenu,Vp as CookiesConsent,_e as Cover,_p as CropShape,Fp as Cropper,Kp as Crumb,sd as DATATYPE,rt as DIALOG,qr as DIALOG_ACTION_POSITION,Re as DRAWER_SIDE,qp as DatePicker,ar as Dialog,cr as Drawer,Xt as FILTER,ot as FORMVALIDATION,ad as FORMVALIDATION_STYLE,Qp as Fab,tu as Fieldset,nu as Filters,Te as Flex,or as Form,iu as Grid,Wo as Group,te as Icon,We as Image,de as Input,Lr as KeyboardKeys,pa as KeysLabelMap,ma as KeysMap,Ft as Label,_o as LayersProvider,Ke as List,yu as MediaPlayer,vu as NetworkStatus,Pt as ORIGIN,od as OriginType,nt as Overlay,rd as PLACEMENTS,Tt as POSITION,ld as PROGRESS,$t as Pagination,go as PaginationStyle,Iu as Password,ku as PinInput,ve as Position,at as ProgressBar,Vo as RADIO,Vu as Radio,Oe as SHEET,Mo as SHEET_ACTION_POSITION,ed as SKELETON,Oo as SLIDER,nd as SORT,we as SPINNER,Ot as ScrollView,Mr as Search,Uu as Select,_t as SelectTabs,yl as Sheet,dt as Slider,ro as SnackPosition,Sn as SnackStyle,oo as SnackType,ae as Span,Ie as Spinner,id as Status,qu as Switch,Q as TRANSITIONS,oe as TRANSITION_CURVES,wf as TabView,cf as Table,uf as TableOfContents,If as Terminal,$ as Text,zf as TextWheel,Of as Textarea,Ei as ThemeProvider,wn as ToastDefaultTitle,ro as ToastPosition,pr as ToastProvider,Sn as ToastStyle,oo as ToastType,Bt as ToolTip,Xf as TreeView,q as Variant,bi as __ZUZJS_UI_VERSION,Rt as animationTransition,Do as buildClassString,jr as buildWithStyles,Id as css,Ho as getAnimationCurve,Ed as getAnimationTransition,Si as getZuzMap,ca as isKeyCombination,Yr as setZuzMap,M as useBase,lc as useContextMenu,pc as useDialog,dc as useDrawer,Se as useFx,yc as useMorph,Dt as usePosition,Tc as useSnack,Go as useToast};
|