@zuzjs/ui 1.0.15 → 1.0.16
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/index.cjs +7 -7
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -6
- package/package.json +1 -1
- /package/dist/{chunk-FKLSYD6G.js → chunk-CRCJOEEP.js} +0 -0
- /package/dist/{chunk-UHTI4JCT.cjs → chunk-HIAJLWFZ.cjs} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
var
|
|
1
|
+
'use strict';var chunkHIAJLWFZ_cjs=require('./chunk-HIAJLWFZ.cjs'),react=require('react'),hooks=require('@zuzjs/hooks'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),core=require('@zuzjs/core'),react$1=require('@zuzjs/core/react'),dateFns=require('date-fns');/* ZuzJS UI CLI */
|
|
2
|
+
var zo={Circle:"CIRCLE",Square:"SQUARE"},Bp={Default:"DEFAULT",Circle:"CIRCLE"},Lp={Light:"light",Dark:"dark",System:"system"},ye={Default:"DEFAULT",Switch:"SWITCH"},Bt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},ee=Bt,Ke=hooks.AnchorType,Mp=Ke,W={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},kp={Asc:"ASC",Desc:"DESC"},Op={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Dp={Dots:"DOTS"},be={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},le={Success:"success",Error:"error",Warning:"warning",Info:"info"},Z={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},U={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Hp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},me={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},De=me,Lt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},_o=Lt,Vp={Bar:"BAR",Ring:"RING"},ct={Default:"range",Text:"number"},Mt={Default:"DEFAULT",Card:"CARD"},pt={Gooey:"gooey"},se={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Fo=Symbol.for("zuz.global.map"),Zo=o=>{globalThis[Fo]=o;},Ds=()=>globalThis[Fo]||{},kt=o=>{let n=Array.isArray(o)?o.join(" "):o;if(!n||typeof n!="string")return "";let e=Ds();return process.env.NODE_ENV==="development"&&Object.keys(e).length===0&&console.warn(`[${chunkHIAJLWFZ_cjs.f}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),chunkHIAJLWFZ_cjs.h(n).filter(Boolean).map(t=>{let s=t.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[u,l,m]=s;return chunkHIAJLWFZ_cjs.h(m).map(i=>{let a=`${l}(${i})`;return e[a]||i}).join(" ")}return e[t]||t}).join(" ")},ru=o=>{let n=Array.isArray(o)?o.join(" "):o;return !n||typeof n!="string"?"":kt(n)},Ko=o=>{let n={};for(let e in o){let r=o[e];if(e.startsWith("--")){n[e]=r;continue}let t=chunkHIAJLWFZ_cjs.e[e]?.toString()??e;if(t==="x"||t==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${chunkHIAJLWFZ_cjs.i.addUnitsSafely(e,r)} ${s[1]??"0px"}`;}else if(t==="y"||t==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${chunkHIAJLWFZ_cjs.i.addUnitsSafely(e,r)}`;}else chunkHIAJLWFZ_cjs.d.includes(t)?n[t]=chunkHIAJLWFZ_cjs.i.addUnitsSafely(e,r):n[t]=r;}return n},Ot=o=>{if(!o)return "linear";switch(o.toUpperCase()){case Z.Bounce:return "var(--bounce)";case Z.Liquid:return "var(--liquid)";case Z.Spring:return "var(--spring)";case Z.EaseInOut:return "ease-in-out";case Z.EaseOutBack:return "ease-out-back";default:return "linear"}},We=(o,n=0)=>{let e={},r={},t=n||20;switch(o){case U.SlideInLeft:case U.SlideInRight:e={"--fx-x":o===U.SlideInLeft?`-${t}px`:`${t}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case U.SlideInTop:case U.SlideInBottom:e={"--fx-y":o===U.SlideInTop?`-${t}px`:`${t}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case U.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case U.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},nu=(o,n,e)=>{let{from:r,to:t}=We(o);return n?{...r,...t}:e?r:t};var Vs=(o,n)=>{let e=react.useRef([]),r=react.useRef(false);return react.useEffect(()=>{o?.when||(r.current=false);},[o?.transition]),react.useEffect(()=>{let t=n?.current;if(!t||!o||!o.clearAtEnd)return;let s=u=>{e.current.includes(u.propertyName)&&o.clearAtEnd===true&&(t.style.transform="",t.style.filter="",e.current.forEach(l=>t.style.removeProperty(l)));};return t.addEventListener("transitionend",s),()=>t.removeEventListener("transitionend",s)},[o,n]),react.useEffect(()=>{if(typeof window>"u"||!n?.current)return;let t=n.current;(o?.scroll||o?.mouse)&&(t.style.willChange="transform",t.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",t.style.transition=`translate 0.1s ${o.curve?Ot(o.curve):"var(--spring)"}`);},[o,n]),react.useMemo(()=>{if(!o)return {style:{}};let {transition:t,from:s,to:u,exit:l,when:m,duration:i=.3,delay:a=0,curve:f}=o,c=m===false&&!r.current;m===false&&r.current;m===true&&(r.current=true);let y={},{from:b,to:d}=t?We(t):{from:s||{},to:u||{}};y=m===void 0?{...b,...d}:m?{...d}:l||b;let v=Ot(f),S=[],h=Ko(y);e.current=Object.keys(h);let w={...h};Object.keys(h).forEach(C=>{let T=C.startsWith("--")?"all":C;S.includes(T)||S.push(`${T} ${i}s ${v} ${a}s`);});return {style:{...w,transition:c?"none":S.join(", "),opacity:c?0:w.opacity,pointerEvents:c?"none":w.pointerEvents}}},[o,o?.when])},ae=Vs;var As=(o,n)=>{let{as:e,fx:r,transition:t,skeleton:s,className:u,propsToRemove:l,style:m,...i}=o||{},a=t?{transition:t,duration:.3}:r||{},{style:f}=ae(a,n),c=kt(e??"");return {style:{...m,...f},className:[u||"",c||"",s?.enabled?"--skeleton":""].join(" ").trim(),rest:{...chunkHIAJLWFZ_cjs.g(i,l?[...l,"skeleton"]:["skeleton"])}}},R=As;var Fs=(o,n={})=>{let{offset:e=8,direction:r="bottom",container:t=null,triggerRef:s=null}=n,u=react.useRef(null),l=react.useCallback(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=m.getBoundingClientRect(),f=i.getBoundingClientRect(),c,g;t?(c=t.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(m).position==="fixed"?g="fixed":g="absolute",g==="fixed"?c={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:c={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),m.style.position!==g&&(m.style.position=g),u.current=g;let d=0,v=0;switch(r){case "top":d=f.top-a.height-e,v=f.left,d<c.top&&f.bottom+a.height+e<=c.bottom&&(d=f.bottom+e);break;case "bottom":d=f.bottom+e,v=f.left,d+a.height>c.bottom&&f.top-a.height-e>=c.top&&(d=f.top-a.height-e);break;case "left":d=f.top,v=f.left-a.width-e,v<c.left&&f.right+a.width+e<=c.right&&(v=f.right+e);break;case "right":d=f.top,v=f.right+e,v+a.width>c.right&&f.left-a.width-e>=c.left&&(v=f.left-a.width-e);break}if(d=Math.max(c.top,Math.min(d,c.bottom-a.height)),v=Math.max(c.left,Math.min(v,c.right-a.width)),u.current==="fixed")m.style.top=`${d}px`,m.style.left=`${v}px`;else {let S;m.offsetParent?S=m.offsetParent.getBoundingClientRect():S={top:0,left:0};let h=d-S.top+window.scrollY,w=v-S.left+window.scrollX;m.style.top=`${h}px`,m.style.left=`${w}px`;}},[o,s,e,r,t]);return react.useEffect(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=new ResizeObserver(l);return a.observe(m),i&&a.observe(i),l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,true),()=>{a.disconnect(),i&&a.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("scroll",l,true);}},[o,r,e,t,s]),{postion:u.current,reposition:l}},Ue=Fs;var Go="(prefers-color-scheme: dark)",Ws=typeof window>"u",Xo=react.createContext(void 0),At=o=>{let n=react.useContext(Xo);if(!n){if(o===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},q=At,Us=({children:o,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...t})=>(r&&Zo(r),jsxRuntime.jsx(Gs,{storageKey:n,forceTheme:e,...t,children:o})),Gs=({children:o,storageKey:n,forceTheme:e,...r})=>{let[t,s]=react.useState(()=>e||qo(n,"system")),[u,l]=react.useState(()=>e||qo(n)),m=c=>(c||(c=window.matchMedia(Go)),c.matches?"dark":"light"),i=react.useCallback(c=>{let g=c=="system"?m():c,y=document.documentElement;y.setAttribute("color-scheme",g),y.style.colorScheme=g,l(g);},[m]),a=react.useCallback(c=>{s(c),localStorage.setItem(n,c),i(c);},[t]),f=react.useCallback(c=>{let g=m(c);l(g),t==="system"&&i("system");},[t]);return react.useEffect(()=>{t==null&&window.localStorage.getItem(n);},[t]),react.useEffect(()=>{window.matchMedia(Go).addEventListener("change",f);},[f]),react.useEffect(()=>{let c=g=>{g.key==n&&(g.newValue?a(g.newValue):a("system"));};return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[a]),react.useEffect(()=>{i(e||t||"system");},[t]),jsxRuntime.jsxs(Xo,{value:{colorScheme:t,resolvedScheme:u,setColorScheme:a,...r},children:[e?null:jsxRuntime.jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
3
3
|
const themes = ['light', 'dark']
|
|
4
4
|
let theme = localStorage.getItem(\`${n}\`) || "system";
|
|
5
5
|
if (theme === "system") {
|
|
6
6
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
7
|
}
|
|
8
8
|
document.documentElement.setAttribute("color-scheme", theme);
|
|
9
|
-
document.documentElement.style.colorScheme = theme;`}}),jsxRuntime.jsx($t,{children:o})]})},qo=(o,n)=>{if(Ws)return;let t;try{t=localStorage.getItem(o)||void 0;}catch{}return t||n};var Yo=({ref:o,...n})=>{let{style:t,...r}=n,{style:e,className:s,rest:u}=R(r);return jsxRuntime.jsx("span",{ref:o,style:t,className:s,...u})};Yo.displayName="Zuz.Span";var Q=Yo;var Jo=react.forwardRef((o,n)=>{let{name:t,pathCount:r,variant:e,color:s,...u}=o,{variant:l}=q(true),{className:c,style:a,rest:i}=R(u);return jsxRuntime.jsx("div",{style:{color:s,...a},className:`icon-${t} --icon --${e||l||U.Small} ${c}`.trim(),ref:n,...i,children:Array(r||0).fill(0).map((f,m)=>jsxRuntime.jsx(Q,{className:`path${m+1}`},`${t}-layer-${m}`))})});Jo.displayName="Zuz.Icon";var X=Jo;var re={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var jo=o=>{let{type:n,variant:t,color:r,...e}=o,{className:s,style:u,rest:l}=R(e),{spinner:c}=q(true),a=()=>{switch(n||c?.type||re.Simple){case re.Simple:return null;case re.Wave:return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(p,{as:"--bar --bar1"}),jsxRuntime.jsx(p,{as:"--bar --bar2"}),jsxRuntime.jsx(p,{as:"--bar --bar3"})]});case re.Roller:return null}};return jsxRuntime.jsx(p,{className:`${s} --spinner --${(n||c?.type||re.Simple).toLowerCase()} --${t||c?.variant||U.Small}`.trim(),style:{...u},...l,children:a()})};jo.displayName="Zuz.Spinner";var ge=jo;var gt={Loading:"loading",Normal:"normal"};var tr=({ref:o,...n})=>{let{reset:t,kind:r="solid",variant:e,icon:s,iconSize:u,children:l,withLabel:c,spinner:a,state:i,disabled:f,...m}=n,{style:g,className:w,rest:y}=R(m),{variant:b}=q(true);return jsxRuntime.jsxs("button",{className:`--button --${r} --${e||b} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${w}`.trim().replace(/\s+/g," "),style:g,ref:o,disabled:i==gt.Loading||n.skeleton?.enabled||f,...y,children:[i==gt.Loading&&jsxRuntime.jsx(ge,{variant:e||b,type:a||re.Simple}),(!i||i==gt.Normal)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(X,{variant:u,name:s}),c===true?jsxRuntime.jsx(Q,{children:l}):l]})]})};tr.displayName="Zuz.Button";var z=tr;var ea={colorSchemeLight:jsxRuntime.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:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.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:jsxRuntime.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:[jsxRuntime.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsxRuntime.jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsxRuntime.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:jsxRuntime.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsxRuntime.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[ie.Info]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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"})}),[ie.Warning]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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"})}),[ie.Error]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[ie.Success]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),plus:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},D=ea;var ta=({title:o="Alert",onClose:n})=>jsxRuntime.jsxs(p,{as:"--head flex aic rel",children:[jsxRuntime.jsx(p,{as:`--${o?"title":"dot"} flex aic jcc rel`,children:o}),jsxRuntime.jsx(z,{onClick:t=>n(),className:"--closer abs center-v",children:D.close})]}),rr=ta;var ra=({action:o,render:n=true,message:t=""})=>jsxRuntime.jsx(p,{as:`--body flex aic rel ${o?"":"--no-action"}`.trim(),children:n?t:null}),nr=ra;var sa=({action:o,actionPosition:n,dialogID:t,variant:r})=>jsxRuntime.jsx(p,{as:`--footer flex aic rel ${n?n==zo.Center?"jcc":"":"jce"}`.trim(),children:o.map((e,s)=>jsxRuntime.jsx(z,{variant:r,onClick:u=>e.handler?e.handler():e.onClick?e.onClick():console.log("onClick Handler missing"),as:"--action",children:e.label},`dialog-${t}-action-${e.key}`))}),ar=sa;var ir=react.forwardRef((o,n)=>{let{children:t,fx:r,when:e,fxDelay:s,fxStep:u,classToIgnore:l,...c}=o,a=q(true),i=hooks.useDelayed(),f=r||a?.group?.fx,m=s||a?.group?.fxDelay,g=u||a?.group?.fxStep,w=l||a?.group?.classToIgnore||"--ignore",y=react.useMemo(()=>f?react$1.addPropsToChildren(t,b=>{if(b.type===react.Fragment)return false;let T=b.props||{},h="fx"in T,d=T.as?Array.isArray(T.as)?T.as.join(" "):T.as:T.className||"",v=typeof d=="string"&&d.includes(w);return !h&&!v},b=>({fx:{...f,delay:(m||0)+b*(g||.1),when:e??(r?.when||i)}})):t,[t,e,i,f]);return jsxRuntime.jsx(p,{className:"--group",ref:n,...c,children:y})});ir.displayName="Zuz.Group";var _t=ir;var mr=react.forwardRef((o,n)=>{let{h:t,html:r,children:e,lines:s,...u}=o,{style:l,className:c,rest:a}=R(u),i=`h${o.h||1}`;return jsxRuntime.jsx(i,{ref:n,style:l,className:c,...a,children:r?jsxRuntime.jsx(Q,{dangerouslySetInnerHTML:{__html:r}}):e})});mr.displayName="Zuz.Text";var H=mr;var pr=react.forwardRef((o,n)=>{let{message:t,spinner:r,spinnerSize:e,color:s,when:u,hideMessage:l,...c}=o,{className:a,style:i,rest:f}=R(c),{spinner:m}=q(true);return "when"in o&&o.when==false?null:jsxRuntime.jsxs(_t,{fx:{transition:G.SlideInBottom,curve:_.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fillx nope nous ${a}`.trim(),style:{...i,backgroundColor:"var(--cover-bg)"},...f,children:[jsxRuntime.jsx(ge,{variant:e||m?.variant||U.Small,type:r||m?.type||re.Simple}),!l&&jsxRuntime.jsx(H,{className:"--label",style:{color:"var(--cover-label)"},children:t||"loading"})]})});pr.displayName="Zuz.Cover";var Ee=pr;var dr=({ref:o,...n})=>{let{index:t,id:r,title:e,message:s,transition:u,curve:l,speed:c,type:a,action:i,actionPosition:f,spinner:m,loadingMessage:g,variant:w,onClose:y,onShow:b,onHide:T,...h}=n,d=react.useMemo(()=>core.uuid(12),[]),[v,N]=react.useState(e||""),[S,C]=react.useState(s||""),[I,M]=react.useState(a||De.Dialog),[L,V]=react.useState(false),[E,Z]=react.useState(true),[K,k]=react.useState(i||null),[P,A]=react.useState(false),{variant:$,spinner:W,dialog:O}=q(true),F=w||O?.variant||$||U.Small,{style:Y,className:te,rest:j}=R(h),ce=react.useRef(null),de=se({when:L,duration:c||O?.speed||.3,delay:O?.delay||.1,transition:u||O?.transition||G.SlideInBottom,curve:l||O?.curve||_.EaseInOut});return react.useEffect(()=>{M(De.Dialog),C(s),N(v),K&&k(K.reduce((it,lt)=>(it.push({...lt,key:lt.key||core.uuid(12)}),it),[])),V(true),setTimeout(()=>b?b():()=>{},1e3);},[]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ne,{when:L}),jsxRuntime.jsxs(p,{as:`--dialog --${(a??De.Default).toLowerCase()} ${L?"--visible":""} ${te} fixed abc`.trim(),style:de.style,...j,ref:ce,children:[jsxRuntime.jsx(Ee,{when:P,spinner:m||O?.spinner||W?.type||re.Simple,message:g||O?.loadingMessage}),jsxRuntime.jsx(rr,{title:v,onClose:()=>{y(r),V(false);}}),jsxRuntime.jsx(nr,{message:S,render:E,action:K}),K&&jsxRuntime.jsx(ar,{variant:F,action:K,dialogID:d,actionPosition:f})]})]})};dr.displayName="Zuz.Dialog";var Ft=dr;var gr=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(gr||{}),hr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var wa=({index:o,id:n,type:t,icon:r,title:e,message:s,duration:u,onClose:l})=>{let c=hooks.useDelayed(),a=hooks.useDelayed(((u||4)-1)*1e3),{toast:i}=q(true),f=se({when:c&&!a,duration:i?.duration||.2,transition:G.SlideInTop,curve:i?.curve||_.EaseInOut});return react.useEffect(()=>{console.log("--expired",a,n),a&&n&&l?.(n);},[a,n]),jsxRuntime.jsxs(p,{as:`--snack --${t} --snack-${n} ${o>2?"--snacked":""} flex aic`,style:f.style,children:[jsxRuntime.jsx(p,{as:"--ico flex aic jcc",fx:{transition:G.ScaleIn,curve:_.Spring,delay:.2,when:c&&!a},children:r?jsxRuntime.jsx(X,{name:r,fx:{transition:G.ScaleIn,curve:_.Spring,delay:.4,duration:.5,when:c&&!a}}):jsxRuntime.jsx(p,{as:"--no-icon",fx:{transition:G.ScaleIn,curve:_.Spring,delay:.4,duration:.5,when:c&&!a}})}),jsxRuntime.jsxs(p,{as:"--meta",children:[jsxRuntime.jsx(H,{as:"--tt",fx:{transition:G.SlideInTop,curve:_.Spring,delay:.3,when:c},children:e||hr[t]}),jsxRuntime.jsx(H,{as:"--tm",fx:{transition:G.SlideInTop,curve:_.Spring,delay:.4,duration:.5,when:c},children:s})]})]})},Zt=wa;var Kt=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(t=>t!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},qe=new Kt;var br=react.forwardRef((o,n)=>{let{speed:t,style:r,...e}=o,{rootRef:s,containerRef:u,thumbY:l,thumbX:c,onScrollY:a,onScrollX:i}=hooks.useScrollbar(t||1),{style:f,className:m,rest:g}=R(e);return react.useEffect(()=>{let w=u.current;if(!w)return;let y=()=>{window.dispatchEvent(new Event("resize"));};return w.addEventListener("scroll",y),()=>w.removeEventListener("scroll",y)},[]),jsxRuntime.jsxs(p,{ref:s,className:m.trim(),as:"--scrollview rel",children:[jsxRuntime.jsx(p,{as:`--scroll-content ${m}`.trim(),ref:u,style:r||{},children:g.children}),jsxRuntime.jsx(p,{as:"--scroll-track --track-y --abs",children:jsxRuntime.jsx(p,{as:"--scroll-thumb --abs",ref:l,onMouseDown:a})}),jsxRuntime.jsx(p,{as:"--scroll-track --track-x --abs",children:jsxRuntime.jsx(p,{as:"--scroll-thumb --abs",ref:c,onMouseDown:i})})]})});br.displayName="Zuz.ScrollView";var Wt=br;var Sr=({ref:o,...n})=>{let{id:t,index:r,from:e,speed:s,children:u,margin:l,animation:c,prerender:a,onClose:i,...f}=n,{drawer:m}=q(true),[g,w]=react.useState(u),[y,b]=react.useState(false),[T,h]=react.useState(a??(m?.prerender||true)),d=()=>{b(false),i?.(t??-1);},{className:v,style:N,rest:S}=R(f),C=react.useMemo(()=>[{keys:[hooks.KeyCode.Escape],callback:()=>{qe.isTop(d)&&d();}}],[y]);hooks.useShortcuts(C),react.useEffect(()=>{w(u);},[u]),react.useEffect(()=>(y?qe.push(d):qe.pop(d),()=>qe.pop(d)),[y]),react.useEffect(()=>{b(true);},[]);let I=e||m?.from||ne.Left,M=react.useMemo(()=>{switch(I){case ne.Left:return {from:{x:"-100vw"},to:{x:0}};case ne.Right:return {from:{x:"100vw"},to:{x:0}};case ne.Top:return {from:{y:"-100vh"},to:{y:0}};case ne.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[e,m?.from]),L=se({from:{...M.from,opacity:0},to:{...M.to,opacity:1},when:y,curve:c||m?.animation||_.EaseInOut,duration:s||m?.speed||.5});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ne,{onClick:V=>{y&&d();},when:y}),jsxRuntime.jsxs(p,{ref:o,"aria-hidden":!y,className:`--drawer flex cols ${v} --${I.toLowerCase()} fixed`,style:{...N,...L.style,"--m":`${l||m?.margin||0}px`},...S,children:[e==ne.Top||e==ne.Bottom?jsxRuntime.jsx(p,{className:"--handle"}):null,jsxRuntime.jsx(Wt,{children:T||y?g:null})]})]})};Sr.displayName="Zuz.Drawer";var Xt=Sr;var Na=o=>{let{label:n,labelColor:t,icon:r,iconColor:e,index:s,className:u,onSelect:l}=o;return n=="-"?jsxRuntime.jsx(p,{className:"--line"}):jsxRuntime.jsxs(z,{reset:true,onClick:c=>l?.(o),className:`--item ${u||""}`.trim(),children:[jsxRuntime.jsx(p,{as:"--icon",children:jsxRuntime.jsx(X,{name:r,className:"--ico",style:e?{color:e}:{}})}),jsxRuntime.jsx(H,{className:"--lbl flex aic",style:t?{color:t}:{},children:n})]})},Cr=Na;var Rr=({ref:o,...n})=>{let{id:t,as:r,fx:e,offsetX:s,offsetY:u,parent:l,event:c,arrow:a,when:i,items:f,header:m,footer:g,origin:w=Ze.TopRight,...y}=n,[b,T]=react.useState(false),[h,d]=react.useState(f||[]),{position:v,targetRef:N,calculatedAnchor:S}=hooks.useAnchorPosition(l?.current,c,{offsetX:s,offsetY:u,preferredAnchor:w}),I=l&&v.top>l.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",M=react.useMemo(()=>{let k=S.toLowerCase();return k.includes("left")?"--arrow-left":k.includes("right")?"--arrow-right":"--arrow-center"},[S]),L=v.top!==0||v.left!==0;react.useEffect(()=>{i&&L?T(true):i||T(false);},[i,L]);let{className:V,style:E,rest:Z}=R(y),K=se({...e?.transition?{transition:e.transition??G.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:e?.curve??_.EaseInOut,duration:e?.duration??.05,when:b&&L});return jsxRuntime.jsxs(p,{ref:N,className:`--contextmenu ${a||l!=null?`--has-arrow ${I} ${M}`:""} abs flex cols ${V}`.trim(),"aria-hidden":!b,style:{...E,...K.style,top:v.top,left:v.left,visibility:L?"visible":"hidden",transformOrigin:S},...Z,children:[typeof m=="function"?react.createElement(m):m,h.map((k,P)=>jsxRuntime.jsx(Cr,{...k,index:P},`context-${k.label.toLowerCase()}-${P}`)),typeof g=="function"?react.createElement(g):g]})};Rr.displayName="Zuz.ContextMenu";var Yt=Rr;var me=react.createContext(null),_a=({ref:o,...n})=>{let r=react.useContext(me)?.depth??0,[e,s]=react.useState(null),[u,l]=react.useState(false),[c,a]=react.useState([]),i=hooks.useDelayed(),f=react.useRef(0),m=()=>++f.current,g=()=>{l(false),setTimeout(()=>s(null),200);};react.useImperativeHandle(o,()=>({add(h){let d=m(),v={id:d,...h};return a(N=>[v,...N.slice(0,20)]),d},openMenu(h){l(false),setTimeout(()=>{s({id:m(),type:"menu",props:h}),l(true);},16);},remove(h){a(d=>d.filter(v=>v.id!==h)),e?.id===h&&g();},clear(){a([]);}})),react.useEffect(()=>{if(e&&u){let h=()=>g();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[e,u,g]);let w=h=>{setTimeout(()=>{a(d=>d.filter(v=>v.id!==h)),e?.id===h&&s(null);},1e3);};if(!i)return null;let y=c.filter(h=>h.type=="dialog").reverse(),b=c.filter(h=>h.type=="drawer").reverse(),T=c.filter(h=>h.type=="toast");return reactDom.createPortal(jsxRuntime.jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[y.length>0&&jsxRuntime.jsx(p,{as:"--zuz-layer-dialogs fixed fill nope",children:y.map((h,d)=>jsxRuntime.jsx(Ft,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),b.length>0&&jsxRuntime.jsx(p,{as:"--zuz-layer-drawers fixed fill nope",children:b.map((h,d)=>jsxRuntime.jsx(Xt,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),T.length>0&&jsxRuntime.jsx(p,{as:"--zuz-layer-toasts fixed fill nope",children:T.map((h,d)=>jsxRuntime.jsx(Zt,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),e&&jsxRuntime.jsx(p,{as:"--zuz-layer-menus fixed fill nope",children:jsxRuntime.jsx(Yt,{onClose:g,when:u,...e.props},`menu-${e.id}`)})]}),document.body)},Fa=({children:o})=>{let n=react.useContext(me),t=n?n.depth+1:0,r=react.useRef(null),e=react.useMemo(()=>({add:s=>r.current?.add(s),openMenu:s=>r.current?.openMenu(s),remove:s=>r.current?.remove(s),clear:()=>r.current?.clear(),depth:t,isSubLayer:!!n}),[n]);return jsxRuntime.jsxs(me.Provider,{value:e,children:[o,jsxRuntime.jsx(_a,{ref:r})]})},$t=Fa;var Ka=()=>{let o=react.useContext(me);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>o.clear(),t=e=>o.remove(e);return {clearAll:n,show:e=>{let s=o.add({type:"dialog",props:{...e,type:De.Dialog}});return {id:s,hide:()=>t(s)}},hide:t}},Wa=Ka;var Ga=()=>{let o=react.useContext(me);if(!o)throw new Error("useToast must be used inside <LayersProvider>");let n=(a,i)=>o.add({type:"toast",props:{...i,type:a}});return {show:(a,i,f,m)=>n("default",{title:a,message:i,icon:f,duration:m}),hide:a=>o.remove(a),success:(a,i,f,m)=>n("success",{title:a,message:i,icon:f,duration:m}),error:(a,i,f,m)=>n("error",{title:a,message:i,icon:f,duration:m}),warn:(a,i,f,m)=>n("warn",{title:a,message:i,icon:f,duration:m}),promise:(a,i,f,m)=>n("promise",{title:a,message:i,icon:f,duration:m}),clearAll:()=>o.clear()}},Jt=Ga;var Xa=()=>{let o=react.useContext(me);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>o.clear(),t=e=>o.remove(e),r=e=>{let s=o.add({type:"drawer",props:e});return {id:s,hide:()=>t(s)}};return {clearAll:n,open:e=>r({children:e}),right:e=>r({children:e,from:ne.Right}),left:e=>r({children:e,from:ne.Left}),top:e=>r({children:e,from:ne.Top}),bottom:e=>r({children:e,from:ne.Bottom}),close:t}},Ya=Xa;var Ja=(o,n,t={})=>{let[r,e]=react.useState(null),[s,u]=react.useState(false),{duration:l=.25,curve:c=_.EaseOutBack,borderRadius:a={from:40,to:24},targetWidth:i=320}=t;return react.useLayoutEffect(()=>{n&&o.current?(e(o.current.getBoundingClientRect()),u(true)):n||u(false);},[n,o]),{style:se({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:a.from},to:{opacity:1,width:i,height:"auto",borderRadius:a.to},curve:c,duration:l,when:s&&n}).style,isMeasured:s,sourceRect:r}},ja=Ja;var ti=()=>{let o=react.useContext(me);if(!o)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,e,s)=>{r.preventDefault(),o.openMenu({event:r,items:e,origin:s});},showMenu:(r,{items:e,origin:s,offsetX:u,offsetY:l,transition:c,curve:a,arrow:i,duration:f,header:m,footer:g})=>{o.openMenu({fx:{transition:c,curve:a,duration:f},parent:r,items:e,origin:s||Ze.TopCenter,offsetX:u,offsetY:l,arrow:i,header:m,footer:g});},hide:o.clear}},oi=ti;var Lr=({ref:o,style:n,...t})=>{let r=react.useRef(null),e=react.useMemo(()=>o&&typeof o!="function"&&o.current?o:r,[o]),{style:s,className:u,rest:l}=R(t,e);return jsxRuntime.jsx("div",{ref:o||r,style:{...s,...n||{}},className:u,...l})};Lr.displayName="Zuz.Box";var p=Lr;var Or=react.forwardRef((o,n)=>{let{title:t,message:r,...e}=o,[s,u]=react.useState(false);return jsxRuntime.jsxs(p,{className:"--accordion flex cols",...e,children:[jsxRuntime.jsxs(z,{onClick:l=>u(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsxRuntime.jsx(H,{className:"--label flex",children:t}),jsxRuntime.jsx(p,{className:"--arrow flex",children:s?D.arrowUp:D.arrowDown})]}),s&&jsxRuntime.jsx(p,{className:"--detail",children:r})]})});Or.displayName="Zuz.Accordion";var li=Or;var mi=({label:o,icon:n,onClick:t,idx:r,selected:e})=>jsxRuntime.jsx(z,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${e?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsxRuntime.jsx(X,{name:n}):n}),Dr=mi;var Hr=react.forwardRef((o,n)=>{let{items:t,name:r,selected:e,position:s,...u}=o,l=react.useRef(null),[c,a]=react.useState(e||t[0].tag||0),i=react.useCallback(({x:b,y:T})=>{if(l.current){let h=l.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${b-h.left}`),document.documentElement.style.setProperty("--tip-y",`${T-h.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),f=react.useCallback(()=>{l.current&&(l.current.removeEventListener("pointerleave",f),l.current.removeEventListener("pointermove",i),document.documentElement.style.setProperty("--tip-s","0"));},[]),m=react.useCallback(()=>{l.current&&(l.current.addEventListener("pointerleave",f),l.current.addEventListener("pointermove",i));},[]);react.useEffect(()=>{l.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((b,T)=>T.label.length>b.length?T.label:b,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),l.current?.addEventListener("pointerenter",m));},[]);let{className:g,style:w,rest:y}=R(u);return jsxRuntime.jsxs(p,{ref:l,style:w,className:[`--actionbar flex aic ${g}`,`${!s||s==ee.Auto?"rel":`--${s}`}`].join(" ").trim(),...y,children:[t.map((b,T)=>jsxRuntime.jsx(Dr,{selected:c===b.tag||e==T,...b,idx:T},`actionbar-action-${b.label.toLowerCase().replace(/\s+/g,"-")}`)),jsxRuntime.jsx(p,{className:"--tip abs",children:jsxRuntime.jsx(p,{className:"--track flex aic",children:t.map(({label:b})=>jsxRuntime.jsx(p,{className:"--lb",children:b},`tool-tip-${b.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Hr.displayName="Zuz.ActionBar";var di=Hr;var Ar=react.forwardRef((o,n)=>{let{type:t,icon:r,title:e,message:s,iconSize:u,...l}=o,{className:c,style:a,rest:i}=R(l);return jsxRuntime.jsxs(p,{className:`--alert --${t||ie.Info} flex aic ${c}`.trim(),style:a,...i,children:[jsxRuntime.jsx(p,{className:`--icon icon-${r||"auto-matic"}`,style:u?{fontSize:u,width:u,height:u}:{},children:!r&&D[t||ie.Info]}),jsxRuntime.jsxs(p,{className:"--meta flex cols",children:[jsxRuntime.jsx(H,{className:`--title ${s?"--tm":""}`,children:e||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsxRuntime.jsx(H,{className:"--message",h:2,children:s})]})]})});Ar.displayName="Zuz.Alert";var xi=Ar;var $r=({ref:o,...n})=>{let{variant:t,numeric:r,onConfirm:e,...s}=n,{style:u,className:l,rest:c}=R(s),{variant:a}=q(true),i=f=>{r&&(f.currentTarget.value=f.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsxRuntime.jsx("input",{className:`--input --${t||a} flex ${l}`.trim(),style:u,onInput:i,onKeyDown:f=>{f.key=="Enter"&&e?.(f.currentTarget.value);},ref:o,...c})};$r.displayName="Zuz.Input";var oe=$r;var _r=o=>{let{meta:n,children:t}=o,r=hooks.useDelayed(),{label:e,icon:s,...u}=react.isValidElement(n)?{}:n,{className:l,style:c,rest:a}=R({...u,...u.animate?{animate:{...u.animate,when:r}}:{}});return react.isValidElement(n)?jsxRuntime.jsx("li",{style:c,className:l,children:n}):jsxRuntime.jsxs("li",{style:c,className:l,...a,children:[t,typeof n=="string"?n:e]})};_r.displayName="Zuz.ListItem";var Fr=_r;var Kr=react.forwardRef((o,n)=>{let{items:t,variant:r,direction:e,seperator:s,ol:u,...l}=o,{className:c,style:a,rest:i}=R(l),f=u==true?"ol":"ul";return react.createElement(f,{className:`--list --${r||U.Small} flex ${e??"cols"} ${c}`.trim(),style:a,ref:n,...i,children:t.map((m,g,w)=>{let y=`${typeof m=="string"?`li-${String(m)}`:react.isValidElement(m)?`li-${m.key}`||`${g}-${core.MD5(m.toString())}`:m.label}-${g}`;return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsx(Fr,{meta:m}),s&&w[g+1]?jsxRuntime.jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${y}`):null]},y)})})});Kr.displayName="Zuz.List";var Le=Kr;var Ur=react.forwardRef((o,n)=>{let{fx:t,action:r,data:e,withStyle:s,onChange:u,...l}=o,{className:c}=R({as:s||""}),{style:a}=R(l),[i,f]=react.useState(false),[m,g]=react.useState(e||[]),w=react.useRef(null),y=react.useRef(null),b=react.useRef(null),T=react.useMemo(()=>l.name||core.uuid(12),[]),[h,d]=react.useState(null),[v,N]=react.useState(null),[S,C]=react.useState([]),M=hooks.useDebounce(P=>{P.target.value==""?(f(false),g([])):r&&P.target.value.trim()!=""&&core.withPost(r,{query:P.target.value}).then(A=>{"items"in A&&core._(A.items).isArray()?(g(A.items),N(P.target.value),C(A.items)):console.error("Action Response should contain items array"),d(null);}).catch(A=>{d(null),g([]);});},250),L=()=>{if(y.current){let P=y.current.getBoundingClientRect(),A=window.innerHeight-P.bottom,$=P.top;if(b.current){let W=b.current;A<W.offsetHeight&&$>A?(W.style.top="auto",W.style.bottom=`${P.height}px`,W.style.maxHeight=`${$-150}px`):(W.style.top=`${P.height+5}px`,W.style.bottom="auto",W.style.maxHeight=`${A-150}px`);}}},V=P=>{if(m.length>0){if((P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),P.stopPropagation()),P.key==="Escape")d(null),f(false),g([]);else if(P.key==="ArrowDown")d(A=>{let $=A===null||A===m.length-1?0:A+1;return Z($),$});else if(P.key==="ArrowUp")d(A=>{let $=A===null||A===0?m.length-1:A-1;return Z($),$});else if(P.key==="Enter"&&h!==null){let A=m[h];w.current&&(w.current.value=A,f(false),g([]));}}},E=P=>{w.current&&(w.current.value=P,f(false),g([]));},Z=P=>{let A=m[P];if(A&&w.current&&(w.current.value=A,w.current.setSelectionRange(A.length,A.length)),b.current){let W=b.current.children[P];W&&W.scrollIntoView({block:"nearest"});}},K=P=>{y.current&&!y.current.contains(P.target)&&(f(false),g([]));},k=()=>{w.current&&w.current.value===v&&(g(S),d(null),L());};return react.useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",K),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",K);}),[]),react.useEffect(()=>{L();},[m]),jsxRuntime.jsxs(p,{style:a,ref:y,className:`--autocomplete --${o.size||U.Small} flex aic rel ${c}`.trim(),children:[jsxRuntime.jsx(oe,{ref:w,autoComplete:"off",onChange:M,onKeyDown:V,onFocus:k,...l}),jsxRuntime.jsx(p,{className:"--arrow rel flex aic jcc",children:m.length>0?D.arrowUp:D.arrowDown}),m.length>0&&jsxRuntime.jsx(Le,{id:T,ref:b,className:"--suggestion-list flex cols abs",items:m.map((P,A)=>({label:P,onClick:$=>{$.preventDefault(),$.stopPropagation(),E(P);},className:h===A?"--current":"",animate:{transition:G.SlideInBottom,curve:_.EaseInOut,delay:core.clamp(.02*A,.02,.5)}}))})]})});Ur.displayName="Zuz.AutoComplete";var Di=Ur;var Gr=react.forwardRef((o,n)=>{let t=react.useRef(null),r=react.useMemo(()=>n&&typeof n!="function"&&n.current?n:t,[n]),{style:e,className:s,rest:u}=R(o,r);return !u.src||u.src==""?null:jsxRuntime.jsx("img",{ref:r,style:e,className:`${s} flex`,...u})});Gr.displayName="Zuz.Image";var Qe=Gr;var qr=react.forwardRef((o,n)=>{let{src:t,variant:r,type:e,crossOrigin:s,referrerPolicy:u,fx:l,as:c,alt:a,color:i,style:f,...m}=o,[g,w,y]=hooks.useImage(t??"",s,u),{className:b,style:T,rest:h}=R({fx:l,as:c});return jsxRuntime.jsx(p,{className:`--avatar --${r||U.Small} --${(e||$o.Circle).toLowerCase()} rel flex aic jcc ${b}`.trim(),style:{background:i||"var(--primary)",...f,...T},...h,children:t?jsxRuntime.jsx(Qe,{src:g,crossOrigin:s,referrerPolicy:u,...m}):jsxRuntime.jsx(H,{className:"--avatar-label",children:(a?a.charAt(0):"A").toUpperCase()})})});qr.displayName="Zuz.Avatar";var Zi=qr;var Ki=({size:o=5,type:n="dead",label:t="",loading:r=false,...e})=>{let{style:s,className:u,rest:l}=R(e);return jsxRuntime.jsxs(p,{style:{width:`${o+4}px`,height:`${o+4}px`,...s},as:`--badge rel flex aic jcc ${u}`.trim(),children:[jsxRuntime.jsx(p,{fx:{transition:G.FadeIn,curve:_.Liquid,duration:.5,when:r},as:"abs abc",children:jsxRuntime.jsx(ge,{})}),jsxRuntime.jsx(p,{style:{width:`${o}px`,height:`${o}px`},as:`--dot --${n}`})]})},Wi=Ki;var sl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>dateFns.format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>dateFns.format(dateFns.addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>dateFns.addDays(new Date,1),getDateFormat:()=>dateFns.format(dateFns.addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let o=new Date,n=o.getDay();return dateFns.addDays(o,(6-n)%7||6)},getDateFormat:()=>{let o=new Date,n=o.getDay();return dateFns.format(dateFns.addDays(o,(6-n)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>dateFns.addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,1),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,2),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,4),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,4)}],al=o=>{let n=new Set;return o.filter(t=>{if(t.label=="Later")return true;let r=t.getDate().toISOString().split("T")[0];return n.has(r)?false:(n.add(r),true)})},Xr=react.forwardRef((o,n)=>{let{defaultValue:t,variant:r,onChange:e,...s}=o,{style:u,className:l,rest:c}=R(s),[a,i]=react.useState(t||new Date),f=dateFns.startOfMonth(a),m=dateFns.endOfMonth(a),g=dateFns.startOfWeek(f),w=dateFns.endOfWeek(m),y=react.useMemo(()=>dateFns.eachDayOfInterval({start:g,end:w}),[g,w]),b=d=>{e?.(d),i(d);},T=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()-1));},h=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()+1));};return jsxRuntime.jsxs(p,{as:`--calendar flex --${r||"sm"} ${l}`,style:u,children:[jsxRuntime.jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:al(sl).map(d=>{let v=d.getDate();return jsxRuntime.jsxs(z,{onClick:()=>b(v),as:["--calendar-quick-option flex aic gap:5"],children:[jsxRuntime.jsx(H,{as:"flex:1",children:d.label}),jsxRuntime.jsx(H,{as:"tar",children:d.getDateFormat()})]},`--dtp-option-label-${d.label}`)})}),jsxRuntime.jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxRuntime.jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsxRuntime.jsx(H,{as:"flex:1 --calendar-cm bold",children:dateFns.format(a,"MMMM yyyy")}),jsxRuntime.jsx(z,{onClick:T,as:"--calendar-chevron",children:D.chevronUpOutline}),jsxRuntime.jsx(z,{onClick:h,as:"--calendar-chevron",children:D.chevronDownOutline})]}),jsxRuntime.jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(d=>jsxRuntime.jsx(H,{as:"--calendar-day",children:d},`--calendar-hd-${d}`)),y.map((d,v)=>{let N=dateFns.isSameMonth(d,a),S=dateFns.isSameDay(d,a),C=dateFns.isToday(d);return jsxRuntime.jsx(z,{disabled:!N,onClick:()=>b(d),as:["--calendar-day --calendar-dd",`${S?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:dateFns.format(d,"d")},`--calendar-day-${v}-${d.getFullYear()}-${d.getMonth()}-${d.getDay()}`)})]})]})]})});Xr.displayName="Zuz.Calendar";var ao=Xr;var Yr=(n=>(n.Line="line",n))(Yr||{});var jr=react.forwardRef((o,n)=>{let{data:t,width:r,height:e,lineColor:s,strokeWidth:u=2,gradientStartColor:l,gradientEndColor:c,animated:a,animDuration:i=2,animDelay:f=0,padding:m=0,type:g,...w}=o,{className:y,style:b,rest:T}=R(w),h=react.useRef(null),d=hooks.useResizeObserver(h.current?.parentElement||h),v=typeof r=="number"?r:d.width,N=typeof e=="number"?e:d.height,S={width:v,height:N},C=react.useId(),{pathD:I,areaPathD:M}=hooks.useLineChart(t,S,m+(u||2)),L=react.useRef(null),V=react.useRef(null),[E,Z]=react.useState(0),[K,k]=react.useState(0);return react.useEffect(()=>{a&&(L.current&&Z(L.current.getTotalLength()),V.current&&k(V.current.getTotalLength()));},[a,I,M,v,N]),jsxRuntime.jsx(p,{ref:h,as:`--chart --${g||"line"}-chart ${y}`.trim(),style:{...b,width:r,height:e},...T,children:v>0&&N>0&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${v} ${N}`,preserveAspectRatio:"xMidYMid meet",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:l}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:c})]})}),jsxRuntime.jsx("path",{ref:V,d:M,fill:`url(#${C})`,stroke:"none",style:a?{strokeDasharray:K,strokeDashoffset:K}:{},children:a&&jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",from:K,to:"0",dur:`${i||2}s`,begin:`${f||0}s`,fill:"freeze"})}),jsxRuntime.jsx("path",{ref:L,d:I,fill:"none",stroke:s,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round",style:a?{strokeDasharray:E,strokeDashoffset:E}:{},children:a&&jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${i||2}s`,begin:`${f||0}s`,fill:"freeze"})})]})})});jr.displayName="Zuz.Chart";var ul=jr;var en=(e=>(e[e.Sending=0]="Sending",e[e.Sent=1]="Sent",e[e.Delivered=2]="Delivered",e[e.Read=3]="Read",e))(en||{}),tn=(a=>(a.Image="img",a.Video="vid",a.Audio="audio",a.Link="link",a.Document="doc",a.Location="loc",a.Contact="contact",a.Event="event",a.Poll="poll",a))(tn||{});var rn=react.forwardRef((o,n)=>{let{progress:t,type:r,animated:e,...s}=o,u=react.useRef(null);react.useImperativeHandle(n,()=>({setProgress:i=>{u.current.style.width=`${i*100}%`;}}),[]),react.useEffect(()=>{t&&u.current&&(e?setTimeout(()=>u.current.style.width=`${t*100}%`,500):u.current.style.width=`${t*100}%`);},[t,u.current]);let{className:l,style:c,rest:a}=R(s);return jsxRuntime.jsx(p,{className:`--progress ${e?"--animated":""} flex rel ${l}`.trim(),style:c,...a,children:jsxRuntime.jsx(p,{ref:u,className:"--bar rel"})})});rn.displayName="Zuz.ProgressBar";var lo=rn;var nn=react.forwardRef((o,n)=>{let{text:t,media:r,side:e="me",status:s=1,timeStamp:u=Date.now(),arrow:l=true,...c}=o,{className:a,style:i,rest:f}=R(c);return jsxRuntime.jsx(p,{className:`--bubble-wrapper flex --bw-${e}`.trim(),children:jsxRuntime.jsxs(p,{className:`--bubble --bubble-${e} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${l==true?"--b-arrow":""} ${a}`.trim(),style:{...i},...f,children:[t&&jsxRuntime.jsx(H,{className:"--bubble-text",children:t}),r?r.type=="audio"?jsxRuntime.jsxs(p,{as:"flex aic --bubble-audio",children:[jsxRuntime.jsx(Q,{className:"--bm-action",children:D.play}),jsxRuntime.jsx(lo,{progress:.7}),jsxRuntime.jsx(H,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsxRuntime.jsx(p,{as:"--bubble-image",children:jsxRuntime.jsx(Qe,{src:r.source})}):null:null,jsxRuntime.jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsxRuntime.jsx(H,{className:"--bubble-stamp tar",children:core.timeSince(u)}),e=="me"&&jsxRuntime.jsx(Q,{className:`--bubble-status --bs-${s}`,children:s==0?D.pending:s==1?D.done:s==2?D.doneAll:D.doneAll})]})]})})});nn.displayName="Zuz.Bubble";var bl=nn;var sn=react.forwardRef((o,n)=>{let{style:t,className:r,rest:e}=R(o);return jsxRuntime.jsx("label",{ref:n,style:t,className:r,...e})});sn.displayName="Zuz.Label";var je=sn;var an=react.forwardRef((o,n)=>{let{name:t,required:r,type:e,value:s,size:u,variant:l,checked:c,onSwitch:a,...i}=o,[f,m]=react.useState(c||false),g=react.useRef(null),{variant:w}=q(true);return react.useImperativeHandle(n,()=>({setChecked(y,b=true){m(y),g.current&&(g.current.checked=y),b&&a&&a(y,s||"cb");},toggle(y=true){g.current&&(g.current.checked=!f),y&&a&&a&&a(!f,s||"cb"),m(!f);}})),jsxRuntime.jsxs(je,{className:`--${(e||be.Default).toLowerCase()} ${!e||e==be.Default?"--checkbox":"--switch"} --${l||w||U.Small} flex aic jcc ${f?"is-checked":""} rel`.trim(),...i,children:[(!e||e==be.Default)&&D.check,jsxRuntime.jsx(oe,{ref:g,defaultChecked:f,value:s||"cb",type:"checkbox",className:"abs",name:t,required:r||false,onChange:y=>{a&&a(y.target.checked,s||"cb"),m(y.target.checked);}})]})});an.displayName="Zuz.CheckBox";var et=an;var El=({ref:o,...n})=>{let{code:t,lang:r="tsx",showLines:e=false,highlight:s="",as:u,fx:l,...c}=n,a=react.useRef(null),{className:i,style:f,rest:m}=R({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:l},a),g=react.useMemo(()=>{let y=new Set;return s.split(",").forEach(b=>{if(b.includes("-")){let[T,h]=b.split("-").map(Number);for(let d=T;d<=h;d++)y.add(d);}else b&&y.add(Number(b));}),y},[s]),w=react.useMemo(()=>{let y=t.split(`
|
|
10
|
-
`);for(;
|
|
11
|
-
${
|
|
9
|
+
document.documentElement.style.colorScheme = theme;`}}),jsxRuntime.jsx($t,{children:o})]})},qo=(o,n)=>{if(Ws)return;let e;try{e=localStorage.getItem(o)||void 0;}catch{}return e||n};var Yo=({ref:o,...n})=>{let{style:e,...r}=n,{style:t,className:s,rest:u}=R(r);return jsxRuntime.jsx("span",{ref:o,style:e,className:s,...u})};Yo.displayName="Zuz.Span";var Q=Yo;var Jo=react.forwardRef((o,n)=>{let{name:e,pathCount:r,variant:t,color:s,...u}=o,{variant:l}=q(true),{className:m,style:i,rest:a}=R(u);return jsxRuntime.jsx("div",{style:{color:s,...i},className:`icon-${e} --icon --${t||l||W.Small} ${m}`.trim(),ref:n,...a,children:Array(r||0).fill(0).map((f,c)=>jsxRuntime.jsx(Q,{className:`path${c+1}`},`${e}-layer-${c}`))})});Jo.displayName="Zuz.Icon";var X=Jo;var re={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var jo=o=>{let{type:n,variant:e,color:r,...t}=o,{className:s,style:u,rest:l}=R(t),{spinner:m}=q(true),i=()=>{switch(n||m?.type||re.Simple){case re.Simple:return null;case re.Wave:return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(p,{as:"--bar --bar1"}),jsxRuntime.jsx(p,{as:"--bar --bar2"}),jsxRuntime.jsx(p,{as:"--bar --bar3"})]});case re.Roller:return null}};return jsxRuntime.jsx(p,{className:`${s} --spinner --${(n||m?.type||re.Simple).toLowerCase()} --${e||m?.variant||W.Small}`.trim(),style:{...u},...l,children:i()})};jo.displayName="Zuz.Spinner";var ge=jo;var dt={Loading:"loading",Normal:"normal"};var tr=({ref:o,...n})=>{let{reset:e,kind:r="solid",variant:t,icon:s,iconSize:u,children:l,withLabel:m,spinner:i,state:a,disabled:f,...c}=n,{style:g,className:y,rest:b}=R(c),{variant:d}=q(true);return jsxRuntime.jsxs("button",{className:`--button --${r} --${t||d} flex aic ${e?"":"jcc"} ${s?"--with-icon":""} ${y}`.trim().replace(/\s+/g," "),style:g,ref:o,disabled:a==dt.Loading||n.skeleton?.enabled||f,...b,children:[a==dt.Loading&&jsxRuntime.jsx(ge,{variant:t||d,type:i||re.Simple}),(!a||a==dt.Normal)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(X,{variant:u,name:s}),m===true?jsxRuntime.jsx(Q,{children:l}):l]})]})};tr.displayName="Zuz.Button";var $=tr;var rr=react.forwardRef((o,n)=>{let{h:e,html:r,children:t,lines:s,...u}=o,{style:l,className:m,rest:i}=R(u),a=`h${o.h||1}`;return jsxRuntime.jsx(a,{ref:n,style:l,className:m,...i,children:r?jsxRuntime.jsx(Q,{dangerouslySetInnerHTML:{__html:r}}):t})});rr.displayName="Zuz.Text";var V=rr;var ta=o=>{let{label:n,labelColor:e,icon:r,iconColor:t,index:s,className:u,onSelect:l}=o;return n=="-"?jsxRuntime.jsx(p,{className:"--line"}):jsxRuntime.jsxs($,{reset:true,onClick:m=>l?.(o),className:`--item ${u||""}`.trim(),children:[jsxRuntime.jsx(p,{as:"--icon",children:jsxRuntime.jsx(X,{name:r,className:"--ico",style:t?{color:t}:{}})}),jsxRuntime.jsx(V,{className:"--lbl flex aic",style:e?{color:e}:{},children:n})]})},nr=ta;var ir=({ref:o,...n})=>{let{id:e,as:r,fx:t,offsetX:s,offsetY:u,parent:l,event:m,arrow:i,when:a,items:f,header:c,footer:g,origin:y=Ke.TopRight,...b}=n,[d,v]=react.useState(false),[S,h]=react.useState(f||[]),{position:w,targetRef:N,calculatedAnchor:C}=hooks.useAnchorPosition(l?.current,m,{offsetX:s,offsetY:u,preferredAnchor:y}),I=l&&w.top>l.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",M=react.useMemo(()=>{let k=C.toLowerCase();return k.includes("left")?"--arrow-left":k.includes("right")?"--arrow-right":"--arrow-center"},[C]),L=w.top!==0||w.left!==0;react.useEffect(()=>{a&&L?v(true):a||v(false);},[a,L]);let{className:D,style:E,rest:F}=R(b),G=ae({...t?.transition?{transition:t.transition??U.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:t?.curve??Z.EaseInOut,duration:t?.duration??.05,when:d&&L});return jsxRuntime.jsxs(p,{ref:N,className:`--contextmenu ${i||l!=null?`--has-arrow ${I} ${M}`:""} abs flex cols ${D}`.trim(),"aria-hidden":!d,style:{...E,...G.style,top:w.top,left:w.left,visibility:L?"visible":"hidden",transformOrigin:C},...F,children:[typeof c=="function"?react.createElement(c):c,S.map((k,P)=>jsxRuntime.jsx(nr,{...k,index:P},`context-${k.label.toLowerCase()}-${P}`)),typeof g=="function"?react.createElement(g):g]})};ir.displayName="Zuz.ContextMenu";var _t=ir;var lr=react.forwardRef((o,n)=>{let{children:e,fx:r,when:t,fxDelay:s,fxStep:u,classToIgnore:l,...m}=o,i=q(true),a=hooks.useDelayed(),f=r||i?.group?.fx,c=s||i?.group?.fxDelay,g=u||i?.group?.fxStep,y=l||i?.group?.classToIgnore||"--ignore",b=react.useMemo(()=>f?react$1.addPropsToChildren(e,d=>{if(d.type===react.Fragment)return false;let v=d.props||{},S="fx"in v,h=v.as?Array.isArray(v.as)?v.as.join(" "):v.as:v.className||"",w=typeof h=="string"&&h.includes(y);return !S&&!w},d=>({fx:{...f,delay:(c||0)+d*(g||.1),when:t??(r?.when||a)}})):e,[e,t,a,f]);return jsxRuntime.jsx(p,{className:"--group",ref:n,...m,children:b})});lr.displayName="Zuz.Group";var Ft=lr;var cr=react.forwardRef((o,n)=>{let{message:e,spinner:r,spinnerSize:t,color:s,when:u,hideMessage:l,...m}=o,{className:i,style:a,rest:f}=R(m),{spinner:c}=q(true);return "when"in o&&o.when==false?null:jsxRuntime.jsxs(Ft,{fx:{transition:U.SlideInBottom,curve:Z.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fillx nope nous ${i}`.trim(),style:{...a,backgroundColor:"var(--cover-bg)"},...f,children:[jsxRuntime.jsx(ge,{variant:t||c?.variant||W.Small,type:r||c?.type||re.Simple}),!l&&jsxRuntime.jsx(V,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});cr.displayName="Zuz.Cover";var Ne=cr;var pr=react.forwardRef((o,n)=>{let{when:e,...r}=o;return jsxRuntime.jsx(p,{ref:n,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:U.FadeIn,when:e},...r})});pr.displayName="Zuz.Overlay";var Ee=pr;var ya=({action:o,render:n=true,message:e=""})=>jsxRuntime.jsx(p,{as:`--body flex aic rel ${o?"":"--no-action"}`.trim(),children:n?e:null}),ur=ya;var wa=({action:o,actionPosition:n,dialogID:e,variant:r})=>jsxRuntime.jsx(p,{as:`--footer flex aic rel ${n?n==_o.Center?"jcc":"":"jce"}`.trim(),children:o.map((t,s)=>jsxRuntime.jsx($,{variant:r,onClick:u=>t.handler?t.handler():t.onClick?t.onClick():console.log("onClick Handler missing"),as:"--action",children:t.label},`dialog-${e}-action-${t.key}`))}),dr=wa;var va={colorSchemeLight:jsxRuntime.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:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.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:jsxRuntime.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:[jsxRuntime.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsxRuntime.jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsxRuntime.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:jsxRuntime.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsxRuntime.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[le.Info]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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"})}),[le.Warning]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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"})}),[le.Error]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[le.Success]:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),plus:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsxRuntime.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:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},O=va;var Sa=({title:o="Alert",onClose:n})=>jsxRuntime.jsxs(p,{as:"--head flex aic rel",children:[jsxRuntime.jsx(p,{as:`--${o?"title":"dot"} flex aic jcc rel`,children:o}),jsxRuntime.jsx($,{onClick:e=>n(),className:"--closer abs center-v",children:O.close})]}),hr=Sa;var wr=({ref:o,...n})=>{let{index:e,id:r,title:t,message:s,transition:u,curve:l,speed:m,type:i,action:a,actionPosition:f,spinner:c,loadingMessage:g,variant:y,inBackground:b,onClose:d,onShow:v,onHide:S,...h}=n,w=react.useMemo(()=>core.uuid(12),[]),[N,C]=react.useState(t||""),[T,I]=react.useState(s||""),[M,L]=react.useState(i||De.Dialog),[D,E]=react.useState(false),[F,G]=react.useState(true),[k,P]=react.useState(a||null),[A,z]=react.useState(false),{variant:K,spinner:H,dialog:_}=q(true),Y=y||_?.variant||K||W.Small,{style:oe,className:j,rest:pe}=R(h),de=react.useRef(null),Nt=ae({when:D,duration:m||_?.speed||.3,delay:_?.delay||.1,transition:u||_?.transition||U.SlideInBottom,curve:l||_?.curve||Z.EaseInOut});react.useEffect(()=>{L(De.Dialog),I(s),C(N),k&&P(k.reduce((Ie,ne)=>(Ie.push({...ne,key:ne.key||core.uuid(12)}),Ie),[])),E(true),setTimeout(()=>v?v():()=>{},1e3);},[]);let lt=react.useMemo(()=>1e4+e*10,[e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ee,{style:{zIndex:lt},when:D}),jsxRuntime.jsxs(p,{as:`--dialog --${(i??De.Default).toLowerCase()} ${D?"--visible":""} ${j} fixed abc`.trim(),style:{...Nt.style,zIndex:lt+1,pointerEvents:b==true?"none":"auto",...b==true?{scale:"0.92",filter:"blur(2px)"}:{}},...pe,ref:de,children:[jsxRuntime.jsx(Ne,{when:A,spinner:c||_?.spinner||H?.type||re.Simple,message:g||_?.loadingMessage}),jsxRuntime.jsx(hr,{title:N,onClose:()=>{E(false),setTimeout(()=>d(r),300);}}),jsxRuntime.jsx(ur,{message:T,render:F,action:k}),k&&jsxRuntime.jsx(dr,{variant:Y,action:k,dialogID:w,actionPosition:f})]})]})};wr.displayName="Zuz.Dialog";var Zt=wr;var Kt=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(e=>e!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},qe=new Kt;var vr=react.forwardRef((o,n)=>{let{speed:e,style:r,...t}=o,{rootRef:s,containerRef:u,thumbY:l,thumbX:m,onScrollY:i,onScrollX:a}=hooks.useScrollbar(e||1),{style:f,className:c,rest:g}=R(t);return react.useEffect(()=>{let y=u.current;if(!y)return;let b=()=>{window.dispatchEvent(new Event("resize"));};return y.addEventListener("scroll",b),()=>y.removeEventListener("scroll",b)},[]),jsxRuntime.jsxs(p,{ref:s,className:c.trim(),as:"--scrollview rel",children:[jsxRuntime.jsx(p,{as:`--scroll-content ${c}`.trim(),ref:u,style:r||{},children:g.children}),jsxRuntime.jsx(p,{as:"--scroll-track --track-y --abs",children:jsxRuntime.jsx(p,{as:"--scroll-thumb --abs",ref:l,onMouseDown:i})}),jsxRuntime.jsx(p,{as:"--scroll-track --track-x --abs",children:jsxRuntime.jsx(p,{as:"--scroll-thumb --abs",ref:m,onMouseDown:a})})]})});vr.displayName="Zuz.ScrollView";var Wt=vr;var Cr=({ref:o,...n})=>{let{id:e,index:r,from:t,speed:s,children:u,margin:l,animation:m,prerender:i,inBackground:a,onClose:f,...c}=n,{drawer:g}=q(true),[y,b]=react.useState(u),[d,v]=react.useState(false),[S,h]=react.useState(i??(g?.prerender||true)),w=()=>{v(false),f?.(e??-1);},{className:N,style:C,rest:T}=R(c),I=react.useMemo(()=>[{keys:[hooks.KeyCode.Escape],callback:()=>{qe.isTop(w)&&w();}}],[d]);hooks.useShortcuts(I),react.useEffect(()=>{b(u);},[u]),react.useEffect(()=>(d?qe.push(w):qe.pop(w),()=>qe.pop(w)),[d]),react.useEffect(()=>{v(true);},[]);let M=t||g?.from||se.Left,L=react.useMemo(()=>{switch(M){case se.Left:return {from:{x:"-100vw"},to:{x:0}};case se.Right:return {from:{x:"100vw"},to:{x:0}};case se.Top:return {from:{y:"-100vh"},to:{y:0}};case se.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[t,g?.from]),D=ae({from:{...L.from,opacity:0},to:{...L.to,opacity:1},when:d,curve:m||g?.animation||Z.EaseInOut,duration:s||g?.speed||.5}),E=react.useMemo(()=>1e4+(r||1)*10,[r]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ee,{onClick:F=>{d&&w();},when:d,style:{zIndex:E}}),jsxRuntime.jsxs(p,{ref:o,"aria-hidden":!d,className:`--drawer flex cols ${N} --${M.toLowerCase()} fixed`,style:{...C,...D.style,"--m":`${l||g?.margin||0}px`,zIndex:E+1,pointerEvents:a==true?"none":"auto",...a==true?{scale:"0.92",filter:"blur(2px)"}:{}},...T,children:[t==se.Top||t==se.Bottom?jsxRuntime.jsx(p,{className:"--handle"}):null,jsxRuntime.jsx(Wt,{children:S||d?y:null})]})]})};Cr.displayName="Zuz.Drawer";var Yt=Cr;var Tr=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Tr||{}),Pr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Da=({index:o,id:n,type:e,icon:r,title:t,message:s,duration:u,onClose:l})=>{let m=hooks.useDelayed(),i=hooks.useDelayed(((u||4)-1)*1e3),{toast:a}=q(true),f=ae({when:m&&!i,duration:a?.duration||.2,transition:U.SlideInTop,curve:a?.curve||Z.EaseInOut});return react.useEffect(()=>{console.log("--expired",i,n),i&&n&&l?.(n);},[i,n]),jsxRuntime.jsxs(p,{as:`--snack --${e} --snack-${n} ${o>2?"--snacked":""} flex aic`,style:f.style,children:[jsxRuntime.jsx(p,{as:"--ico flex aic jcc",fx:{transition:U.ScaleIn,curve:Z.Spring,delay:.2,when:m&&!i},children:r?jsxRuntime.jsx(X,{name:r,fx:{transition:U.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:m&&!i}}):jsxRuntime.jsx(p,{as:"--no-icon",fx:{transition:U.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:m&&!i}})}),jsxRuntime.jsxs(p,{as:"--meta",children:[jsxRuntime.jsx(V,{as:"--tt",fx:{transition:U.SlideInTop,curve:Z.Spring,delay:.3,when:m},children:t||Pr[e]}),jsxRuntime.jsx(V,{as:"--tm",fx:{transition:U.SlideInTop,curve:Z.Spring,delay:.4,duration:.5,when:m},children:s})]})]})},Qt=Da;var ce=react.createContext(null),_a=({ref:o,...n})=>{let r=react.useContext(ce)?.depth??0,[t,s]=react.useState(null),[u,l]=react.useState(false),[m,i]=react.useState([]),a=hooks.useDelayed(),f=react.useRef(0),c=()=>++f.current,g=()=>{l(false),setTimeout(()=>s(null),200);};react.useImperativeHandle(o,()=>({add(d){let v=c(),S={id:v,...d};return i(h=>[...h,S]),v},openMenu(d){l(false),setTimeout(()=>{s({id:c(),type:"menu",props:d}),l(true);},16);},remove(d){i(v=>v.filter(S=>S.id!==d)),t?.id===d&&g();},clear(){i([]);}})),react.useEffect(()=>{if(t&&u){let d=()=>g();return document.addEventListener("click",d),()=>document.removeEventListener("click",d)}},[t,u,g]);let y=d=>{setTimeout(()=>{i(v=>v.filter(S=>S.id!==d)),t?.id===d&&s(null);},1e3);};if(!a)return null;let b=react.useMemo(()=>[...m],[m]);return reactDom.createPortal(jsxRuntime.jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[b.map((d,v)=>{let S=v<b.length-1;return d.type==="dialog"?jsxRuntime.jsx(Zt,{onClose:y,index:v,id:d.id,...d.props,inBackground:S},`layer-${d.type}-${d.id}`):d.type==="drawer"?jsxRuntime.jsx(Yt,{onClose:y,index:v,id:d.id,...d.props,inBackground:S},`layer-${d.type}-${d.id}`):d.type==="toast"?jsxRuntime.jsx(Qt,{onClose:y,index:v,id:d.id,...d.props,inBackground:S},`layer-${d.type}-${d.id}`):null}),t&&jsxRuntime.jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:1001},children:jsxRuntime.jsx(_t,{onClose:g,when:u,...t.props},`menu-${t.id}`)})]}),document.body)},Fa=({children:o})=>{let n=react.useContext(ce),e=n?n.depth+1:0,r=react.useRef(null),t=react.useMemo(()=>({add:s=>r.current?.add(s),openMenu:s=>r.current?.openMenu(s),remove:s=>r.current?.remove(s),clear:()=>r.current?.clear(),depth:e,isSubLayer:!!n}),[n]);return jsxRuntime.jsxs(ce.Provider,{value:t,children:[o,jsxRuntime.jsx(_a,{ref:r})]})},$t=Fa;var Ka=()=>{let o=react.useContext(ce);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>o.clear(),e=t=>o.remove(t);return {clearAll:n,show:t=>{let s=o.add({type:"dialog",props:{...t,type:De.Dialog}});return {id:s,hide:()=>e(s)}},hide:e}},Wa=Ka;var Ga=()=>{let o=react.useContext(ce);if(!o)throw new Error("useToast must be used inside <LayersProvider>");let n=(i,a)=>o.add({type:"toast",props:{...a,type:i}});return {show:(i,a,f,c)=>n("default",{title:i,message:a,icon:f,duration:c}),hide:i=>o.remove(i),success:(i,a,f,c)=>n("success",{title:i,message:a,icon:f,duration:c}),error:(i,a,f,c)=>n("error",{title:i,message:a,icon:f,duration:c}),warn:(i,a,f,c)=>n("warn",{title:i,message:a,icon:f,duration:c}),promise:(i,a,f,c)=>n("promise",{title:i,message:a,icon:f,duration:c}),clearAll:()=>o.clear()}},jt=Ga;var Xa=()=>{let o=react.useContext(ce);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>o.clear(),e=t=>o.remove(t),r=t=>{let s=o.add({type:"drawer",props:t});return {id:s,hide:()=>e(s)}};return {clearAll:n,open:t=>r({children:t}),right:t=>r({children:t,from:se.Right}),left:t=>r({children:t,from:se.Left}),top:t=>r({children:t,from:se.Top}),bottom:t=>r({children:t,from:se.Bottom}),close:e}},Ya=Xa;var Ja=(o,n,e={})=>{let[r,t]=react.useState(null),[s,u]=react.useState(false),{duration:l=.25,curve:m=Z.EaseOutBack,borderRadius:i={from:40,to:24},targetWidth:a=320}=e;return react.useLayoutEffect(()=>{n&&o.current?(t(o.current.getBoundingClientRect()),u(true)):n||u(false);},[n,o]),{style:ae({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:i.from},to:{opacity:1,width:a,height:"auto",borderRadius:i.to},curve:m,duration:l,when:s&&n}).style,isMeasured:s,sourceRect:r}},ja=Ja;var ti=()=>{let o=react.useContext(ce);if(!o)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,t,s)=>{r.preventDefault(),o.openMenu({event:r,items:t,origin:s});},showMenu:(r,{items:t,origin:s,offsetX:u,offsetY:l,transition:m,curve:i,arrow:a,duration:f,header:c,footer:g})=>{o.openMenu({fx:{transition:m,curve:i,duration:f},parent:r,items:t,origin:s||Ke.TopCenter,offsetX:u,offsetY:l,arrow:a,header:c,footer:g});},hide:o.clear}},oi=ti;var kr=({ref:o,style:n,...e})=>{let r=react.useRef(null),t=react.useMemo(()=>o&&typeof o!="function"&&o.current?o:r,[o]),{style:s,className:u,rest:l}=R(e,t);return jsxRuntime.jsx("div",{ref:o||r,style:{...s,...n||{}},className:u,...l})};kr.displayName="Zuz.Box";var p=kr;var Dr=react.forwardRef((o,n)=>{let{title:e,message:r,...t}=o,[s,u]=react.useState(false);return jsxRuntime.jsxs(p,{className:"--accordion flex cols",...t,children:[jsxRuntime.jsxs($,{onClick:l=>u(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsxRuntime.jsx(V,{className:"--label flex",children:e}),jsxRuntime.jsx(p,{className:"--arrow flex",children:s?O.arrowUp:O.arrowDown})]}),s&&jsxRuntime.jsx(p,{className:"--detail",children:r})]})});Dr.displayName="Zuz.Accordion";var li=Dr;var mi=({label:o,icon:n,onClick:e,idx:r,selected:t})=>jsxRuntime.jsx($,{onClick:e,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${t?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsxRuntime.jsx(X,{name:n}):n}),Vr=mi;var Ar=react.forwardRef((o,n)=>{let{items:e,name:r,selected:t,position:s,...u}=o,l=react.useRef(null),[m,i]=react.useState(t||e[0].tag||0),a=react.useCallback(({x:d,y:v})=>{if(l.current){let S=l.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${d-S.left}`),document.documentElement.style.setProperty("--tip-y",`${v-S.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),f=react.useCallback(()=>{l.current&&(l.current.removeEventListener("pointerleave",f),l.current.removeEventListener("pointermove",a),document.documentElement.style.setProperty("--tip-s","0"));},[]),c=react.useCallback(()=>{l.current&&(l.current.addEventListener("pointerleave",f),l.current.addEventListener("pointermove",a));},[]);react.useEffect(()=>{l.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((d,v)=>v.label.length>d.length?v.label:d,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),l.current?.addEventListener("pointerenter",c));},[]);let{className:g,style:y,rest:b}=R(u);return jsxRuntime.jsxs(p,{ref:l,style:y,className:[`--actionbar flex aic ${g}`,`${!s||s==ee.Auto?"rel":`--${s}`}`].join(" ").trim(),...b,children:[e.map((d,v)=>jsxRuntime.jsx(Vr,{selected:m===d.tag||t==v,...d,idx:v},`actionbar-action-${d.label.toLowerCase().replace(/\s+/g,"-")}`)),jsxRuntime.jsx(p,{className:"--tip abs",children:jsxRuntime.jsx(p,{className:"--track flex aic",children:e.map(({label:d})=>jsxRuntime.jsx(p,{className:"--lb",children:d},`tool-tip-${d.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Ar.displayName="Zuz.ActionBar";var di=Ar;var zr=react.forwardRef((o,n)=>{let{type:e,icon:r,title:t,message:s,iconSize:u,...l}=o,{className:m,style:i,rest:a}=R(l);return jsxRuntime.jsxs(p,{className:`--alert --${e||le.Info} flex aic ${m}`.trim(),style:i,...a,children:[jsxRuntime.jsx(p,{className:`--icon icon-${r||"auto-matic"}`,style:u?{fontSize:u,width:u,height:u}:{},children:!r&&O[e||le.Info]}),jsxRuntime.jsxs(p,{className:"--meta flex cols",children:[jsxRuntime.jsx(V,{className:`--title ${s?"--tm":""}`,children:t||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsxRuntime.jsx(V,{className:"--message",h:2,children:s})]})]})});zr.displayName="Zuz.Alert";var xi=zr;var _r=({ref:o,...n})=>{let{variant:e,numeric:r,onConfirm:t,...s}=n,{style:u,className:l,rest:m}=R(s),{variant:i}=q(true),a=f=>{r&&(f.currentTarget.value=f.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsxRuntime.jsx("input",{className:`--input --${e||i} flex ${l}`.trim(),style:u,onInput:a,onKeyDown:f=>{f.key=="Enter"&&t?.(f.currentTarget.value);},ref:o,...m})};_r.displayName="Zuz.Input";var te=_r;var Zr=o=>{let{meta:n,children:e}=o,r=hooks.useDelayed(),{label:t,icon:s,...u}=react.isValidElement(n)?{}:n,{className:l,style:m,rest:i}=R({...u,...u.animate?{animate:{...u.animate,when:r}}:{}});return react.isValidElement(n)?jsxRuntime.jsx("li",{style:m,className:l,children:n}):jsxRuntime.jsxs("li",{style:m,className:l,...i,children:[e,typeof n=="string"?n:t]})};Zr.displayName="Zuz.ListItem";var Kr=Zr;var Ur=react.forwardRef((o,n)=>{let{items:e,variant:r,direction:t,seperator:s,ol:u,...l}=o,{className:m,style:i,rest:a}=R(l),f=u==true?"ol":"ul";return react.createElement(f,{className:`--list --${r||W.Small} flex ${t??"cols"} ${m}`.trim(),style:i,ref:n,...a,children:e.map((c,g,y)=>{let b=`${typeof c=="string"?`li-${String(c)}`:react.isValidElement(c)?`li-${c.key}`||`${g}-${core.MD5(c.toString())}`:c.label}-${g}`;return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsx(Kr,{meta:c}),s&&y[g+1]?jsxRuntime.jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${b}`):null]},b)})})});Ur.displayName="Zuz.List";var Le=Ur;var qr=react.forwardRef((o,n)=>{let{fx:e,action:r,data:t,withStyle:s,onChange:u,...l}=o,{className:m}=R({as:s||""}),{style:i}=R(l),[a,f]=react.useState(false),[c,g]=react.useState(t||[]),y=react.useRef(null),b=react.useRef(null),d=react.useRef(null),v=react.useMemo(()=>l.name||core.uuid(12),[]),[S,h]=react.useState(null),[w,N]=react.useState(null),[C,T]=react.useState([]),M=hooks.useDebounce(P=>{P.target.value==""?(f(false),g([])):r&&P.target.value.trim()!=""&&core.withPost(r,{query:P.target.value}).then(A=>{"items"in A&&core._(A.items).isArray()?(g(A.items),N(P.target.value),T(A.items)):console.error("Action Response should contain items array"),h(null);}).catch(A=>{h(null),g([]);});},250),L=()=>{if(b.current){let P=b.current.getBoundingClientRect(),A=window.innerHeight-P.bottom,z=P.top;if(d.current){let K=d.current;A<K.offsetHeight&&z>A?(K.style.top="auto",K.style.bottom=`${P.height}px`,K.style.maxHeight=`${z-150}px`):(K.style.top=`${P.height+5}px`,K.style.bottom="auto",K.style.maxHeight=`${A-150}px`);}}},D=P=>{if(c.length>0){if((P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),P.stopPropagation()),P.key==="Escape")h(null),f(false),g([]);else if(P.key==="ArrowDown")h(A=>{let z=A===null||A===c.length-1?0:A+1;return F(z),z});else if(P.key==="ArrowUp")h(A=>{let z=A===null||A===0?c.length-1:A-1;return F(z),z});else if(P.key==="Enter"&&S!==null){let A=c[S];y.current&&(y.current.value=A,f(false),g([]));}}},E=P=>{y.current&&(y.current.value=P,f(false),g([]));},F=P=>{let A=c[P];if(A&&y.current&&(y.current.value=A,y.current.setSelectionRange(A.length,A.length)),d.current){let K=d.current.children[P];K&&K.scrollIntoView({block:"nearest"});}},G=P=>{b.current&&!b.current.contains(P.target)&&(f(false),g([]));},k=()=>{y.current&&y.current.value===w&&(g(C),h(null),L());};return react.useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",G),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",G);}),[]),react.useEffect(()=>{L();},[c]),jsxRuntime.jsxs(p,{style:i,ref:b,className:`--autocomplete --${o.size||W.Small} flex aic rel ${m}`.trim(),children:[jsxRuntime.jsx(te,{ref:y,autoComplete:"off",onChange:M,onKeyDown:D,onFocus:k,...l}),jsxRuntime.jsx(p,{className:"--arrow rel flex aic jcc",children:c.length>0?O.arrowUp:O.arrowDown}),c.length>0&&jsxRuntime.jsx(Le,{id:v,ref:d,className:"--suggestion-list flex cols abs",items:c.map((P,A)=>({label:P,onClick:z=>{z.preventDefault(),z.stopPropagation(),E(P);},className:S===A?"--current":"",animate:{transition:U.SlideInBottom,curve:Z.EaseInOut,delay:core.clamp(.02*A,.02,.5)}}))})]})});qr.displayName="Zuz.AutoComplete";var Di=qr;var Xr=react.forwardRef((o,n)=>{let e=react.useRef(null),r=react.useMemo(()=>n&&typeof n!="function"&&n.current?n:e,[n]),{style:t,className:s,rest:u}=R(o,r);return !u.src||u.src==""?null:jsxRuntime.jsx("img",{ref:r,style:t,className:`${s} flex`,...u})});Xr.displayName="Zuz.Image";var Je=Xr;var Yr=react.forwardRef((o,n)=>{let{src:e,variant:r,type:t,crossOrigin:s,referrerPolicy:u,fx:l,as:m,alt:i,color:a,style:f,...c}=o,[g,y,b]=hooks.useImage(e??"",s,u),{className:d,style:v,rest:S}=R({fx:l,as:m});return jsxRuntime.jsx(p,{className:`--avatar --${r||W.Small} --${(t||zo.Circle).toLowerCase()} rel flex aic jcc ${d}`.trim(),style:{background:a||"var(--primary)",...f,...v},...S,children:e?jsxRuntime.jsx(Je,{src:g,crossOrigin:s,referrerPolicy:u,...c}):jsxRuntime.jsx(V,{className:"--avatar-label",children:(i?i.charAt(0):"A").toUpperCase()})})});Yr.displayName="Zuz.Avatar";var Zi=Yr;var Ki=({size:o=5,type:n="dead",label:e="",loading:r=false,...t})=>{let{style:s,className:u,rest:l}=R(t);return jsxRuntime.jsxs(p,{style:{width:`${o+4}px`,height:`${o+4}px`,...s},as:`--badge rel flex aic jcc ${u}`.trim(),children:[jsxRuntime.jsx(p,{fx:{transition:U.FadeIn,curve:Z.Liquid,duration:.5,when:r},as:"abs abc",children:jsxRuntime.jsx(ge,{})}),jsxRuntime.jsx(p,{style:{width:`${o}px`,height:`${o}px`},as:`--dot --${n}`})]})},Wi=Ki;var sl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>dateFns.format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>dateFns.format(dateFns.addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>dateFns.addDays(new Date,1),getDateFormat:()=>dateFns.format(dateFns.addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let o=new Date,n=o.getDay();return dateFns.addDays(o,(6-n)%7||6)},getDateFormat:()=>{let o=new Date,n=o.getDay();return dateFns.format(dateFns.addDays(o,(6-n)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>dateFns.addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,1),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,2),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>dateFns.format(dateFns.addWeeks(new Date,4),"d MMM"),getDate:()=>dateFns.addWeeks(new Date,4)}],al=o=>{let n=new Set;return o.filter(e=>{if(e.label=="Later")return true;let r=e.getDate().toISOString().split("T")[0];return n.has(r)?false:(n.add(r),true)})},Qr=react.forwardRef((o,n)=>{let{defaultValue:e,variant:r,onChange:t,...s}=o,{style:u,className:l,rest:m}=R(s),[i,a]=react.useState(e||new Date),f=dateFns.startOfMonth(i),c=dateFns.endOfMonth(i),g=dateFns.startOfWeek(f),y=dateFns.endOfWeek(c),b=react.useMemo(()=>dateFns.eachDayOfInterval({start:g,end:y}),[g,y]),d=h=>{t?.(h),a(h);},v=()=>{a(h=>new Date(h.getFullYear(),h.getMonth()-1));},S=()=>{a(h=>new Date(h.getFullYear(),h.getMonth()+1));};return jsxRuntime.jsxs(p,{as:`--calendar flex --${r||"sm"} ${l}`,style:u,children:[jsxRuntime.jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:al(sl).map(h=>{let w=h.getDate();return jsxRuntime.jsxs($,{onClick:()=>d(w),as:["--calendar-quick-option flex aic gap:5"],children:[jsxRuntime.jsx(V,{as:"flex:1",children:h.label}),jsxRuntime.jsx(V,{as:"tar",children:h.getDateFormat()})]},`--dtp-option-label-${h.label}`)})}),jsxRuntime.jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxRuntime.jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsxRuntime.jsx(V,{as:"flex:1 --calendar-cm bold",children:dateFns.format(i,"MMMM yyyy")}),jsxRuntime.jsx($,{onClick:v,as:"--calendar-chevron",children:O.chevronUpOutline}),jsxRuntime.jsx($,{onClick:S,as:"--calendar-chevron",children:O.chevronDownOutline})]}),jsxRuntime.jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(h=>jsxRuntime.jsx(V,{as:"--calendar-day",children:h},`--calendar-hd-${h}`)),b.map((h,w)=>{let N=dateFns.isSameMonth(h,i),C=dateFns.isSameDay(h,i),T=dateFns.isToday(h);return jsxRuntime.jsx($,{disabled:!N,onClick:()=>d(h),as:["--calendar-day --calendar-dd",`${C?"--calendar-dd-selected":""}`,`${T?"--calendar-dd-current":""}`],children:dateFns.format(h,"d")},`--calendar-day-${w}-${h.getFullYear()}-${h.getMonth()}-${h.getDay()}`)})]})]})]})});Qr.displayName="Zuz.Calendar";var io=Qr;var Jr=(n=>(n.Line="line",n))(Jr||{});var tn=react.forwardRef((o,n)=>{let{data:e,width:r,height:t,lineColor:s,strokeWidth:u=2,gradientStartColor:l,gradientEndColor:m,animated:i,animDuration:a=2,animDelay:f=0,padding:c=0,type:g,...y}=o,{className:b,style:d,rest:v}=R(y),S=react.useRef(null),h=hooks.useResizeObserver(S.current?.parentElement||S),w=typeof r=="number"?r:h.width,N=typeof t=="number"?t:h.height,C={width:w,height:N},T=react.useId(),{pathD:I,areaPathD:M}=hooks.useLineChart(e,C,c+(u||2)),L=react.useRef(null),D=react.useRef(null),[E,F]=react.useState(0),[G,k]=react.useState(0);return react.useEffect(()=>{i&&(L.current&&F(L.current.getTotalLength()),D.current&&k(D.current.getTotalLength()));},[i,I,M,w,N]),jsxRuntime.jsx(p,{ref:S,as:`--chart --${g||"line"}-chart ${b}`.trim(),style:{...d,width:r,height:t},...v,children:w>0&&N>0&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${w} ${N}`,preserveAspectRatio:"xMidYMid meet",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:T,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:l}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:m})]})}),jsxRuntime.jsx("path",{ref:D,d:M,fill:`url(#${T})`,stroke:"none",style:i?{strokeDasharray:G,strokeDashoffset:G}:{},children:i&&jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",from:G,to:"0",dur:`${a||2}s`,begin:`${f||0}s`,fill:"freeze"})}),jsxRuntime.jsx("path",{ref:L,d:I,fill:"none",stroke:s,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round",style:i?{strokeDasharray:E,strokeDashoffset:E}:{},children:i&&jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",from:E,to:"0",dur:`${a||2}s`,begin:`${f||0}s`,fill:"freeze"})})]})})});tn.displayName="Zuz.Chart";var ul=tn;var on=(t=>(t[t.Sending=0]="Sending",t[t.Sent=1]="Sent",t[t.Delivered=2]="Delivered",t[t.Read=3]="Read",t))(on||{}),rn=(i=>(i.Image="img",i.Video="vid",i.Audio="audio",i.Link="link",i.Document="doc",i.Location="loc",i.Contact="contact",i.Event="event",i.Poll="poll",i))(rn||{});var sn=react.forwardRef((o,n)=>{let{progress:e,type:r,animated:t,...s}=o,u=react.useRef(null);react.useImperativeHandle(n,()=>({setProgress:a=>{u.current.style.width=`${a*100}%`;}}),[]),react.useEffect(()=>{e&&u.current&&(t?setTimeout(()=>u.current.style.width=`${e*100}%`,500):u.current.style.width=`${e*100}%`);},[e,u.current]);let{className:l,style:m,rest:i}=R(s);return jsxRuntime.jsx(p,{className:`--progress ${t?"--animated":""} flex rel ${l}`.trim(),style:m,...i,children:jsxRuntime.jsx(p,{ref:u,className:"--bar rel"})})});sn.displayName="Zuz.ProgressBar";var mo=sn;var an=react.forwardRef((o,n)=>{let{text:e,media:r,side:t="me",status:s=1,timeStamp:u=Date.now(),arrow:l=true,...m}=o,{className:i,style:a,rest:f}=R(m);return jsxRuntime.jsx(p,{className:`--bubble-wrapper flex --bw-${t}`.trim(),children:jsxRuntime.jsxs(p,{className:`--bubble --bubble-${t} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${l==true?"--b-arrow":""} ${i}`.trim(),style:{...a},...f,children:[e&&jsxRuntime.jsx(V,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxRuntime.jsxs(p,{as:"flex aic --bubble-audio",children:[jsxRuntime.jsx(Q,{className:"--bm-action",children:O.play}),jsxRuntime.jsx(mo,{progress:.7}),jsxRuntime.jsx(V,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsxRuntime.jsx(p,{as:"--bubble-image",children:jsxRuntime.jsx(Je,{src:r.source})}):null:null,jsxRuntime.jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsxRuntime.jsx(V,{className:"--bubble-stamp tar",children:core.timeSince(u)}),t=="me"&&jsxRuntime.jsx(Q,{className:`--bubble-status --bs-${s}`,children:s==0?O.pending:s==1?O.done:s==2?O.doneAll:O.doneAll})]})]})})});an.displayName="Zuz.Bubble";var bl=an;var ln=react.forwardRef((o,n)=>{let{style:e,className:r,rest:t}=R(o);return jsxRuntime.jsx("label",{ref:n,style:e,className:r,...t})});ln.displayName="Zuz.Label";var et=ln;var mn=react.forwardRef((o,n)=>{let{name:e,required:r,type:t,value:s,size:u,variant:l,checked:m,onSwitch:i,...a}=o,[f,c]=react.useState(m||false),g=react.useRef(null),{variant:y}=q(true);return react.useImperativeHandle(n,()=>({setChecked(b,d=true){c(b),g.current&&(g.current.checked=b),d&&i&&i(b,s||"cb");},toggle(b=true){g.current&&(g.current.checked=!f),b&&i&&i&&i(!f,s||"cb"),c(!f);}})),jsxRuntime.jsxs(et,{className:`--${(t||ye.Default).toLowerCase()} ${!t||t==ye.Default?"--checkbox":"--switch"} --${l||y||W.Small} flex aic jcc ${f?"is-checked":""} rel`.trim(),...a,children:[(!t||t==ye.Default)&&O.check,jsxRuntime.jsx(te,{ref:g,defaultChecked:f,value:s||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:b=>{i&&i(b.target.checked,s||"cb"),c(b.target.checked);}})]})});mn.displayName="Zuz.CheckBox";var tt=mn;var El=({ref:o,...n})=>{let{code:e,lang:r="tsx",showLines:t=false,highlight:s="",as:u,fx:l,...m}=n,i=react.useRef(null),{className:a,style:f,rest:c}=R({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:l},i),g=react.useMemo(()=>{let b=new Set;return s.split(",").forEach(d=>{if(d.includes("-")){let[v,S]=d.split("-").map(Number);for(let h=v;h<=S;h++)b.add(h);}else d&&b.add(Number(d));}),b},[s]),y=react.useMemo(()=>{let b=e.split(`
|
|
10
|
+
`);for(;b.length>0&&b[0].trim()==="";)b.shift();for(;b.length>0&&b[b.length-1].trim()==="";)b.pop();let d=b[0]?.match(/^\s*/)?.[0].length||0,v=b.map(h=>{let w=h.match(/^\s*/)?.[0].length||0,N=Math.min(w,d);return h.slice(N)}),S=[{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,w)=>{let N=h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),C=g.has(w+1),T=[];S.forEach(I=>{N=N.replace(I.re,M=>{let L=`ZUZ_ID_${T.length}_ZUZ`;return T.push(`<span class="--token-${I.name}">${M}</span>`),L});});for(let I=T.length-1;I>=0;I--)N=N.replace(`ZUZ_ID_${I}_ZUZ`,T[I]);return `<div class="--code-line ${t==true?"--with-ln":""} ${C?"--is-highlighted":""}">
|
|
11
|
+
${t==true?`<span class="--line-number">${w+1}</span>`:""}
|
|
12
12
|
<span class="--line-content">${N||" "}</span>
|
|
13
|
-
</div>`}).join("")},[t,g]);return jsxRuntime.jsx(p,{as:`--code-block ${i}`,style:f,...c,children:jsxRuntime.jsx("pre",{ref:o,children:jsxRuntime.jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:w}})})})},Bl=El;var mn=({onSelect:o,meta:n,selected:t})=>{let r=react.useRef(null),{index:e,icon:s,label:u}=n,[l,c]=react.useState({x:0,width:0}),a=hooks.useDelayed();return react.useLayoutEffect(()=>{if(a&&r.current){let{width:i,x:f}=r.current.getBoundingClientRect();c({x:f,width:i}),t&&o(e,i,f,n,true);}},[a,r.current]),react.useEffect(()=>{t&&o(e,l.width,l.x,n,false);},[t]),jsxRuntime.jsxs(z,{onClick:()=>o(e,l.width,l.x,n,false),ref:r,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[s?typeof s=="string"?jsxRuntime.jsx(X,{name:s,as:"--segment-icon"}):jsxRuntime.jsx(p,{as:"--segment-icon flex aic jcc",children:s}):null,u&&String(u).trim()!=""&&jsxRuntime.jsx(p,{className:"--segment-label",children:u||`Item ${e}`})]})};mn.displayName="SelectTabItem";var cn=mn;var un=react.forwardRef((o,n)=>{let{fx:t,items:r,selected:e,variant:s,onSwitch:u,...l}=o,[c,a]=react.useState(e||0),i=react.useRef(false),f=react.useRef(c),{className:m,style:g,rest:w}=R(l),y=react.useRef(null),b=react.useRef(null),{variant:T}=q(true),h=(d,v,N,S,C)=>{if((C||c!=d&&c!=-2)&&(a(d),f.current=c,i.current&&u?.(S)),y.current){let I=b.current?.getBoundingClientRect();y.current.style.setProperty("--w",`${v}px`),y.current.style.setProperty("--x",`${I?N-I.left:N}px`);}};return react.useImperativeHandle(n,()=>({setSelected:d=>{typeof d=="number"&&d!=c&&a(d);}}),[c]),react.useEffect(()=>{i.current=true;},[]),jsxRuntime.jsxs(p,{ref:b,"data-selected":c,className:`${m} --segmented --${s||T||U.Medium} flex aic rel`,style:g,...w,children:[jsxRuntime.jsx(p,{ref:y,className:"--segment-tab abs"}),r.map((d,v)=>jsxRuntime.jsx(cn,{onSelect:h,selected:c==v,meta:{...d,index:v}},`segment-${d.label}-${v}`))]})});un.displayName="Zuz.SelectTabs";var tt=un;var gn=react.forwardRef((o,n)=>{let{type:t,...r}=o,e=hooks.useDelayed(),{colorScheme:s,setColorScheme:u}=At(),l=react.useCallback(()=>{u(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:c,style:a}=R(r),i=react.useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"system",index:1,label:"",icon:D.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}],[]),f=react.useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !e||f==-1?null:t=="system"||t=="switch"?jsxRuntime.jsx(tt,{className:`--color-scheme --${t}`,onSwitch:({tag:m})=>{u(m);},selected:f,items:i,...r}):jsxRuntime.jsx(z,{onClick:l,style:a,as:`--color-scheme-switch --${r.variant||U.Small} ${c}`.trim(),children:s=="system"?D.colorSchemeSystem:s=="light"?D.colorSchemeLight:D.colorSchemeDark})});gn.displayName="Zuz.ColorScheme";var Wl=gn;var xn=react.forwardRef((o,n)=>{let[t,r]=react.useState("wait"),{title:e,message:s,acceptLabel:u,rejectLabel:l,position:c}=o,a=async i=>{r(i==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(i));};return react.useEffect(()=>{let i=localStorage.getItem("--ccnt");r(i?i=="1"?"accepted":"rejected":"pending");},[]),jsxRuntime.jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:_.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${c||ee.Left} flex cols`,children:[jsxRuntime.jsx(H,{as:"--title",children:e||"This site uses cookies"}),jsxRuntime.jsx(H,{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"}),jsxRuntime.jsxs(p,{as:"--footer flex aic",children:[jsxRuntime.jsx(z,{onClick:i=>a(1),as:"--accept",children:u||"Accept All"}),jsxRuntime.jsx(z,{onClick:i=>a(0),as:"--reject",children:l||"Cancel"})]})]})});xn.displayName="Zuz.CookiesConsent";var Xl=xn;var wn=react.forwardRef((o,n)=>{let {type:t,value:r,min:e,max:s,step:u,onChange:l,roundValue:c,...a}=o,{className:i,style:f,rest:m}=R(a),g=react.useRef(u||.01).current,w=react.useRef(e||0).current,y=react.useRef(s||1).current,b=react.useRef(r||0).current,T=react.useRef(null),h=react.useRef(null),d=react.useRef(null);react.useRef(null);let N=react.useRef(null),S=react.useRef(null),C=($,W,O)=>($-W)/(O-W)*100,I=$=>{if(h.current){let W=parseFloat($.currentTarget.value),O=C(W,parseFloat($.currentTarget.min),parseFloat($.currentTarget.max));h.current.style.setProperty("--value",`${O}`),h.current.setAttribute("data-value",`${W}`),l&&l(c?+W.toFixed(2):W);}},[M,L]=react.useState(false),[V,E]=react.useState(0),[Z,K]=react.useState(0),k=$=>{L(true),E($.clientX),K(h.current?parseFloat(h.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},P=$=>{if(M){let W=$.clientX-V,O=Math.max(w,Math.min(Z+W*g,y));h.current&&(h.current.setAttribute("data-value",`${O}`),S.current.textContent=c?O.toFixed(2):O.toString(),l&&l(c?+O.toFixed(2):O));}},A=()=>{L(false),document.body.style.cursor="auto";};return react.useEffect(()=>{h.current&&h.current.style.setProperty("--value",T.current?`${C(parseFloat(T.current.value),parseFloat(T.current.min),parseFloat(T.current.max))}`:b.toString());},[]),react.useEffect(()=>(M?(document.addEventListener("mousemove",P),document.addEventListener("mouseup",A)):(document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",A);}),[M]),jsxRuntime.jsx(p,{ref:h,"data-value":b||0,className:`--slider --${t||pt.Default} flex rel ${i}`.trim(),style:{...f},children:pt.Text===t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(H,{ref:S,onMouseDown:k,className:"--slider-text",children:b||0})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(p,{ref:N,className:"--slider-track abs fill"}),jsxRuntime.jsx(p,{ref:d,className:"--slider-knob abs"}),jsxRuntime.jsx(oe,{ref:T,onInput:I,className:"abs fill",tabIndex:0,type:t||pt.Default,defaultValue:b||0,step:g,max:y,min:w})]})})});wn.displayName="Zuz.Slider";var fo=wn;var Sn=react.forwardRef((o,n)=>{let{src:t,shape:r,size:e,...s}=o,{style:u,className:l,rest:c}=R(s),{canvasRef:a,crop:i,setScale:f,handleMouseDown:m,handleMouseUp:g,handleMouseMove:w}=hooks.useImageCropper(t,e||200,r||hooks.CropShape.Circle);return react.useImperativeHandle(n,()=>({getCropped(){return i()},setScale(y){f(y);}})),jsxRuntime.jsxs(p,{as:`--cropper --${r||hooks.CropShape.Circle} ${l}`,style:u,...c,children:[jsxRuntime.jsx("canvas",{ref:a,width:e||200,height:e||200,onMouseDown:m,onMouseUp:g,onMouseLeave:g,onMouseMove:w}),jsxRuntime.jsx(p,{as:"--cropper-slider",children:jsxRuntime.jsx(fo,{onChange:y=>f(y),min:0,max:1,step:.01,value:1})})]})});Sn.displayName="Zuz.Cropper";var tm=Sn;var rm=(t=>(t.Circle="circle",t.Square="square",t))(rm||{});var Tn=react.forwardRef((o,n)=>{let{items:t,maxItems:r}=o,e=react.useMemo(()=>{let l=typeof t=="string",c=l?[]:t;return l&&t.split(",").forEach(a=>{c.push({label:a});}),c},[t]),u=react.useMemo(()=>r&&r>0&&e.length>r-1,[e,r])?[...e.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...e.slice(-r)]:e;return jsxRuntime.jsx(Le,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsxRuntime.jsx(p,{as:"--crumb-chevron",children:D.chevronRightOutline}),items:u.map((l,c,a)=>l.ID=="."?jsxRuntime.jsx(p,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsxRuntime.jsx(p,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${c}`))}):jsxRuntime.jsxs(z,{onClick:()=>l.action?.(),className:"--crumb-item",disabled:!a[c+1],children:[l.icon&&jsxRuntime.jsx(X,{as:"--crumb-icon",name:l.icon}),jsxRuntime.jsx(H,{as:"--crumb-label",children:l.label})]},`${l.label.replace(/\s+/g,"-").toLowerCase()}-${c}`))})});Tn.displayName="Zuz.Crumb";var sm=Tn;var In=react.forwardRef((o,n)=>{let{icon:t,defaultValue:r,value:e,size:s,variant:u,numeric:l,type:c,onConfirm:a,...i}=o,[f,m]=react.useState(false),[g,w]=react.useState(r||null),{style:y,className:b,rest:T}=R(i),h=react.useRef(null),d=react.useRef(null),{reposition:v}=We(d,{direction:ee.Bottom,offset:2}),N=C=>{l&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};react.useEffect(()=>{let C=I=>{let M=I.target,L=h.current?.contains(M),V=d.current?.contains(M);!L&&!V&&m(false);};return f&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[f]),react.useEffect(()=>{let C=I=>{I.key==="Escape"&&f&&(m(false),h.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f]);let S=()=>{m(true);};return react.useEffect(()=>{f&&v();},[f,v]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(p,{as:`--date-picker ${u?`--${u}`:""} rel flex aic ${b}`,"data-value":g?g.toISOString():"",children:[t?typeof t=="string"?jsxRuntime.jsx(X,{as:"mr:10 c:#666",name:t}):t:jsxRuntime.jsx(Q,{as:"--date-picker-icon flex aic jcc",children:D.calendar}),jsxRuntime.jsx("input",{ref:h,value:g?dateFns.format(g,"EEE, MMM d YYY hh:mm a"):e||"",className:`--input ${u?`--${u}`:""} flex`.trim(),style:y,onFocus:S,onInput:N,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&a?.(C.currentTarget.value);},...T}),jsxRuntime.jsx(p,{"aria-hidden":!f,ref:d,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:f,duration:.05},as:`--date-picker-chooser flex aic ${u?`--${u}`:""}`,children:jsxRuntime.jsx(ao,{defaultValue:g,onChange:C=>{w(C),m(false);}})})]})})});In.displayName="Zuz.DatePicker";var mm=In;var Nn=react.forwardRef((o,n)=>{let{icon:t,variant:r,position:e}=o;return jsxRuntime.jsx(z,{className:`--fab fixed --${r||U.Large} --${e||"bottomright"}`,children:t||D.plus})});Nn.displayName="Zuz.Fab";var fm=Nn;var En=o=>{let{names:n,strength:t}=o,r={[ut.Gooey]:e=>jsxRuntime.jsxs("filter",{id:"gooey",children:[jsxRuntime.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:e||10,result:"blur"}),jsxRuntime.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"}),jsxRuntime.jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${ut.Gooey}`)};return react.useEffect(()=>{},[n]),jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsxRuntime.jsx("defs",{children:(n||[ut.Gooey]).map(e=>r[e](t))})})};En.displayName="Zuz.Filters";var hm=En;var Pe=null,ae=null,Ln=react.forwardRef((o,n)=>{let{title:t,message:r,transition:e,curve:s,speed:u,type:l,actionPosition:c,spinner:a,loadingMessage:i,onShow:f,onHide:m,...g}=o,{className:w,style:y,rest:b}=R(g),[T,h]=react.useState(t||""),[d,v]=react.useState(r||""),[N,S]=react.useState(null),[C,I]=react.useState(l||le.Default),M=react.useMemo(()=>core.uuid(12),[]),[L,V]=react.useState(false),E=react.useRef(null),Z=react.useRef(null),[K,k]=react.useState(false),[P,A]=react.useState(true),$=react.useRef(null),W=d;react.useImperativeHandle(n,()=>({setLoading(F){k(F);},showDialog(F,Y,te,j){Pe&&(clearTimeout(Pe),ae&&clearTimeout(ae),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ae=setTimeout(()=>{E.current.classList.remove("--wobble"),ae=null;},500)),I(le.Dialog),Y&&v(Y),F&&h(F),te&&S(te.reduce((ce,de)=>(ce.push({...de,key:de.key||core.uuid(12)}),ce),[])),V(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(F,Y,te,j){Pe&&(clearTimeout(Pe),ae&&clearTimeout(ae),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ae=setTimeout(()=>{E.current.classList.remove("--wobble"),ae=null;},500)),I(le.Dialog),v(Y),h(F),te&&S(te.reduce((ce,de)=>(ce.push({...de,key:de.key||core.uuid(12)}),ce),[])),V(true),setTimeout(()=>j?j():()=>{},1e3);},error(F,Y){this.show(F,Y,le.Error);},warn(F,Y){this.show(F,Y,le.Warn);},success(F,Y){this.show(F,Y,le.Success);},show(F,Y,te){Pe&&(clearTimeout(Pe),ae&&clearTimeout(ae),Z.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${Z.current} scale(.9)`.trim();},50),ae=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=Z.current||"",ae=null;},500)),Pe=setTimeout(()=>{V(false),Pe=null,ae=null;},(Y||4)*1e3),I(te||le.Default),v(F),V(true),f?.();},hide(){V(false),m?.();}}));let O=react.useMemo(()=>{let F={when:L,duration:u||.3,delay:.1};if(C==le.Dialog){if(e){let{from:Y,to:te}=Ke(e,20);return {from:Y,to:te,curve:s||_.EaseInOut,...F}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:_.Spring,...F}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:_.Spring,...F}},[L,C]);return react.useEffect(()=>{$.current&&clearTimeout($.current),L?A(true):$.current=setTimeout(()=>A(false),1e3);},[L]),C==le.Dialog?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ne,{when:L}),jsxRuntime.jsxs(p,{className:`--sheet --sheet-${C.toLowerCase()} ${L?"is-visible":""} ${w} fixed`.trim(),style:y,fx:O,...b,ref:E,children:[jsxRuntime.jsx(Ee,{when:K,spinner:a,message:i}),jsxRuntime.jsxs(p,{className:"--head flex aic rel",children:[jsxRuntime.jsx(p,{className:`--${T?"title":"dot"} flex aic rel`,children:T||""}),jsxRuntime.jsx(z,{onClick:F=>V(false),className:"--closer abs",children:"\xD7"})]}),jsxRuntime.jsx(p,{className:`--body flex aic rel ${N?"":"--no-action"}`.trim(),children:P?W:null}),N&&jsxRuntime.jsx(p,{className:`--footer flex aic rel ${c?c==Lt.Center?"jcc":"":"jce"}`.trim(),children:N.map((F,Y)=>jsxRuntime.jsx(z,{onClick:te=>F.handler?F.handler():F.onClick?F.onClick():console.log("onClick Handler missing"),className:"--action",children:F.label},`sheet-${M}-action-${F.key}`))})]})]}):jsxRuntime.jsx(p,{className:`--sheet --sheet-${C.toLowerCase()} ${w} abs`.trim(),style:y,...b,fx:O,ref:E,children:L?d:null})}),rt=o=>typeof o=="object"&&o!=null&&"setLoading"in o&&"success"in o&&"error"in o;Ln.displayName="Zuz.Sheet";var vm=Ln;var Mn=({ref:o,...n})=>{let{name:t,cover:r,spinner:e,errors:s,action:u,children:l,withData:c,beforeSubmit:a,onSubmit:i,onError:f,onSuccess:m,resetOnSuccess:g,...w}=n,{className:y,style:b,rest:T}=R(w),[h,d]=react.useState(false),v=react.useRef(null),N=react.useRef(null),S=react.useRef(null),C=Jt(),I=react.useCallback(P=>v.current?v.current.querySelectorAll(P):[],[v.current]),M=P=>({name:P.name||P.getAttribute("name")||P.getAttribute("data-name"),required:P.required?true:P.getAttribute("data-required")?P.getAttribute("data-required")=="true":false,with:P.with||P.getAttribute("with")}),L=P=>{let A=[];return P.querySelectorAll(".--input").forEach($=>{A.push($.value);}),A.join("")},V=react.useCallback(P=>{let{required:$}=M(P);if($){if(P.type=="checkbox"&&P.checked==false)return false;if(P.classList.contains("--otp")){let O=L(P);if(O==""||O.length<parseInt(P.getAttribute("data-size")))return false}if(P.classList.contains("--select")&&P.querySelector("button.--selected").dataset.value=="-1"||P.value=="")return false}if(P.getAttribute("with")){let O=P.getAttribute("with");switch(O.includes("@")&&(O=O.split("@")[0],O=="match"&&(O=we.MatchField)),O.toUpperCase()){case we.IPV4:return core._(P.value).isIPv4();case we.IPV6:return core._(P.value).isIPv6();case we.Email:return core._(P.value).isEmail();case we.Uri:try{return new URL(P.value),!0}catch{return false}case we.Password:return console.log("Add FORMVALIDATION.Password"),false;case we.MatchField:let[F,Y,te]=P.getAttribute("with").split("@"),j=document.querySelector(`[name=${Y.trim()}]`);if(!j)return false;switch(te||"direct-match"){case "if-not-empty":if(j&&!core._(j.value).isEmpty()&&j.value!=P.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&P.classList.contains("--otp")&&L(j)!=L(P))return false;if(j&&j.value!=P.value)return false;break}break;default:return true}}return true},[v.current]),E=react.useCallback(()=>{let P={},A={},$=null,W=null;if(Array.from(I("[name]")).forEach(O=>{let{name:F,required:Y,with:te}=M(O),j=true;(Y||te)&&(j=V(O)),P[F]={valid:j,value:O.type=="checkbox"?O.checked==true?O.value:false:O.classList.contains("--otp")?L(O):O.classList.contains("--select")?O.querySelector("button.--selected").dataset.value:O.value},A[F]=O.type=="checkbox"?O.checked==true:O.classList.contains("--otp")?L(O):O.classList.contains("--select")?O.querySelector("button.--selected").dataset.value:O.value,j?O.classList.remove("input-with-error"):($==null&&s&&($=O,W=s[F]),O.classList.add("input-with-error"));}),$){let O=$;if(O.classList.contains("--otp"))for(let F of Array.from(O.querySelectorAll(".--input"))){let Y=F;if(Y.value==""){Y.focus();break}}else O.focus();}return {error:$!=null,errorMsg:W||"Fix errors to continue...",data:P,payload:A}},[v.current]),Z=react.useCallback(()=>{let{error:P,errorMsg:A,payload:$}=E();P?C.error(A):u?react.startTransition(async()=>{a&&a($),rt(r)?r.setLoading(true):d(true),C.clearAll(),core.withPost(u,{...$,...c||{}}).then(W=>{let O=W;rt(r)?r.setLoading(false):d(false),g&&Array.from(I("[name]")).forEach(F=>{F instanceof HTMLInputElement&&(F.value="");}),m?m(O):(C.clearAll(),C.success(O.message||"Redirecting..."));}).catch(W=>{rt(r)?r.setLoading(false):d(false),f?f(W):C.error(W.message||"We cannot process your request at this time.");});}):i&&i($);},[u,N.current,v.current]),K=react.useCallback(()=>{let P=I("[type=submit]");!P||P.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):P.forEach(A=>{A.addEventListener("click",Z);});},[v.current]),k=react.useMemo(()=>react$1.addPropsToChildren(l,P=>P.props.type=="submit",P=>({ref:S})),[l]);return react.useImperativeHandle(o,()=>({setLoading(P){if(P){N.current?.hide();try{C.clearAll();}catch{}}d(P);},showError(P){typeof P=="string"?C.error(P):N.current.error(P,4);},hideError(){N.current.hide();try{C.clearAll();}catch{}},init(){K();},submit(){Z();}})),react.useEffect(K,[]),jsxRuntime.jsxs(p,{ref:v,style:b,className:`--form flex rel ${y} ${t?`--form-${t.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!rt(r)&&jsxRuntime.jsx(Ee,{message:r?r.message||void 0:"working",spinner:e,color:r&&"color"in r?r.color:"#ffffff",when:h}),k]})};Mn.displayName="Zuz.Form";var Bm=Mn;var On=o=>{let {ref:n,cols:t,rows:r,gap:e,gapX:s,gapY:u,align:l,justify:c,inline:a,flow:i,autoCols:f,autoRows:m,template:g,...w}=o;react.useRef(null);let {className:b,style:T,rest:h}=R(w),d=N=>typeof N=="number"?`repeat(${N}, 1fr)`:N,v={display:a?"inline-grid":"grid",gridTemplateColumns:d(t),gridTemplateRows:d(r),gap:e,columnGap:s,rowGap:u,alignItems:l,justifyContent:c==="between"?"space-between":c==="around"?"space-around":c,gridAutoFlow:i,gridAutoColumns:f,gridAutoRows:m,gridTemplateAreas:g,...T};return jsxRuntime.jsx(p,{ref:n,as:`--grid ${b}`.trim(),style:v,...h})};On.displayName="Zuz.Grid";var km=On;var kn=o=>typeof o=="string"&&o.includes("+"),Dn={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"},Hn={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 An=react.forwardRef(({children:o,keys:n,variant:t},r)=>{let e=react.useMemo(()=>{if(kn(n)){let s=null;return {keys:String(n).split("+").reduce((l,c,a,i)=>(i[a+1]?l.push(c):s=c.toUpperCase(),l),[]),children:s}}return {keys:n,children:String(o).toUpperCase()}},[n]);return jsxRuntime.jsxs(p,{as:`--keyboard-keys --${t||U.Small} flex aic`,children:[(Array.isArray(e.keys)?e.keys:[e.keys]).map(s=>jsxRuntime.jsx("abbr",{title:Hn[s],children:Dn[s]},s)),jsxRuntime.jsx(Q,{children:e?.children??o})]})});An.displayName="Zuz.KeyboardKeys";var vo=An;var zn=react.forwardRef((o,n)=>{let t=hooks.useNetworkStatus(),{onlineMessage:r,offlineMessage:e,variant:s}=o;return jsxRuntime.jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:_.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||U.Small} fixed flex`,children:[jsxRuntime.jsx(p,{className:"--ico",children:t?D[ie.Success]:D[ie.Error]}),jsxRuntime.jsx(H,{as:"--message",children:t?r||"internet connection restored :)":e||"no internet connection"})]})});zn.displayName="Zuz.NetWorkManager";var _m=zn;var So=(t=>(t.Table="table",t.Gooey="gooey",t))(So||{});var Zn=react.forwardRef((o,n)=>{let{itemCount:t,itemsPerPage:r,startPage:e,pageRange:s,paginationStyle:u,breakLabel:l,prevLabel:c,nextLabel:a,hash:i,loading:f,seperator:m,renderOnZeroPageCount:g,onPageChange:w,...y}=o,b=react.useMemo(()=>core.toHash(core.numberInRange(4,8)),[]),T=react.useCallback(E=>`${core.toHash(E,i||6,b)}${m||""}${b}`,[b]),h=react.useMemo(()=>l||"...",[l]),[d,v]=react.useState({id:i?e?typeof e=="number"?T(e):e:1:e||1,label:e||1}),{style:N,className:S,rest:C}=R(y),I=react.useCallback(E=>typeof E=="number"?E:+E.label,[]);if(!t)throw new Error('"itemCount" prop is required');let M=react.useMemo(()=>Math.ceil(t/r),[t,r]),L=react.useMemo(()=>{let E=[],Z=Math.max(I(d)-(s||2),1),K=Math.min(I(d)+(s||2),M);Z>1&&E.push({id:i?T(1):1,label:1}),Z>2&&E.push({id:-1,label:h});for(let k=Z;k<=K;k++)E.push({id:i?T(k):k,label:k});return K<M-1&&E.push({id:-1,label:h}),K<M&&E.push({id:i?T(M):M,label:M}),E},[d]),V=react.useCallback(E=>{let Z=E;+Z.label<1||+Z.label>M||(v(Z),w?.(Z));},[t,r,d]);return L.length<=1&&(g??false)===false?null:jsxRuntime.jsxs(p,{ref:n,as:`--pagination --pgt-${u||"table"} flex aic w:100% jcc ${S}`,children:[jsxRuntime.jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:h}]).map((E,Z,K)=>jsxRuntime.jsx(z,{disabled:E.id==-1||I(d)==+E.label,className:(typeof E=="string"?E:E.label)==I(d)?"--current-page":"",onClick:k=>V(E),children:typeof E=="string"?E:E.label},`--pg-${Z}-${E.id}`))}),jsxRuntime.jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(I(d)-1)*r+1} - `,`${Math.min(I(d)*r,t)} of ${t} items`].join(" ")}),jsxRuntime.jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsxRuntime.jsx(z,{disabled:I(d)<=1,onClick:E=>V({id:i?T(I(d)-1):I(d)-1,label:I(d)-1}),children:D.chevronLeftOutline}),jsxRuntime.jsx(z,{disabled:L.length<=1||I(d)==I(L[L.length-1]),onClick:E=>V({id:i?T(I(d)+1):I(d)+1,label:I(d)+1}),children:D.chevronRightOutline})]})]})});Zn.displayName="Zuz.Pagination";var To=Zn;var Wn=react.forwardRef((o,n)=>{let{strenthMeter:t,onChange:r,...e}=o;"type"in e&&delete e.type;let{style:s,className:u,rest:l}=R(e),[c,a]=react.useState(false),[i,f]=react.useState(""),m=react.useMemo(()=>core.checkPasswordStrength(i),[i]),g=hooks.useDebounce(w=>{t&&f(w.target.value),r&&r(w);},100);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{as:"w:100% flex cols",children:[jsxRuntime.jsxs(p,{style:s,className:"--password flex aic rel",children:[jsxRuntime.jsx(oe,{ref:n,type:c?"text":"password",className:u,onChange:g,...l}),jsxRuntime.jsx(z,{tabIndex:-1,onClick:()=>a(w=>!w),className:"--toggle flex aic jcc abs",children:c?D.eye:D.eyeSlash})]}),t&&jsxRuntime.jsxs(p,{as:`flex aic --password-meter --pb-score-${m.score}`,style:s,children:[jsxRuntime.jsxs(p,{as:"--password-bars flex aic",children:[jsxRuntime.jsx(p,{as:`--pbar ${m.score>=1?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${m.score>=2?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${m.score>=3?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${m.score>=4?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${m.score>=5?"--pb-on":""}`.trim()})]}),jsxRuntime.jsx(H,{as:"--password-meter-label","aria-hidden":true,children:m.result})]})]})});Wn.displayName="Zuz.Password";var Qm=Wn;var Gn=react.forwardRef((o,n)=>{let{size:t,length:r,mask:e,...s}=o,u=react.useRef([]),l="pinput",c=false,a={};"with"in s&&(a={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(l=s.name,delete s.name),"required"in s&&(c=true,delete s.required);let{style:i}=R(s),f=m=>{let g=m.currentTarget,w=u.current[parseInt(g.dataset.index)+1],y=u.current[parseInt(g.dataset.index)-1];g.value.length===1&&w?w.focus():g.value.length===0&&y&&y.focus();};return react.useEffect(()=>{u.current=u.current.slice(0,t||r);},[t||r]),jsxRuntime.jsx(p,{name:l,style:i,className:"--otp flex aic rel","data-required":c,"data-size":t||r||4,...a,children:Array(t||r||4).fill(1).map((m,g)=>jsxRuntime.jsx(oe,{autoComplete:"new-password","data-index":g,ref:w=>{u.current[g]=w;},numeric:true,onChange:f,maxLength:1,placeholder:e?"\xB7":"0",type:e?"password":"text",...s},`pin-${g}`))})});Gn.displayName="Zuz.PinInput";var tc=Gn;var qn=react.forwardRef((o,n)=>{let{children:t,className:r,name:e,required:s,type:u,value:l,variant:c,checked:a,onSwitch:i,...f}=o,[m,g]=react.useState(a||false),{variant:w}=q(true),y=react.useRef(null);return jsxRuntime.jsxs(je,{className:`${r} --${(u||Mt.Default).toLowerCase()} --radio${!u||u==Mt.Default?"":"card"} --${c||w||U.Small} flex aic rel`.trim(),...f,children:[jsxRuntime.jsx(oe,{ref:y,defaultChecked:m,value:l||"rd",type:"radio",className:"abs",name:e,required:s||false,onChange:b=>{i&&i(b.target.checked,l||"cb"),g(b.target.checked);}}),jsxRuntime.jsx(p,{className:"--dot rel",children:jsxRuntime.jsx(p,{className:"--rod abs abc"})}),jsxRuntime.jsx(p,{className:"--value",children:t})]})});qn.displayName="Zuz.Radio";var sc=qn;var Xn=react.forwardRef((o,n)=>{let{fx:t,withStyle:r,as:e,reverse:s=false,searchIcon:u=D.search,hideSearchIcon:l=false,clearIcon:c=D.close,hideClearIcon:a=false,onChange:i,onClear:f,...m}=o,{style:g,className:w}=R({as:o.as}),[y,b]=react.useState(""),{variant:T}=q(true),h=react.useRef(null),d=react.useMemo(()=>jsxRuntime.jsx(z,{tabIndex:-1,onClick:S=>N(),className:"--send flex aic jcc",variant:o.variant||U.Small,children:y!==""?!a&&(typeof c=="string"?jsxRuntime.jsx(X,{name:c,as:"--search-action"}):c):!l&&(typeof u=="string"?jsxRuntime.jsx(X,{name:u,as:"--search-action"}):u)}),[s,u,a,c,l]);"type"in o&&delete o.type;let v=S=>{b(S.target.value),i?.(S.target.value);},N=S=>{y.trim()!==""&&(b(""),i?.(""),h.current&&(h.current.value="",o.onConfirm?.("")));};return react.useImperativeHandle(n,()=>({focus:()=>h.current?.focus(),value:()=>h.current?.value})),react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{style:g,className:`--search ${s?"--search-rev":""} --${o.variant||T||U.Medium} flex aic ${typeof o.as=="string"&&o.as.includes("abs")?"":"rel"} ${w}`.trim(),children:[s&&d,jsxRuntime.jsx(oe,{ref:h,onChange:v,...m}),o.shortcut&&jsxRuntime.jsx(vo,{keys:o.shortcut,as:"abs"}),!s&&d]})});Xn.displayName="Zuz.Search";var fc=Xn;var Qn=({value:o,updateValue:n,o:t})=>jsxRuntime.jsxs(z,{onClick:r=>n(t),as:"--select-option-item",className:o&&(typeof t=="string"?t:t.value)==(typeof o=="string"?o:o.value)?"selected":"",children:[t.icon&&jsxRuntime.jsx(X,{name:t.icon,as:`--select-option-icon --icon-${t.value}`,color:t.iconColor||void 0}),jsxRuntime.jsx(H,{suppressHydrationWarning:true,children:typeof t=="string"?t:t.label})]});Qn.displayName="Option";var Jn=Qn;var es=({ref:o,...n})=>{let{selected:t,options:r,label:e,name:s,variant:u,search:l,searchPlaceholder:c,maxHeight:a,arrowDownIcon:i=D.arrowDown,arrowUpIcon:f=D.arrowUp,onChange:m,...g}=n,[w,y]=react.useState(t?typeof t=="string"?r.find(k=>k.value===t):t:r[0]),[b,T]=react.useState(false),[h,d]=react.useState(null),v=react.useRef(null),N=react.useRef(null),S=react.useRef(null),C=react.useId(),I=react.useMemo(()=>s||C,[]),{reposition:M}=We(S,{direction:Bt.Bottom,offset:2}),{variant:L}=q(true),{className:V,style:E,rest:Z}=R(g),K=k=>{y(k),T(false),m&&m(k);};return react.useImperativeHandle(o,()=>({setSelected:k=>{if(typeof k=="string"){let P=r.find(A=>A.value===k);P&&y(P);}else y(k);},getValue:()=>w||null})),react.useEffect(()=>{if(!b)return;let k=()=>{M();};return window.addEventListener("scroll",k,true),window.addEventListener("resize",M),()=>{window.removeEventListener("scroll",M,true),window.removeEventListener("resize",M);}},[b,M]),react.useEffect(()=>{if(!b){N.current&&(N.current.value=""),d(null);return}N.current?.focus(),M();let k=A=>{S.current&&!S.current.contains(A.target)&&T(false);},P=setTimeout(()=>{document.addEventListener("click",k);},0);return ()=>{clearTimeout(P),document.removeEventListener("click",k);}},[b,M]),jsxRuntime.jsxs(p,{className:`--select --${u||L} ${s?`--${s}`:""} rel`.trim(),name:I,children:[jsxRuntime.jsxs(z,{ref:v,"data-value":w?typeof w=="string"?w:w.value:w||"-1",className:`--selected flex aic rel ${V}`.trim(),withLabel:false,style:E,onClick:k=>{k.stopPropagation(),T(P=>!P);},...Z,children:[jsxRuntime.jsx(H,{className:"--label",children:w?typeof w=="string"?w:w.label:e||"Choose"}),jsxRuntime.jsx(p,{className:"--svg-arrow rel flex aic jcc",children:b?typeof f=="string"?jsxRuntime.jsx(X,{name:f,as:"--search-action"}):f:typeof i=="string"?jsxRuntime.jsx(X,{name:i,as:"--search-action"}):i})]}),jsxRuntime.jsxs(p,{id:I,className:"--options-list flex cols abs","aria-hidden":!b,style:{maxHeight:a||"auto"},ref:S,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:b,duration:.05},children:[l&&jsxRuntime.jsx(p,{as:"--select-search --sticky",children:jsxRuntime.jsx(oe,{ref:N,onChange:k=>{d(k.target.value==""?null:k.target.value);},className:"--search-input",placeholder:c||"Search..."})}),(h==null?r:r.filter(k=>k.label.toLowerCase().includes(h.toLowerCase())||k.value.toLowerCase().includes(h.toLowerCase()))).map(k=>jsxRuntime.jsx(Jn,{updateValue:K,value:w,o:k},`option-${(typeof k=="string"?k:k.label).replace(/\s+/g,"-")}-${typeof k=="string"?k:k.value}`))]})]})};es.displayName="Zuz.Select";var bc=es;var ts=react.forwardRef((o,n)=>jsxRuntime.jsx(et,{type:be.Switch,...o,ref:n}));ts.displayName="Zuz.Switch";var vc=ts;var rs=o=>{let{idx:n,id:t,as:r,weight:e,style:s,value:u,render:l,resize:c,sortBy:a,sortable:i,onSort:f}=o,[m,g]=react.useState(0),w=()=>{i&&(f?.(String(t),m==1?-1:1),g(y=>y==1?-1:1));};return jsxRuntime.jsxs(p,{style:{flex:e||1,...s},as:`--col flex aic ${r||""} ${i?"--sortable":""}`,onClick:w,children:[jsxRuntime.jsx(p,{children:u}),n==-1&&i&&a==t&&jsxRuntime.jsx(p,{as:"--arrow flex aib",children:m==1?D.arrowUp:D.arrowDown})]})};rs.displayName="Zuz.Column";var Pt=rs;var ss=o=>{let{index:n,pubsub:t,schema:r,data:e,ids:s,styles:u,animate:l,sortBy:c,selectable:a,tableRef:i,loading:f,rowClassName:m,onSort:g,onRowClick:w,onSelect:y,onContextMenu:b}=o,T=hooks.useDelayed(),h=react.useMemo(()=>({transition:G.SlideInBottom,curve:_.EaseInOut,delay:.02*(n+1)}),[]),d=react.useRef(null),v=(S,C)=>{n==-1?t.emit(`ALL_ROWS_${S?"CHECKED":"UNCHECKED"}`,S):(y&&y(e,S),t.emit(`ROW_${S?"CHECKED":"UNCHECKED"}`,S,C));},N=(S,C,I)=>jsxRuntime.jsx(Pt,{idx:S,id:C,as:"--selector",pubsub:t,value:jsxRuntime.jsx(et,{value:I,ref:d,onSwitch:v,type:be.Default})});return react.useEffect(()=>{let S=(L,V)=>{d.current?.setChecked(L,false);},C=(L,V)=>{let E=false;i?.current&&i.current.querySelectorAll(".--row").forEach(Z=>{let K=Z;if(!K.classList.contains("--row-head")){let k=K.querySelector(".--selector input[type=checkbox]");k&&k.checked&&!E&&(E=k.checked);}}),d.current.setChecked(E,false);},I=L=>{d.current?.setChecked(L,false),y&&y(e,L);},M=L=>{d.current?.setChecked(L,false),y&&y(e,L);};return n==-1?(t.on("ROW_CHECKED",S),t.on("ROW_UNCHECKED",C),()=>{t.off("ROW_CHECKED",S),t.off("ROW_UNCHECKED",C);}):(t.on("ALL_ROWS_CHECKED",I),t.on("ALL_ROWS_UNCHECKED",M),()=>{t.off("ALL_ROWS_CHECKED",I),t.off("ALL_ROWS_UNCHECKED",M);})},[]),jsxRuntime.jsxs(p,{onContextMenu:S=>b?b(S,e):null,onClick:S=>w?w(S,o.data):()=>{},...l?{fx:{...h,when:T}}:{},as:`--row flex aic ${w?"--row-clickable":""} ${n==-1?"--row-head":""} ${m||""}`,children:[n==-1&&r.map((S,C)=>{let{renderWhenHeader:I,render:M,value:L,...V}=S;return jsxRuntime.jsxs(react.Fragment,{children:[a&&C==0&&N(-1,`--selector-${S.id}`,"all"),jsxRuntime.jsx(Pt,{idx:-1,onSort:g,sortBy:c,value:L,...V,pubsub:t,style:u[S.id]})]},`--col-${S.id}`)}),f&&n>-1&&jsxRuntime.jsx(p,{as:"--col",children:jsxRuntime.jsx(H,{as:"opacity:0",children:"..."})}),!f&&n>-1&&s&&e&&r.map((S,C)=>jsxRuntime.jsxs(react.Fragment,{children:[a&&C==0&&N(C,`--selector-${S.id}`,S.id.toString()),s.includes(String(S.id))?jsxRuntime.jsx(Pt,{pubsub:t,idx:C,id:String(S.id),style:u[String(S.id)],value:S.render?S.render(e,n):e[String(S.id).includes(".")?String(S.id).split(".").reverse()[0]:S.id]}):null]},`--${String(S.id)}-val-${C}`))]})};ss.displayName="Zuz.Row";var Rt=ss;var ms=(o,n)=>{let{schema:t,rows:r,rowCount:e,rowsPerPage:s,currentPage:u,pagination:l,paginationHash:c,showPaginationOnZeroPageCount:a,animateRows:i,header:f,rowClassName:m,selectableRows:g,hoverable:w,sortBy:y,loading:b,loadingRowCount:T,loadingMessage:h,spinner:d,emptyMessage:v,onSort:N,onRowClick:S,onRowSelectToggle:C,onPageChange:I,onRowContextMenu:M,...L}=o,V=react.useRef(null),E=react.useMemo(()=>t.reduce((pe,J)=>(pe[J.id]={flex:J.weight||1,...J.w&&{width:J.w},...J.maxW&&{maxWidth:J.maxW},...J.minW&&{minWidth:J.minW},...J.h&&{height:J.h},...J.maxH&&{maxHeight:J.maxH},...J.minH&&{minHeight:J.minH}},pe),{}),[t]),Z=react.useMemo(()=>Object.keys(E),[t]),K=react.useMemo(()=>f??true,[f]),{style:k,className:P,rest:A}=R(L),$=react.useRef(null),W=react.useMemo(()=>new core.PubSub,[]),O=react.useRef(r.map(()=>core.uuid(8))),[F,Y]=react.useState(y||null),[te,j]=react.useState(h||"loading"),ce=react.useMemo(()=>!b&&r&&r.length==0,[b,r]),de=react.useCallback(()=>v?typeof v=="function"?jsxRuntime.jsx(v,{}):v:jsxRuntime.jsx(H,{as:"tac s:18 mt:75",children:"No Record Found"}),[b,r]);react.useEffect(()=>{O.current=r.map(()=>core.uuid(8));},[r]);let it=(pe,J)=>{Y(pe),N?.(pe,J);},lt=(e||(r?r.length:0))/(s||10),mt=react.useMemo(()=>a||lt>1?jsxRuntime.jsx(To,{hash:c,ref:V,renderOnZeroPageCount:a,onPageChange:I,paginationStyle:"table",startPage:u,itemCount:e||(r?r.length:0),itemsPerPage:s||10}):null,[u,e]);return react.useImperativeHandle(n,()=>({setLoading(pe){}})),jsxRuntime.jsxs(p,{as:`--table ${w??true?"--hoverable":""} flex cols rel ${P}`,ref:$,children:[K==true&&jsxRuntime.jsx(Rt,{sortBy:F,onSort:it,tableRef:$,pubsub:W,selectable:g,index:-1,schema:t,loading:true,styles:E}),b&&jsxRuntime.jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsxRuntime.jsx(ge,{type:d||re.Simple}),te&&jsxRuntime.jsx(H,{as:"--table-loading-message",children:te})]}),b&&Array(T||5).fill({}).map((pe,J)=>jsxRuntime.jsx(Rt,{tableRef:$,index:J,pubsub:W,schema:t,styles:E,loading:true,animate:i,onRowClick:S},`--trow-loading-${J}-${t[0].id}`)),!b&&r&&r.map((pe,J)=>jsxRuntime.jsx(Rt,{tableRef:$,pubsub:W,loading:false,index:J,schema:t,ids:Z,styles:E,animate:i,data:pe,onRowClick:S,rowClassName:m,selectable:g,onSelect:C,onContextMenu:M},`--trow-${O.current[J]||J}-${t[0].id}`)),ce&&de(),jsxRuntime.jsx(p,{"aria-hidden":!l||!mt,...i?{fx:{transition:G.SlideInBottom,curve:_.EaseInOut,delay:.02*(r.length+1),when:!b&&r&&l&&mt!=null}}:{},as:"--row flex aic --row-footer",children:l&&mt?mt:null})]})};ms.displayName="Zuz.Table";var kc=react.forwardRef(ms),Dc=kc;var Vc=({ref:o,...n})=>{let{title:t,items:r}=n,[e,s]=react.useState(0),u=(l,c,a)=>{l.preventDefault(),s(c),document.getElementById(a)?.scrollIntoView({behavior:"smooth"});};return jsxRuntime.jsxs(p,{ref:o,as:"--table-of-contents rel flex cols",children:[jsxRuntime.jsx(H,{as:"--toc-title",children:t}),jsxRuntime.jsx(Le,{items:r.map((l,c)=>jsxRuntime.jsx("a",{className:e==c?"--toc-active":"",style:{anchorName:e===c?"--toc-active":"none",color:e==c?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:a=>u(a,c,l.tag),href:`#${l.tag}`,children:l.label}))})]})},Ac=Vc;var cs=({isActive:o,transitionType:n,speed:t,width:r,render:e,content:s,onHeightChange:u})=>{let l=react.useRef(null),c=hooks.useResizeObserver(l);react.useEffect(()=>{o&&c.height>0&&u(c.height);},[o,c.height]);let a=react.useMemo(()=>{let i={flexShrink:0,height:"fit-content"};return n==="fade"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,visibility:o?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:o?1:0}:n==="scale"?{...i,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,transform:`scale(${o?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:o?1:0}:i},[o,n,r,t]);return jsxRuntime.jsx(p,{ref:l,style:{...a},className:"--content",children:e||o?s:null})};cs.displayName="Zuz.TabBody";var ps=cs;var ds=({ref:o,...n})=>{let{tabs:t,speed:r=.3,prerender:e=true,variant:s,tabStyle:u="fixed",onChange:l,transitionType:c="slide",...a}=n,[i,f]=react.useState(0),m=react.useRef(null),g=hooks.useResizeObserver(m),w=react.useMemo(()=>core.uuid(8),[]),[y,b]=react.useState("auto"),T=react.useMemo(()=>g.width>0,[g.width]);react.useImperativeHandle(o,()=>({setTab:C=>f(C)}));let h=react.useMemo(()=>t.map(C=>({...C,key:C.key||core.uuid(8)})),[t]),{style:d,className:v,rest:N}=R({as:`flex cols w-full no-overflow ${a.as||""}`,...a}),S=()=>{if(!T)return {opacity:0};switch(c){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${i*g.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxRuntime.jsxs(p,{ref:m,style:d,className:`--tabview --${u} flex cols ${v}`,children:[jsxRuntime.jsx(tt,{as:"--tabview-head",onSwitch:C=>{f(C.index);let I=h.find(M=>M.tag==C.tag);I&&I.onSelect&&(I.onSelect(I,C.index),l?.(I,C.index));},selected:i,items:h.reduce((C,I,M)=>(C.push({icon:I.icon,index:M,label:I.label,tag:I.tag}),C),[])}),jsxRuntime.jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:y,transition:T?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:T?1:0},children:jsxRuntime.jsx(p,{className:"--track",style:{...S()},children:h.map((C,I)=>jsxRuntime.jsx(ps,{isActive:I===i,transitionType:c,speed:r,width:g.width,render:e||I===i,onHeightChange:M=>I===i&&b(M),content:C.body},`tab-body-${C.key||I}-${w}`))})})]})};ds.displayName="Zuz.TabView";var qc=ds;var Jc=({ref:o,commands:n,onCommand:t,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:e="zuz ~ ",variant:s,...u})=>{let[l,c]=react.useState([{type:"output",content:r}]),[a,i]=react.useState(""),f=react.useRef(null),m=react.useRef(null),{variant:g}=q(true);react.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[l]);let w=v=>{let N=typeof v=="string"?{type:"output",content:v}:v;c(S=>{let C=[...S,N];return C.length>1e3?C.slice(-1e3):C});},y=()=>c([]);react.useImperativeHandle(o,()=>({write:w,clear:y}));let b=async v=>{let[N,...S]=v.split(" "),C=N.toLowerCase();return n&&n[C]?await n[C](S):t?await t(v):`command not found: ${N}`},T=v=>{let N=/\u001b\[(\d+)m/g,S=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},I=0,M="#d4d4d4",L=false,V;for(;(V=N.exec(v))!==null;){let Z=v.slice(I,V.index);Z&&S.push({text:Z,color:M,bold:L});let K=V[1];K==="0"?(M="#d4d4d4",L=false):K==="1"?L=true:C[K]&&(M=C[K]),I=N.lastIndex;}let E=v.slice(I);return E&&S.push({text:E,color:M,bold:L}),S},h=(v,N)=>v.includes("\x1B")?T(v).map((S,C)=>jsxRuntime.jsx(Q,{style:{color:S.color||"#d4d4d4",fontWeight:S.bold?"bold":"normal"},children:S.text},`--terminal-msg-${C}-${S.text.replace(/\S+/g,"-")}`)):jsxRuntime.jsx(Q,{style:{color:N==="error"?"#ff5f56":N==="command"?"#00ff00":"#d4d4d4"},children:v}),d=async v=>{if(v.key==="Enter"&&a.trim()){let N=a.trim(),S=[...l,{type:"command",content:`${e}${N}`}];i(""),c(S);let C=await b(N);c(I=>[...I,{type:"output",content:C}]);}};return jsxRuntime.jsxs(p,{as:`--zuz-terminal --${s||g||U.Medium} flex cols ${u.className}`,onClick:()=>m.current?.focus(),children:[jsxRuntime.jsx(p,{ref:f,className:"--terminal-log",children:l.map((v,N)=>jsxRuntime.jsx(p,{children:jsxRuntime.jsx(H,{children:h(v.content,v.type)})},N))}),jsxRuntime.jsxs(p,{as:"flex aic --terminal-input",children:[jsxRuntime.jsx(H,{as:"--terminal-prompt",children:e}),jsxRuntime.jsx(oe,{ref:m,className:"--zuz-term-input",autoFocus:true,value:a,variant:s||g||U.Medium,onChange:v=>i(v.target.value),onKeyDown:d})]})]})},jc=Jc;var ep=({meta:o})=>jsxRuntime.jsxs(z,{as:"flex aic --command-item",children:[o.icon&&jsxRuntime.jsx(X,{name:o.icon,as:"--command-icon"}),jsxRuntime.jsx(H,{children:o.label})]}),tp=({position:o,onSelect:n,commands:t,visible:r})=>jsxRuntime.jsx(p,{"aria-hidden":!r,fx:{transition:G.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...o},children:t.map(e=>jsxRuntime.jsx(ep,{meta:e},`cmd-${e.label.replace(/\s+/,"-")}`))}),ys=tp;var vs=react.forwardRef((o,n)=>{let{autoResize:t,maxHeight:r,variant:e,resize:s="none",command:u,commands:l,onInput:c,cmd:a,renderDropdown:i,value:f,defaultValue:m,...g}=o,w=react.useRef(null),y=react.useRef(null),{variant:b}=q(true),{style:T,className:h,rest:d}=R(g),{showDropdown:v,dropdownPosition:N,handleKeyDown:S,handleInput:C,handleCommandSelect:I}=hooks.useCommandActions({command:u,commands:l,cmd:a,ref:w}),M=react.useCallback(()=>{let V=w.current;!V||!t||(y.current&&cancelAnimationFrame(y.current),y.current=requestAnimationFrame(()=>{V.style.height="auto";let E=V.scrollHeight;if(r){let Z=parseInt(r.toString(),10);isNaN(Z)||(E=Math.min(E,Z));}V.style.height=`${E}px`,V.style.overflowY=r&&E>=parseInt(r.toString(),10)?"auto":"hidden";}));},[t,r]),L=V=>{c?.(V),C(V),M();};return react.useEffect(()=>{M();},[f,m,M]),react.useEffect(()=>{t&&w.current&&M();},[t,M]),react.useEffect(()=>()=>{y.current&&cancelAnimationFrame(y.current);},[]),jsxRuntime.jsxs(p,{as:"rel",children:[jsxRuntime.jsx("textarea",{className:`--input --textarea --${e||b||U.Medium} flex ${h}`.trim(),style:{...T,resize:s,height:t?"auto":T?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:S,onInput:L,ref:V=>{typeof n=="function"?n(V):n&&(n.current=V),w.current=V;},value:f,defaultValue:m,...d}),i?i({show:v,position:N,commands:l||[],onSelect:I}):l&&l.length>0&&jsxRuntime.jsx(ys,{visible:v,commands:l,onSelect:I,position:N})]})});vs.displayName="Zuz.TextArea";var ap=vs;var Cs=react.forwardRef((o,n)=>{let{as:t,value:r,color:e,direction:s,...u}=o,l=react.useRef(null),[c,a]=react.useState(r||0);return react.useImperativeHandle(n,()=>({updateValue(i){c.toString().length!==i.toString().length&&a(i);},setValue(i){if(this.updateValue(i),l.current){let f=i.toString().split("");l.current.querySelectorAll(".--wheel-char").forEach((m,g)=>{let w=f[g];if(m instanceof HTMLElement){m.setAttribute("data-value",w);let y=m.querySelector(".--wheel-char-track");y instanceof HTMLElement&&(y.style.setProperty("--v",w),y.offsetWidth);}});}}})),react.useEffect(()=>{a(r||0);},[r]),jsxRuntime.jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:l,...u,children:[(c||0).toString().split("").map((i,f)=>isNaN(parseInt(i,10))?jsxRuntime.jsx(Q,{className:"--wheel-char wheel-char-symbol grid",children:i},`wheel-char-symbol-${f}`):jsxRuntime.jsx(Q,{"data-value":i,className:`--wheel-char grid ${f>(c||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxRuntime.jsxs(Q,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":i},children:[jsxRuntime.jsx(Q,{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((m,g)=>jsxRuntime.jsx(Q,{children:m},`${f}--${g}`)),jsxRuntime.jsx(Q,{children:!s||s==="down"?9:0})]})},`wheel-char-${f}`)),e&&jsxRuntime.jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${e}, transparent, transparent, transparent, ${e})`}})]})});Cs.displayName="Zuz.TextWheel";var fp=Cs;var Is=react.forwardRef((o,n)=>{let{title:t,position:r,margin:e,children:s,...u}=o,{style:l,className:c,rest:a}=R(u),[i,f]=react.useState(false),m=react.useMemo(()=>r||ee.Top,[]),g=react.useRef(null),w=react.useRef(null),y=d=>{},b=typeof ResizeObserver<"u"?new ResizeObserver(y):{observe:()=>{},unobserve:()=>{}},T=hooks.useDimensions(),h=react.useMemo(()=>{if(!w.current)return {left:0,top:0};let d=w.current.previousElementSibling;if(d){let v=d.getBoundingClientRect();switch(b.observe(d),m){case ee.Top:return {left:v.left+v.width/2,top:v.top-(e||25)};case ee.Bottom:return {left:v.left+v.width/2,top:v.top+(e||25)};case ee.Left:return {left:v.left-v.width/2,top:v.top+v.height/2};case ee.Right:return {left:v.right,top:v.top+v.height/2};default:return {left:0,top:0}}}},[w.current,T,b]);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{ref:g,className:"--with-tooltip rel",onMouseEnter:d=>f(true),onMouseLeave:d=>f(false),children:[s,jsxRuntime.jsx(p,{ref:w,style:{left:h?.left+"px",top:h?.top+"px"},className:`--tooltip --${r||ee.Top} fixed ${c}`.trim(),fx:{from:m==ee.Bottom||m==ee.Top?{opacity:0,x:"-50%",y:m==ee.Top?-5:5}:{opacity:0,y:"-50%",x:m==ee.Right?15:-25},to:m==ee.Bottom||m==ee.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:m==ee.Right?10:-20},curve:_.EaseInOut,when:i},children:jsxRuntime.jsx(H,{className:"--text rel",children:t})})]})});Is.displayName="Zuz.ToolTip";var yp=Is;var ko=react.forwardRef((o,n)=>{let{as:t,meta:r,nodes:e,icons:s,onSelect:u,treeTag:l,selected:c,roots:a,expanded:i,...f}=o,{tag:m,label:g,icon:w,under:y,isHead:b}=r,T=react.useMemo(()=>a.includes(m),[a]),[h,d]=react.useState(i),v=()=>{localStorage.setItem(`--tn${l}-${m}`,h?"0":"1"),d(!h);};react.useEffect(()=>{i||T&&!localStorage.getItem(`--tn${l}-${m}`)?(localStorage.setItem(`--tn${l}-${m}`,"1"),d(true)):d(localStorage.getItem(`--tn${l}-${m}`)=="1");},[]);let N=react.useMemo(()=>e.filter(S=>S.under==m),[e,m]);return jsxRuntime.jsxs(p,{className:`--treenode ${T?"--is-root":""} --treenode-${m} flex cols`,children:[jsxRuntime.jsxs(p,{className:`--node --node-${m} flex aic ${c==m?" --selected":""}`,children:[jsxRuntime.jsx(z,{skeleton:f.skeleton,onClick:v,className:"--node-aro-btn",disabled:N.length==0,children:s?.arrowClose&&s?.arrowOpen?jsxRuntime.jsx(X,{skeleton:f.skeleton,className:"--node-aro-icon",name:N.length==0?s?.arrowDisabled||s?.arrowClose:h?s?.arrowOpen:s?.arrowClose}):N.length==0?D.chevronBottom:h?D.chevronBottom:D.chevronRight}),jsxRuntime.jsxs(z,{className:"--node-meta flex aic",onClick:S=>u(m),children:[(s?.nodeOpen&&s?.nodeClose||T&&s?.rootOpen&&s?.rootClose)&&jsxRuntime.jsx(X,{skeleton:f.skeleton,className:`--node-icon ${T?"--icon-root":""}`,name:w||(h?T&&s?.rootOpen||s.nodeOpen:T&&s?.rootClose||s?.nodeClose)}),jsxRuntime.jsx(H,{className:`--node-label ${T?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:g})]})]}),h&&N.length>0&&jsxRuntime.jsx(p,{className:`--sub-node tree-sub-node-${m} flex cols`,children:N.map(S=>jsxRuntime.jsx(ko,{treeTag:l,selected:c,onSelect:u,icons:s,roots:a,expanded:S.expanded||false,meta:S,nodes:e},`--node-${S.tag}`))})]})});ko.displayName="TreeItem";var Es=ko;var Ls=react.forwardRef((o,n)=>{let{as:t,nodes:r,onNodeSelect:e,tag:s,icons:u,roots:l,selected:c,...a}=o,[i,f]=react.useState(c);react.useImperativeHandle(n,()=>({getSelected:()=>i}),[e]);let m=g=>{f(g),e&&e(g);};return react.useEffect(()=>{i!=c&&f(c);},[c]),jsxRuntime.jsx(p,{className:"--treeview flex cols",children:r.filter(g=>l.includes(g.tag)).map(g=>jsxRuntime.jsx(Es,{treeTag:s?`-${s}`:"",selected:i,onSelect:w=>m(w),icons:u,meta:g,roots:l,expanded:g.expanded||false,skeleton:a.skeleton,nodes:r},`--node-${g.tag}`))})});Ls.displayName="Zuz.TreeView";var Ip=Ls;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
14
|
-
Object.defineProperty(exports,"PACKAGE_NAME",{enumerable:true,get:function(){return
|
|
13
|
+
</div>`}).join("")},[e,g]);return jsxRuntime.jsx(p,{as:`--code-block ${a}`,style:f,...m,children:jsxRuntime.jsx("pre",{ref:o,children:jsxRuntime.jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:y}})})})},Bl=El;var pn=({onSelect:o,meta:n,selected:e})=>{let r=react.useRef(null),{index:t,icon:s,label:u}=n,[l,m]=react.useState({x:0,width:0}),i=hooks.useDelayed();return react.useLayoutEffect(()=>{if(i&&r.current){let{width:a,x:f}=r.current.getBoundingClientRect();m({x:f,width:a}),e&&o(t,a,f,n,true);}},[i,r.current]),react.useEffect(()=>{e&&o(t,l.width,l.x,n,false);},[e]),jsxRuntime.jsxs($,{onClick:()=>o(t,l.width,l.x,n,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[s?typeof s=="string"?jsxRuntime.jsx(X,{name:s,as:"--segment-icon"}):jsxRuntime.jsx(p,{as:"--segment-icon flex aic jcc",children:s}):null,u&&String(u).trim()!=""&&jsxRuntime.jsx(p,{className:"--segment-label",children:u||`Item ${t}`})]})};pn.displayName="SelectTabItem";var un=pn;var dn=react.forwardRef((o,n)=>{let{fx:e,items:r,selected:t,variant:s,onSwitch:u,...l}=o,[m,i]=react.useState(t||0),a=react.useRef(false),f=react.useRef(m),{className:c,style:g,rest:y}=R(l),b=react.useRef(null),d=react.useRef(null),{variant:v}=q(true),S=(h,w,N,C,T)=>{if((T||m!=h&&m!=-2)&&(i(h),f.current=m,a.current&&u?.(C)),b.current){let I=d.current?.getBoundingClientRect();b.current.style.setProperty("--w",`${w}px`),b.current.style.setProperty("--x",`${I?N-I.left:N}px`);}};return react.useImperativeHandle(n,()=>({setSelected:h=>{typeof h=="number"&&h!=m&&i(h);}}),[m]),react.useEffect(()=>{a.current=true;},[]),jsxRuntime.jsxs(p,{ref:d,"data-selected":m,className:`${c} --segmented --${s||v||W.Medium} flex aic rel`,style:g,...y,children:[jsxRuntime.jsx(p,{ref:b,className:"--segment-tab abs"}),r.map((h,w)=>jsxRuntime.jsx(un,{onSelect:S,selected:m==w,meta:{...h,index:w}},`segment-${h.label}-${w}`))]})});dn.displayName="Zuz.SelectTabs";var ot=dn;var xn=react.forwardRef((o,n)=>{let{type:e,...r}=o,t=hooks.useDelayed(),{colorScheme:s,setColorScheme:u}=At(),l=react.useCallback(()=>{u(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:m,style:i}=R(r),a=react.useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"system",index:1,label:"",icon:O.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}],[]),f=react.useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !t||f==-1?null:e=="system"||e=="switch"?jsxRuntime.jsx(ot,{className:`--color-scheme --${e}`,onSwitch:({tag:c})=>{u(c);},selected:f,items:a,...r}):jsxRuntime.jsx($,{onClick:l,style:i,as:`--color-scheme-switch --${r.variant||W.Small} ${m}`.trim(),children:s=="system"?O.colorSchemeSystem:s=="light"?O.colorSchemeLight:O.colorSchemeDark})});xn.displayName="Zuz.ColorScheme";var Wl=xn;var bn=react.forwardRef((o,n)=>{let[e,r]=react.useState("wait"),{title:t,message:s,acceptLabel:u,rejectLabel:l,position:m}=o,i=async a=>{r(a==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(a));};return react.useEffect(()=>{let a=localStorage.getItem("--ccnt");r(a?a=="1"?"accepted":"rejected":"pending");},[]),jsxRuntime.jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:Z.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${m||ee.Left} flex cols`,children:[jsxRuntime.jsx(V,{as:"--title",children:t||"This site uses cookies"}),jsxRuntime.jsx(V,{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"}),jsxRuntime.jsxs(p,{as:"--footer flex aic",children:[jsxRuntime.jsx($,{onClick:a=>i(1),as:"--accept",children:u||"Accept All"}),jsxRuntime.jsx($,{onClick:a=>i(0),as:"--reject",children:l||"Cancel"})]})]})});bn.displayName="Zuz.CookiesConsent";var Xl=bn;var Sn=react.forwardRef((o,n)=>{let {type:e,value:r,min:t,max:s,step:u,onChange:l,roundValue:m,...i}=o,{className:a,style:f,rest:c}=R(i),g=react.useRef(u||.01).current,y=react.useRef(t||0).current,b=react.useRef(s||1).current,d=react.useRef(r||0).current,v=react.useRef(null),S=react.useRef(null),h=react.useRef(null);react.useRef(null);let N=react.useRef(null),C=react.useRef(null),T=(z,K,H)=>(z-K)/(H-K)*100,I=z=>{if(S.current){let K=parseFloat(z.currentTarget.value),H=T(K,parseFloat(z.currentTarget.min),parseFloat(z.currentTarget.max));S.current.style.setProperty("--value",`${H}`),S.current.setAttribute("data-value",`${K}`),l&&l(m?+K.toFixed(2):K);}},[M,L]=react.useState(false),[D,E]=react.useState(0),[F,G]=react.useState(0),k=z=>{L(true),E(z.clientX),G(S.current?parseFloat(S.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},P=z=>{if(M){let K=z.clientX-D,H=Math.max(y,Math.min(F+K*g,b));S.current&&(S.current.setAttribute("data-value",`${H}`),C.current.textContent=m?H.toFixed(2):H.toString(),l&&l(m?+H.toFixed(2):H));}},A=()=>{L(false),document.body.style.cursor="auto";};return react.useEffect(()=>{S.current&&S.current.style.setProperty("--value",v.current?`${T(parseFloat(v.current.value),parseFloat(v.current.min),parseFloat(v.current.max))}`:d.toString());},[]),react.useEffect(()=>(M?(document.addEventListener("mousemove",P),document.addEventListener("mouseup",A)):(document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",A);}),[M]),jsxRuntime.jsx(p,{ref:S,"data-value":d||0,className:`--slider --${e||ct.Default} flex rel ${a}`.trim(),style:{...f},children:ct.Text===e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(V,{ref:C,onMouseDown:k,className:"--slider-text",children:d||0})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(p,{ref:N,className:"--slider-track abs fill"}),jsxRuntime.jsx(p,{ref:h,className:"--slider-knob abs"}),jsxRuntime.jsx(te,{ref:v,onInput:I,className:"abs fill",tabIndex:0,type:e||ct.Default,defaultValue:d||0,step:g,max:b,min:y})]})})});Sn.displayName="Zuz.Slider";var go=Sn;var Tn=react.forwardRef((o,n)=>{let{src:e,shape:r,size:t,...s}=o,{style:u,className:l,rest:m}=R(s),{canvasRef:i,crop:a,setScale:f,handleMouseDown:c,handleMouseUp:g,handleMouseMove:y}=hooks.useImageCropper(e,t||200,r||hooks.CropShape.Circle);return react.useImperativeHandle(n,()=>({getCropped(){return a()},setScale(b){f(b);}})),jsxRuntime.jsxs(p,{as:`--cropper --${r||hooks.CropShape.Circle} ${l}`,style:u,...m,children:[jsxRuntime.jsx("canvas",{ref:i,width:t||200,height:t||200,onMouseDown:c,onMouseUp:g,onMouseLeave:g,onMouseMove:y}),jsxRuntime.jsx(p,{as:"--cropper-slider",children:jsxRuntime.jsx(go,{onChange:b=>f(b),min:0,max:1,step:.01,value:1})})]})});Tn.displayName="Zuz.Cropper";var tm=Tn;var rm=(e=>(e.Circle="circle",e.Square="square",e))(rm||{});var Rn=react.forwardRef((o,n)=>{let{items:e,maxItems:r}=o,t=react.useMemo(()=>{let l=typeof e=="string",m=l?[]:e;return l&&e.split(",").forEach(i=>{m.push({label:i});}),m},[e]),u=react.useMemo(()=>r&&r>0&&t.length>r-1,[t,r])?[...t.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...t.slice(-r)]:t;return jsxRuntime.jsx(Le,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsxRuntime.jsx(p,{as:"--crumb-chevron",children:O.chevronRightOutline}),items:u.map((l,m,i)=>l.ID=="."?jsxRuntime.jsx(p,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsxRuntime.jsx(p,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${m}`))}):jsxRuntime.jsxs($,{onClick:()=>l.action?.(),className:"--crumb-item",disabled:!i[m+1],children:[l.icon&&jsxRuntime.jsx(X,{as:"--crumb-icon",name:l.icon}),jsxRuntime.jsx(V,{as:"--crumb-label",children:l.label})]},`${l.label.replace(/\s+/g,"-").toLowerCase()}-${m}`))})});Rn.displayName="Zuz.Crumb";var sm=Rn;var En=react.forwardRef((o,n)=>{let{icon:e,defaultValue:r,value:t,size:s,variant:u,numeric:l,type:m,onConfirm:i,...a}=o,[f,c]=react.useState(false),[g,y]=react.useState(r||null),{style:b,className:d,rest:v}=R(a),S=react.useRef(null),h=react.useRef(null),{reposition:w}=Ue(h,{direction:ee.Bottom,offset:2}),N=T=>{l&&(T.currentTarget.value=T.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};react.useEffect(()=>{let T=I=>{let M=I.target,L=S.current?.contains(M),D=h.current?.contains(M);!L&&!D&&c(false);};return f&&document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T);}},[f]),react.useEffect(()=>{let T=I=>{I.key==="Escape"&&f&&(c(false),S.current?.focus());};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[f]);let C=()=>{c(true);};return react.useEffect(()=>{f&&w();},[f,w]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(p,{as:`--date-picker ${u?`--${u}`:""} rel flex aic ${d}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsxRuntime.jsx(X,{as:"mr:10 c:#666",name:e}):e:jsxRuntime.jsx(Q,{as:"--date-picker-icon flex aic jcc",children:O.calendar}),jsxRuntime.jsx("input",{ref:S,value:g?dateFns.format(g,"EEE, MMM d YYY hh:mm a"):t||"",className:`--input ${u?`--${u}`:""} flex`.trim(),style:b,onFocus:C,onInput:N,autoComplete:"new-password",onKeyDown:T=>{T.key=="Enter"&&i?.(T.currentTarget.value);},...v}),jsxRuntime.jsx(p,{"aria-hidden":!f,ref:h,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:f,duration:.05},as:`--date-picker-chooser flex aic ${u?`--${u}`:""}`,children:jsxRuntime.jsx(io,{defaultValue:g,onChange:T=>{y(T),c(false);}})})]})})});En.displayName="Zuz.DatePicker";var mm=En;var Bn=react.forwardRef((o,n)=>{let{icon:e,variant:r,position:t}=o;return jsxRuntime.jsx($,{className:`--fab fixed --${r||W.Large} --${t||"bottomright"}`,children:e||O.plus})});Bn.displayName="Zuz.Fab";var fm=Bn;var Ln=o=>{let{names:n,strength:e}=o,r={[pt.Gooey]:t=>jsxRuntime.jsxs("filter",{id:"gooey",children:[jsxRuntime.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:t||10,result:"blur"}),jsxRuntime.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"}),jsxRuntime.jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${pt.Gooey}`)};return react.useEffect(()=>{},[n]),jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsxRuntime.jsx("defs",{children:(n||[pt.Gooey]).map(t=>r[t](e))})})};Ln.displayName="Zuz.Filters";var hm=Ln;var Te=null,ie=null,kn=react.forwardRef((o,n)=>{let{title:e,message:r,transition:t,curve:s,speed:u,type:l,actionPosition:m,spinner:i,loadingMessage:a,onShow:f,onHide:c,...g}=o,{className:y,style:b,rest:d}=R(g),[v,S]=react.useState(e||""),[h,w]=react.useState(r||""),[N,C]=react.useState(null),[T,I]=react.useState(l||me.Default),M=react.useMemo(()=>core.uuid(12),[]),[L,D]=react.useState(false),E=react.useRef(null),F=react.useRef(null),[G,k]=react.useState(false),[P,A]=react.useState(true),z=react.useRef(null),K=h;react.useImperativeHandle(n,()=>({setLoading(_){k(_);},showDialog(_,Y,oe,j){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),ie=null;},500)),I(me.Dialog),Y&&w(Y),_&&S(_),oe&&C(oe.reduce((pe,de)=>(pe.push({...de,key:de.key||core.uuid(12)}),pe),[])),D(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(_,Y,oe,j){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),ie=null;},500)),I(me.Dialog),w(Y),S(_),oe&&C(oe.reduce((pe,de)=>(pe.push({...de,key:de.key||core.uuid(12)}),pe),[])),D(true),setTimeout(()=>j?j():()=>{},1e3);},error(_,Y){this.show(_,Y,me.Error);},warn(_,Y){this.show(_,Y,me.Warn);},success(_,Y){this.show(_,Y,me.Success);},show(_,Y,oe){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),F.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${F.current} scale(.9)`.trim();},50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=F.current||"",ie=null;},500)),Te=setTimeout(()=>{D(false),Te=null,ie=null;},(Y||4)*1e3),I(oe||me.Default),w(_),D(true),f?.();},hide(){D(false),c?.();}}));let H=react.useMemo(()=>{let _={when:L,duration:u||.3,delay:.1};if(T==me.Dialog){if(t){let{from:Y,to:oe}=We(t,20);return {from:Y,to:oe,curve:s||Z.EaseInOut,..._}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Z.Spring,..._}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Z.Spring,..._}},[L,T]);return react.useEffect(()=>{z.current&&clearTimeout(z.current),L?A(true):z.current=setTimeout(()=>A(false),1e3);},[L]),T==me.Dialog?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ee,{when:L}),jsxRuntime.jsxs(p,{className:`--sheet --sheet-${T.toLowerCase()} ${L?"is-visible":""} ${y} fixed`.trim(),style:b,fx:H,...d,ref:E,children:[jsxRuntime.jsx(Ne,{when:G,spinner:i,message:a}),jsxRuntime.jsxs(p,{className:"--head flex aic rel",children:[jsxRuntime.jsx(p,{className:`--${v?"title":"dot"} flex aic rel`,children:v||""}),jsxRuntime.jsx($,{onClick:_=>D(false),className:"--closer abs",children:"\xD7"})]}),jsxRuntime.jsx(p,{className:`--body flex aic rel ${N?"":"--no-action"}`.trim(),children:P?K:null}),N&&jsxRuntime.jsx(p,{className:`--footer flex aic rel ${m?m==Lt.Center?"jcc":"":"jce"}`.trim(),children:N.map((_,Y)=>jsxRuntime.jsx($,{onClick:oe=>_.handler?_.handler():_.onClick?_.onClick():console.log("onClick Handler missing"),className:"--action",children:_.label},`sheet-${M}-action-${_.key}`))})]})]}):jsxRuntime.jsx(p,{className:`--sheet --sheet-${T.toLowerCase()} ${y} abs`.trim(),style:b,...d,fx:H,ref:E,children:L?h:null})}),nt=o=>typeof o=="object"&&o!=null&&"setLoading"in o&&"success"in o&&"error"in o;kn.displayName="Zuz.Sheet";var vm=kn;var On=({ref:o,...n})=>{let{name:e,cover:r,spinner:t,errors:s,action:u,children:l,withData:m,beforeSubmit:i,onSubmit:a,onError:f,onSuccess:c,resetOnSuccess:g,...y}=n,{className:b,style:d,rest:v}=R(y),[S,h]=react.useState(false),w=react.useRef(null),N=react.useRef(null),C=react.useRef(null),T=jt(),I=react.useCallback(P=>w.current?w.current.querySelectorAll(P):[],[w.current]),M=P=>({name:P.name||P.getAttribute("name")||P.getAttribute("data-name"),required:P.required?true:P.getAttribute("data-required")?P.getAttribute("data-required")=="true":false,with:P.with||P.getAttribute("with")}),L=P=>{let A=[];return P.querySelectorAll(".--input").forEach(z=>{A.push(z.value);}),A.join("")},D=react.useCallback(P=>{let{required:z}=M(P);if(z){if(P.type=="checkbox"&&P.checked==false)return false;if(P.classList.contains("--otp")){let H=L(P);if(H==""||H.length<parseInt(P.getAttribute("data-size")))return false}if(P.classList.contains("--select")&&P.querySelector("button.--selected").dataset.value=="-1"||P.value=="")return false}if(P.getAttribute("with")){let H=P.getAttribute("with");switch(H.includes("@")&&(H=H.split("@")[0],H=="match"&&(H=be.MatchField)),H.toUpperCase()){case be.IPV4:return core._(P.value).isIPv4();case be.IPV6:return core._(P.value).isIPv6();case be.Email:return core._(P.value).isEmail();case be.Uri:try{return new URL(P.value),!0}catch{return false}case be.Password:return console.log("Add FORMVALIDATION.Password"),false;case be.MatchField:let[_,Y,oe]=P.getAttribute("with").split("@"),j=document.querySelector(`[name=${Y.trim()}]`);if(!j)return false;switch(oe||"direct-match"){case "if-not-empty":if(j&&!core._(j.value).isEmpty()&&j.value!=P.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&P.classList.contains("--otp")&&L(j)!=L(P))return false;if(j&&j.value!=P.value)return false;break}break;default:return true}}return true},[w.current]),E=react.useCallback(()=>{let P={},A={},z=null,K=null;if(Array.from(I("[name]")).forEach(H=>{let{name:_,required:Y,with:oe}=M(H),j=true;(Y||oe)&&(j=D(H)),P[_]={valid:j,value:H.type=="checkbox"?H.checked==true?H.value:false:H.classList.contains("--otp")?L(H):H.classList.contains("--select")?H.querySelector("button.--selected").dataset.value:H.value},A[_]=H.type=="checkbox"?H.checked==true:H.classList.contains("--otp")?L(H):H.classList.contains("--select")?H.querySelector("button.--selected").dataset.value:H.value,j?H.classList.remove("input-with-error"):(z==null&&s&&(z=H,K=s[_]),H.classList.add("input-with-error"));}),z){let H=z;if(H.classList.contains("--otp"))for(let _ of Array.from(H.querySelectorAll(".--input"))){let Y=_;if(Y.value==""){Y.focus();break}}else H.focus();}return {error:z!=null,errorMsg:K||"Fix errors to continue...",data:P,payload:A}},[w.current]),F=react.useCallback(()=>{let{error:P,errorMsg:A,payload:z}=E();P?T.error(A):u?react.startTransition(async()=>{i&&i(z),nt(r)?r.setLoading(true):h(true),T.clearAll(),core.withPost(u,{...z,...m||{}}).then(K=>{let H=K;nt(r)?r.setLoading(false):h(false),g&&Array.from(I("[name]")).forEach(_=>{_ instanceof HTMLInputElement&&(_.value="");}),c?c(H):(T.clearAll(),T.success(H.message||"Redirecting..."));}).catch(K=>{nt(r)?r.setLoading(false):h(false),f?f(K):T.error(K.message||"We cannot process your request at this time.");});}):a&&a(z);},[u,N.current,w.current]),G=react.useCallback(()=>{let P=I("[type=submit]");!P||P.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):P.forEach(A=>{A.addEventListener("click",F);});},[w.current]),k=react.useMemo(()=>react$1.addPropsToChildren(l,P=>P.props.type=="submit",P=>({ref:C})),[l]);return react.useImperativeHandle(o,()=>({setLoading(P){if(P){N.current?.hide();try{T.clearAll();}catch{}}h(P);},showError(P){typeof P=="string"?T.error(P):N.current.error(P,4);},hideError(){N.current.hide();try{T.clearAll();}catch{}},init(){G();},submit(){F();}})),react.useEffect(G,[]),jsxRuntime.jsxs(p,{ref:w,style:d,className:`--form flex rel ${b} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!nt(r)&&jsxRuntime.jsx(Ne,{message:r?r.message||void 0:"working",spinner:t,color:r&&"color"in r?r.color:"#ffffff",when:S}),k]})};On.displayName="Zuz.Form";var Bm=On;var Dn=o=>{let {ref:n,cols:e,rows:r,gap:t,gapX:s,gapY:u,align:l,justify:m,inline:i,flow:a,autoCols:f,autoRows:c,template:g,...y}=o;react.useRef(null);let {className:d,style:v,rest:S}=R(y),h=N=>typeof N=="number"?`repeat(${N}, 1fr)`:N,w={display:i?"inline-grid":"grid",gridTemplateColumns:h(e),gridTemplateRows:h(r),gap:t,columnGap:s,rowGap:u,alignItems:l,justifyContent:m==="between"?"space-between":m==="around"?"space-around":m,gridAutoFlow:a,gridAutoColumns:f,gridAutoRows:c,gridTemplateAreas:g,...v};return jsxRuntime.jsx(p,{ref:n,as:`--grid ${d}`.trim(),style:w,...S})};Dn.displayName="Zuz.Grid";var Om=Dn;var Hn=o=>typeof o=="string"&&o.includes("+"),Vn={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"},An={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 zn=react.forwardRef(({children:o,keys:n,variant:e},r)=>{let t=react.useMemo(()=>{if(Hn(n)){let s=null;return {keys:String(n).split("+").reduce((l,m,i,a)=>(a[i+1]?l.push(m):s=m.toUpperCase(),l),[]),children:s}}return {keys:n,children:String(o).toUpperCase()}},[n]);return jsxRuntime.jsxs(p,{as:`--keyboard-keys --${e||W.Small} flex aic`,children:[(Array.isArray(t.keys)?t.keys:[t.keys]).map(s=>jsxRuntime.jsx("abbr",{title:An[s],children:Vn[s]},s)),jsxRuntime.jsx(Q,{children:t?.children??o})]})});zn.displayName="Zuz.KeyboardKeys";var So=zn;var Fn=react.forwardRef((o,n)=>{let e=hooks.useNetworkStatus(),{onlineMessage:r,offlineMessage:t,variant:s}=o;return jsxRuntime.jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:Z.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||W.Small} fixed flex`,children:[jsxRuntime.jsx(p,{className:"--ico",children:e?O[le.Success]:O[le.Error]}),jsxRuntime.jsx(V,{as:"--message",children:e?r||"internet connection restored :)":t||"no internet connection"})]})});Fn.displayName="Zuz.NetWorkManager";var _m=Fn;var Co=(e=>(e.Table="table",e.Gooey="gooey",e))(Co||{});var Wn=react.forwardRef((o,n)=>{let{itemCount:e,itemsPerPage:r,startPage:t,pageRange:s,paginationStyle:u,breakLabel:l,prevLabel:m,nextLabel:i,hash:a,loading:f,seperator:c,renderOnZeroPageCount:g,onPageChange:y,...b}=o,d=react.useMemo(()=>core.toHash(core.numberInRange(4,8)),[]),v=react.useCallback(E=>`${core.toHash(E,a||6,d)}${c||""}${d}`,[d]),S=react.useMemo(()=>l||"...",[l]),[h,w]=react.useState({id:a?t?typeof t=="number"?v(t):t:1:t||1,label:t||1}),{style:N,className:C,rest:T}=R(b),I=react.useCallback(E=>typeof E=="number"?E:+E.label,[]);if(!e)throw new Error('"itemCount" prop is required');let M=react.useMemo(()=>Math.ceil(e/r),[e,r]),L=react.useMemo(()=>{let E=[],F=Math.max(I(h)-(s||2),1),G=Math.min(I(h)+(s||2),M);F>1&&E.push({id:a?v(1):1,label:1}),F>2&&E.push({id:-1,label:S});for(let k=F;k<=G;k++)E.push({id:a?v(k):k,label:k});return G<M-1&&E.push({id:-1,label:S}),G<M&&E.push({id:a?v(M):M,label:M}),E},[h]),D=react.useCallback(E=>{let F=E;+F.label<1||+F.label>M||(w(F),y?.(F));},[e,r,h]);return L.length<=1&&(g??false)===false?null:jsxRuntime.jsxs(p,{ref:n,as:`--pagination --pgt-${u||"table"} flex aic w:100% jcc ${C}`,children:[jsxRuntime.jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:S}]).map((E,F,G)=>jsxRuntime.jsx($,{disabled:E.id==-1||I(h)==+E.label,className:(typeof E=="string"?E:E.label)==I(h)?"--current-page":"",onClick:k=>D(E),children:typeof E=="string"?E:E.label},`--pg-${F}-${E.id}`))}),jsxRuntime.jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(I(h)-1)*r+1} - `,`${Math.min(I(h)*r,e)} of ${e} items`].join(" ")}),jsxRuntime.jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsxRuntime.jsx($,{disabled:I(h)<=1,onClick:E=>D({id:a?v(I(h)-1):I(h)-1,label:I(h)-1}),children:O.chevronLeftOutline}),jsxRuntime.jsx($,{disabled:L.length<=1||I(h)==I(L[L.length-1]),onClick:E=>D({id:a?v(I(h)+1):I(h)+1,label:I(h)+1}),children:O.chevronRightOutline})]})]})});Wn.displayName="Zuz.Pagination";var Po=Wn;var Gn=react.forwardRef((o,n)=>{let{strenthMeter:e,onChange:r,...t}=o;"type"in t&&delete t.type;let{style:s,className:u,rest:l}=R(t),[m,i]=react.useState(false),[a,f]=react.useState(""),c=react.useMemo(()=>core.checkPasswordStrength(a),[a]),g=hooks.useDebounce(y=>{e&&f(y.target.value),r&&r(y);},100);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{as:"w:100% flex cols",children:[jsxRuntime.jsxs(p,{style:s,className:"--password flex aic rel",children:[jsxRuntime.jsx(te,{ref:n,type:m?"text":"password",className:u,onChange:g,...l}),jsxRuntime.jsx($,{tabIndex:-1,onClick:()=>i(y=>!y),className:"--toggle flex aic jcc abs",children:m?O.eye:O.eyeSlash})]}),e&&jsxRuntime.jsxs(p,{as:`flex aic --password-meter --pb-score-${c.score}`,style:s,children:[jsxRuntime.jsxs(p,{as:"--password-bars flex aic",children:[jsxRuntime.jsx(p,{as:`--pbar ${c.score>=1?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${c.score>=2?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${c.score>=3?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${c.score>=4?"--pb-on":""}`.trim()}),jsxRuntime.jsx(p,{as:`--pbar ${c.score>=5?"--pb-on":""}`.trim()})]}),jsxRuntime.jsx(V,{as:"--password-meter-label","aria-hidden":true,children:c.result})]})]})});Gn.displayName="Zuz.Password";var Qm=Gn;var Xn=react.forwardRef((o,n)=>{let{size:e,length:r,mask:t,...s}=o,u=react.useRef([]),l="pinput",m=false,i={};"with"in s&&(i={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(l=s.name,delete s.name),"required"in s&&(m=true,delete s.required);let{style:a}=R(s),f=c=>{let g=c.currentTarget,y=u.current[parseInt(g.dataset.index)+1],b=u.current[parseInt(g.dataset.index)-1];g.value.length===1&&y?y.focus():g.value.length===0&&b&&b.focus();};return react.useEffect(()=>{u.current=u.current.slice(0,e||r);},[e||r]),jsxRuntime.jsx(p,{name:l,style:a,className:"--otp flex aic rel","data-required":m,"data-size":e||r||4,...i,children:Array(e||r||4).fill(1).map((c,g)=>jsxRuntime.jsx(te,{autoComplete:"new-password","data-index":g,ref:y=>{u.current[g]=y;},numeric:true,onChange:f,maxLength:1,placeholder:t?"\xB7":"0",type:t?"password":"text",...s},`pin-${g}`))})});Xn.displayName="Zuz.PinInput";var tc=Xn;var Yn=react.forwardRef((o,n)=>{let{children:e,className:r,name:t,required:s,type:u,value:l,variant:m,checked:i,onSwitch:a,...f}=o,[c,g]=react.useState(i||false),{variant:y}=q(true),b=react.useRef(null);return jsxRuntime.jsxs(et,{className:`${r} --${(u||Mt.Default).toLowerCase()} --radio${!u||u==Mt.Default?"":"card"} --${m||y||W.Small} flex aic rel`.trim(),...f,children:[jsxRuntime.jsx(te,{ref:b,defaultChecked:c,value:l||"rd",type:"radio",className:"abs",name:t,required:s||false,onChange:d=>{a&&a(d.target.checked,l||"cb"),g(d.target.checked);}}),jsxRuntime.jsx(p,{className:"--dot rel",children:jsxRuntime.jsx(p,{className:"--rod abs abc"})}),jsxRuntime.jsx(p,{className:"--value",children:e})]})});Yn.displayName="Zuz.Radio";var sc=Yn;var Qn=react.forwardRef((o,n)=>{let{fx:e,withStyle:r,as:t,reverse:s=false,searchIcon:u=O.search,hideSearchIcon:l=false,clearIcon:m=O.close,hideClearIcon:i=false,onChange:a,onClear:f,...c}=o,{style:g,className:y}=R({as:o.as}),[b,d]=react.useState(""),{variant:v}=q(true),S=react.useRef(null),h=react.useMemo(()=>jsxRuntime.jsx($,{tabIndex:-1,onClick:C=>N(),className:"--send flex aic jcc",variant:o.variant||W.Small,children:b!==""?!i&&(typeof m=="string"?jsxRuntime.jsx(X,{name:m,as:"--search-action"}):m):!l&&(typeof u=="string"?jsxRuntime.jsx(X,{name:u,as:"--search-action"}):u)}),[s,u,i,m,l]);"type"in o&&delete o.type;let w=C=>{d(C.target.value),a?.(C.target.value);},N=C=>{b.trim()!==""&&(d(""),a?.(""),S.current&&(S.current.value="",o.onConfirm?.("")));};return react.useImperativeHandle(n,()=>({focus:()=>S.current?.focus(),value:()=>S.current?.value})),react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{style:g,className:`--search ${s?"--search-rev":""} --${o.variant||v||W.Medium} flex aic ${typeof o.as=="string"&&o.as.includes("abs")?"":"rel"} ${y}`.trim(),children:[s&&h,jsxRuntime.jsx(te,{ref:S,onChange:w,...c}),o.shortcut&&jsxRuntime.jsx(So,{keys:o.shortcut,as:"abs"}),!s&&h]})});Qn.displayName="Zuz.Search";var fc=Qn;var jn=({value:o,updateValue:n,o:e})=>jsxRuntime.jsxs($,{onClick:r=>n(e),as:"--select-option-item",className:o&&(typeof e=="string"?e:e.value)==(typeof o=="string"?o:o.value)?"selected":"",children:[e.icon&&jsxRuntime.jsx(X,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsxRuntime.jsx(V,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});jn.displayName="Option";var es=jn;var os=({ref:o,...n})=>{let{selected:e,options:r,label:t,name:s,variant:u,search:l,searchPlaceholder:m,maxHeight:i,arrowDownIcon:a=O.arrowDown,arrowUpIcon:f=O.arrowUp,onChange:c,...g}=n,[y,b]=react.useState(e?typeof e=="string"?r.find(k=>k.value===e):e:r[0]),[d,v]=react.useState(false),[S,h]=react.useState(null),w=react.useRef(null),N=react.useRef(null),C=react.useRef(null),T=react.useId(),I=react.useMemo(()=>s||T,[]),{reposition:M}=Ue(C,{direction:Bt.Bottom,offset:2}),{variant:L}=q(true),{className:D,style:E,rest:F}=R(g),G=k=>{b(k),v(false),c&&c(k);};return react.useImperativeHandle(o,()=>({setSelected:k=>{if(typeof k=="string"){let P=r.find(A=>A.value===k);P&&b(P);}else b(k);},getValue:()=>y||null})),react.useEffect(()=>{if(!d)return;let k=()=>{M();};return window.addEventListener("scroll",k,true),window.addEventListener("resize",M),()=>{window.removeEventListener("scroll",M,true),window.removeEventListener("resize",M);}},[d,M]),react.useEffect(()=>{if(!d){N.current&&(N.current.value=""),h(null);return}N.current?.focus(),M();let k=A=>{C.current&&!C.current.contains(A.target)&&v(false);},P=setTimeout(()=>{document.addEventListener("click",k);},0);return ()=>{clearTimeout(P),document.removeEventListener("click",k);}},[d,M]),jsxRuntime.jsxs(p,{className:`--select --${u||L} ${s?`--${s}`:""} rel`.trim(),name:I,children:[jsxRuntime.jsxs($,{ref:w,"data-value":y?typeof y=="string"?y:y.value:y||"-1",className:`--selected flex aic rel ${D}`.trim(),withLabel:false,style:E,onClick:k=>{k.stopPropagation(),v(P=>!P);},...F,children:[jsxRuntime.jsx(V,{className:"--label",children:y?typeof y=="string"?y:y.label:t||"Choose"}),jsxRuntime.jsx(p,{className:"--svg-arrow rel flex aic jcc",children:d?typeof f=="string"?jsxRuntime.jsx(X,{name:f,as:"--search-action"}):f:typeof a=="string"?jsxRuntime.jsx(X,{name:a,as:"--search-action"}):a})]}),jsxRuntime.jsxs(p,{id:I,className:"--options-list flex cols abs","aria-hidden":!d,style:{maxHeight:i||"auto"},ref:C,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:d,duration:.05},children:[l&&jsxRuntime.jsx(p,{as:"--select-search --sticky",children:jsxRuntime.jsx(te,{ref:N,onChange:k=>{h(k.target.value==""?null:k.target.value);},className:"--search-input",placeholder:m||"Search..."})}),(S==null?r:r.filter(k=>k.label.toLowerCase().includes(S.toLowerCase())||k.value.toLowerCase().includes(S.toLowerCase()))).map(k=>jsxRuntime.jsx(es,{updateValue:G,value:y,o:k},`option-${(typeof k=="string"?k:k.label).replace(/\s+/g,"-")}-${typeof k=="string"?k:k.value}`))]})]})};os.displayName="Zuz.Select";var bc=os;var rs=react.forwardRef((o,n)=>jsxRuntime.jsx(tt,{type:ye.Switch,...o,ref:n}));rs.displayName="Zuz.Switch";var vc=rs;var ss=o=>{let{idx:n,id:e,as:r,weight:t,style:s,value:u,render:l,resize:m,sortBy:i,sortable:a,onSort:f}=o,[c,g]=react.useState(0),y=()=>{a&&(f?.(String(e),c==1?-1:1),g(b=>b==1?-1:1));};return jsxRuntime.jsxs(p,{style:{flex:t||1,...s},as:`--col flex aic ${r||""} ${a?"--sortable":""}`,onClick:y,children:[jsxRuntime.jsx(p,{children:u}),n==-1&&a&&i==e&&jsxRuntime.jsx(p,{as:"--arrow flex aib",children:c==1?O.arrowUp:O.arrowDown})]})};ss.displayName="Zuz.Column";var Tt=ss;var is=o=>{let{index:n,pubsub:e,schema:r,data:t,ids:s,styles:u,animate:l,sortBy:m,selectable:i,tableRef:a,loading:f,rowClassName:c,onSort:g,onRowClick:y,onSelect:b,onContextMenu:d}=o,v=hooks.useDelayed(),S=react.useMemo(()=>({transition:U.SlideInBottom,curve:Z.EaseInOut,delay:.02*(n+1)}),[]),h=react.useRef(null),w=(C,T)=>{n==-1?e.emit(`ALL_ROWS_${C?"CHECKED":"UNCHECKED"}`,C):(b&&b(t,C),e.emit(`ROW_${C?"CHECKED":"UNCHECKED"}`,C,T));},N=(C,T,I)=>jsxRuntime.jsx(Tt,{idx:C,id:T,as:"--selector",pubsub:e,value:jsxRuntime.jsx(tt,{value:I,ref:h,onSwitch:w,type:ye.Default})});return react.useEffect(()=>{let C=(L,D)=>{h.current?.setChecked(L,false);},T=(L,D)=>{let E=false;a?.current&&a.current.querySelectorAll(".--row").forEach(F=>{let G=F;if(!G.classList.contains("--row-head")){let k=G.querySelector(".--selector input[type=checkbox]");k&&k.checked&&!E&&(E=k.checked);}}),h.current.setChecked(E,false);},I=L=>{h.current?.setChecked(L,false),b&&b(t,L);},M=L=>{h.current?.setChecked(L,false),b&&b(t,L);};return n==-1?(e.on("ROW_CHECKED",C),e.on("ROW_UNCHECKED",T),()=>{e.off("ROW_CHECKED",C),e.off("ROW_UNCHECKED",T);}):(e.on("ALL_ROWS_CHECKED",I),e.on("ALL_ROWS_UNCHECKED",M),()=>{e.off("ALL_ROWS_CHECKED",I),e.off("ALL_ROWS_UNCHECKED",M);})},[]),jsxRuntime.jsxs(p,{onContextMenu:C=>d?d(C,t):null,onClick:C=>y?y(C,o.data):()=>{},...l?{fx:{...S,when:v}}:{},as:`--row flex aic ${y?"--row-clickable":""} ${n==-1?"--row-head":""} ${c||""}`,children:[n==-1&&r.map((C,T)=>{let{renderWhenHeader:I,render:M,value:L,...D}=C;return jsxRuntime.jsxs(react.Fragment,{children:[i&&T==0&&N(-1,`--selector-${C.id}`,"all"),jsxRuntime.jsx(Tt,{idx:-1,onSort:g,sortBy:m,value:L,...D,pubsub:e,style:u[C.id]})]},`--col-${C.id}`)}),f&&n>-1&&jsxRuntime.jsx(p,{as:"--col",children:jsxRuntime.jsx(V,{as:"opacity:0",children:"..."})}),!f&&n>-1&&s&&t&&r.map((C,T)=>jsxRuntime.jsxs(react.Fragment,{children:[i&&T==0&&N(T,`--selector-${C.id}`,C.id.toString()),s.includes(String(C.id))?jsxRuntime.jsx(Tt,{pubsub:e,idx:T,id:String(C.id),style:u[String(C.id)],value:C.render?C.render(t,n):t[String(C.id).includes(".")?String(C.id).split(".").reverse()[0]:C.id]}):null]},`--${String(C.id)}-val-${T}`))]})};is.displayName="Zuz.Row";var Pt=is;var ps=(o,n)=>{let{schema:e,rows:r,rowCount:t,rowsPerPage:s,currentPage:u,pagination:l,paginationHash:m,showPaginationOnZeroPageCount:i,animateRows:a,header:f,rowClassName:c,selectableRows:g,hoverable:y,sortBy:b,loading:d,loadingRowCount:v,loadingMessage:S,spinner:h,emptyMessage:w,onSort:N,onRowClick:C,onRowSelectToggle:T,onPageChange:I,onRowContextMenu:M,...L}=o,D=react.useRef(null),E=react.useMemo(()=>e.reduce((ne,J)=>(ne[J.id]={flex:J.weight||1,...J.w&&{width:J.w},...J.maxW&&{maxWidth:J.maxW},...J.minW&&{minWidth:J.minW},...J.h&&{height:J.h},...J.maxH&&{maxHeight:J.maxH},...J.minH&&{minHeight:J.minH}},ne),{}),[e]),F=react.useMemo(()=>Object.keys(E),[e]),G=react.useMemo(()=>f??true,[f]),{style:k,className:P,rest:A}=R(L),z=react.useRef(null),K=react.useMemo(()=>new core.PubSub,[]),H=react.useRef(r.map(()=>core.uuid(8))),[_,Y]=react.useState(b||null),[oe,j]=react.useState(S||"loading"),pe=react.useMemo(()=>!d&&r&&r.length==0,[d,r]),de=react.useCallback(()=>w?typeof w=="function"?jsxRuntime.jsx(w,{}):w:jsxRuntime.jsx(V,{as:"tac s:18 mt:75",children:"No Record Found"}),[d,r]);react.useEffect(()=>{H.current=r.map(()=>core.uuid(8));},[r]);let Nt=(ne,J)=>{Y(ne),N?.(ne,J);},lt=(t||(r?r.length:0))/(s||10),Ie=react.useMemo(()=>i||lt>1?jsxRuntime.jsx(Po,{hash:m,ref:D,renderOnZeroPageCount:i,onPageChange:I,paginationStyle:"table",startPage:u,itemCount:t||(r?r.length:0),itemsPerPage:s||10}):null,[u,t]);return react.useImperativeHandle(n,()=>({setLoading(ne){}})),jsxRuntime.jsxs(p,{as:`--table ${y??true?"--hoverable":""} flex cols rel ${P}`,ref:z,children:[G==true&&jsxRuntime.jsx(Pt,{sortBy:_,onSort:Nt,tableRef:z,pubsub:K,selectable:g,index:-1,schema:e,loading:true,styles:E}),d&&jsxRuntime.jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsxRuntime.jsx(ge,{type:h||re.Simple}),oe&&jsxRuntime.jsx(V,{as:"--table-loading-message",children:oe})]}),d&&Array(v||5).fill({}).map((ne,J)=>jsxRuntime.jsx(Pt,{tableRef:z,index:J,pubsub:K,schema:e,styles:E,loading:true,animate:a,onRowClick:C},`--trow-loading-${J}-${e[0].id}`)),!d&&r&&r.map((ne,J)=>jsxRuntime.jsx(Pt,{tableRef:z,pubsub:K,loading:false,index:J,schema:e,ids:F,styles:E,animate:a,data:ne,onRowClick:C,rowClassName:c,selectable:g,onSelect:T,onContextMenu:M},`--trow-${H.current[J]||J}-${e[0].id}`)),pe&&de(),jsxRuntime.jsx(p,{"aria-hidden":!l||!Ie,...a?{fx:{transition:U.SlideInBottom,curve:Z.EaseInOut,delay:.02*(r.length+1),when:!d&&r&&l&&Ie!=null}}:{},as:"--row flex aic --row-footer",children:l&&Ie?Ie:null})]})};ps.displayName="Zuz.Table";var Oc=react.forwardRef(ps),Dc=Oc;var Vc=({ref:o,...n})=>{let{title:e,items:r}=n,[t,s]=react.useState(0),u=(l,m,i)=>{l.preventDefault(),s(m),document.getElementById(i)?.scrollIntoView({behavior:"smooth"});};return jsxRuntime.jsxs(p,{ref:o,as:"--table-of-contents rel flex cols",children:[jsxRuntime.jsx(V,{as:"--toc-title",children:e}),jsxRuntime.jsx(Le,{items:r.map((l,m)=>jsxRuntime.jsx("a",{className:t==m?"--toc-active":"",style:{anchorName:t===m?"--toc-active":"none",color:t==m?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:i=>u(i,m,l.tag),href:`#${l.tag}`,children:l.label}))})]})},Ac=Vc;var us=({isActive:o,transitionType:n,speed:e,width:r,render:t,content:s,onHeightChange:u})=>{let l=react.useRef(null),m=hooks.useResizeObserver(l);react.useEffect(()=>{o&&m.height>0&&u(m.height);},[o,m.height]);let i=react.useMemo(()=>{let a={flexShrink:0,height:"fit-content"};return n==="fade"?{...a,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,visibility:o?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:o?1:0}:n==="scale"?{...a,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,transform:`scale(${o?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:o?1:0}:a},[o,n,r,e]);return jsxRuntime.jsx(p,{ref:l,style:{...i},className:"--content",children:t||o?s:null})};us.displayName="Zuz.TabBody";var fs=us;var hs=({ref:o,...n})=>{let{tabs:e,speed:r=.3,prerender:t=true,variant:s,tabStyle:u="fixed",onChange:l,transitionType:m="slide",...i}=n,[a,f]=react.useState(0),c=react.useRef(null),g=hooks.useResizeObserver(c),y=react.useMemo(()=>core.uuid(8),[]),[b,d]=react.useState("auto"),v=react.useMemo(()=>g.width>0,[g.width]);react.useImperativeHandle(o,()=>({setTab:T=>f(T)}));let S=react.useMemo(()=>e.map(T=>({...T,key:T.key||core.uuid(8)})),[e]),{style:h,className:w,rest:N}=R({as:`flex cols w-full no-overflow ${i.as||""}`,...i}),C=()=>{if(!v)return {opacity:0};switch(m){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${a*g.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxRuntime.jsxs(p,{ref:c,style:h,className:`--tabview --${u} flex cols ${w}`,children:[jsxRuntime.jsx(ot,{as:"--tabview-head",onSwitch:T=>{f(T.index);let I=S.find(M=>M.tag==T.tag);I&&I.onSelect&&(I.onSelect(I,T.index),l?.(I,T.index));},selected:a,items:S.reduce((T,I,M)=>(T.push({icon:I.icon,index:M,label:I.label,tag:I.tag}),T),[])}),jsxRuntime.jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:b,transition:v?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:v?1:0},children:jsxRuntime.jsx(p,{className:"--track",style:{...C()},children:S.map((T,I)=>jsxRuntime.jsx(fs,{isActive:I===a,transitionType:m,speed:r,width:g.width,render:t||I===a,onHeightChange:M=>I===a&&d(M),content:T.body},`tab-body-${T.key||I}-${y}`))})})]})};hs.displayName="Zuz.TabView";var qc=hs;var Jc=({ref:o,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:t="zuz ~ ",variant:s,...u})=>{let[l,m]=react.useState([{type:"output",content:r}]),[i,a]=react.useState(""),f=react.useRef(null),c=react.useRef(null),{variant:g}=q(true);react.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[l]);let y=w=>{let N=typeof w=="string"?{type:"output",content:w}:w;m(C=>{let T=[...C,N];return T.length>1e3?T.slice(-1e3):T});},b=()=>m([]);react.useImperativeHandle(o,()=>({write:y,clear:b}));let d=async w=>{let[N,...C]=w.split(" "),T=N.toLowerCase();return n&&n[T]?await n[T](C):e?await e(w):`command not found: ${N}`},v=w=>{let N=/\u001b\[(\d+)m/g,C=[],T={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},I=0,M="#d4d4d4",L=false,D;for(;(D=N.exec(w))!==null;){let F=w.slice(I,D.index);F&&C.push({text:F,color:M,bold:L});let G=D[1];G==="0"?(M="#d4d4d4",L=false):G==="1"?L=true:T[G]&&(M=T[G]),I=N.lastIndex;}let E=w.slice(I);return E&&C.push({text:E,color:M,bold:L}),C},S=(w,N)=>w.includes("\x1B")?v(w).map((C,T)=>jsxRuntime.jsx(Q,{style:{color:C.color||"#d4d4d4",fontWeight:C.bold?"bold":"normal"},children:C.text},`--terminal-msg-${T}-${C.text.replace(/\S+/g,"-")}`)):jsxRuntime.jsx(Q,{style:{color:N==="error"?"#ff5f56":N==="command"?"#00ff00":"#d4d4d4"},children:w}),h=async w=>{if(w.key==="Enter"&&i.trim()){let N=i.trim(),C=[...l,{type:"command",content:`${t}${N}`}];a(""),m(C);let T=await d(N);m(I=>[...I,{type:"output",content:T}]);}};return jsxRuntime.jsxs(p,{as:`--zuz-terminal --${s||g||W.Medium} flex cols ${u.className}`,onClick:()=>c.current?.focus(),children:[jsxRuntime.jsx(p,{ref:f,className:"--terminal-log",children:l.map((w,N)=>jsxRuntime.jsx(p,{children:jsxRuntime.jsx(V,{children:S(w.content,w.type)})},N))}),jsxRuntime.jsxs(p,{as:"flex aic --terminal-input",children:[jsxRuntime.jsx(V,{as:"--terminal-prompt",children:t}),jsxRuntime.jsx(te,{ref:c,className:"--zuz-term-input",autoFocus:true,value:i,variant:s||g||W.Medium,onChange:w=>a(w.target.value),onKeyDown:h})]})]})},jc=Jc;var ep=({meta:o})=>jsxRuntime.jsxs($,{as:"flex aic --command-item",children:[o.icon&&jsxRuntime.jsx(X,{name:o.icon,as:"--command-icon"}),jsxRuntime.jsx(V,{children:o.label})]}),tp=({position:o,onSelect:n,commands:e,visible:r})=>jsxRuntime.jsx(p,{"aria-hidden":!r,fx:{transition:U.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...o},children:e.map(t=>jsxRuntime.jsx(ep,{meta:t},`cmd-${t.label.replace(/\s+/,"-")}`))}),ws=tp;var Cs=react.forwardRef((o,n)=>{let{autoResize:e,maxHeight:r,variant:t,resize:s="none",command:u,commands:l,onInput:m,cmd:i,renderDropdown:a,value:f,defaultValue:c,...g}=o,y=react.useRef(null),b=react.useRef(null),{variant:d}=q(true),{style:v,className:S,rest:h}=R(g),{showDropdown:w,dropdownPosition:N,handleKeyDown:C,handleInput:T,handleCommandSelect:I}=hooks.useCommandActions({command:u,commands:l,cmd:i,ref:y}),M=react.useCallback(()=>{let D=y.current;!D||!e||(b.current&&cancelAnimationFrame(b.current),b.current=requestAnimationFrame(()=>{D.style.height="auto";let E=D.scrollHeight;if(r){let F=parseInt(r.toString(),10);isNaN(F)||(E=Math.min(E,F));}D.style.height=`${E}px`,D.style.overflowY=r&&E>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),L=D=>{m?.(D),T(D),M();};return react.useEffect(()=>{M();},[f,c,M]),react.useEffect(()=>{e&&y.current&&M();},[e,M]),react.useEffect(()=>()=>{b.current&&cancelAnimationFrame(b.current);},[]),jsxRuntime.jsxs(p,{as:"rel",children:[jsxRuntime.jsx("textarea",{className:`--input --textarea --${t||d||W.Medium} flex ${S}`.trim(),style:{...v,resize:s,height:e?"auto":v?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:C,onInput:L,ref:D=>{typeof n=="function"?n(D):n&&(n.current=D),y.current=D;},value:f,defaultValue:c,...h}),a?a({show:w,position:N,commands:l||[],onSelect:I}):l&&l.length>0&&jsxRuntime.jsx(ws,{visible:w,commands:l,onSelect:I,position:N})]})});Cs.displayName="Zuz.TextArea";var ap=Cs;var Ps=react.forwardRef((o,n)=>{let{as:e,value:r,color:t,direction:s,...u}=o,l=react.useRef(null),[m,i]=react.useState(r||0);return react.useImperativeHandle(n,()=>({updateValue(a){m.toString().length!==a.toString().length&&i(a);},setValue(a){if(this.updateValue(a),l.current){let f=a.toString().split("");l.current.querySelectorAll(".--wheel-char").forEach((c,g)=>{let y=f[g];if(c instanceof HTMLElement){c.setAttribute("data-value",y);let b=c.querySelector(".--wheel-char-track");b instanceof HTMLElement&&(b.style.setProperty("--v",y),b.offsetWidth);}});}}})),react.useEffect(()=>{i(r||0);},[r]),jsxRuntime.jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:l,...u,children:[(m||0).toString().split("").map((a,f)=>isNaN(parseInt(a,10))?jsxRuntime.jsx(Q,{className:"--wheel-char wheel-char-symbol grid",children:a},`wheel-char-symbol-${f}`):jsxRuntime.jsx(Q,{"data-value":a,className:`--wheel-char grid ${f>(m||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxRuntime.jsxs(Q,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":a},children:[jsxRuntime.jsx(Q,{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((c,g)=>jsxRuntime.jsx(Q,{children:c},`${f}--${g}`)),jsxRuntime.jsx(Q,{children:!s||s==="down"?9:0})]})},`wheel-char-${f}`)),t&&jsxRuntime.jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${t}, transparent, transparent, transparent, ${t})`}})]})});Ps.displayName="Zuz.TextWheel";var fp=Ps;var Es=react.forwardRef((o,n)=>{let{title:e,position:r,margin:t,children:s,...u}=o,{style:l,className:m,rest:i}=R(u),[a,f]=react.useState(false),c=react.useMemo(()=>r||ee.Top,[]),g=react.useRef(null),y=react.useRef(null),b=h=>{},d=typeof ResizeObserver<"u"?new ResizeObserver(b):{observe:()=>{},unobserve:()=>{}},v=hooks.useDimensions(),S=react.useMemo(()=>{if(!y.current)return {left:0,top:0};let h=y.current.previousElementSibling;if(h){let w=h.getBoundingClientRect();switch(d.observe(h),c){case ee.Top:return {left:w.left+w.width/2,top:w.top-(t||25)};case ee.Bottom:return {left:w.left+w.width/2,top:w.top+(t||25)};case ee.Left:return {left:w.left-w.width/2,top:w.top+w.height/2};case ee.Right:return {left:w.right,top:w.top+w.height/2};default:return {left:0,top:0}}}},[y.current,v,d]);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(p,{ref:g,className:"--with-tooltip rel",onMouseEnter:h=>f(true),onMouseLeave:h=>f(false),children:[s,jsxRuntime.jsx(p,{ref:y,style:{left:S?.left+"px",top:S?.top+"px"},className:`--tooltip --${r||ee.Top} fixed ${m}`.trim(),fx:{from:c==ee.Bottom||c==ee.Top?{opacity:0,x:"-50%",y:c==ee.Top?-5:5}:{opacity:0,y:"-50%",x:c==ee.Right?15:-25},to:c==ee.Bottom||c==ee.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:c==ee.Right?10:-20},curve:Z.EaseInOut,when:a},children:jsxRuntime.jsx(V,{className:"--text rel",children:e})})]})});Es.displayName="Zuz.ToolTip";var yp=Es;var Do=react.forwardRef((o,n)=>{let{as:e,meta:r,nodes:t,icons:s,onSelect:u,treeTag:l,selected:m,roots:i,expanded:a,...f}=o,{tag:c,label:g,icon:y,under:b,isHead:d}=r,v=react.useMemo(()=>i.includes(c),[i]),[S,h]=react.useState(a),w=()=>{localStorage.setItem(`--tn${l}-${c}`,S?"0":"1"),h(!S);};react.useEffect(()=>{a||v&&!localStorage.getItem(`--tn${l}-${c}`)?(localStorage.setItem(`--tn${l}-${c}`,"1"),h(true)):h(localStorage.getItem(`--tn${l}-${c}`)=="1");},[]);let N=react.useMemo(()=>t.filter(C=>C.under==c),[t,c]);return jsxRuntime.jsxs(p,{className:`--treenode ${v?"--is-root":""} --treenode-${c} flex cols`,children:[jsxRuntime.jsxs(p,{className:`--node --node-${c} flex aic ${m==c?" --selected":""}`,children:[jsxRuntime.jsx($,{skeleton:f.skeleton,onClick:w,className:"--node-aro-btn",disabled:N.length==0,children:s?.arrowClose&&s?.arrowOpen?jsxRuntime.jsx(X,{skeleton:f.skeleton,className:"--node-aro-icon",name:N.length==0?s?.arrowDisabled||s?.arrowClose:S?s?.arrowOpen:s?.arrowClose}):N.length==0?O.chevronBottom:S?O.chevronBottom:O.chevronRight}),jsxRuntime.jsxs($,{className:"--node-meta flex aic",onClick:C=>u(c),children:[(s?.nodeOpen&&s?.nodeClose||v&&s?.rootOpen&&s?.rootClose)&&jsxRuntime.jsx(X,{skeleton:f.skeleton,className:`--node-icon ${v?"--icon-root":""}`,name:y||(S?v&&s?.rootOpen||s.nodeOpen:v&&s?.rootClose||s?.nodeClose)}),jsxRuntime.jsx(V,{className:`--node-label ${v?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:g})]})]}),S&&N.length>0&&jsxRuntime.jsx(p,{className:`--sub-node tree-sub-node-${c} flex cols`,children:N.map(C=>jsxRuntime.jsx(Do,{treeTag:l,selected:m,onSelect:u,icons:s,roots:i,expanded:C.expanded||false,meta:C,nodes:t},`--node-${C.tag}`))})]})});Do.displayName="TreeItem";var Ls=Do;var ks=react.forwardRef((o,n)=>{let{as:e,nodes:r,onNodeSelect:t,tag:s,icons:u,roots:l,selected:m,...i}=o,[a,f]=react.useState(m);react.useImperativeHandle(n,()=>({getSelected:()=>a}),[t]);let c=g=>{f(g),t&&t(g);};return react.useEffect(()=>{a!=m&&f(m);},[m]),jsxRuntime.jsx(p,{className:"--treeview flex cols",children:r.filter(g=>l.includes(g.tag)).map(g=>jsxRuntime.jsx(Ls,{treeTag:s?`-${s}`:"",selected:a,onSelect:y=>c(y),icons:u,meta:g,roots:l,expanded:g.expanded||false,skeleton:i.skeleton,nodes:r},`--node-${g.tag}`))})});ks.displayName="Zuz.TreeView";var Ip=ks;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
14
|
+
Object.defineProperty(exports,"PACKAGE_NAME",{enumerable:true,get:function(){return chunkHIAJLWFZ_cjs.f}});Object.defineProperty(exports,"cleanProps",{enumerable:true,get:function(){return chunkHIAJLWFZ_cjs.g}});Object.defineProperty(exports,"splitAtoms",{enumerable:true,get:function(){return chunkHIAJLWFZ_cjs.h}});exports.ALERT=le;exports.AVATAR=zo;exports.Accordion=li;exports.ActionBar=di;exports.Alert=xi;exports.AutoComplete=Di;exports.Avatar=Zi;exports.Badge=Wi;exports.Box=p;exports.Bubble=bl;exports.BubbleMediaType=rn;exports.BubbleStatus=on;exports.Button=$;exports.CHART=Jr;exports.CHECKBOX=ye;exports.COLORTHEME=Lp;exports.Calendar=io;exports.Chart=ul;exports.CheckBox=tt;exports.CodeBlock=Bl;exports.ColorScheme=Wl;exports.ContextMenu=_t;exports.CookiesConsent=Xl;exports.Cover=Ne;exports.CropShape=rm;exports.Cropper=tm;exports.Crumb=sm;exports.DATATYPE=Op;exports.DIALOG=De;exports.DIALOG_ACTION_POSITION=_o;exports.DRAWER_SIDE=se;exports.DatePicker=mm;exports.Dialog=Zt;exports.Drawer=Yt;exports.FILTER=pt;exports.FORMVALIDATION=be;exports.FORMVALIDATION_STYLE=Dp;exports.Fab=fm;exports.Filters=hm;exports.Form=Bm;exports.Grid=Om;exports.Group=Ft;exports.Icon=X;exports.Image=Je;exports.Input=te;exports.KeyboardKeys=So;exports.KeysLabelMap=An;exports.KeysMap=Vn;exports.Label=et;exports.LayersProvider=$t;exports.List=Le;exports.NetworkStatus=_m;exports.ORIGIN=Ke;exports.OriginType=Mp;exports.Overlay=Ee;exports.POSITION=Bt;exports.PROGRESS=Vp;exports.Pagination=Po;exports.PaginationStyle=Co;exports.Password=Qm;exports.PinInput=tc;exports.Position=ee;exports.ProgressBar=mo;exports.RADIO=Mt;exports.Radio=sc;exports.SHEET=me;exports.SHEET_ACTION_POSITION=Lt;exports.SKELETON=Bp;exports.SLIDER=ct;exports.SORT=kp;exports.SPINNER=re;exports.ScrollView=Wt;exports.Search=fc;exports.Select=bc;exports.SelectTabs=ot;exports.Sheet=vm;exports.Slider=go;exports.Span=Q;exports.Spinner=ge;exports.Status=Hp;exports.Switch=vc;exports.TRANSITIONS=U;exports.TRANSITION_CURVES=Z;exports.TabView=qc;exports.Table=Dc;exports.TableOfContents=Ac;exports.Terminal=jc;exports.Text=V;exports.TextWheel=fp;exports.Textarea=ap;exports.ThemeProvider=Us;exports.ToastDefaultTitle=Pr;exports.ToastProvider=Qt;exports.ToastType=Tr;exports.ToolTip=yp;exports.TreeView=Ip;exports.Variant=W;exports.animationTransition=We;exports.buildClassString=kt;exports.buildWithStyles=Ko;exports.css=ru;exports.getAnimationCurve=Ot;exports.getAnimationTransition=nu;exports.getZuzMap=Ds;exports.isKeyCombination=Hn;exports.setZuzMap=Zo;exports.useBase=R;exports.useContextMenu=oi;exports.useDialog=Wa;exports.useDrawer=Ya;exports.useFx=ae;exports.useMorph=ja;exports.usePosition=Ue;exports.useToast=jt;
|