@app-studio/web 0.9.88 → 0.9.89

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/web.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),s=require("app-studio"),$i=require("lucide-react/dynamic"),Bo=require("zustand"),Li=require("react-dom"),ke=require("formik");function Di(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Q=Di(g),Ao=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Hi=({type:e="single",value:t,defaultValue:o,onValueChange:r,collapsible:a=!1})=>{const i=t!==void 0,l=t??o,d=()=>e==="multiple"?Array.isArray(l)?l:l?[l]:[]:Array.isArray(l)?l[0]:l,[c,u]=g.useState(d()),p=g.useMemo(()=>Ao("accordion"),[]),m=i?t:c,h=g.useMemo(()=>m===void 0?[]:Array.isArray(m)?m:[m],[m]);g.useEffect(()=>{i&&(e==="multiple"&&!Array.isArray(t)?(console.warn('Accordion with type="multiple" received non-array value:',t),u(t?[String(t)]:[])):e==="single"&&Array.isArray(t)?(console.warn('Accordion with type="single" received array value:',t),u(t.length>0?t[0]:void 0)):u(t))},[t,i,e]);const x=g.useCallback(b=>{let y;if(e==="single")m===b&&a?y=void 0:m!==b?y=b:y=m;else{const k=Array.isArray(m)?m:[];k.includes(b)?y=k.filter(j=>j!==b):y=[...k,b],Array.isArray(y)&&y.length===0&&(y=[])}i||u(y),r&&r(y)},[e,m,a,i,r]),f=g.useCallback(b=>h.includes(b),[h]);return{expandedItems:h,toggleItem:x,isItemExpanded:f,type:e,collapsible:a,baseId:p}},Bi={square:{borderRadius:0},rounded:{borderRadius:8}},Ai={default:{backgroundColor:"transparent",borderWidth:0,transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",transition:"border-color 0.15s ease, background-color 0.15s ease",_hover:{borderColor:"color-gray-300"}},filled:{backgroundColor:"color-gray-50",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-100"}}},Zr=g.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Fi=({children:e,value:t})=>n.jsx(Zr.Provider,{value:t,children:e}),en=()=>{const e=g.useContext(Zr);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},Oi=({value:e,children:t,isDisabled:o=!1,views:r,...a})=>{const{isItemExpanded:i,baseId:l}=en(),d=i(e),c=`${l}-trigger-${e}`,u=`${l}-content-${e}`;return n.jsx(s.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:o?.5:1,pointerEvents:o?"none":"auto","data-state":d?"open":"closed","data-disabled":o?"":void 0,...r==null?void 0:r.item,...a,children:g.Children.map(t,p=>g.isValidElement(p)?g.cloneElement(p,{...p.props,value:e,isExpanded:d,isDisabled:o,triggerId:c,contentId:u}):p)})},vi=({children:e,value:t,isExpanded:o,isDisabled:r,triggerId:a,contentId:i,views:l,asChild:d=!1,...c})=>{const{toggleItem:u}=en(),m={id:a,"aria-expanded":o,"aria-controls":i,"aria-disabled":r,"data-state":o?"open":"closed","data-disabled":r?"":void 0,onClick:()=>{t&&!r&&u(t)},padding:16,cursor:r?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...l==null?void 0:l.container,...c};if(d&&g.isValidElement(e)){const h=g.Children.only(e);return g.cloneElement(h,{...m,...h.props})}return n.jsxs(s.Horizontal,{...m,children:[e,n.jsx(s.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:o?"rotate(180deg)":"rotate(0deg)",...l==null?void 0:l.icon,children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},Ni=({children:e,isExpanded:t,isDisabled:o,triggerId:r,contentId:a,views:i,...l})=>t?n.jsx(s.View,{id:a,role:"region","aria-labelledby":r,padding:16,backgroundColor:"color-white",maxHeight:t?"1000px":"0",transition:"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",opacity:1,overflow:"hidden","data-state":t?"open":"closed","data-disabled":o?"":void 0,...i==null?void 0:i.container,...l,children:e}):null,Ui=({children:e,shape:t="rounded",variant:o="default",views:r,baseId:a,type:i,collapsible:l,themeMode:d,...c})=>n.jsx(s.Vertical,{width:"100%","data-orientation":"vertical",...Bi[t],...Ai[o],...r==null?void 0:r.container,...c,children:e}),qi=({children:e,type:t="single",value:o,defaultValue:r,onValueChange:a,collapsible:i=!1,shape:l="rounded",variant:d="default",views:c,...u})=>{const p=Array.isArray(r)?r:r?[r]:void 0,m=Hi({type:t,value:o,defaultValue:r??p,onValueChange:a,collapsible:i});return n.jsx(Fi,{value:{expandedItems:m.expandedItems,toggleItem:m.toggleItem,isItemExpanded:m.isItemExpanded,type:m.type,collapsible:m.collapsible,baseId:m.baseId},children:n.jsx(Ui,{shape:l,variant:d,views:c,baseId:m.baseId,type:m.type,collapsible:m.collapsible,...u,children:e})})},Jt=qi;Jt.Item=Oi;Jt.Trigger=vi;Jt.Content=Ni;const yr=({widthHeight:e,color:t="currentColor",transform:o,orientation:r="up",children:a,...i})=>n.jsx(s.Center,{widthHeight:e,lineHeight:e,color:t,display:"flex",transform:o||(r==="left"?"rotate(-90deg)":r==="right"?"rotate(90deg)":r==="up"?"rotate(0deg)":r==="down"?"rotate(180deg)":"none"),...i,children:a}),Gi=(e,t,o)=>{const{getColor:r}=s.useTheme(),a=r(t);return{fill:e?a:"none",stroke:a,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}},Ot=({name:e="circle",widthHeight:t=24,color:o="currentColor",filled:r=!1,strokeWidth:a=1,size:i,children:l,...d})=>{const c=i||t;if(!e)return n.jsx(yr,{widthHeight:t,color:o,...d,children:l});const u=Gi(r,o,a);return n.jsx(yr,{widthHeight:c,color:o,...d,children:n.jsx($i.DynamicIcon,{name:e,size:c,...u})})},N=(e,t={})=>{const o=r=>n.jsx(Ot,{name:e,...t,...r});return o.displayName=`${e}Icon`,o},Yi=N("user",{filled:!1}),Xi=N("circle-help",{filled:!1}),Ki=N("folder",{filled:!1}),ie=N("chevron-up",{filled:!1}),Qi=N("grip-vertical",{filled:!1}),xt=N("file",{filled:!1}),Ji=N("video",{filled:!1}),Zi=N("image",{filled:!1}),Zt=N("volume",{filled:!1}),el=N("twitter",{filled:!1}),tl=N("x",{filled:!1}),ol=N("twitch",{filled:!1}),xe=N("x",{filled:!1,strokeWidth:2}),rl=N("instagram",{filled:!1}),nl=N("youtube",{filled:!1}),al=N("facebook",{filled:!1}),il=N("linkedin",{filled:!1}),ll=N("at-sign",{filled:!1}),tn=N("minus",{filled:!1}),Re=N("info",{filled:!1}),Fo=N("play",{filled:!1}),on=N("pause",{filled:!1}),cl=N("heart",{filled:!1}),sl=N("star",{filled:!1}),dl=N("save",{filled:!1}),Oo=N("triangle-alert",{filled:!1}),ul=N("battery",{filled:!1}),pl=N("bookmark",{filled:!1}),gl=N("cloud",{filled:!1}),ml=N("copy",{filled:!1}),eo=N("trash",{filled:!1}),hl=eo,fl=N("edit",{filled:!1}),vo=N("mic",{filled:!1}),to=N("square",{filled:!1}),No=N("send",{filled:!1}),Uo=N("loader",{filled:!1}),bt=N("paperclip",{filled:!1}),vt=N("search",{filled:!1}),xl=N("home",{filled:!1}),rn=N("settings",{filled:!1}),bl=N("download",{filled:!1}),nn=N("share",{filled:!1}),oo=N("check",{filled:!1}),yl=N("plus",{filled:!1}),qo=N("eye-off",{filled:!1}),Go=N("eye",{filled:!1}),kl=N("lock",{filled:!1}),Cl=N("user",{filled:!1}),an=N("external-link",{filled:!1}),Yo=N("check-circle",{filled:!1}),ro=N("alert-circle",{filled:!1}),jl=N("bell",{filled:!1}),Sl=N("file-text",{filled:!1}),wl=N("bar-chart",{filled:!1}),Il=N("moon",{filled:!1}),ln=N("panel-left",{filled:!1}),Xo=N("upload",{filled:!1}),Tl=oo,Ml=e=>n.jsx(ie,{orientation:"left",...e}),Rl=N("zoom-out",{filled:!1}),zl=N("type",{filled:!1}),El=N("shapes",{filled:!1}),Vl=N("rotate-cw",{filled:!1}),Pl=N("gift",{filled:!1}),_l=N("shield",{filled:!1}),Wl=N("log-out",{filled:!1}),$l=N("power",{filled:!1}),Ll=N("link",{filled:!1}),Dl=N("layout",{filled:!1}),Hl=N("zap",{filled:!1}),Bl=N("credit-card",{filled:!1}),Al=N("more-horizontal",{filled:!1}),Fl=eo,Ol=N("filter",{filled:!1}),vl=N("calendar",{filled:!1}),Nl=N("clock",{filled:!1}),Ul=N("map-pin",{filled:!1}),ql=N("menu",{filled:!1}),Gl=N("refresh-cw",{filled:!1}),Yl=N("printer",{filled:!1}),Xl=N("wand",{filled:!1}),Kl=N("thumbs-down",{filled:!1}),Ql=N("thumbs-up",{filled:!1}),Jl=N("camera",{filled:!1}),Zl=N("bluetooth",{filled:!1}),ec=N("unlock",{filled:!1}),tc=N("wifi",{filled:!1}),oc=N("arrow-right",{filled:!1}),rc=N("arrow-up",{filled:!1}),nc=N("loader",{filled:!1}),ac=N("sliders-horizontal",{filled:!1}),ic=N("crop",{filled:!1}),lc=N("zoom-in",{filled:!1}),cc=N("grip-horizontal",{filled:!1}),cn=N("mouse-pointer-2",{filled:!1}),sc=e=>({default:{container:{backgroundColor:"color-gray-50",borderColor:"color-gray-200",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},content:{color:"color-gray-700"},icon:{color:"color-gray-500"}},info:{container:{backgroundColor:"color-blue-50",borderColor:"color-blue-200",boxShadow:"0 1px 2px rgba(59, 130, 246, 0.05)"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",borderColor:"color-green-200",boxShadow:"0 1px 2px rgba(34, 197, 94, 0.05)"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},error:{container:{backgroundColor:"color-red-50",borderColor:"color-red-200",boxShadow:"0 1px 2px rgba(239, 68, 68, 0.05)"},content:{color:"color-red-700"},icon:{color:"color-red-500"}},warning:{container:{backgroundColor:"color-orange-50",borderColor:"color-orange-200",boxShadow:"0 1px 2px rgba(249, 115, 22, 0.05)"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}}}),dc=({icon:e,title:t="",views:o,description:r="",variant:a="default",themeMode:i,children:l,...d})=>{const{themeMode:c}=s.useTheme(),u=sc(),p=()=>{var x;if(e)return e;const h={size:20,color:((x=o==null?void 0:o.icon)==null?void 0:x.color)??u[a].icon.color};switch(a){case"info":return n.jsx(Re,{...h});case"success":return n.jsx(Yo,{...h});case"error":return n.jsx(ro,{...h});case"warning":default:return n.jsx(Oo,{...h})}};return n.jsxs(s.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:u[a].container.borderColor,backgroundColor:u[a].container.backgroundColor,boxShadow:u[a].container.boxShadow,transition:"all 0.2s ease",...o==null?void 0:o.container,...d,children:[n.jsx(s.View,{alignSelf:"flex-start",marginTop:"2px",...o==null?void 0:o.icon,children:p()}),n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsx(s.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...o==null?void 0:o.title,children:t}),n.jsx(s.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...o==null?void 0:o.description,children:r||l})]})]})},uc=e=>n.jsx(dc,{...e}),pc=uc,gc=({ratio:e=16/9,children:t,views:o,...r})=>n.jsx(s.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...r,...o==null?void 0:o.center,children:n.jsx(s.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...o==null?void 0:o.view,children:t})}),mc=({ratio:e,children:t,...o})=>n.jsx(gc,{ratio:e,...o,children:t}),hc=mc;function fc(e,t,o){return Math.min(Math.max(e,t),o)}const xc=({bars:e,isPaused:t,...o})=>n.jsx(s.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...o,children:e.map((a,i)=>n.jsx(s.View,{width:2,backgroundColor:t?"color-gray-200":a>=0?"color-gray-900":"color-gray-500",style:{height:`${fc(a*300,2,32)}px`}},i))}),Ko=({analyserNode:e,isPaused:t,...o})=>{const r=g.useRef(null),a=60,i=32,[l,d]=g.useState([]);return g.useEffect(()=>{if(!e){d(Array(a).fill(-1));return}const c=e.frequencyBinCount,u=new Uint8Array(c),p=()=>{e.getByteTimeDomainData(u);let m=0;for(let x=0;x<c;x++){const f=(u[x]-128)/128;m+=f*f}const h=Math.sqrt(m/c);g.startTransition(()=>{d(x=>{const b=[...x,h].slice(-a);return b.length<a?[...Array(a-b.length).fill(-1),...b]:b})})};return r.current=setInterval(p,i),()=>{r.current&&clearInterval(r.current)}},[e]),n.jsx(xc,{bars:l,isPaused:t,...o})},no=Bo.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(t,o="",r="",a,i,l,d,c,u)=>e({visible:!0,variant:t,title:o,subtitle:r,isClosable:a,views:i,action:l,actionText:d,showIcon:c,timeout:u}),hide:()=>e({visible:!1})})),sn=(e,t,o,r)=>{no.getState().show(e,t,o,r==null?void 0:r.isClosable,r==null?void 0:r.views,r==null?void 0:r.action,r==null?void 0:r.actionText,r==null?void 0:r.showIcon,r==null?void 0:r.timeout)},dn=()=>{no.getState().hide()},bc={info:{container:{backgroundColor:"color-blue-200",border:"color-blue-400"},icon:{color:"color-blue-500",name:"InformationIcon"},content:{color:"color-blue-500"},close:{color:"color-blue-500",name:"CloseIcon"}},success:{container:{backgroundColor:"color-green-200",border:"color-green-400"},icon:{color:"color-green-500",name:"SuccessIcon"},content:{color:"color-green-500"},close:{color:"color-green-500",name:"CloseIcon"}},error:{container:{backgroundColor:"color-red-200",border:"color-red-400"},icon:{color:"color-red-500",name:"ErrrorIcon"},content:{color:"color-red-500"},close:{color:"color-red-500",name:"CloseIcon"}},warning:{container:{backgroundColor:"color-orange-200",border:"color-orange-400"},icon:{color:"color-orange-500",name:"ErrrorIcon"},content:{color:"color-orange-500"},close:{color:"color-orange-500",name:"CloseIcon"}}},un=({variant:e,hide:t,title:o,subtitle:r,theme:a,action:i,actionText:l,showIcon:d=!1,isClosable:c=!1,timeout:u=3e3,views:p})=>{var k,j;g.useEffect(()=>{if(u&&!c){const S=setTimeout(()=>{t()},u);return()=>{clearTimeout(S)}}},[]);const m=a??bc,h=!!(i&&l),x={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${m[e].container.border}`},f={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],b={info:n.jsx(Re,{widthHeight:24,color:f,...p==null?void 0:p.icon}),success:n.jsx(Yo,{widthHeight:24,color:f,...p==null?void 0:p.icon}),warning:n.jsx(Oo,{widthHeight:24,color:f,...p==null?void 0:p.icon}),error:n.jsx(ro,{widthHeight:24,color:f,...p==null?void 0:p.icon})}[e],y=d&&b;return n.jsxs(s.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${m[e].content.color}`,backgroundColor:`${m[e].container.backgroundColor}`,onClick:c?()=>{}:()=>{t()},...x,...p==null?void 0:p.container,children:[y&&b,n.jsxs(s.Vertical,{gap:8,width:"100%",children:[n.jsx(s.Text,{size:"md",weight:"semiBold",...p==null?void 0:p.title,children:o}),r&&n.jsx(s.Text,{size:"sm",...p==null?void 0:p.subtitle,children:r})]}),h&&n.jsx(s.Text,{marginRight:10,onClick:i,padding:"6px 10px",whiteSpace:"nowrap",...x,...p==null?void 0:p.actionText,children:l}),c&&n.jsx(s.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{t()},...(k=p==null?void 0:p.closingIcon)==null?void 0:k.container,children:n.jsx(xe,{widthHeight:18,color:f,...(j=p==null?void 0:p.closingIcon)==null?void 0:j.icon})})]})},yc=({container:e,theme:t,position:o="topRight"})=>{const{visible:r,title:a,variant:i,subtitle:l,isClosable:d,views:c,action:u,actionText:p,showIcon:m,timeout:h}=no(),x={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[o],f=()=>n.jsx(un,{variant:i,subtitle:l,show:r,title:a,theme:t,isClosable:d,views:c,action:u,actionText:p,showIcon:m,timeout:h,hide:()=>dn()}),b=e?g.cloneElement(e,{},f()):n.jsx(s.View,{position:"absolute",zIndex:1e4,...x,children:f()});return r?b:null},kc=(e,t)=>{const o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{o.currentTime=1},o.oncanplay=()=>{const r=document.createElement("canvas");r.width=o.videoWidth,r.height=o.videoHeight;const a=r.getContext("2d");if(a){a.drawImage(o,0,0,r.width,r.height);const i=r.toDataURL("image/jpeg");t(i)}URL.revokeObjectURL(o.src)},o.src=URL.createObjectURL(e)},Cc=({maxSize:e=100*1024*1024,onFileSelect:t,onMultipleFileSelect:o,validateFile:r,thumbnail:a,multiple:i=!1,onError:l=d=>{sn("error","Error",d)}})=>{const d=g.useRef(null),c=g.useRef(null),[u,p]=g.useState(null),[m,h]=g.useState([]),[x,f]=g.useState(null),[b,y]=g.useState(null),[k,j]=g.useState(a||null),S=g.useCallback(w=>{const I=w.target.files;if(f(null),!I||I.length===0){l("No file selected"),f("No file selected");return}if(i){const M=Array.from(I),R=[];for(const E of M){if(E.size>e){l(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`),f(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(r){const W=r(E);if(W){l(`${E.name}: ${W}`),f(`${E.name}: ${W}`);continue}}R.push(E)}R.length>0&&(h(R),o&&o(R))}else{const M=I[0];if(M.size>e){l(`File exceeds ${Math.round(e/(1024*1024))}MB.`),f(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(r){const R=r(M);if(R){l(R),f(R);return}}y(URL.createObjectURL(M)),M.type.startsWith("video/")&&kc(M,j),t&&(p(M),t(M))}},[e,t,o,r,i]),C=()=>{var w;return(w=d.current)==null?void 0:w.click()};return g.useEffect(()=>()=>{b&&URL.revokeObjectURL(b),k&&URL.revokeObjectURL(k)},[b,k]),{previewUrl:b,thumbnailUrl:k,errorMessage:x,fileInputRef:d,videoRef:c,selectedFile:u,selectedFiles:m,handleFileChange:S,handleClick:C}},jc=({accept:e,isLoading:t=!1,progress:o=0,icon:r,text:a,previewUrl:i,thumbnailUrl:l,errorMessage:d,fileInputRef:c,videoRef:u,selectedFile:p,selectedFiles:m,handleFileChange:h,handleClick:x,multiple:f=!1,containerProps:b,errorMessageProps:y,progressProps:k,videoProps:j,imageProps:S,iconProps:C,textProps:w,fileType:I,previewUrl:M,renderError:R=({errorMessage:V,errorMessageProps:_,themeMode:P})=>n.jsx(s.Text,{color:"red",fontSize:12,marginTop:8,..._,...z==null?void 0:z.text,children:V}),renderText:E=({text:V,textProps:_})=>n.jsx(s.Text,{marginTop:8,..._,...z==null?void 0:z.text,children:V}),renderFile:W=({selectedFile:V,textProps:_})=>V?n.jsxs(s.Center,{marginTop:8,gap:10,flexDirection:"column",...z==null?void 0:z.container,children:[n.jsx(s.Text,{maxLines:2,..._,...z==null?void 0:z.text,children:V.name}),n.jsxs(s.Text,{..._,...z==null?void 0:z.text,children:["(",Math.round(V.size/1024)," KB)"]})]}):null,renderVideo:T=({selectedFile:V,videoRef:_,videoProps:P})=>n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...z==null?void 0:z.view,children:n.jsx(s.View,{as:"video",width:"100%",height:"100%",src:V?URL.createObjectURL(V):void 0,style:{objectFit:"cover"},ref:_,...P,...z==null?void 0:z.view})}),renderImage:$=({previewUrl:V,imageProps:_})=>(console.log("Rendering image with URL:",V),n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...z==null?void 0:z.view,children:n.jsx(s.Image,{src:V,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},..._,...z==null?void 0:z.image})})),renderProgress:D=({progress:V,progressProps:_})=>n.jsxs(s.Horizontal,{gap:8,alignItems:"center",..._,...z==null?void 0:z.horizontal,children:[n.jsx(s.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...z==null?void 0:z.view,children:n.jsx(s.View,{height:4,width:`${V}%`,borderRadius:2,backgroundColor:"color-dark-50",...z==null?void 0:z.view})}),n.jsxs(s.Text,{fontSize:12,...z==null?void 0:z.text,children:[V,"%"]})]}),views:z={}})=>{const V=M||i;return n.jsxs(s.Center,{onClick:x,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:p&&o===100?"200px":"auto",...b,...z==null?void 0:z.container,children:[o===100&&I==="image"&&V&&$({previewUrl:V,imageProps:S}),o===100&&I==="video"&&l&&T({selectedFile:p,thumbnailUrl:l,videoRef:u,videoProps:j,imageProps:S}),o===100&&I==="file"&&p&&W({selectedFile:p,textProps:w}),o<100&&(r||n.jsx(Xo,{widthHeight:32,...C})),!t&&!p&&a&&E({text:a,textProps:w}),t&&D({progress:o,progressProps:k}),!t&&d&&R({errorMessage:d,errorMessageProps:y}),n.jsx(s.View,{as:"input",type:"file",ref:c,onChange:h,accept:e,multiple:f,style:{display:"none"},...z==null?void 0:z.view})]})},ao=({accept:e="*/*",icon:t,text:o,maxSize:r,onFileSelect:a,onMultipleFileSelect:i,validateFile:l,isLoading:d=!1,progress:c=0,fileType:u,multiple:p=!1,...m})=>{const{previewUrl:h,thumbnailUrl:x,errorMessage:f,videoRef:b,fileInputRef:y,selectedFile:k,selectedFiles:j,handleFileChange:S,handleClick:C}=Cc({maxSize:r,onFileSelect:a,onMultipleFileSelect:i,validateFile:l,multiple:p}),I=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return n.jsx(jc,{handleClick:C,accept:e,isLoading:d,progress:c,icon:t,text:o,maxSize:r,onFileSelect:a,validateFile:l,errorMessage:f,handleFileChange:S,selectedFile:k,selectedFiles:j,videoRef:b,fileInputRef:y,previewUrl:h,thumbnailUrl:x,fileType:I,multiple:p,...m})};function Sc({onAudio:e,recording:t,paused:o,audioBlob:r,analyserNode:a,startRecording:i,stopRecording:l,pauseRecording:d,resumeRecording:c,resetRecording:u,handleFileChange:p,...m}){const[h,x]=g.useState(null);return g.useEffect(()=>{if(r){const f=URL.createObjectURL(r);return x(f),()=>{URL.revokeObjectURL(f)}}return x(null),()=>{}},[r]),n.jsxs(s.View,{gap:"8px",...m,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",margin:10,children:[n.jsx(ao,{accept:"audio/*",icon:n.jsx(bt,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:f=>e(f),fileType:"file",multiple:!1,renderError:({errorMessage:f})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"}}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:"50%",padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:f=>f.size>100*1024*1024?"File size exceeds 100MB limit":f.type.startsWith("audio/")?null:"Only audio files are allowed"}),t?n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[n.jsx(s.View,{as:"button",type:"button",onClick:o?c:d,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:o?n.jsx(Fo,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(on,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.View,{as:"button",type:"button",onClick:l,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"theme-error",color:"color-white",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-red-600"},children:n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.View,{minWidth:90,children:t&&n.jsx(Ko,{analyserNode:a,isPaused:o})})]}):n.jsx(s.View,{as:"button",type:"button",onClick:i,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:n.jsx(vo,{widthHeight:16,color:"currentColor",filled:!1})})]}),h&&!t&&n.jsx("audio",{controls:!0,src:h})]})}function pn(){const[e,t]=g.useState(!1),[o,r]=g.useState(!1),[a,i]=g.useState(0),[l,d]=g.useState(null),[c,u]=g.useState(null),[p,m]=g.useState(null),h=g.useRef(null),x=g.useRef(null),f=g.useRef(null),b=g.useRef(null),y=g.useRef([]),k=g.useRef(null),j=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",S=g.useCallback(()=>{h.current&&(h.current.state!=="inactive"&&h.current.stop(),h.current=null),b.current&&(b.current.getTracks().forEach(E=>E.stop()),b.current=null),x.current&&(x.current.close(),x.current=null),f.current&&(f.current.disconnect(),f.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=g.useCallback(async()=>{S(),d(null),i(0),y.current=[];try{const E=await navigator.mediaDevices.getUserMedia({audio:!0});b.current=E;const W=MediaRecorder.isTypeSupported(j)?j:void 0,T=new MediaRecorder(E,W?{mimeType:W}:void 0);h.current=T;const $=new(window.AudioContext||window.webkitAudioContext);x.current=$;const D=$.createMediaStreamSource(E),z=$.createAnalyser();z.fftSize=256,z.smoothingTimeConstant=.8,D.connect(z),f.current=z,u(z),T.ondataavailable=V=>{V.data.size>0&&y.current.push(V.data)},T.onstop=()=>{const V=new Blob(y.current,{type:T.mimeType||j});m(V),S()},T.start(),t(!0),r(!1),k.current=setInterval(()=>{i(V=>V+1)},1e3)}catch{d("Microphone access denied or unavailable."),S()}},[S]),w=g.useCallback(()=>{h.current&&h.current.state!=="inactive"&&h.current.stop(),t(!1),r(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),I=g.useCallback(()=>{h.current&&h.current.state==="recording"&&(h.current.pause(),r(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=g.useCallback(()=>{h.current&&h.current.state==="paused"&&(h.current.resume(),r(!1),k.current||(k.current=setInterval(()=>{i(E=>E+1)},1e3)))},[]),R=g.useCallback(()=>{S(),t(!1),r(!1),m(null),i(0),d(null),y.current=[]},[S]);return g.useEffect(()=>()=>S(),[S]),{recording:e,paused:o,audioBlob:p,analyserNode:c,duration:a,error:l,startRecording:C,stopRecording:w,pauseRecording:I,resumeRecording:M,resetRecording:R}}function wc(e){const{onAudio:t}=e,{recording:o,paused:r,audioBlob:a,analyserNode:i,startRecording:l,stopRecording:d,pauseRecording:c,resumeRecording:u,resetRecording:p}=pn();return g.useEffect(()=>{if(a&&t){const h=new File([a],"recording.webm",{type:a.type||"audio/webm;codecs=opus"});t(h)}},[a,t]),{recording:o,paused:r,audioBlob:a,analyserNode:i,startRecording:l,stopRecording:d,pauseRecording:c,resumeRecording:u,resetRecording:p,handleFileChange:h=>{var f;const x=(f=h.target.files)==null?void 0:f[0];x&&t&&t(x)}}}function Ic(e){const t=wc(e);return n.jsx(Sc,{...e,...t})}const Tc=()=>{const[e,t]=g.useState(!1);return{imageError:e,setImageError:t}},Mc={xs:24,sm:32,md:48,lg:64,xl:80},xo={container:{borderRadius:"50%",overflow:"hidden",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",backgroundColor:"color-gray-100",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",transition:"all 0.2s ease"},fallback:{fontWeight:"500",color:"color-gray-600"},image:{objectFit:"cover",transition:"all 0.2s ease"}},Rc=({src:e,size:t="md",fallback:o="IM",views:r,imageError:a,setImageError:i,onClick:l=()=>{},children:d})=>{const c=Mc[t],u={...xo.image,...(r==null?void 0:r.image)||{}};return n.jsxs(s.Center,{role:"avatar",width:c,height:c,...xo.container,borderColor:a?"color-gray-400":"transparent",onClick:l,...r==null?void 0:r.container,children:[!a&&e?n.jsx(s.Image,{alt:"IM",src:e,style:u,width:c,height:c,onError:()=>i(!0)}):n.jsx(s.Text,{size:t,...xo.fallback,...r==null?void 0:r.fallback,children:o}),d]})},zc=({src:e,size:t,views:o,fallback:r,onClick:a,children:i})=>{const{imageError:l,setImageError:d}=Tc();return n.jsx(Rc,{src:e,size:t,views:o,fallback:r,imageError:l,setImageError:d,onClick:a,children:i})},Ec=zc,Vc={xs:{minWidth:"20px",height:"20px",padding:"0 6px",fontSize:"10px",fontWeight:"500",lineHeight:"20px"},sm:{minWidth:"24px",height:"24px",padding:"0 8px",fontSize:"12px",fontWeight:"500",lineHeight:"24px"},md:{minWidth:"28px",height:"28px",padding:"0 10px",fontSize:"14px",fontWeight:"500",lineHeight:"28px"},lg:{minWidth:"32px",height:"32px",padding:"0 12px",fontSize:"16px",fontWeight:"500",lineHeight:"32px"},xl:{minWidth:"36px",height:"36px",padding:"0 14px",fontSize:"20px",fontWeight:"500",lineHeight:"36px"}},Pc={square:0,rounded:"8px",pill:"9999px"},_c={"top-right":{top:"4px",right:"4px",position:"absolute"},"top-left":{top:"4px",left:"4px",position:"absolute"},"bottom-right":{bottom:"4px",right:"4px",position:"absolute"},"bottom-left":{bottom:"4px",left:"4px",position:"absolute"}},Wc=e=>({filled:{backgroundColor:"theme-primary",color:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"theme-primary",color:"theme-primary",transition:"all 0.2s ease"},link:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",color:"theme-primary",textDecoration:"underline",textUnderlineOffset:"2px",transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:"color-gray-500",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"}}),gn=e=>({default:{indicator:{backgroundColor:"color-gray-400"},label:{color:"color-gray-700"}},info:{indicator:{backgroundColor:"color-blue-500"},label:{color:"color-blue-700"}},success:{indicator:{backgroundColor:"color-green-500"},label:{color:"color-green-700"}},warning:{indicator:{backgroundColor:"color-orange-500"},label:{color:"color-orange-700"}},error:{indicator:{backgroundColor:"color-red-500"},label:{color:"color-red-700"}}}),$c=({content:e,children:t,icon:o,pastil:r,position:a,shape:i="pill",variant:l="filled",size:d="md",views:c,themeMode:u,...p})=>{const{themeMode:m}=s.useTheme(),h=Wc()[l],x=gn(),f={width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Pc[i],...Vc[d],...h,...a?_c[a]:{},...c==null?void 0:c.container};let b="currentColor";return typeof r=="string"?r in x?b=x[r].indicator.backgroundColor:b=r:r===!0&&(b="color-green-500",l==="filled"&&(b="color-white")),n.jsxs(s.Center,{role:"badge",...f,...p,children:[o&&n.jsx(s.View,{role:"badge-icon",...c==null?void 0:c.icon,children:o}),r&&n.jsx(s.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:b,...c==null?void 0:c.pastil}),(e||t)&&n.jsx(s.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...c==null?void 0:c.text,color:f.color,children:t||e})]})},Lc=e=>n.jsx($c,{...e}),Dc=()=>{const[e,t]=g.useState(!1);return{isHovered:e,setIsHovered:t}};/**
2
- * @remix-run/router v1.11.0
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),s=require("app-studio"),Li=require("lucide-react/dynamic"),Bo=require("zustand"),Di=require("react-dom"),ke=require("formik");function Hi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Q=Hi(g),Ao=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Bi=({type:e="single",value:t,defaultValue:o,onValueChange:r,collapsible:a=!1})=>{const i=t!==void 0,l=t??o,d=()=>e==="multiple"?Array.isArray(l)?l:l?[l]:[]:Array.isArray(l)?l[0]:l,[c,u]=g.useState(d()),p=g.useMemo(()=>Ao("accordion"),[]),h=i?t:c,m=g.useMemo(()=>h===void 0?[]:Array.isArray(h)?h:[h],[h]);g.useEffect(()=>{i&&(e==="multiple"&&!Array.isArray(t)?(console.warn('Accordion with type="multiple" received non-array value:',t),u(t?[String(t)]:[])):e==="single"&&Array.isArray(t)?(console.warn('Accordion with type="single" received array value:',t),u(t.length>0?t[0]:void 0)):u(t))},[t,i,e]);const x=g.useCallback(b=>{let y;if(e==="single")h===b&&a?y=void 0:h!==b?y=b:y=h;else{const k=Array.isArray(h)?h:[];k.includes(b)?y=k.filter(j=>j!==b):y=[...k,b],Array.isArray(y)&&y.length===0&&(y=[])}i||u(y),r&&r(y)},[e,h,a,i,r]),f=g.useCallback(b=>m.includes(b),[m]);return{expandedItems:m,toggleItem:x,isItemExpanded:f,type:e,collapsible:a,baseId:p}},Ai={square:{borderRadius:0},rounded:{borderRadius:8}},Fi={default:{backgroundColor:"transparent",borderWidth:0,transition:"background-color 0.15s ease"},outline:{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",transition:"border-color 0.15s ease, background-color 0.15s ease",_hover:{borderColor:"color-gray-300"}},filled:{backgroundColor:"color-gray-50",transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-100"}}},en=g.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Oi=({children:e,value:t})=>n.jsx(en.Provider,{value:t,children:e}),tn=()=>{const e=g.useContext(en);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},vi=({value:e,children:t,isDisabled:o=!1,views:r,...a})=>{const{isItemExpanded:i,baseId:l}=tn(),d=i(e),c=`${l}-trigger-${e}`,u=`${l}-content-${e}`;return n.jsx(s.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:o?.5:1,pointerEvents:o?"none":"auto","data-state":d?"open":"closed","data-disabled":o?"":void 0,...r==null?void 0:r.item,...a,children:g.Children.map(t,p=>g.isValidElement(p)?g.cloneElement(p,{...p.props,value:e,isExpanded:d,isDisabled:o,triggerId:c,contentId:u}):p)})},Ni=({children:e,value:t,isExpanded:o,isDisabled:r,triggerId:a,contentId:i,views:l,asChild:d=!1,...c})=>{const{toggleItem:u}=tn(),h={id:a,"aria-expanded":o,"aria-controls":i,"aria-disabled":r,"data-state":o?"open":"closed","data-disabled":r?"":void 0,onClick:()=>{t&&!r&&u(t)},padding:16,cursor:r?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...l==null?void 0:l.container,...c};if(d&&g.isValidElement(e)){const m=g.Children.only(e);return g.cloneElement(m,{...h,...m.props})}return n.jsxs(s.Horizontal,{...h,children:[e,n.jsx(s.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:o?"rotate(180deg)":"rotate(0deg)",...l==null?void 0:l.icon,children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},Ui=({children:e,isExpanded:t,isDisabled:o,triggerId:r,contentId:a,views:i,...l})=>t?n.jsx(s.View,{id:a,role:"region","aria-labelledby":r,padding:16,backgroundColor:"color-white",maxHeight:t?"1000px":"0",transition:"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",opacity:1,overflow:"hidden","data-state":t?"open":"closed","data-disabled":o?"":void 0,...i==null?void 0:i.container,...l,children:e}):null,qi=({children:e,shape:t="rounded",variant:o="default",views:r,baseId:a,type:i,collapsible:l,themeMode:d,...c})=>n.jsx(s.Vertical,{width:"100%","data-orientation":"vertical",...Ai[t],...Fi[o],...r==null?void 0:r.container,...c,children:e}),Gi=({children:e,type:t="single",value:o,defaultValue:r,onValueChange:a,collapsible:i=!1,shape:l="rounded",variant:d="default",views:c,...u})=>{const p=Array.isArray(r)?r:r?[r]:void 0,h=Bi({type:t,value:o,defaultValue:r??p,onValueChange:a,collapsible:i});return n.jsx(Oi,{value:{expandedItems:h.expandedItems,toggleItem:h.toggleItem,isItemExpanded:h.isItemExpanded,type:h.type,collapsible:h.collapsible,baseId:h.baseId},children:n.jsx(qi,{shape:l,variant:d,views:c,baseId:h.baseId,type:h.type,collapsible:h.collapsible,...u,children:e})})},Jt=Gi;Jt.Item=vi;Jt.Trigger=Ni;Jt.Content=Ui;const yr=({widthHeight:e,color:t="currentColor",transform:o,orientation:r="up",children:a,...i})=>n.jsx(s.Center,{widthHeight:e,lineHeight:e,color:t,display:"flex",transform:o||(r==="left"?"rotate(-90deg)":r==="right"?"rotate(90deg)":r==="up"?"rotate(0deg)":r==="down"?"rotate(180deg)":"none"),...i,children:a}),Yi=(e,t,o)=>{const{getColor:r}=s.useTheme(),a=r(t);return{fill:e?a:"none",stroke:a,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}},Ot=({name:e="circle",widthHeight:t=24,color:o="currentColor",filled:r=!1,strokeWidth:a=1,size:i,children:l,...d})=>{const c=i||t;if(!e)return n.jsx(yr,{widthHeight:t,color:o,...d,children:l});const u=Yi(r,o,a);return n.jsx(yr,{widthHeight:c,color:o,...d,children:n.jsx(Li.DynamicIcon,{name:e,size:c,...u})})},v=(e,t={})=>{const o=r=>n.jsx(Ot,{name:e,...t,...r});return o.displayName=`${e}Icon`,o},Xi=v("user",{filled:!1}),Ki=v("circle-help",{filled:!1}),Qi=v("folder",{filled:!1}),ie=v("chevron-up",{filled:!1}),Ji=v("grip-vertical",{filled:!1}),xt=v("file",{filled:!1}),Zi=v("video",{filled:!1}),el=v("image",{filled:!1}),Zt=v("volume",{filled:!1}),tl=v("twitter",{filled:!1}),ol=v("x",{filled:!1}),rl=v("twitch",{filled:!1}),ye=v("x",{filled:!1,strokeWidth:2}),nl=v("instagram",{filled:!1}),al=v("youtube",{filled:!1}),il=v("facebook",{filled:!1}),ll=v("linkedin",{filled:!1}),cl=v("at-sign",{filled:!1}),on=v("minus",{filled:!1}),ze=v("info",{filled:!1}),Fo=v("play",{filled:!1}),rn=v("pause",{filled:!1}),sl=v("heart",{filled:!1}),dl=v("star",{filled:!1}),ul=v("save",{filled:!1}),Oo=v("triangle-alert",{filled:!1}),pl=v("battery",{filled:!1}),gl=v("bookmark",{filled:!1}),hl=v("cloud",{filled:!1}),ml=v("copy",{filled:!1}),eo=v("trash",{filled:!1}),fl=eo,xl=v("edit",{filled:!1}),vo=v("mic",{filled:!1}),to=v("square",{filled:!1}),No=v("send",{filled:!1}),Uo=v("loader",{filled:!1}),bt=v("paperclip",{filled:!1}),vt=v("search",{filled:!1}),bl=v("home",{filled:!1}),nn=v("settings",{filled:!1}),yl=v("download",{filled:!1}),an=v("share",{filled:!1}),oo=v("check",{filled:!1}),kl=v("plus",{filled:!1}),qo=v("eye-off",{filled:!1}),Go=v("eye",{filled:!1}),Cl=v("lock",{filled:!1}),jl=v("user",{filled:!1}),ln=v("external-link",{filled:!1}),Yo=v("check-circle",{filled:!1}),ro=v("alert-circle",{filled:!1}),Sl=v("bell",{filled:!1}),wl=v("file-text",{filled:!1}),Il=v("bar-chart",{filled:!1}),Tl=v("moon",{filled:!1}),cn=v("panel-left",{filled:!1}),Xo=v("upload",{filled:!1}),Ml=oo,Rl=e=>n.jsx(ie,{orientation:"left",...e}),zl=v("zoom-out",{filled:!1}),El=v("type",{filled:!1}),Vl=v("shapes",{filled:!1}),Pl=v("rotate-cw",{filled:!1}),Wl=v("gift",{filled:!1}),_l=v("shield",{filled:!1}),$l=v("log-out",{filled:!1}),Ll=v("power",{filled:!1}),Dl=v("link",{filled:!1}),Hl=v("layout",{filled:!1}),Bl=v("zap",{filled:!1}),Al=v("credit-card",{filled:!1}),Fl=v("more-horizontal",{filled:!1}),Ol=eo,vl=v("filter",{filled:!1}),Nl=v("calendar",{filled:!1}),Ul=v("clock",{filled:!1}),ql=v("map-pin",{filled:!1}),Gl=v("menu",{filled:!1}),Yl=v("refresh-cw",{filled:!1}),Xl=v("printer",{filled:!1}),Kl=v("wand",{filled:!1}),Ql=v("thumbs-down",{filled:!1}),Jl=v("thumbs-up",{filled:!1}),Zl=v("camera",{filled:!1}),ec=v("bluetooth",{filled:!1}),tc=v("unlock",{filled:!1}),oc=v("wifi",{filled:!1}),rc=v("arrow-right",{filled:!1}),nc=v("arrow-up",{filled:!1}),ac=v("loader",{filled:!1}),ic=v("sliders-horizontal",{filled:!1}),lc=v("crop",{filled:!1}),cc=v("zoom-in",{filled:!1}),sc=v("grip-horizontal",{filled:!1}),sn=v("mouse-pointer-2",{filled:!1}),dc=e=>({default:{container:{backgroundColor:"color-gray-50",borderColor:"color-gray-200",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},content:{color:"color-gray-700"},icon:{color:"color-gray-500"}},info:{container:{backgroundColor:"color-blue-50",borderColor:"color-blue-200",boxShadow:"0 1px 2px rgba(59, 130, 246, 0.05)"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",borderColor:"color-green-200",boxShadow:"0 1px 2px rgba(34, 197, 94, 0.05)"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},error:{container:{backgroundColor:"color-red-50",borderColor:"color-red-200",boxShadow:"0 1px 2px rgba(239, 68, 68, 0.05)"},content:{color:"color-red-700"},icon:{color:"color-red-500"}},warning:{container:{backgroundColor:"color-orange-50",borderColor:"color-orange-200",boxShadow:"0 1px 2px rgba(249, 115, 22, 0.05)"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}}}),uc=({icon:e,title:t="",views:o,description:r="",variant:a="default",themeMode:i,children:l,...d})=>{const{themeMode:c}=s.useTheme(),u=dc(),p=()=>{var x;if(e)return e;const m={size:20,color:((x=o==null?void 0:o.icon)==null?void 0:x.color)??u[a].icon.color};switch(a){case"info":return n.jsx(ze,{...m});case"success":return n.jsx(Yo,{...m});case"error":return n.jsx(ro,{...m});case"warning":default:return n.jsx(Oo,{...m})}};return n.jsxs(s.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:u[a].container.borderColor,backgroundColor:u[a].container.backgroundColor,boxShadow:u[a].container.boxShadow,transition:"all 0.2s ease",...o==null?void 0:o.container,...d,children:[n.jsx(s.View,{alignSelf:"flex-start",marginTop:"2px",...o==null?void 0:o.icon,children:p()}),n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsx(s.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...o==null?void 0:o.title,children:t}),n.jsx(s.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:u[a].content.color,backgroundColor:u[a].container.backgroundColor,...o==null?void 0:o.description,children:r||l})]})]})},pc=e=>n.jsx(uc,{...e}),gc=pc,hc=({ratio:e=16/9,children:t,views:o,...r})=>n.jsx(s.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...r,...o==null?void 0:o.center,children:n.jsx(s.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...o==null?void 0:o.view,children:t})}),mc=({ratio:e,children:t,...o})=>n.jsx(hc,{ratio:e,...o,children:t}),fc=mc;function xc(e,t,o){return Math.min(Math.max(e,t),o)}const bc=({bars:e,isPaused:t,...o})=>n.jsx(s.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...o,children:e.map((a,i)=>n.jsx(s.View,{width:2,backgroundColor:t?"color-gray-200":a>=0?"color-gray-900":"color-gray-500",style:{height:`${xc(a*300,2,32)}px`}},i))}),Ko=({analyserNode:e,isPaused:t,...o})=>{const r=g.useRef(null),a=60,i=32,[l,d]=g.useState([]);return g.useEffect(()=>{if(!e){d(Array(a).fill(-1));return}const c=e.frequencyBinCount,u=new Uint8Array(c),p=()=>{e.getByteTimeDomainData(u);let h=0;for(let x=0;x<c;x++){const f=(u[x]-128)/128;h+=f*f}const m=Math.sqrt(h/c);g.startTransition(()=>{d(x=>{const b=[...x,m].slice(-a);return b.length<a?[...Array(a-b.length).fill(-1),...b]:b})})};return r.current=setInterval(p,i),()=>{r.current&&clearInterval(r.current)}},[e]),n.jsx(bc,{bars:l,isPaused:t,...o})},no=Bo.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(t,o="",r="",a,i,l,d,c,u)=>e({visible:!0,variant:t,title:o,subtitle:r,isClosable:a,views:i,action:l,actionText:d,showIcon:c,timeout:u}),hide:()=>e({visible:!1})})),dn=(e,t,o,r)=>{no.getState().show(e,t,o,r==null?void 0:r.isClosable,r==null?void 0:r.views,r==null?void 0:r.action,r==null?void 0:r.actionText,r==null?void 0:r.showIcon,r==null?void 0:r.timeout)},un=()=>{no.getState().hide()},yc={info:{container:{backgroundColor:"color-blue-200",border:"color-blue-400"},icon:{color:"color-blue-500",name:"InformationIcon"},content:{color:"color-blue-500"},close:{color:"color-blue-500",name:"CloseIcon"}},success:{container:{backgroundColor:"color-green-200",border:"color-green-400"},icon:{color:"color-green-500",name:"SuccessIcon"},content:{color:"color-green-500"},close:{color:"color-green-500",name:"CloseIcon"}},error:{container:{backgroundColor:"color-red-200",border:"color-red-400"},icon:{color:"color-red-500",name:"ErrrorIcon"},content:{color:"color-red-500"},close:{color:"color-red-500",name:"CloseIcon"}},warning:{container:{backgroundColor:"color-orange-200",border:"color-orange-400"},icon:{color:"color-orange-500",name:"ErrrorIcon"},content:{color:"color-orange-500"},close:{color:"color-orange-500",name:"CloseIcon"}}},pn=({variant:e,hide:t,title:o,subtitle:r,theme:a,action:i,actionText:l,showIcon:d=!1,isClosable:c=!1,timeout:u=3e3,views:p})=>{var k,j;g.useEffect(()=>{if(u&&!c){const S=setTimeout(()=>{t()},u);return()=>{clearTimeout(S)}}},[]);const h=a??yc,m=!!(i&&l),x={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${h[e].container.border}`},f={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],b={info:n.jsx(ze,{widthHeight:24,color:f,...p==null?void 0:p.icon}),success:n.jsx(Yo,{widthHeight:24,color:f,...p==null?void 0:p.icon}),warning:n.jsx(Oo,{widthHeight:24,color:f,...p==null?void 0:p.icon}),error:n.jsx(ro,{widthHeight:24,color:f,...p==null?void 0:p.icon})}[e],y=d&&b;return n.jsxs(s.Horizontal,{role:"messageContent",gap:16,width:400,flexWrap:"nowrap",position:"relative",alignItems:"center",padding:"14px 24px 14px 14px",color:`${h[e].content.color}`,backgroundColor:`${h[e].container.backgroundColor}`,onClick:c?()=>{}:()=>{t()},...x,...p==null?void 0:p.container,children:[y&&b,n.jsxs(s.Vertical,{gap:8,width:"100%",children:[n.jsx(s.Text,{size:"md",weight:"semiBold",...p==null?void 0:p.title,children:o}),r&&n.jsx(s.Text,{size:"sm",...p==null?void 0:p.subtitle,children:r})]}),m&&n.jsx(s.Text,{marginRight:10,onClick:i,padding:"6px 10px",whiteSpace:"nowrap",...x,...p==null?void 0:p.actionText,children:l}),c&&n.jsx(s.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{t()},...(k=p==null?void 0:p.closingIcon)==null?void 0:k.container,children:n.jsx(ye,{widthHeight:18,color:f,...(j=p==null?void 0:p.closingIcon)==null?void 0:j.icon})})]})},kc=({container:e,theme:t,position:o="topRight"})=>{const{visible:r,title:a,variant:i,subtitle:l,isClosable:d,views:c,action:u,actionText:p,showIcon:h,timeout:m}=no(),x={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[o],f=()=>n.jsx(pn,{variant:i,subtitle:l,show:r,title:a,theme:t,isClosable:d,views:c,action:u,actionText:p,showIcon:h,timeout:m,hide:()=>un()}),b=e?g.cloneElement(e,{},f()):n.jsx(s.View,{position:"absolute",zIndex:1e4,...x,children:f()});return r?b:null},Cc=(e,t)=>{const o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{o.currentTime=1},o.oncanplay=()=>{const r=document.createElement("canvas");r.width=o.videoWidth,r.height=o.videoHeight;const a=r.getContext("2d");if(a){a.drawImage(o,0,0,r.width,r.height);const i=r.toDataURL("image/jpeg");t(i)}URL.revokeObjectURL(o.src)},o.src=URL.createObjectURL(e)},jc=({maxSize:e=100*1024*1024,onFileSelect:t,onMultipleFileSelect:o,validateFile:r,thumbnail:a,multiple:i=!1,onError:l=d=>{dn("error","Error",d)}})=>{const d=g.useRef(null),c=g.useRef(null),[u,p]=g.useState(null),[h,m]=g.useState([]),[x,f]=g.useState(null),[b,y]=g.useState(null),[k,j]=g.useState(a||null),S=g.useCallback(w=>{const I=w.target.files;if(f(null),!I||I.length===0){l("No file selected"),f("No file selected");return}if(i){const M=Array.from(I),R=[];for(const E of M){if(E.size>e){l(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`),f(`File ${E.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(r){const _=r(E);if(_){l(`${E.name}: ${_}`),f(`${E.name}: ${_}`);continue}}R.push(E)}R.length>0&&(m(R),o&&o(R))}else{const M=I[0];if(M.size>e){l(`File exceeds ${Math.round(e/(1024*1024))}MB.`),f(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(r){const R=r(M);if(R){l(R),f(R);return}}y(URL.createObjectURL(M)),M.type.startsWith("video/")&&Cc(M,j),t&&(p(M),t(M))}},[e,t,o,r,i]),C=()=>{var w;return(w=d.current)==null?void 0:w.click()};return g.useEffect(()=>()=>{b&&URL.revokeObjectURL(b),k&&URL.revokeObjectURL(k)},[b,k]),{previewUrl:b,thumbnailUrl:k,errorMessage:x,fileInputRef:d,videoRef:c,selectedFile:u,selectedFiles:h,handleFileChange:S,handleClick:C}},Sc=({accept:e,isLoading:t=!1,progress:o=0,icon:r,text:a,previewUrl:i,thumbnailUrl:l,errorMessage:d,fileInputRef:c,videoRef:u,selectedFile:p,selectedFiles:h,handleFileChange:m,handleClick:x,multiple:f=!1,containerProps:b,errorMessageProps:y,progressProps:k,videoProps:j,imageProps:S,iconProps:C,textProps:w,fileType:I,previewUrl:M,renderError:R=({errorMessage:V,errorMessageProps:W,themeMode:P})=>n.jsx(s.Text,{color:"red",fontSize:12,marginTop:8,...W,...z==null?void 0:z.text,children:V}),renderText:E=({text:V,textProps:W})=>n.jsx(s.Text,{marginTop:8,...W,...z==null?void 0:z.text,children:V}),renderFile:_=({selectedFile:V,textProps:W})=>V?n.jsxs(s.Center,{marginTop:8,gap:10,flexDirection:"column",...z==null?void 0:z.container,children:[n.jsx(s.Text,{maxLines:2,...W,...z==null?void 0:z.text,children:V.name}),n.jsxs(s.Text,{...W,...z==null?void 0:z.text,children:["(",Math.round(V.size/1024)," KB)"]})]}):null,renderVideo:T=({selectedFile:V,videoRef:W,videoProps:P})=>n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...z==null?void 0:z.view,children:n.jsx(s.View,{as:"video",width:"100%",height:"100%",src:V?URL.createObjectURL(V):void 0,style:{objectFit:"cover"},ref:W,...P,...z==null?void 0:z.view})}),renderImage:$=({previewUrl:V,imageProps:W})=>(console.log("Rendering image with URL:",V),n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...z==null?void 0:z.view,children:n.jsx(s.Image,{src:V,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...W,...z==null?void 0:z.image})})),renderProgress:D=({progress:V,progressProps:W})=>n.jsxs(s.Horizontal,{gap:8,alignItems:"center",...W,...z==null?void 0:z.horizontal,children:[n.jsx(s.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...z==null?void 0:z.view,children:n.jsx(s.View,{height:4,width:`${V}%`,borderRadius:2,backgroundColor:"color-dark-50",...z==null?void 0:z.view})}),n.jsxs(s.Text,{fontSize:12,...z==null?void 0:z.text,children:[V,"%"]})]}),views:z={}})=>{const V=M||i;return n.jsxs(s.Center,{onClick:x,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:p&&o===100?"200px":"auto",...b,...z==null?void 0:z.container,children:[o===100&&I==="image"&&V&&$({previewUrl:V,imageProps:S}),o===100&&I==="video"&&l&&T({selectedFile:p,thumbnailUrl:l,videoRef:u,videoProps:j,imageProps:S}),o===100&&I==="file"&&p&&_({selectedFile:p,textProps:w}),o<100&&(r||n.jsx(Xo,{widthHeight:32,...C})),!t&&!p&&a&&E({text:a,textProps:w}),t&&D({progress:o,progressProps:k}),!t&&d&&R({errorMessage:d,errorMessageProps:y}),n.jsx(s.View,{as:"input",type:"file",ref:c,onChange:m,accept:e,multiple:f,style:{display:"none"},...z==null?void 0:z.view})]})},ao=({accept:e="*/*",icon:t,text:o,maxSize:r,onFileSelect:a,onMultipleFileSelect:i,validateFile:l,isLoading:d=!1,progress:c=0,fileType:u,multiple:p=!1,...h})=>{const{previewUrl:m,thumbnailUrl:x,errorMessage:f,videoRef:b,fileInputRef:y,selectedFile:k,selectedFiles:j,handleFileChange:S,handleClick:C}=jc({maxSize:r,onFileSelect:a,onMultipleFileSelect:i,validateFile:l,multiple:p}),I=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return n.jsx(Sc,{handleClick:C,accept:e,isLoading:d,progress:c,icon:t,text:o,maxSize:r,onFileSelect:a,validateFile:l,errorMessage:f,handleFileChange:S,selectedFile:k,selectedFiles:j,videoRef:b,fileInputRef:y,previewUrl:m,thumbnailUrl:x,fileType:I,multiple:p,...h})};function wc({onAudio:e,recording:t,paused:o,audioBlob:r,analyserNode:a,startRecording:i,stopRecording:l,pauseRecording:d,resumeRecording:c,resetRecording:u,handleFileChange:p,...h}){const[m,x]=g.useState(null);return g.useEffect(()=>{if(r){const f=URL.createObjectURL(r);return x(f),()=>{URL.revokeObjectURL(f)}}return x(null),()=>{}},[r]),n.jsxs(s.View,{gap:"8px",...h,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",margin:10,children:[n.jsx(ao,{accept:"audio/*",icon:n.jsx(bt,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:f=>e(f),fileType:"file",multiple:!1,renderError:({errorMessage:f})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"}}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:"50%",padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:f=>f.size>100*1024*1024?"File size exceeds 100MB limit":f.type.startsWith("audio/")?null:"Only audio files are allowed"}),t?n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[n.jsx(s.View,{as:"button",type:"button",onClick:o?c:d,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:o?n.jsx(Fo,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(rn,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.View,{as:"button",type:"button",onClick:l,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"theme-error",color:"color-white",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-red-600"},children:n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1})}),n.jsx(s.View,{minWidth:90,children:t&&n.jsx(Ko,{analyserNode:a,isPaused:o})})]}):n.jsx(s.View,{as:"button",type:"button",onClick:i,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-100",color:"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:"color-gray-200"},children:n.jsx(vo,{widthHeight:16,color:"currentColor",filled:!1})})]}),m&&!t&&n.jsx("audio",{controls:!0,src:m})]})}function gn(){const[e,t]=g.useState(!1),[o,r]=g.useState(!1),[a,i]=g.useState(0),[l,d]=g.useState(null),[c,u]=g.useState(null),[p,h]=g.useState(null),m=g.useRef(null),x=g.useRef(null),f=g.useRef(null),b=g.useRef(null),y=g.useRef([]),k=g.useRef(null),j=typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm",S=g.useCallback(()=>{m.current&&(m.current.state!=="inactive"&&m.current.stop(),m.current=null),b.current&&(b.current.getTracks().forEach(E=>E.stop()),b.current=null),x.current&&(x.current.close(),x.current=null),f.current&&(f.current.disconnect(),f.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),C=g.useCallback(async()=>{S(),d(null),i(0),y.current=[];try{const E=await navigator.mediaDevices.getUserMedia({audio:!0});b.current=E;const _=MediaRecorder.isTypeSupported(j)?j:void 0,T=new MediaRecorder(E,_?{mimeType:_}:void 0);m.current=T;const $=new(window.AudioContext||window.webkitAudioContext);x.current=$;const D=$.createMediaStreamSource(E),z=$.createAnalyser();z.fftSize=256,z.smoothingTimeConstant=.8,D.connect(z),f.current=z,u(z),T.ondataavailable=V=>{V.data.size>0&&y.current.push(V.data)},T.onstop=()=>{const V=new Blob(y.current,{type:T.mimeType||j});h(V),S()},T.start(),t(!0),r(!1),k.current=setInterval(()=>{i(V=>V+1)},1e3)}catch{d("Microphone access denied or unavailable."),S()}},[S]),w=g.useCallback(()=>{m.current&&m.current.state!=="inactive"&&m.current.stop(),t(!1),r(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),I=g.useCallback(()=>{m.current&&m.current.state==="recording"&&(m.current.pause(),r(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=g.useCallback(()=>{m.current&&m.current.state==="paused"&&(m.current.resume(),r(!1),k.current||(k.current=setInterval(()=>{i(E=>E+1)},1e3)))},[]),R=g.useCallback(()=>{S(),t(!1),r(!1),h(null),i(0),d(null),y.current=[]},[S]);return g.useEffect(()=>()=>S(),[S]),{recording:e,paused:o,audioBlob:p,analyserNode:c,duration:a,error:l,startRecording:C,stopRecording:w,pauseRecording:I,resumeRecording:M,resetRecording:R}}function Ic(e){const{onAudio:t}=e,{recording:o,paused:r,audioBlob:a,analyserNode:i,startRecording:l,stopRecording:d,pauseRecording:c,resumeRecording:u,resetRecording:p}=gn();return g.useEffect(()=>{if(a&&t){const m=new File([a],"recording.webm",{type:a.type||"audio/webm;codecs=opus"});t(m)}},[a,t]),{recording:o,paused:r,audioBlob:a,analyserNode:i,startRecording:l,stopRecording:d,pauseRecording:c,resumeRecording:u,resetRecording:p,handleFileChange:m=>{var f;const x=(f=m.target.files)==null?void 0:f[0];x&&t&&t(x)}}}function Tc(e){const t=Ic(e);return n.jsx(wc,{...e,...t})}const Mc=()=>{const[e,t]=g.useState(!1);return{imageError:e,setImageError:t}},Rc={xs:24,sm:32,md:48,lg:64,xl:80},xo={container:{borderRadius:"50%",overflow:"hidden",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",backgroundColor:"color-gray-100",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",transition:"all 0.2s ease"},fallback:{fontWeight:"500",color:"color-gray-600"},image:{objectFit:"cover",transition:"all 0.2s ease"}},zc=({src:e,size:t="md",fallback:o="IM",views:r,imageError:a,setImageError:i,onClick:l=()=>{},children:d})=>{const c=Rc[t],u={...xo.image,...(r==null?void 0:r.image)||{}};return n.jsxs(s.Center,{role:"avatar",width:c,height:c,...xo.container,borderColor:a?"color-gray-400":"transparent",onClick:l,...r==null?void 0:r.container,children:[!a&&e?n.jsx(s.Image,{alt:"IM",src:e,style:u,width:c,height:c,onError:()=>i(!0)}):n.jsx(s.Text,{size:t,...xo.fallback,...r==null?void 0:r.fallback,children:o}),d]})},Ec=({src:e,size:t,views:o,fallback:r,onClick:a,children:i})=>{const{imageError:l,setImageError:d}=Mc();return n.jsx(zc,{src:e,size:t,views:o,fallback:r,imageError:l,setImageError:d,onClick:a,children:i})},Vc=Ec,Pc={xs:{minWidth:"20px",height:"20px",padding:"0 6px",fontSize:"10px",fontWeight:"500",lineHeight:"20px"},sm:{minWidth:"24px",height:"24px",padding:"0 8px",fontSize:"12px",fontWeight:"500",lineHeight:"24px"},md:{minWidth:"28px",height:"28px",padding:"0 10px",fontSize:"14px",fontWeight:"500",lineHeight:"28px"},lg:{minWidth:"32px",height:"32px",padding:"0 12px",fontSize:"16px",fontWeight:"500",lineHeight:"32px"},xl:{minWidth:"36px",height:"36px",padding:"0 14px",fontSize:"20px",fontWeight:"500",lineHeight:"36px"}},Wc={square:0,rounded:"8px",pill:"9999px"},_c={"top-right":{top:"4px",right:"4px",position:"absolute"},"top-left":{top:"4px",left:"4px",position:"absolute"},"bottom-right":{bottom:"4px",right:"4px",position:"absolute"},"bottom-left":{bottom:"4px",left:"4px",position:"absolute"}},$c=e=>({filled:{backgroundColor:"theme-primary",color:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"theme-primary",color:"theme-primary",transition:"all 0.2s ease"},link:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",color:"theme-primary",textDecoration:"underline",textUnderlineOffset:"2px",transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:"color-gray-500",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",transition:"all 0.2s ease"}}),hn=e=>({default:{indicator:{backgroundColor:"color-gray-400"},label:{color:"color-gray-700"}},info:{indicator:{backgroundColor:"color-blue-500"},label:{color:"color-blue-700"}},success:{indicator:{backgroundColor:"color-green-500"},label:{color:"color-green-700"}},warning:{indicator:{backgroundColor:"color-orange-500"},label:{color:"color-orange-700"}},error:{indicator:{backgroundColor:"color-red-500"},label:{color:"color-red-700"}}}),Lc=({content:e,children:t,icon:o,pastil:r,position:a,shape:i="pill",variant:l="filled",size:d="md",views:c,themeMode:u,...p})=>{const{themeMode:h}=s.useTheme(),m=$c()[l],x=hn(),f={width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Wc[i],...Pc[d],...m,...a?_c[a]:{},...c==null?void 0:c.container};let b="currentColor";return typeof r=="string"?r in x?b=x[r].indicator.backgroundColor:b=r:r===!0&&(b="color-green-500",l==="filled"&&(b="color-white")),n.jsxs(s.Center,{role:"badge",...f,...p,children:[o&&n.jsx(s.View,{role:"badge-icon",...c==null?void 0:c.icon,children:o}),r&&n.jsx(s.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:b,...c==null?void 0:c.pastil}),(e||t)&&n.jsx(s.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...c==null?void 0:c.text,color:f.color,children:t||e})]})},Dc=e=>n.jsx(Lc,{...e}),Hc=()=>{const[e,t]=g.useState(!1);return{isHovered:e,setIsHovered:t}};/**
2
+ * @remix-run/router v1.23.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -7,8 +7,8 @@
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Mo.apply(this,arguments)}var kr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(kr||(kr={}));function ce(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Je(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ro(e){let{pathname:t="/",search:o="",hash:r=""}=e;return o&&o!=="?"&&(t+=o.charAt(0)==="?"?o:"?"+o),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function mn(e){let t={};if(e){let o=e.indexOf("#");o>=0&&(t.hash=e.substr(o),e=e.substr(0,o));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Cr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Cr||(Cr={}));function jr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[o,r]=Hc(e.path,e.caseSensitive,e.end),a=t.match(o);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((u,p,m)=>{let{paramName:h,isOptional:x}=p;if(h==="*"){let b=d[m]||"";l=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const f=d[m];return x&&!f?u[h]=void 0:u[h]=Bc(f||"",h),u},{}),pathname:i,pathnameBase:l,pattern:e}}function Hc(e,t,o){t===void 0&&(t=!1),o===void 0&&(o=!0),Je(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(l,d,c)=>(r.push({paramName:d,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Bc(e,t){try{return decodeURIComponent(e)}catch(o){return Je(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+o+").")),e}}function ht(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let o=t.endsWith("/")?t.length-1:t.length,r=e.charAt(o);return r&&r!=="/"?null:e.slice(o)||"/"}function Ac(e,t){t===void 0&&(t="/");let{pathname:o,search:r="",hash:a=""}=typeof e=="string"?mn(e):e;return{pathname:o?o.startsWith("/")?o:Fc(o,t):t,search:Oc(r),hash:vc(a)}}function Fc(e,t){let o=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?o.length>1&&o.pop():a!=="."&&o.push(a)}),o.length>1?o.join("/"):"/"}function bo(e,t,o,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+o+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function hn(e){return e.filter((t,o)=>o===0||t.route.path&&t.route.path.length>0)}function fn(e,t,o,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=mn(e):(a=Mo({},e),ce(!a.pathname||!a.pathname.includes("?"),bo("?","pathname","search",a)),ce(!a.pathname||!a.pathname.includes("#"),bo("#","pathname","hash",a)),ce(!a.search||!a.search.includes("#"),bo("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,d;if(r||l==null)d=o;else{let m=t.length-1;if(l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),m-=1;a.pathname=h.join("/")}d=m>=0?t[m]:"/"}let c=Ac(a,d),u=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&o.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const Qo=e=>e.join("/").replace(/\/\/+/g,"/"),Oc=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vc=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xn=["post","put","patch","delete"];new Set(xn);const Nc=["get",...xn];new Set(Nc);/**
11
- * React Router v6.18.0
10
+ */function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Mo.apply(this,arguments)}var kr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(kr||(kr={}));function se(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ze(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ro(e){let{pathname:t="/",search:o="",hash:r=""}=e;return o&&o!=="?"&&(t+=o.charAt(0)==="?"?o:"?"+o),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function mn(e){let t={};if(e){let o=e.indexOf("#");o>=0&&(t.hash=e.substr(o),e=e.substr(0,o));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Cr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Cr||(Cr={}));function jr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[o,r]=Bc(e.path,e.caseSensitive,e.end),a=t.match(o);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((u,p,h)=>{let{paramName:m,isOptional:x}=p;if(m==="*"){let b=d[h]||"";l=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const f=d[h];return x&&!f?u[m]=void 0:u[m]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function Bc(e,t,o){t===void 0&&(t=!1),o===void 0&&(o=!0),Ze(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,c)=>(r.push({paramName:d,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Qe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let o=t.endsWith("/")?t.length-1:t.length,r=e.charAt(o);return r&&r!=="/"?null:e.slice(o)||"/"}const Ac=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fc=e=>Ac.test(e);function Oc(e,t){t===void 0&&(t="/");let{pathname:o,search:r="",hash:a=""}=typeof e=="string"?mn(e):e,i;if(o)if(Fc(o))i=o;else{if(o.includes("//")){let l=o;o=o.replace(/\/\/+/g,"/"),Ze(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+o))}o.startsWith("/")?i=Sr(o.substring(1),"/"):i=Sr(o,t)}else i=t;return{pathname:i,search:Nc(r),hash:Uc(a)}}function Sr(e,t){let o=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?o.length>1&&o.pop():a!=="."&&o.push(a)}),o.length>1?o.join("/"):"/"}function bo(e,t,o,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+o+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vc(e){return e.filter((t,o)=>o===0||t.route.path&&t.route.path.length>0)}function fn(e,t){let o=vc(e);return t?o.map((r,a)=>a===o.length-1?r.pathname:r.pathnameBase):o.map(r=>r.pathnameBase)}function xn(e,t,o,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=mn(e):(a=Mo({},e),se(!a.pathname||!a.pathname.includes("?"),bo("?","pathname","search",a)),se(!a.pathname||!a.pathname.includes("#"),bo("#","pathname","hash",a)),se(!a.search||!a.search.includes("#"),bo("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,d;if(l==null)d=o;else{let h=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),h-=1;a.pathname=m.join("/")}d=h>=0?t[h]:"/"}let c=Oc(a,d),u=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&o.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const Qo=e=>e.join("/").replace(/\/\/+/g,"/"),Nc=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Uc=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,bn=["post","put","patch","delete"];new Set(bn);const qc=["get",...bn];new Set(qc);/**
11
+ * React Router v6.30.3
12
12
  *
13
13
  * Copyright (c) Remix Software Inc.
14
14
  *
@@ -16,8 +16,8 @@
16
16
  * LICENSE.md file in the root directory of this source tree.
17
17
  *
18
18
  * @license MIT
19
- */function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},zo.apply(this,arguments)}const io=Q.createContext(null);process.env.NODE_ENV!=="production"&&(io.displayName="DataRouter");const bn=Q.createContext(null);process.env.NODE_ENV!=="production"&&(bn.displayName="DataRouterState");const Uc=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Uc.displayName="Await");const Ee=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Ee.displayName="Navigation");const Jo=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Jo.displayName="Location");const Ze=Q.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Ze.displayName="Route");const qc=Q.createContext(null);process.env.NODE_ENV!=="production"&&(qc.displayName="RouteError");function Gc(e,t){let{relative:o}=t===void 0?{}:t;Zo()||(process.env.NODE_ENV!=="production"?ce(!1,"useHref() may be used only in the context of a <Router> component."):ce(!1));let{basename:r,navigator:a}=Q.useContext(Ee),{hash:i,pathname:l,search:d}=kt(e,{relative:o}),c=l;return r!=="/"&&(c=l==="/"?r:Qo([r,l])),a.createHref({pathname:c,search:d,hash:i})}function Zo(){return Q.useContext(Jo)!=null}function yt(){return Zo()||(process.env.NODE_ENV!=="production"?ce(!1,"useLocation() may be used only in the context of a <Router> component."):ce(!1)),Q.useContext(Jo).location}const yn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kn(e){Q.useContext(Ee).static||Q.useLayoutEffect(e)}function Yc(){let{isDataRoute:e}=Q.useContext(Ze);return e?Zc():Xc()}function Xc(){Zo()||(process.env.NODE_ENV!=="production"?ce(!1,"useNavigate() may be used only in the context of a <Router> component."):ce(!1));let e=Q.useContext(io),{basename:t,navigator:o}=Q.useContext(Ee),{matches:r}=Q.useContext(Ze),{pathname:a}=yt(),i=JSON.stringify(hn(r).map(c=>c.pathnameBase)),l=Q.useRef(!1);return kn(()=>{l.current=!0}),Q.useCallback(function(c,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&Je(l.current,yn),!l.current)return;if(typeof c=="number"){o.go(c);return}let p=fn(c,JSON.parse(i),a,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Qo([t,p.pathname])),(u.replace?o.replace:o.push)(p,u.state,u)},[t,o,i,a,e])}function kt(e,t){let{relative:o}=t===void 0?{}:t,{matches:r}=Q.useContext(Ze),{pathname:a}=yt(),i=JSON.stringify(hn(r).map(l=>l.pathnameBase));return Q.useMemo(()=>fn(e,JSON.parse(i),a,o==="path"),[e,i,a,o])}var Cn=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Cn||{}),er=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(er||{});function jn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Kc(e){let t=Q.useContext(io);return t||(process.env.NODE_ENV!=="production"?ce(!1,jn(e)):ce(!1)),t}function Qc(e){let t=Q.useContext(Ze);return t||(process.env.NODE_ENV!=="production"?ce(!1,jn(e)):ce(!1)),t}function Sn(e){let t=Qc(e),o=t.matches[t.matches.length-1];return o.route.id||(process.env.NODE_ENV!=="production"?ce(!1,e+' can only be used on routes that contain a unique "id"'):ce(!1)),o.route.id}function Jc(){return Sn(er.UseRouteId)}function Zc(){let{router:e}=Kc(Cn.UseNavigateStable),t=Sn(er.UseNavigateStable),o=Q.useRef(!1);return kn(()=>{o.current=!0}),Q.useCallback(function(a,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Je(o.current,yn),o.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,zo({fromRouteId:t},i)))},[e,t])}new Promise(()=>{});/**
20
- * React Router DOM v6.18.0
19
+ */function zo(){return zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},zo.apply(this,arguments)}const io=Q.createContext(null);process.env.NODE_ENV!=="production"&&(io.displayName="DataRouter");const yn=Q.createContext(null);process.env.NODE_ENV!=="production"&&(yn.displayName="DataRouterState");const Gc=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Gc.displayName="Await");const Ie=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Ie.displayName="Navigation");const Jo=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Jo.displayName="Location");const et=Q.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(et.displayName="Route");const Yc=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Yc.displayName="RouteError");function Xc(e,t){let{relative:o}=t===void 0?{}:t;Zo()||(process.env.NODE_ENV!=="production"?se(!1,"useHref() may be used only in the context of a <Router> component."):se(!1));let{basename:r,navigator:a}=Q.useContext(Ie),{hash:i,pathname:l,search:d}=kt(e,{relative:o}),c=l;return r!=="/"&&(c=l==="/"?r:Qo([r,l])),a.createHref({pathname:c,search:d,hash:i})}function Zo(){return Q.useContext(Jo)!=null}function yt(){return Zo()||(process.env.NODE_ENV!=="production"?se(!1,"useLocation() may be used only in the context of a <Router> component."):se(!1)),Q.useContext(Jo).location}const kn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cn(e){Q.useContext(Ie).static||Q.useLayoutEffect(e)}function Kc(){let{isDataRoute:e}=Q.useContext(et);return e?ts():Qc()}function Qc(){Zo()||(process.env.NODE_ENV!=="production"?se(!1,"useNavigate() may be used only in the context of a <Router> component."):se(!1));let e=Q.useContext(io),{basename:t,future:o,navigator:r}=Q.useContext(Ie),{matches:a}=Q.useContext(et),{pathname:i}=yt(),l=JSON.stringify(fn(a,o.v7_relativeSplatPath)),d=Q.useRef(!1);return Cn(()=>{d.current=!0}),Q.useCallback(function(u,p){if(p===void 0&&(p={}),process.env.NODE_ENV!=="production"&&Ze(d.current,kn),!d.current)return;if(typeof u=="number"){r.go(u);return}let h=xn(u,JSON.parse(l),i,p.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Qo([t,h.pathname])),(p.replace?r.replace:r.push)(h,p.state,p)},[t,r,l,i,e])}function kt(e,t){let{relative:o}=t===void 0?{}:t,{future:r}=Q.useContext(Ie),{matches:a}=Q.useContext(et),{pathname:i}=yt(),l=JSON.stringify(fn(a,r.v7_relativeSplatPath));return Q.useMemo(()=>xn(e,JSON.parse(l),i,o==="path"),[e,l,i,o])}var jn=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jn||{}),er=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(er||{});function Sn(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Jc(e){let t=Q.useContext(io);return t||(process.env.NODE_ENV!=="production"?se(!1,Sn(e)):se(!1)),t}function Zc(e){let t=Q.useContext(et);return t||(process.env.NODE_ENV!=="production"?se(!1,Sn(e)):se(!1)),t}function wn(e){let t=Zc(e),o=t.matches[t.matches.length-1];return o.route.id||(process.env.NODE_ENV!=="production"?se(!1,e+' can only be used on routes that contain a unique "id"'):se(!1)),o.route.id}function es(){return wn(er.UseRouteId)}function ts(){let{router:e}=Jc(jn.UseNavigateStable),t=wn(er.UseNavigateStable),o=Q.useRef(!1);return Cn(()=>{o.current=!0}),Q.useCallback(function(a,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Ze(o.current,kn),o.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,zo({fromRouteId:t},i)))},[e,t])}new Promise(()=>{});/**
20
+ * React Router DOM v6.30.3
21
21
  *
22
22
  * Copyright (c) Remix Software Inc.
23
23
  *
@@ -25,12 +25,12 @@
25
25
  * LICENSE.md file in the root directory of this source tree.
26
26
  *
27
27
  * @license MIT
28
- */function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Qe.apply(this,arguments)}function tr(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}const Ht="get",Bt="application/x-www-form-urlencoded";function lo(e){return e!=null&&typeof e.tagName=="string"}function es(e){return lo(e)&&e.tagName.toLowerCase()==="button"}function ts(e){return lo(e)&&e.tagName.toLowerCase()==="form"}function os(e){return lo(e)&&e.tagName.toLowerCase()==="input"}function rs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ns(e,t){return e.button===0&&(!t||t==="_self")&&!rs(e)}let Et=null;function as(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}const is=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yo(e){return e!=null&&!is.has(e)?(process.env.NODE_ENV!=="production"&&Je(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Bt+'"')),null):e}function ls(e,t){let o,r,a,i,l;if(ts(e)){let d=e.getAttribute("action");r=d?ht(d,t):null,o=e.getAttribute("method")||Ht,a=yo(e.getAttribute("enctype"))||Bt,i=new FormData(e)}else if(es(e)||os(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||d.getAttribute("action");if(r=c?ht(c,t):null,o=e.getAttribute("formmethod")||d.getAttribute("method")||Ht,a=yo(e.getAttribute("formenctype"))||yo(d.getAttribute("enctype"))||Bt,i=new FormData(d,e),!as()){let{name:u,type:p,value:m}=e;if(p==="image"){let h=u?u+".":"";i.append(h+"x","0"),i.append(h+"y","0")}else u&&i.append(u,m)}}else{if(lo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Ht,r=null,a=Bt,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:o.toLowerCase(),encType:a,formData:i,body:l}}const cs=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ss=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ds=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],wn=Q.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(wn.displayName="ViewTransition");const us=Q.createContext(new Map);process.env.NODE_ENV!=="production"&&(us.displayName="Fetchers");process.env.NODE_ENV;const ps=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,or=Q.forwardRef(function(t,o){let{onClick:r,relative:a,reloadDocument:i,replace:l,state:d,target:c,to:u,preventScrollReset:p,unstable_viewTransition:m}=t,h=tr(t,cs),{basename:x}=Q.useContext(Ee),f,b=!1;if(typeof u=="string"&&gs.test(u)&&(f=u,ps))try{let S=new URL(window.location.href),C=u.startsWith("//")?new URL(S.protocol+u):new URL(u),w=ht(C.pathname,x);C.origin===S.origin&&w!=null?u=w+C.search+C.hash:b=!0}catch{process.env.NODE_ENV!=="production"&&Je(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let y=Gc(u,{relative:a}),k=xs(u,{replace:l,state:d,target:c,preventScrollReset:p,relative:a,unstable_viewTransition:m});function j(S){r&&r(S),S.defaultPrevented||k(S)}return Q.createElement("a",Qe({},h,{href:f||y,onClick:b||i?r:j,ref:o,target:c}))});process.env.NODE_ENV!=="production"&&(or.displayName="Link");const ms=Q.forwardRef(function(t,o){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:l=!1,style:d,to:c,unstable_viewTransition:u,children:p}=t,m=tr(t,ss),h=kt(c,{relative:m.relative}),x=yt(),f=Q.useContext(bn),{navigator:b}=Q.useContext(Ee),y=f!=null&&Ss(h)&&u===!0,k=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,j=x.pathname,S=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(j=j.toLowerCase(),S=S?S.toLowerCase():null,k=k.toLowerCase());let C=j===k||!l&&j.startsWith(k)&&j.charAt(k.length)==="/",w=S!=null&&(S===k||!l&&S.startsWith(k)&&S.charAt(k.length)==="/"),I={isActive:C,isPending:w,isTransitioning:y},M=C?r:void 0,R;typeof i=="function"?R=i(I):R=[i,C?"active":null,w?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let E=typeof d=="function"?d(I):d;return Q.createElement(or,Qe({},m,{"aria-current":M,className:R,ref:o,style:E,to:c,unstable_viewTransition:u}),typeof p=="function"?p(I):p)});process.env.NODE_ENV!=="production"&&(ms.displayName="NavLink");const hs=Q.forwardRef((e,t)=>{let{fetcherKey:o,navigate:r,reloadDocument:a,replace:i,state:l,method:d=Ht,action:c,onSubmit:u,relative:p,preventScrollReset:m,unstable_viewTransition:h}=e,x=tr(e,ds),f=Cs(),b=js(c,{relative:p}),y=d.toLowerCase()==="get"?"get":"post",k=j=>{if(u&&u(j),j.defaultPrevented)return;j.preventDefault();let S=j.nativeEvent.submitter,C=(S==null?void 0:S.getAttribute("formmethod"))||d;f(S||j.currentTarget,{fetcherKey:o,method:C,navigate:r,replace:i,state:l,relative:p,preventScrollReset:m,unstable_viewTransition:h})};return Q.createElement("form",Qe({ref:t,method:y,action:b,onSubmit:a?u:k},x))});process.env.NODE_ENV!=="production"&&(hs.displayName="Form");process.env.NODE_ENV;var Nt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Nt||(Nt={}));var Sr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sr||(Sr={}));function fs(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function In(e){let t=Q.useContext(io);return t||(process.env.NODE_ENV!=="production"?ce(!1,fs(e)):ce(!1)),t}function xs(e,t){let{target:o,replace:r,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:d}=t===void 0?{}:t,c=Yc(),u=yt(),p=kt(e,{relative:l});return Q.useCallback(m=>{if(ns(m,o)){m.preventDefault();let h=r!==void 0?r:Ro(u)===Ro(p);c(e,{replace:h,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:d})}},[u,c,p,r,a,o,e,i,l,d])}function bs(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let ys=0,ks=()=>"__"+String(++ys)+"__";function Cs(){let{router:e}=In(Nt.UseSubmit),{basename:t}=Q.useContext(Ee),o=Jc();return Q.useCallback(function(r,a){a===void 0&&(a={}),bs();let{action:i,method:l,encType:d,formData:c,body:u}=ls(r,t);if(a.navigate===!1){let p=a.fetcherKey||ks();e.fetch(p,o,a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||l,formEncType:a.encType||d})}else e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||l,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:o,unstable_viewTransition:a.unstable_viewTransition})},[e,t,o])}function js(e,t){let{relative:o}=t===void 0?{}:t,{basename:r}=Q.useContext(Ee),a=Q.useContext(Ze);a||(process.env.NODE_ENV!=="production"?ce(!1,"useFormAction must be used inside a RouteContext"):ce(!1));let[i]=a.matches.slice(-1),l=Qe({},kt(e||".",{relative:o})),d=yt();if(e==null&&(l.search=d.search,i.route.index)){let c=new URLSearchParams(l.search);c.delete("index"),l.search=c.toString()?"?"+c.toString():""}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Qo([r,l.pathname])),Ro(l)}function Ss(e,t){t===void 0&&(t={});let o=Q.useContext(wn);o==null&&(process.env.NODE_ENV!=="production"?ce(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):ce(!1));let{basename:r}=In(Nt.useViewTransitionState),a=kt(e,{relative:t.relative});if(!o.isTransitioning)return!1;let i=ht(o.currentLocation.pathname,r)||o.currentLocation.pathname,l=ht(o.nextLocation.pathname,r)||o.nextLocation.pathname;return jr(a.pathname,l)!=null||jr(a.pathname,i)!=null}const ws={xs:12,sm:14,md:16,lg:18,xl:20},Is=({children:e,to:t="/",iconSize:o="sm",underline:r="default",isHovered:a=!1,isExternal:i=!1,views:l={icon:{},text:{}},setIsHovered:d=()=>{},...c})=>{const u=()=>{r==="hover"&&d(!0)},p=()=>{r==="hover"&&d(!1)},m=()=>r==="underline"||r==="hover"&&a?"underline":"none";return n.jsx(or,{to:t,target:i?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:n.jsxs(s.Horizontal,{onMouseEnter:u,onMouseLeave:p,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:m(),...l.text,...c,children:[e,i&&n.jsx(an,{widthHeight:ws[o]})]})})},Ts=e=>{const t=Dc();return n.jsx(Is,{...t,...e})},Tn=Ts,rr={xs:14,sm:18,md:22,lg:26,xl:30},nr={fast:50,normal:100,slow:300},Ms=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},nr[t]);return()=>clearInterval(m)},[t]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${c}px`,height:`${c}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),n.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("g",{id:"SVGRepo_iconCarrier",children:n.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},Rs=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},nr[t]);return()=>clearInterval(m)},[t]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${c}px`,height:`${c}px`,style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},zs=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},nr[t]);return()=>clearInterval(m)},[t]),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${c}px`,height:`${c}px`,style:{transform:`rotate(${u}deg)`},...a,children:n.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},Es=({size:e,children:t,textColor:o,loaderColor:r,type:a="default",speed:i="normal",textPosition:l="right",views:d,...c})=>{const{getColor:u}=s.useTheme();r=u(r||c.color||"theme-loading"),o=u(o||c.color||"theme-loading");const p={size:e,speed:i,color:r},m={default:n.jsx(Ms,{...p}),dotted:n.jsx(Rs,{...p}),quarter:n.jsx(zs,{...p})};return n.jsxs(s.Center,{gap:10,flexDirection:l==="top"||l==="bottom"?"column":"row",...c,...d==null?void 0:d.container,children:[(l==="left"||l==="top")&&t&&n.jsx(s.View,{color:o,...d==null?void 0:d.text,children:t}),m[a],(l==="right"||l==="bottom")&&t&&n.jsx(s.View,{color:o,...d==null?void 0:d.text,children:t})]})},Vs=e=>n.jsx(Es,{...e}),ft=Vs,Ps={xs:10,sm:12,md:14,lg:16,xl:20},it={xs:12,sm:16,md:20,lg:24,xl:28},lt=e=>({minHeight:it[e]*2,paddingHorizontal:it[e]/2,fontSize:Ps[e],fontWeight:500,lineHeight:it[e],letterSpacing:"-0.01em",paddingInline:it[e],paddingBlock:it[e]/2,outlineWidth:"medium"}),Mn={xs:lt("xs"),sm:lt("sm"),md:lt("md"),lg:lt("lg"),xl:lt("xl")},mt={square:0,rounded:8,pill:999},Rn={xs:{width:16,height:16,padding:6},sm:{width:20,height:20,padding:6},md:{width:24,height:24,padding:8},lg:{width:24,height:24,padding:12},xl:{width:28,height:28,padding:14}},_s=(e,t,o=!1)=>{const r=o?t:e,a=o?e:t,i=o?t:e;return{filled:{backgroundColor:r,color:a,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${r}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:i,color:i,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:i,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:i,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:o?`color-mix(in srgb, ${i} 20%, transparent)`:`color-mix(in srgb, ${i} 5%, transparent)`,color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{backgroundColor:o?`color-mix(in srgb, ${i} 40%, transparent)`:`color-mix(in srgb, ${i} 15%, transparent)`},_active:{backgroundColor:o?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.15)"},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"all 0.2s ease"}}},Ws=({children:e,icon:t,isLoading:o,iconPosition:r="left",loaderPosition:a="left",size:i="md",resolvedTextColor:l,isIconRounded:d,views:c})=>{const u=["left","right"].includes(r)?s.Horizontal:s.Vertical,p=Mn[i],m=d?Rn[i]:{};return n.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...p,...m,...c==null?void 0:c.content,children:[o&&a==="left"&&n.jsx(ft,{size:i==="xs"||i==="sm"?"sm":"md",color:l,...c==null?void 0:c.loader}),t&&["left","top"].includes(r)&&!o&&n.jsx(s.View,{color:l,...c==null?void 0:c.icon,children:t}),e,t&&["right","bottom"].includes(r)&&!o&&n.jsx(s.View,{color:l,...c==null?void 0:c.icon,children:t}),o&&a==="right"&&n.jsx(ft,{size:i==="xs"||i==="sm"?"sm":"md",color:l,...c==null?void 0:c.loader})]})},$s=e=>{const t=mt[e];return typeof t=="number"?t:typeof t=="string"&&parseInt(t,10)||0},Ls=({asComponent:e,isDisabled:t,isLoading:o,isWrapped:r=!1,borderRadius:a,width:i,height:l,baseStyles:d,sizeStyles:c,iconPad:u,mainTone:p,resolvedTextColor:m,children:h,borderWidth:x=0,...f})=>n.jsx(s.Element,{as:e,disabled:!!(t||o),display:r?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:a,width:i,height:l,...d,...c,...u,backgroundColor:(d==null?void 0:d.backgroundColor)||(r?p:void 0),color:m,borderWidth:r?0:void 0,cursor:t?"default":"pointer",...f,children:h}),Ds=({shape:e,isDisabled:t,onClick:o,shadow:r,borderWidth:a,isAuto:i,isFilled:l,views:d,children:c,...u})=>n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:mt[e],cursor:t?"default":"pointer",onClick:o,boxShadow:r,padding:a,width:i?"fit-content":l?"100%":void 0,...d==null?void 0:d.container,...u,children:c}),Hs=({variant:e,animation:t,to:o,isDisabled:r,isLoading:a,isAuto:i,isFilled:l,isExternal:d,shape:c="rounded",shadow:u,onClick:p,views:m,baseStyles:h,sizeStyles:x,iconPad:f,resolvedTextColor:b,content:y,size:k,mainTone:j,borderMovingDuration:S=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:w="#705CFF",animatedStrokeTextColor:I="#333333",getColor:M=E=>E,...R})=>{var $;const E=$s(c),W=o?n.jsx(Tn,{to:o,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...m==null?void 0:m.link,children:y}):y,T={isDisabled:r,isLoading:a,baseStyles:h,sizeStyles:x,iconPad:f,resolvedTextColor:b,mainTone:j,children:W};if(t==="borderMoving"&&C){const z={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${S}s`,timingFunction:"linear",iterationCount:"infinite"};return n.jsx(Ds,{shape:c,isDisabled:r,onClick:p,shadow:u,borderWidth:3,isAuto:i,isFilled:l,views:m,background:`linear-gradient(90deg, ${C[0]}, ${C[1]}, ${C[2]}, ${C[0]})`,backgroundSize:"200% 100%",animate:z,...R,children:n.jsx(Ls,{asComponent:o?"div":"button",isWrapped:!0,borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...T})})}if(t==="animatedStroke"){const D=M(w),z=M(I),V=1e3,_={from:{strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63)},to:{strokeWidth:"3px",strokeDasharray:`${V}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},P=["group",($=m==null?void 0:m.container)==null?void 0:$.className,R==null?void 0:R.className].filter(Boolean).join(" ");return n.jsxs(s.Element,{as:o?"div":"button",type:o?void 0:"button",disabled:!!(!o&&(r||a)),onClick:p,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:i?"fit-content":l?"100%":void 0,borderRadius:mt[c],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",color:z,backgroundColor:"transparent",borderWidth:0,...m==null?void 0:m.container,...R,className:P,children:[n.jsx(s.View,{as:"svg",position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",pointerEvents:"none",zIndex:1,"aria-hidden":"true",children:n.jsx(s.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:E,ry:E,fill:"transparent",stroke:D,strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63),pathLength:V,on:{groupHover:{animate:_}}})}),n.jsx(s.View,{position:"relative",zIndex:0,children:W})]})}if(t==="borderReveal"){const z=(C==null?void 0:C[0])||j||"#000000",_=S*.75/4,P=`linear-gradient(90deg, ${z} 50%, transparent 50%)`,L=`linear-gradient(180deg, ${z} 50%, transparent 50%)`,H=`linear-gradient(270deg, ${z} 50%, transparent 50%)`,B=`linear-gradient(0deg, ${z} 50%, transparent 50%)`,F="100% 0, 100% 100%, 0 100%, 0 0",A="0 0, 100% 0, 100% 100%, 0 100%",O=`0s, ${_}s, ${_*2}s, ${_*2}s`,G=`${_*2}s, ${_*2}s, ${_}s, 0s`,Y=4;return n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:mt[c],cursor:r?"default":"pointer",onClick:p,boxShadow:u,padding:3,background:`
28
+ */function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Je.apply(this,arguments)}function tr(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}const Ht="get",Bt="application/x-www-form-urlencoded";function lo(e){return e!=null&&typeof e.tagName=="string"}function os(e){return lo(e)&&e.tagName.toLowerCase()==="button"}function rs(e){return lo(e)&&e.tagName.toLowerCase()==="form"}function ns(e){return lo(e)&&e.tagName.toLowerCase()==="input"}function as(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function is(e,t){return e.button===0&&(!t||t==="_self")&&!as(e)}let Et=null;function ls(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}const cs=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yo(e){return e!=null&&!cs.has(e)?(process.env.NODE_ENV!=="production"&&Ze(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Bt+'"')),null):e}function ss(e,t){let o,r,a,i,l;if(rs(e)){let d=e.getAttribute("action");r=d?Qe(d,t):null,o=e.getAttribute("method")||Ht,a=yo(e.getAttribute("enctype"))||Bt,i=new FormData(e)}else if(os(e)||ns(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||d.getAttribute("action");if(r=c?Qe(c,t):null,o=e.getAttribute("formmethod")||d.getAttribute("method")||Ht,a=yo(e.getAttribute("formenctype"))||yo(d.getAttribute("enctype"))||Bt,i=new FormData(d,e),!ls()){let{name:u,type:p,value:h}=e;if(p==="image"){let m=u?u+".":"";i.append(m+"x","0"),i.append(m+"y","0")}else u&&i.append(u,h)}}else{if(lo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Ht,r=null,a=Bt,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:o.toLowerCase(),encType:a,formData:i,body:l}}const ds=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],us=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ps=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],gs="6";try{window.__reactRouterVersion=gs}catch{}const In=Q.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(In.displayName="ViewTransition");const hs=Q.createContext(new Map);process.env.NODE_ENV!=="production"&&(hs.displayName="Fetchers");process.env.NODE_ENV;const ms=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,or=Q.forwardRef(function(t,o){let{onClick:r,relative:a,reloadDocument:i,replace:l,state:d,target:c,to:u,preventScrollReset:p,viewTransition:h}=t,m=tr(t,ds),{basename:x}=Q.useContext(Ie),f,b=!1;if(typeof u=="string"&&fs.test(u)&&(f=u,ms))try{let S=new URL(window.location.href),C=u.startsWith("//")?new URL(S.protocol+u):new URL(u),w=Qe(C.pathname,x);C.origin===S.origin&&w!=null?u=w+C.search+C.hash:b=!0}catch{process.env.NODE_ENV!=="production"&&Ze(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let y=Xc(u,{relative:a}),k=ks(u,{replace:l,state:d,target:c,preventScrollReset:p,relative:a,viewTransition:h});function j(S){r&&r(S),S.defaultPrevented||k(S)}return Q.createElement("a",Je({},m,{href:f||y,onClick:b||i?r:j,ref:o,target:c}))});process.env.NODE_ENV!=="production"&&(or.displayName="Link");const xs=Q.forwardRef(function(t,o){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:l=!1,style:d,to:c,viewTransition:u,children:p}=t,h=tr(t,us),m=kt(c,{relative:h.relative}),x=yt(),f=Q.useContext(yn),{navigator:b,basename:y}=Q.useContext(Ie),k=f!=null&&Ts(m)&&u===!0,j=b.encodeLocation?b.encodeLocation(m).pathname:m.pathname,S=x.pathname,C=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(S=S.toLowerCase(),C=C?C.toLowerCase():null,j=j.toLowerCase()),C&&y&&(C=Qe(C,y)||C);const w=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let I=S===j||!l&&S.startsWith(j)&&S.charAt(w)==="/",M=C!=null&&(C===j||!l&&C.startsWith(j)&&C.charAt(j.length)==="/"),R={isActive:I,isPending:M,isTransitioning:k},E=I?r:void 0,_;typeof i=="function"?_=i(R):_=[i,I?"active":null,M?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let T=typeof d=="function"?d(R):d;return Q.createElement(or,Je({},h,{"aria-current":E,className:_,ref:o,style:T,to:c,viewTransition:u}),typeof p=="function"?p(R):p)});process.env.NODE_ENV!=="production"&&(xs.displayName="NavLink");const bs=Q.forwardRef((e,t)=>{let{fetcherKey:o,navigate:r,reloadDocument:a,replace:i,state:l,method:d=Ht,action:c,onSubmit:u,relative:p,preventScrollReset:h,viewTransition:m}=e,x=tr(e,ps),f=ws(),b=Is(c,{relative:p}),y=d.toLowerCase()==="get"?"get":"post",k=j=>{if(u&&u(j),j.defaultPrevented)return;j.preventDefault();let S=j.nativeEvent.submitter,C=(S==null?void 0:S.getAttribute("formmethod"))||d;f(S||j.currentTarget,{fetcherKey:o,method:C,navigate:r,replace:i,state:l,relative:p,preventScrollReset:h,viewTransition:m})};return Q.createElement("form",Je({ref:t,method:y,action:b,onSubmit:a?u:k},x))});process.env.NODE_ENV!=="production"&&(bs.displayName="Form");process.env.NODE_ENV;var Nt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Nt||(Nt={}));var wr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(wr||(wr={}));function ys(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Tn(e){let t=Q.useContext(io);return t||(process.env.NODE_ENV!=="production"?se(!1,ys(e)):se(!1)),t}function ks(e,t){let{target:o,replace:r,state:a,preventScrollReset:i,relative:l,viewTransition:d}=t===void 0?{}:t,c=Kc(),u=yt(),p=kt(e,{relative:l});return Q.useCallback(h=>{if(is(h,o)){h.preventDefault();let m=r!==void 0?r:Ro(u)===Ro(p);c(e,{replace:m,state:a,preventScrollReset:i,relative:l,viewTransition:d})}},[u,c,p,r,a,o,e,i,l,d])}function Cs(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let js=0,Ss=()=>"__"+String(++js)+"__";function ws(){let{router:e}=Tn(Nt.UseSubmit),{basename:t}=Q.useContext(Ie),o=es();return Q.useCallback(function(r,a){a===void 0&&(a={}),Cs();let{action:i,method:l,encType:d,formData:c,body:u}=ss(r,t);if(a.navigate===!1){let p=a.fetcherKey||Ss();e.fetch(p,o,a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||l,formEncType:a.encType||d,flushSync:a.flushSync})}else e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||l,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:o,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,o])}function Is(e,t){let{relative:o}=t===void 0?{}:t,{basename:r}=Q.useContext(Ie),a=Q.useContext(et);a||(process.env.NODE_ENV!=="production"?se(!1,"useFormAction must be used inside a RouteContext"):se(!1));let[i]=a.matches.slice(-1),l=Je({},kt(e||".",{relative:o})),d=yt();if(e==null){l.search=d.search;let c=new URLSearchParams(l.search),u=c.getAll("index");if(u.some(h=>h==="")){c.delete("index"),u.filter(m=>m).forEach(m=>c.append("index",m));let h=c.toString();l.search=h?"?"+h:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Qo([r,l.pathname])),Ro(l)}function Ts(e,t){t===void 0&&(t={});let o=Q.useContext(In);o==null&&(process.env.NODE_ENV!=="production"?se(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):se(!1));let{basename:r}=Tn(Nt.useViewTransitionState),a=kt(e,{relative:t.relative});if(!o.isTransitioning)return!1;let i=Qe(o.currentLocation.pathname,r)||o.currentLocation.pathname,l=Qe(o.nextLocation.pathname,r)||o.nextLocation.pathname;return jr(a.pathname,l)!=null||jr(a.pathname,i)!=null}const Ms={xs:12,sm:14,md:16,lg:18,xl:20},Rs=({children:e,to:t="/",iconSize:o="sm",underline:r="default",isHovered:a=!1,isExternal:i=!1,views:l={icon:{},text:{}},setIsHovered:d=()=>{},...c})=>{const u=()=>{r==="hover"&&d(!0)},p=()=>{r==="hover"&&d(!1)},h=()=>r==="underline"||r==="hover"&&a?"underline":"none";return n.jsx(or,{to:t,target:i?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:n.jsxs(s.Horizontal,{onMouseEnter:u,onMouseLeave:p,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:h(),...l.text,...c,children:[e,i&&n.jsx(ln,{widthHeight:Ms[o]})]})})},zs=e=>{const t=Hc();return n.jsx(Rs,{...t,...e})},Mn=zs,rr={xs:14,sm:18,md:22,lg:26,xl:30},nr={fast:50,normal:100,slow:300},Es=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},nr[t]);return()=>clearInterval(h)},[t]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${c}px`,height:`${c}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),n.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("g",{id:"SVGRepo_iconCarrier",children:n.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},Vs=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},nr[t]);return()=>clearInterval(h)},[t]),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${c}px`,height:`${c}px`,style:{transform:`rotate(${u}deg)`},...a,children:[n.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),n.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},Ps=({size:e="md",speed:t="normal",color:o="theme-loading",themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=i(o,{themeMode:r||l}),c=typeof e=="number"?e:rr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},nr[t]);return()=>clearInterval(h)},[t]),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${c}px`,height:`${c}px`,style:{transform:`rotate(${u}deg)`},...a,children:n.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},Ws=({size:e,children:t,textColor:o,loaderColor:r,type:a="default",speed:i="normal",textPosition:l="right",views:d,...c})=>{const{getColor:u}=s.useTheme();r=u(r||c.color||"theme-loading"),o=u(o||c.color||"theme-loading");const p={size:e,speed:i,color:r},h={default:n.jsx(Es,{...p}),dotted:n.jsx(Vs,{...p}),quarter:n.jsx(Ps,{...p})};return n.jsxs(s.Center,{gap:10,flexDirection:l==="top"||l==="bottom"?"column":"row",...c,...d==null?void 0:d.container,children:[(l==="left"||l==="top")&&t&&n.jsx(s.View,{color:o,...d==null?void 0:d.text,children:t}),h[a],(l==="right"||l==="bottom")&&t&&n.jsx(s.View,{color:o,...d==null?void 0:d.text,children:t})]})},_s=e=>n.jsx(Ws,{...e}),ft=_s,$s={xs:10,sm:12,md:14,lg:16,xl:20},lt={xs:12,sm:16,md:20,lg:24,xl:28},ct=e=>({minHeight:lt[e]*2,paddingHorizontal:lt[e]/2,fontSize:$s[e],fontWeight:500,lineHeight:lt[e],letterSpacing:"-0.01em",paddingInline:lt[e],paddingBlock:lt[e]/2,outlineWidth:"medium"}),Rn={xs:ct("xs"),sm:ct("sm"),md:ct("md"),lg:ct("lg"),xl:ct("xl")},mt={square:0,rounded:8,pill:999},zn={xs:{width:16,height:16,padding:6},sm:{width:20,height:20,padding:6},md:{width:24,height:24,padding:8},lg:{width:24,height:24,padding:12},xl:{width:28,height:28,padding:14}},Ls=(e,t,o=!1)=>{const r=o?t:e,a=o?e:t,i=o?t:e;return{filled:{backgroundColor:r,color:a,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${r}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:i,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:i,color:i,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:i,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:i,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:o?`color-mix(in srgb, ${i} 20%, transparent)`:`color-mix(in srgb, ${i} 5%, transparent)`,color:i,borderWidth:1,borderStyle:"solid",borderColor:i,_hover:{backgroundColor:o?`color-mix(in srgb, ${i} 40%, transparent)`:`color-mix(in srgb, ${i} 15%, transparent)`},_active:{backgroundColor:o?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.15)"},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${i}`},transition:"all 0.2s ease"}}},Ds=({children:e,icon:t,isLoading:o,iconPosition:r="left",loaderPosition:a="left",size:i="md",resolvedTextColor:l,isIconRounded:d,views:c})=>{const u=["left","right"].includes(r)?s.Horizontal:s.Vertical,p=Rn[i],h=d?zn[i]:{};return n.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...p,...h,...c==null?void 0:c.content,children:[o&&a==="left"&&n.jsx(ft,{size:i==="xs"||i==="sm"?"sm":"md",color:l,...c==null?void 0:c.loader}),t&&["left","top"].includes(r)&&!o&&n.jsx(s.View,{color:l,...c==null?void 0:c.icon,children:t}),e,t&&["right","bottom"].includes(r)&&!o&&n.jsx(s.View,{color:l,...c==null?void 0:c.icon,children:t}),o&&a==="right"&&n.jsx(ft,{size:i==="xs"||i==="sm"?"sm":"md",color:l,...c==null?void 0:c.loader})]})},Hs=e=>{const t=mt[e];return typeof t=="number"?t:typeof t=="string"&&parseInt(t,10)||0},Bs=({asComponent:e,isDisabled:t,isLoading:o,isWrapped:r=!1,borderRadius:a,width:i,height:l,baseStyles:d,sizeStyles:c,iconPad:u,mainTone:p,resolvedTextColor:h,children:m,borderWidth:x=0,...f})=>n.jsx(s.Element,{as:e,disabled:!!(t||o),display:r?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:a,width:i,height:l,...d,...c,...u,backgroundColor:(d==null?void 0:d.backgroundColor)||(r?p:void 0),color:h,borderWidth:r?0:void 0,cursor:t?"default":"pointer",...f,children:m}),As=({shape:e,isDisabled:t,onClick:o,shadow:r,borderWidth:a,isAuto:i,isFilled:l,views:d,children:c,...u})=>n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:mt[e],cursor:t?"default":"pointer",onClick:o,boxShadow:r,padding:a,width:i?"fit-content":l?"100%":void 0,...d==null?void 0:d.container,...u,children:c}),Fs=({variant:e,animation:t,to:o,isDisabled:r,isLoading:a,isAuto:i,isFilled:l,isExternal:d,shape:c="rounded",shadow:u,onClick:p,views:h,baseStyles:m,sizeStyles:x,iconPad:f,resolvedTextColor:b,content:y,size:k,mainTone:j,borderMovingDuration:S=2,borderMovingGradientColors:C=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:w="#705CFF",animatedStrokeTextColor:I="#333333",getColor:M=E=>E,...R})=>{var $;const E=Hs(c),_=o?n.jsx(Mn,{to:o,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...h==null?void 0:h.link,children:y}):y,T={isDisabled:r,isLoading:a,baseStyles:m,sizeStyles:x,iconPad:f,resolvedTextColor:b,mainTone:j,children:_};if(t==="borderMoving"&&C){const z={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${S}s`,timingFunction:"linear",iterationCount:"infinite"};return n.jsx(As,{shape:c,isDisabled:r,onClick:p,shadow:u,borderWidth:3,isAuto:i,isFilled:l,views:h,background:`linear-gradient(90deg, ${C[0]}, ${C[1]}, ${C[2]}, ${C[0]})`,backgroundSize:"200% 100%",animate:z,...R,children:n.jsx(Bs,{asComponent:o?"div":"button",isWrapped:!0,borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...T})})}if(t==="animatedStroke"){const D=M(w),z=M(I),V=1e3,W={from:{strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63)},to:{strokeWidth:"3px",strokeDasharray:`${V}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},P=["group",($=h==null?void 0:h.container)==null?void 0:$.className,R==null?void 0:R.className].filter(Boolean).join(" ");return n.jsxs(s.Element,{as:o?"div":"button",type:o?void 0:"button",disabled:!!(!o&&(r||a)),onClick:p,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:i?"fit-content":l?"100%":void 0,borderRadius:mt[c],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",color:z,backgroundColor:"transparent",borderWidth:0,...h==null?void 0:h.container,...R,className:P,children:[n.jsx(s.View,{as:"svg",position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",pointerEvents:"none",zIndex:1,"aria-hidden":"true",children:n.jsx(s.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:E,ry:E,fill:"transparent",stroke:D,strokeWidth:"8px",strokeDasharray:`0 ${V}`,strokeDashoffset:-Math.round(V*.63),pathLength:V,on:{groupHover:{animate:W}}})}),n.jsx(s.View,{position:"relative",zIndex:0,children:_})]})}if(t==="borderReveal"){const z=(C==null?void 0:C[0])||j||"#000000",W=S*.75/4,P=`linear-gradient(90deg, ${z} 50%, transparent 50%)`,L=`linear-gradient(180deg, ${z} 50%, transparent 50%)`,H=`linear-gradient(270deg, ${z} 50%, transparent 50%)`,B=`linear-gradient(0deg, ${z} 50%, transparent 50%)`,F="100% 0, 100% 100%, 0 100%, 0 0",A="0 0, 100% 0, 100% 100%, 0 100%",O=`0s, ${W}s, ${W*2}s, ${W*2}s`,Y=`${W*2}s, ${W*2}s, ${W}s, 0s`,X=4;return n.jsx(s.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:mt[c],cursor:r?"default":"pointer",onClick:p,boxShadow:u,padding:3,background:`
29
29
  ${P} no-repeat,
30
30
  ${L} no-repeat,
31
31
  ${H} no-repeat,
32
32
  ${B} no-repeat
33
- `,backgroundSize:`200% ${Y}px, ${Y}px 200%, 200% ${Y}px, ${Y}px 200%`,backgroundPosition:F,transitionProperty:"background-position",transitionDuration:`${_}s`,transitionTimingFunction:"linear",transitionDelay:G,_hover:{backgroundPosition:A,transitionDelay:O},width:i?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...R,children:n.jsx(s.View,{as:o?"div":"button",disabled:!!(r||a),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...h,...x,...f,backgroundColor:(h==null?void 0:h.backgroundColor)||j,color:b,borderWidth:0,cursor:r?"default":"pointer",children:W})})}return n.jsx(s.Element,{as:e==="link"&&o?"div":"button",type:e==="link"&&o?void 0:"button",disabled:!!(r||a),...x,...f,display:"inline-flex",alignItems:"center",justifyContent:"center",width:i?"fit-content":l?"100%":void 0,borderRadius:mt[c],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...R,children:W})},Bs=({variant:e="filled",size:t="md",shape:o="rounded",iconPosition:r="left",loaderPosition:a="left",backgroundColor:i,color:l,textColor:d,reversed:c=!1,isAuto:u=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:x,isHovered:f,icon:b,children:y,to:k,isExternal:j,shadow:S,onClick:C,views:w={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:R="#705CFF",animatedStrokeTextColor:E="#333333",...W})=>{const{getColorHex:T}=s.useTheme();let z=T(m?"theme-disabled":h?"theme-loading":i??l??"theme-button-background");(z==="theme-button-background"||z==="theme-loading")&&(z=T(h?"color-dark-500":"theme-primary"));let _=T(d??"theme-button-text");_==="theme-button-text"&&(_=T("color-white"));const L=g.useMemo(()=>_s(z,_,c),[z,_,c])[e],H=(L==null?void 0:L.color)??_,B=n.jsx(Ws,{icon:b,isLoading:h,iconPosition:r,loaderPosition:a,size:t,resolvedTextColor:H,isIconRounded:x,views:w,children:y}),F=Mn[t],A=x?Rn[t]:{};return n.jsx(Hs,{variant:e,animation:W.animation,to:k,isDisabled:m,isLoading:h,isAuto:u,isFilled:p,isExternal:j,shape:o,shadow:S,onClick:C,views:w,baseStyles:L,sizeStyles:F,iconPad:A,resolvedTextColor:H,content:B,size:t,mainTone:z,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:R,animatedStrokeTextColor:E,getColor:T,...W})},As=e=>{const[t,o]=s.useHover();return n.jsx(Bs,{ref:t,isHovered:o,...e})},Le=As,Fs={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Os={square:0,rounded:"8px",pill:"24px"},vs=e=>{const t=e==="dark";return{default:{backgroundColor:t?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:t?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:t?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:t?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:t?"color-gray-900":"color-white",boxShadow:t?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:t?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},co=e=>{const t=e.themeMode==="dark";return{container:{backgroundColor:t?"color-gray-900":"color-white",color:t?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:t?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:t?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:t?"color-gray-800":"color-gray-100"}}},zn=g.createContext({}),ar=()=>g.useContext(zn),Eo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).header,c={...d,...l==null?void 0:l.header,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.header)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:8,...c,children:e})},Vo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).content,c={...d,...l==null?void 0:l.content,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.content)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:12,...c,children:e})},Po=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).footer,c={...d,...l==null?void 0:l.footer,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.footer)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:8,...c,children:e})},Ns=({variant:e="default",size:t="md",shape:o="rounded",children:r,header:a,footer:i,isFullWidth:l=!1,views:d,style:c,themeMode:u,...p})=>{var C,w;const m=s.useTheme(),h=co(m),x=((C=Fs[t])==null?void 0:C.padding)||"16px",f=g.useMemo(()=>({styles:{container:{...h.container,borderRadius:Os[o],...d==null?void 0:d.container},header:{...h.header,padding:x,...d==null?void 0:d.header},content:{...h.content,padding:x,...d==null?void 0:d.content},footer:{...h.footer,padding:x,...d==null?void 0:d.footer}}}),[h,d,x,o]),b=g.Children.toArray(r).some(I=>g.isValidElement(I)&&(I.type===Eo||I.type===Vo||I.type===Po)),{themeMode:y}=m,j=vs(u||y)[e],S={width:l?"100%":"auto",overflow:"hidden",...j,...f.styles.container,...p,style:{...(w=f.styles.container)==null?void 0:w.style,...c}};return n.jsx(zn.Provider,{value:f,children:n.jsx(s.View,{...S,children:b?r:n.jsxs(s.Vertical,{width:"100%",children:[a&&n.jsx(Eo,{children:a}),n.jsx(Vo,{children:r}),i&&n.jsx(Po,{children:i})]})})})},Us=e=>n.jsx(Ns,{...e}),so=Us;so.Header=Eo;so.Content=Vo;so.Footer=Po;const qs=({defaultActiveIndex:e=0,activeIndex:t,onChange:o,autoPlay:r=!1,autoPlayInterval:a=3e3,pauseOnHover:i=!0,infinite:l=!0,totalSlides:d,stepIndices:c})=>{const u=g.useRef(d||0),[p,m]=g.useState(d||0),h=g.useRef(new Set),x=g.useRef(0),f=g.useMemo(()=>Ao("carousel-content"),[]),[b,y]=g.useState(t!==void 0?t:e),[k,j]=g.useState(!1),[S,C]=g.useState(!1),[w,I]=g.useState(0),[M,R]=g.useState(0),E=g.useRef(null);g.useEffect(()=>{t!==void 0&&y(t)},[t]);const W=g.useCallback(A=>{let O=A;l?A<0?O=p-1:A>=p&&(O=0):O=Math.max(0,Math.min(A,p-1)),c&&c.length>0&&(c.includes(O)||(O=c.reduce((Y,q)=>Math.abs(q-O)<Math.abs(Y-O)?q:Y))),t===void 0&&y(O),o&&o(O)},[t,l,o,p]),T=g.useCallback(()=>{W(b+1)},[b,W]),$=g.useCallback(()=>{W(b-1)},[b,W]);g.useEffect(()=>(r&&!k&&!S&&(E.current=setInterval(()=>{T()},a)),()=>{E.current&&clearInterval(E.current)}),[r,a,k,S,T,i]);const D=g.useCallback(()=>{i&&j(!0)},[i]),z=g.useCallback(()=>{j(!1)},[]),V=g.useCallback(A=>{C(!0),"touches"in A?(I(A.touches[0].clientX),R(A.touches[0].clientY)):(I(A.clientX),R(A.clientY))},[]),_=g.useCallback(A=>{if(!S)return;let O,G;"touches"in A?(O=A.touches[0].clientX,G=A.touches[0].clientY):(O=A.clientX,G=A.clientY);const Y=O-w,q=G-M;Math.abs(Y)>Math.abs(q)&&Math.abs(Y)>50&&(Y>0?$():T(),C(!1))},[S,w,M,T,$]),P=g.useCallback(()=>{C(!1)},[]),L=g.useCallback(()=>{const A=x.current++;h.current.add(A);const O=h.current.size;return u.current=O,m(O),A},[]),H=g.useCallback(A=>{h.current.delete(A);const O=h.current.size;if(u.current=O,m(O),O>0&&b>=O){const G=Math.max(0,O-1);t===void 0&&y(G),o&&o(G)}},[b,t,o]),B=l||b>0,F=l||b<p-1;return{activeIndex:b,totalSlides:p,goToSlide:W,nextSlide:T,prevSlide:$,canGoNext:F,canGoPrevious:B,handleMouseEnter:D,handleMouseLeave:z,handleDragStart:V,handleDragMove:_,handleDragEnd:P,registerSlide:L,unregisterSlide:H,contentId:f,infinite:l}},Gs={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},Ys={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Ut={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},Ct=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Ut},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Ut}}),En=g.createContext(null),uo=()=>{const e=g.useContext(En);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Vn=({children:e,isActive:t,views:o,...r})=>n.jsx(s.View,{flexShrink:0,width:"100%",height:"100%",display:t?"block":"none",...o,...r,children:e}),Pn=({views:e,children:t,...o})=>{const{goToPrevious:r,canGoPrevious:a,styles:i}=uo(),d={...Ct().prevButton,...i==null?void 0:i.prevButton,...e==null?void 0:e.prevButton};return n.jsx(Le,{"aria-label":"Previous slide",onClick:()=>r(),isDisabled:!a,...d,...o,children:t??n.jsx(ie,{orientation:"left",widthHeight:16})})},_n=({views:e,children:t,...o})=>{const{goToNext:r,canGoNext:a,styles:i}=uo(),d={...Ct().nextButton,...i==null?void 0:i.nextButton,...e==null?void 0:e.nextButton};return n.jsx(Le,{"aria-label":"Next slide",onClick:()=>r(),isDisabled:!a,...d,...o,children:t??n.jsx(ie,{orientation:"right",widthHeight:16})})},Wn=({children:e,views:t,...o})=>{const{registerSlide:r,unregisterSlide:a,styles:i}=uo(),l=g.useRef(null);g.useEffect(()=>{const u=r();return l.current=u,()=>{l.current!==null&&a(l.current)}},[r,a]);const c={...Ct().item,...i==null?void 0:i.item,...t==null?void 0:t.item};return n.jsx(s.View,{role:"group","aria-roledescription":"slide",...c,...o,children:e})},$n=({children:e,views:t,style:o,...r})=>{const{currentIndex:a,styles:i,contentId:l}=uo(),d=Ct(),c={...d.content,...i==null?void 0:i.content,...t==null?void 0:t.content},u={...d.innerContainer,...i==null?void 0:i.innerContainer,...t==null?void 0:t.innerContainer},p=`-${a*100}%`;return n.jsx(s.View,{...c,...r,style:{...c==null?void 0:c.style,...o},id:l,"aria-live":"polite",children:n.jsx(s.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${p})`},children:e})})},Xs=({children:e,defaultActiveIndex:t=0,activeIndex:o,onChange:r,showNavigation:a=!0,navigationPosition:i="inside",prevButton:l,nextButton:d,showIndicators:c=!0,indicatorPosition:u="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:x=!0,infinite:f=!0,direction:b="horizontal",transitionDuration:y=300,views:k,stepIndices:j,themeMode:S,...C})=>{const w=g.useMemo(()=>g.Children.toArray(e),[e]),I=qs({defaultActiveIndex:t,activeIndex:o,onChange:r,autoPlay:m,autoPlayInterval:h,pauseOnHover:x,infinite:f,totalSlides:w.length}),{activeIndex:M,totalSlides:R,goToSlide:E,nextSlide:W,prevSlide:T,handleMouseEnter:$,handleMouseLeave:D,handleDragStart:z,handleDragMove:V,handleDragEnd:_}=I,P=()=>{if(!a)return null;const B=l||n.jsx(s.View,{as:"button","aria-label":"Previous slide",...Ut,...k==null?void 0:k.prevButton,children:"❮"}),F=d||n.jsx(s.View,{as:"button","aria-label":"Next slide",...Ut,...k==null?void 0:k.nextButton,children:"❯"});return n.jsxs(n.Fragment,{children:[n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:i==="inside"?"10px":"-40px",onClick:T,cursor:!f&&M===0?"not-allowed":"pointer",opacity:!f&&M===0?.5:1,children:B}),n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:i==="inside"?"10px":"-40px",onClick:W,cursor:!f&&M===w.length-1?"not-allowed":"pointer",opacity:!f&&M===w.length-1?.5:1,children:F})]})},L=()=>c?n.jsx(s.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:w.map((B,F)=>n.jsx(s.View,{onClick:()=>E(F),cursor:"pointer",...Gs[p],...F===M?{...Ys[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return g.useMemo(()=>g.Children.toArray(e).some(B=>g.isValidElement(B)&&(B.type===$n||B.type===Wn||B.type===Pn||B.type===_n)),[e])?n.jsx(En.Provider,{value:{currentIndex:M,totalSlides:R,goToSlide:E,goToNext:W,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...Ct(),...k},contentId:I.contentId,infinite:f},children:n.jsx(s.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...C,children:e})}):n.jsxs(s.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:$,onMouseLeave:D,onTouchStart:z,onTouchMove:V,onTouchEnd:_,onMouseDown:z,onMouseMove:V,onMouseUp:_,...k==null?void 0:k.container,...C,children:[n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:w.map((B,F)=>n.jsx(Vn,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:B},F))}),P(),L()]})},Ks=e=>n.jsx(Xs,{...e}),et=Ks;et.Slide=Vn;et.Content=$n;et.Item=Wn;et.Previous=Pn;et.Next=_n;const Ce={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},Qs=[Ce.blue,Ce.green,Ce.purple,Ce.orange,Ce.red,Ce.teal,Ce.pink,Ce.indigo,Ce.yellow,Ce.cyan],Ye=Qs,Js={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Zs={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},ed={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},td={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},od={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},rd={fontSize:"14px"},Ln={stroke:"color-gray-200",strokeWidth:"1px"},qt={stroke:"color-gray-300",strokeWidth:"1px"},Gt={fontSize:"12px",fill:"color-gray-600"},nd={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},ad={strokeWidth:"2px",fill:"none"},id={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Vt={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},ir={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},ld={...ir},cd={...ir,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},sd={...ir,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},dd=({data:e,dataPoints:t,animated:o=!0,animationDuration:r=500,showTooltips:a=!0})=>{const[i,l]=g.useState(o?0:1),[d,c]=g.useState({visible:!1,x:0,y:0,content:null}),u=g.useRef(null),p=g.useRef(null);g.useEffect(()=>{if(!o){l(1);return}const b=Date.now(),y=()=>{const k=Date.now()-b,j=Math.min(k/r,1);l(j),j<1&&(u.current=requestAnimationFrame(y))};return u.current=requestAnimationFrame(y),()=>{u.current&&cancelAnimationFrame(u.current)}},[o,r]);const m=g.useCallback(()=>e?{...e,series:e.series.map((b,y)=>({...b,color:b.color||Ye[y%Ye.length]}))}:t?t.map((b,y)=>({...b,color:b.color||Ye[y%Ye.length]})):null,[e,t]),h=g.useCallback((b,y,k)=>{a&&c({visible:!0,x:b,y,content:k})},[a]),x=g.useCallback(()=>{c(b=>({...b,visible:!1}))},[]),f=g.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:b,height:y}=p.current.getBoundingClientRect();return{width:b,height:y}},[]);return{animationProgress:i,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:x,getChartDimensions:f}},ud=({data:e,width:t,height:o,animationProgress:r,showGrid:a=!0,onBarClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),p={top:20,right:20,bottom:40,left:50},m=t-p.left-p.right,h=o-p.top-p.bottom,x=g.useMemo(()=>{let w=0;return e.series.forEach(I=>{I.data.forEach(M=>{w=Math.max(w,M)})}),w},[e]),f=e.labels.length,b=e.series.length,y=m/f,k=y*.8/b,j=y*.2/(b+1),S=x||10,C=g.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const R=S/5*M;I.push(R)}return I},[x]);return n.jsxs("svg",{width:t,height:o,children:[n.jsx("line",{x1:p.left,y1:o-p.bottom,x2:t-p.right,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),n.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),e.labels.map((w,I)=>{const M=p.left+(I+.5)*y,R=o-p.bottom+20;return n.jsx("text",{x:M,y:R,textAnchor:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:w},`x-label-${I}`)}),C.map((w,I)=>{const M=o-p.bottom-w/S*h;return n.jsxs(g.Fragment,{children:[n.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:w.toFixed(0)}),a&&n.jsx("line",{x1:p.left,y1:M,x2:t-p.right,y2:M,...Ln,...c==null?void 0:c.grid})]},`y-tick-${I}`)}),e.series.map((w,I)=>n.jsx(g.Fragment,{children:w.data.map((M,R)=>{const E=M/S*h*r,W=p.left+R*y+j*(I+1)+k*I,T=o-p.bottom-E,$=e.labels[R],D=e.series.reduce((L,H)=>{const B=H.data[R];return L+(typeof B=="number"?B:0)},0),z=D>0?(M/D*100).toFixed(1):null,V=w.color?u(w.color):"black",_=L=>{const H=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:w.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:V})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:$}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),z!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${z}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:D.toLocaleString()})]})]})]});l(L.clientX,L.clientY,H)},P=()=>{i&&i(w.name,R)};return n.jsx("rect",{x:W,y:T,width:k,height:E,fill:V,onMouseEnter:_,onMouseLeave:d,onClick:P,...nd,...c==null?void 0:c.bar},`bar-${I}-${R}`)})},`series-${I}`))]})},pd=({data:e,width:t,height:o,animationProgress:r,showGrid:a=!0,onPointClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),p={top:20,right:20,bottom:40,left:50},m=t-p.left-p.right,h=o-p.top-p.bottom,x=g.useMemo(()=>{let j=0;return e.series.forEach(S=>{S.data.forEach(C=>{j=Math.max(j,C)})}),j},[e]),f=x||10,b=g.useMemo(()=>{const S=[];for(let C=0;C<=5;C++){const w=f/5*C;S.push(w)}return S},[x]),y=j=>`M ${j.map((C,w)=>{const I=p.left+w/(e.labels.length-1)*m,M=o-p.bottom-C/f*h*r;return`${I},${M}`}).join(" L ")}`,k=j=>{const S=p.left,C=p.left+m,w=o-p.bottom,I=j.map((M,R)=>{const E=p.left+R/(e.labels.length-1)*m,W=o-p.bottom-M/f*h*r;return`${E},${W}`});return`M ${S},${w} L ${I.join(" L ")} L ${C},${w} Z`};return n.jsxs("svg",{width:t,height:o,children:[n.jsx("line",{x1:p.left,y1:o-p.bottom,x2:t-p.right,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),n.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),e.labels.map((j,S)=>{const C=p.left+S/(e.labels.length-1)*m,w=o-p.bottom+20;return n.jsx("text",{x:C,y:w,textAnchor:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:j},`x-label-${S}`)}),b.map((j,S)=>{const C=o-p.bottom-j/f*h;return n.jsxs(g.Fragment,{children:[n.jsx("text",{x:p.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:j.toFixed(0)}),a&&n.jsx("line",{x1:p.left,y1:C,x2:t-p.right,y2:C,...Ln,...c==null?void 0:c.grid})]},`y-tick-${S}`)}),e.series.map((j,S)=>{const C=j.color?u(j.color):"black";return n.jsxs(g.Fragment,{children:[n.jsx("path",{d:k(j.data),fill:C,opacity:.1,...c==null?void 0:c.area}),n.jsx("path",{d:y(j.data),stroke:C,...ad,...c==null?void 0:c.line}),j.data.map((w,I)=>{const M=p.left+I/(e.labels.length-1)*m,R=o-p.bottom-w/f*h*r,E=e.labels[I],W=e.series.reduce((P,L)=>{const H=L.data[I];return P+(typeof H=="number"?H:0)},0),T=W>0?(w/W*100).toFixed(1):null,$=I>0&&typeof j.data[I-1]=="number"?j.data[I-1]:null,D=typeof $=="number"?w-$:null,z=typeof D=="number"?`${D>=0?"+":""}${D.toLocaleString()}`:null,V=P=>{const L=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:j.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:E}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),z!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Change"}),n.jsx(s.Text,{fontWeight:"medium",children:z})]}),T!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${T}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:W.toLocaleString()})]})]})]});l(P.clientX,P.clientY,L)},_=()=>{i&&i(j.name,I)};return n.jsx("circle",{cx:M,cy:R,fill:C,onMouseEnter:V,onMouseLeave:d,onClick:_,...id,...c==null?void 0:c.point},`point-${S}-${I}`)})]},`series-${S}`)})]})},gd=({dataPoints:e,width:t,height:o,animationProgress:r,isDonut:a=!1,onSliceClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),{ref:p,relation:m}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),h=g.useRef(null);g.useEffect(()=>{h.current&&p&&(p.current=h.current)},[h,p]);const f=Math.min(t,o)/2*.8,b=t/2,y=o/2,k=a?f*.6:0,j=g.useMemo(()=>e.reduce((C,w)=>C+w.value,0),[e]),S=g.useMemo(()=>{if(j===0)return[{path:a?[`M ${b} ${y-f}`,`A ${f} ${f} 0 1 1 ${b} ${y+f}`,`A ${f} ${f} 0 1 1 ${b} ${y-f}`,`M ${b} ${y-k}`,`A ${k} ${k} 0 1 0 ${b} ${y+k}`,`A ${k} ${k} 0 1 0 ${b} ${y-k}`,"Z"].join(" "):[`M ${b} ${y}`,`M ${b} ${y-f}`,`A ${f} ${f} 0 1 1 ${b} ${y+f}`,`A ${f} ${f} 0 1 1 ${b} ${y-f}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:b,labelY:y,startAngle:0,endAngle:Math.PI*2,index:-1}];const C=[];let w=-Math.PI/2;for(let I=0;I<e.length;I++){const R=e[I].value/j,E=R*2*Math.PI*r,W=w+E,T=b+Math.cos(w)*f,$=y+Math.sin(w)*f,D=b+Math.cos(W)*f,z=y+Math.sin(W)*f,V=b+Math.cos(w)*k,_=y+Math.sin(w)*k,P=b+Math.cos(W)*k,L=y+Math.sin(W)*k,H=E>Math.PI?1:0;let B;a?B=[`M ${T} ${$}`,`A ${f} ${f} 0 ${H} 1 ${D} ${z}`,`L ${P} ${L}`,`A ${k} ${k} 0 ${H} 0 ${V} ${_}`,"Z"].join(" "):B=[`M ${b} ${y}`,`L ${T} ${$}`,`A ${f} ${f} 0 ${H} 1 ${D} ${z}`,"Z"].join(" ");const F=w+E/2,A=f*.7,O=b+Math.cos(F)*A,G=y+Math.sin(F)*A,Y=`${(R*100).toFixed(1)}%`,q=e[I].color||Ye[I%Ye.length],X=u(q);C.push({path:B,color:X,label:e[I].label,value:e[I].value,percentage:Y,labelX:O,labelY:G,startAngle:w,endAngle:W,index:I}),w=W}return C},[e,j,f,b,y,k,r,a]);return n.jsxs("svg",{ref:h,width:t,height:o,style:{overflow:"visible"},children:[a&&n.jsx("circle",{cx:b,cy:y,r:k,fill:"white",pointerEvents:"none"}),S.map((C,w)=>{const I=E=>{const W=j>0?C.value/j*100:0,T=j>0?Math.max(0,100-W):null,$=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:C.label}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C.color})]}),n.jsxs(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",C.index+1," of ",e.length]}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:C.value.toLocaleString()})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:C.percentage})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Total"}),n.jsx(s.Text,{fontWeight:"medium",children:j.toLocaleString()})]}),T!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Remaining"}),n.jsx(s.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let D=E.clientX,z=E.clientY;if(m&&h.current){const V=h.current.getBoundingClientRect();E.clientX-V.left,E.clientY-V.top,m.space.horizontal==="left"?D=E.clientX-100:D=E.clientX+10,m.space.vertical==="top"?z=E.clientY-30:z=E.clientY+10}l(D,z,$)},M=()=>{C.index!==-1&&i&&i(e[C.index],C.index)},R=C.index===-1;return n.jsxs("g",{children:[n.jsx("path",{d:C.path,fill:C.color,onMouseEnter:R?void 0:I,onMouseLeave:R?void 0:d,onClick:M,...Vt,style:{...Vt==null?void 0:Vt.style,cursor:R?"default":"pointer"},...c==null?void 0:c.pie}),!R&&C.endAngle-C.startAngle>.2&&n.jsx("text",{x:C.labelX,y:C.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:C.percentage})]},`slice-${w}`)})]})},md=({visible:e,x:t,y:o,content:r,maxDistance:a=100,views:i})=>{const l=g.useRef(null),[d,c]=g.useState({left:0,top:0});return g.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),m=p.width,h=p.height,x=10,f=15;let b=t-f,y=o-f;const k=t-b,j=o-y;k>a&&(b=t-a),j>a&&(y=o-a),b+m>window.innerWidth-x&&(b=window.innerWidth-m-x,t-b>a&&(b=t-a)),b<x&&(b=x),y+h>window.innerHeight-x&&(y=window.innerHeight-h-x,o-y>a&&(y=o-a)),y<x&&(y=x),c({left:b,top:y})},[e,t,o,a]),e?n.jsx(s.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...i==null?void 0:i.tooltip,children:r}):null},hd=({type:e,data:t,dataPoints:o,title:r,showLegend:a=!0,legendPosition:i="bottom",showGrid:l=!0,showTooltips:d=!0,animated:c=!0,animationDuration:u=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:x=200,views:f,onDataPointClick:b,onSeriesClick:y,isLoading:k=!1,error:j,noData:S,loadingIndicator:C,errorIndicator:w,noDataIndicator:I,"aria-label":M,themeMode:R,...E})=>{const{animationProgress:W,tooltip:T,containerRef:$,processedData:D,showTooltip:z,hideTooltip:V,getChartDimensions:_}=dd({data:t,dataPoints:o,animated:c,animationDuration:u,showTooltips:d}),P=D(),{width:L,height:H}=_(),B=h||L,F=x||(p?L/m:H),A=()=>{if(!a||!P)return null;let oe=[];return e==="pie"||e==="donut"?Array.isArray(P)&&(oe=P):P&&P.series&&(oe=P.series),!oe||oe.length===0?null:n.jsx(s.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:i==="bottom"?"16px":0,marginBottom:i==="top"?"16px":0,...ed,...f==null?void 0:f.legend,children:oe.map((re,ne)=>n.jsxs(s.View,{...td,...f==null?void 0:f.legendItem,children:[n.jsx(s.View,{backgroundColor:re.color,...od}),n.jsx(s.Text,{...rd,children:re.name||re.label})]},`legend-${ne}`))})},O=()=>{if(!P)return null;switch(e){case"bar":return n.jsx(ud,{data:P,width:B,height:F,animationProgress:W,showGrid:l,onBarClick:y,showTooltip:z,hideTooltip:V,views:f});case"line":case"area":return n.jsx(pd,{data:P,width:B,height:F,animationProgress:W,showGrid:l,onPointClick:y,showTooltip:z,hideTooltip:V,views:f});case"pie":case"donut":return n.jsx(gd,{dataPoints:P,width:B,height:F,animationProgress:W,isDonut:e==="donut",onSliceClick:b,showTooltip:z,hideTooltip:V,views:f});default:return null}},G=()=>k?n.jsx(s.View,{...ld,...f==null?void 0:f.loadingOverlay,children:C||n.jsx(s.Center,{children:n.jsx(ft,{size:"lg"})})}):null,Y=()=>j?n.jsx(s.View,{...cd,...f==null?void 0:f.errorOverlay,children:w||n.jsx(s.Text,{fontWeight:"medium",children:typeof j=="string"?j:"An error occurred"})}):null,q=()=>S?n.jsx(s.View,{...sd,...f==null?void 0:f.noDataOverlay,children:I||n.jsx(s.Text,{children:typeof S=="string"?S:"No data available"})}):null,X=M??(typeof r=="string"?r:"Chart"),ee=!j&&!k&&!S;return n.jsxs(s.View,{ref:$,role:"region","aria-label":X,"aria-busy":k,...Js,...f==null?void 0:f.container,...E,children:[r&&n.jsx(s.Text,{...Zs,children:r}),ee&&i==="top"&&A(),n.jsxs(s.View,{flex:1,width:"100%",position:"relative",...f==null?void 0:f.chart,children:[ee&&O(),G(),Y(),q()]}),ee&&i==="bottom"&&A(),n.jsx(md,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:f})]})},fd=e=>n.jsx(hd,{...e}),xd=fd,bd=(e=365)=>{const[t,o]=g.useState(!1),[r,a]=g.useState(null),i="app-studio-cookie-consent";g.useEffect(()=>{const u=localStorage.getItem(i);a(u!==null?u==="true":!1)},[]);const l=u=>{localStorage.setItem(i,String(u));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${i}-expires`,p.toISOString()),a(u)};return{isHovered:t,setIsHovered:o,hasConsent:r,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(i),localStorage.removeItem(`${i}-expires`),a(!1)}}},yd=e=>{const t=e==="dark";return{default:{container:{backgroundColor:t?"#1f2937":"#ffffff",borderColor:t?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:t?"#e5e7eb":"#4b5563",borderColor:t?"#4b5563":"#d1d5db",hoverBackgroundColor:t?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:t?"#1e3a8a":"#eff6ff",borderColor:t?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:t?"#bfdbfe":"#1e40af",borderColor:t?"#3b82f6":"#93c5fd",hoverBackgroundColor:t?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:t?"#0c4a6e":"#f0f9ff",borderColor:t?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:t?"#bae6fd":"#0369a1",borderColor:t?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:t?"#0369a1":"#e0f2fe"}}}},kd=({title:e="Nous utilisons des cookies",description:t="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:o="Accepter",customizeButtonText:r="Personnaliser",position:a="bottom",variant:i="default",onAccept:l,onCustomize:d,views:c,showCustomizeButton:u=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:x}=s.useTheme(),f=m||x||"light",{hasConsent:b,acceptCookies:y}=bd(p),j=yd(f)[i];if(b)return null;const S=()=>{y(),l&&l()},C=()=>{d&&d()};return n.jsx(s.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...a==="bottom"?{bottom:16}:{top:16},...j.container,...c==null?void 0:c.container,...h,children:n.jsxs(s.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&n.jsx(s.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...c==null?void 0:c.title,children:e}),t&&n.jsx(s.Text,{fontSize:14,color:"color-black",...c==null?void 0:c.description,children:t}),n.jsxs(s.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...c==null?void 0:c.buttonGroup,children:[u&&n.jsx(Le,{variant:"outline",onClick:C,size:"sm",...c==null?void 0:c.customizeButton,children:r}),n.jsx(Le,{variant:"primary",onClick:S,size:"sm",...c==null?void 0:c.acceptButton,children:o})]})]})})},Cd=e=>n.jsx(kd,{...e}),jd=Cd,Sd=e=>{const{size:t,variant:o,onOpenChange:r}=e||{},[a,i]=g.useState(!1),[l,d]=g.useState({x:0,y:0}),[c,u]=g.useState(null),p=g.useRef(null),m=g.useRef(null),h=g.useMemo(()=>Ao("contextmenu-content"),[]),x=g.useCallback(b=>{d({x:b.clientX,y:b.clientY}),i(!0),r==null||r(!0)},[r]),f=g.useCallback(()=>{i(!1),u(null),r==null||r(!1)},[r]);return g.useEffect(()=>{const b=j=>{m.current&&!m.current.contains(j.target)&&f()},y=()=>{a&&f()},k=j=>{j.key==="Escape"&&a&&f()};return document.addEventListener("mousedown",b),window.addEventListener("resize",y),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",b),window.removeEventListener("resize",y),document.removeEventListener("keydown",k)}},[a,f]),{isOpen:a,setIsOpen:i,position:l,setPosition:d,activeSubmenuId:c,setActiveSubmenuId:u,size:t,variant:o,triggerRef:p,contentRef:m,contentId:h,openMenu:x,closeMenu:f}},wr={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},wd={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Ir={hover:{backgroundColor:"color-gray-100"}},Dn=g.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),Id=({children:e,value:t})=>n.jsx(Dn.Provider,{value:t,children:e}),Yt=()=>{const e=g.useContext(Dn);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Hn=({children:e,disableNativeContextMenu:t=!0,asChild:o=!1,isDisabled:r=!1,views:a,...i})=>{const{triggerRef:l,contentId:d,openMenu:c}=Yt(),p={ref:l,onContextMenu:m=>{if(!r)if(t&&m.preventDefault(),c)c(m);else{const{setIsOpen:h,setPosition:x}=Yt();x({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":r?"":void 0,...o&&g.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:r},...a==null?void 0:a.container,...i};if(o&&g.isValidElement(e)){const m=g.Children.only(e);return g.cloneElement(m,{...p,...m.props})}return n.jsx(s.View,{...p,children:e})},lr=({items:e,children:t,position:o,side:r="right",align:a="start",views:i,style:l,...d})=>{const{isOpen:c,position:u,contentRef:p,contentId:m,variant:h}=Yt(),x=g.useRef(null),f=p||x,{ref:b,relation:y}=s.useElementPosition({}),[k,j]=g.useState({x:0,y:0});if(g.useEffect(()=>{if(c&&f.current){const C=o||u,w=f.current.offsetWidth,I=f.current.offsetHeight,M=window.innerWidth,R=window.innerHeight;let E=C.x,W=C.y;y&&(y.space.horizontal==="left"?E=C.x-w:E=C.x,y.space.vertical==="top"?W=C.y-I:W=C.y),E+w>M&&(E=M-w-8),E<8&&(E=8),W+I>R&&(W=R-I-8),W<8&&(W=8),j({x:E,y:W})}},[c,u,o,r,a,f,y]),!c)return null;const S={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return n.jsxs(s.View,{id:m||"context-menu",ref:f,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...S,...l},...wd[h],...i==null?void 0:i.menu,...i==null?void 0:i.content,...d,children:[e&&e.map((C,w)=>C.divider?n.jsx(An,{views:i},`divider-${w}`):n.jsx(Bn,{item:C,views:i},C.id)),t]})},Bn=({item:e,children:t,onSelect:o,isDisabled:r=!1,views:a,...i})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:c,closeMenu:u}=Yt();if(e){const[m,h]=g.useState(!1),x=e.items&&e.items.length>0,f=l===e.id,[b,y]=g.useState({x:0,y:0}),k=e.disabled||r,j=()=>{h(!0),x&&d(e.id)},S=()=>{h(!1)},C=()=>{k||!x&&e.onClick&&(e.onClick(),u&&u())},{ref:w,relation:I}=s.useElementPosition({});return g.useEffect(()=>{if(f&&w.current){const M=w.current.getBoundingClientRect(),R=window.innerWidth,E=200;let W=!1;if(I)W=I.space.horizontal==="left";else{const T=R-M.right,$=M.left;W=T<E&&$>T}y({x:W?M.left-E:M.right,y:M.top})}},[f,e.items,I]),n.jsxs(s.View,{ref:w,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...wr[c],_hover:k?{}:Ir.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:j,onMouseLeave:S,onClick:C,...a==null?void 0:a.item,...i,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),x&&n.jsx(s.View,{marginLeft:8,...a==null?void 0:a.submenuIndicator,children:n.jsx(ie,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),f&&x&&n.jsx(lr,{items:e.items||[],position:b,side:"right",align:"start",views:a})]})}const p=m=>{r||(o==null||o(m),u&&u())};return n.jsx(s.View,{role:"menuitem",onClick:p,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,"aria-disabled":r,"data-disabled":r?"":void 0,...wr[c],_hover:r?{}:Ir.hover,...a==null?void 0:a.item,...i,children:t})},An=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...t}),Td=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...t}),Md=({children:e,items:t,size:o="md",variant:r="default",disableNativeContextMenu:a=!0,views:i,themeMode:l,...d})=>!t||t.length===0?n.jsx(n.Fragment,{children:e}):n.jsxs(n.Fragment,{children:[n.jsx(Hn,{disableNativeContextMenu:a,views:i,...d,children:e}),n.jsx(lr,{items:t,views:i})]}),Rd=({children:e,items:t,size:o="md",variant:r="default",disableNativeContextMenu:a=!0,onOpenChange:i,views:l,...d})=>{const c=Sd({size:o,variant:r,onOpenChange:i}),{isOpen:u,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:x,setActiveSubmenuId:f,triggerRef:b,contentRef:y,contentId:k,openMenu:j,closeMenu:S}=c;return n.jsx(Id,{value:{isOpen:u,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:x,setActiveSubmenuId:f,size:o,variant:r,triggerRef:b,contentRef:y,contentId:k,openMenu:j,closeMenu:S,styles:l},children:n.jsx(Md,{items:t,size:o,variant:r,disableNativeContextMenu:a,views:l,...d,children:e})})},tt=Rd;tt.Trigger=Hn;tt.Content=lr;tt.Item=Bn;tt.Divider=An;tt.Separator=Td;const zd=({src:e,color:t,views:o,themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=t?{fill:i(t,{themeMode:l}),stroke:i(t,{themeMode:l})}:{};return n.jsx(s.Center,{...a,...o==null?void 0:o.container,children:n.jsx(s.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...o==null?void 0:o.image})})},Ed=({path:e,...t})=>n.jsx(s.Image,{src:e,...t}),Fn=({placeholder:e,isMulti:t,options:o,id:r=`select-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?t?[]:"":Array.isArray(o)&&o.length>0?o[0].value:t?[]:"",[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(a),[m,h]=g.useState(0),[x,f]=g.useState(!0);return{id:r,value:u,setValue:p,hide:x,setHide:f,isHovered:i,setIsHovered:l,isFocused:d,setIsFocused:c,highlightedIndex:m,setHighlightedIndex:h}},On=({children:e,containerId:t="portal-root"})=>{const[o,r]=g.useState(null);return g.useEffect(()=>{let a=document.getElementById(t),i=!1;return a||(i=!0,a=document.createElement("div"),a.setAttribute("id",t),document.body.appendChild(a)),r(a),()=>{i&&a&&a.parentNode&&a.childNodes.length===0&&a.parentNode.removeChild(a)}},[t]),o?Li.createPortal(e,o):null},_o=({children:e,views:t={helperText:{}},...o})=>n.jsx(s.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...t.helperText,...o,children:e}),Ie=g.forwardRef(({children:e,helperText:t,error:o=!1,views:r,...a},i)=>n.jsxs(s.Vertical,{ref:i,gap:8,position:"relative",width:"100%",marginVertical:4,...a,...r==null?void 0:r.container,children:[e,!o&&t&&n.jsx(_o,{marginTop:4,...r==null?void 0:r.helperText,children:t}),o&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...r==null?void 0:r.error,children:o})]}));Ie.displayName="FieldContainer";const vn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Tr={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},Nn={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},Vd={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},Pd={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:t,children:o,value:r,size:a="md",shape:i="default",variant:l="default",error:d=!1,showLabel:c=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:x={pickerBox:{}},...f})=>{const y=d?"color-red-500":(p||u)&&!m?"theme-primary":"color-gray-300";return n.jsx(s.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:y,backgroundColor:"color-white",fontSize:s.Typography.fontSizes[a],cursor:m?"not-allowed":h?"auto":"text",opacity:m?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...c?Vd:Pd,...t,...vn[i],...Nn[l],...x==null?void 0:x.container,...f,children:o})},cr=({children:e,...t})=>n.jsx(s.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...t,children:e}),_d={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},Wd=({children:e,heading:t,isItalic:o=!1,isUnderlined:r=!1,isStriked:a=!1,weight:i="normal",size:l="sm",dropDown:d,...c})=>{const u=t?_d[t]:{};return n.jsx(s.Element,{as:"label",width:"100%",fontSize:l,fontStyle:o?"italic":"normal",fontWeight:s.Typography.fontWeights[i],textDecoration:a?"line-through":r?"underline":"none",...u,...c,children:e})},$d=e=>n.jsx(Wd,{...e}),jt=$d,He=({children:e,size:t="md",error:o=!1,color:r="theme-primary",views:a={label:{}},helperText:i,...l})=>n.jsx(jt,{top:0,zIndex:-10,position:"absolute",fontSize:Tr[t],lineHeight:Tr[t],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:o?"color-red-500":r,transition:"color 200ms ease-out",...a.label,...l,children:e}),ot=({children:e,...t})=>n.jsx(s.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...t,children:e}),Un={xs:12,sm:14,md:16,lg:20,xl:24},Ld={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},Dd={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Hd={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},Pt={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Mr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Bd={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},Ad={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},Fd=({isHovered:e,setIsHovered:t,option:o,size:r="md",callback:a=()=>{},style:i,isSelected:l=!1,...d})=>{const c=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof a=="function"&&a(h)},u=()=>t(!e),p=()=>l&&e?Pt.selectedHighlighted:l?Pt.selected:e?Pt.highlighted:Pt.default;return n.jsxs(s.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Hd,...p(),onMouseEnter:u,onMouseLeave:u,onClick:m=>c(m,o.value),...d,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[r],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...i,children:o.label}),l&&n.jsx(s.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Od=({size:e="md",views:t={field:{},text:{}},value:o,isDisabled:r,placeholder:a,removeOption:i=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:s.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:r?"color-gray-400":"color-gray-900",cursor:r?"not-allowed":"pointer",transition:"all 0.2s ease",...t.field,...t.text},c=l.length>0&&l.find(u=>u.value===o);return n.jsx(s.Text,{...d,children:(o===""||Array.isArray(o)&&o.length===0)&&a?a:n.jsx(n.Fragment,{children:typeof o=="string"?(c&&c.label)??o:Array.isArray(o)&&o.length>0?n.jsx(s.Horizontal,{gap:6,children:o.map(u=>n.jsx(Ud,{option:u,removeOption:i},u))}):n.jsx("span",{children:o})})})},vd=({id:e,name:t,value:o,onChange:r,isMulti:a=!1,isDisabled:i=!1,isReadOnly:l=!1,options:d=[],...c})=>{const u=p=>{r&&r(p)};return n.jsx(s.Element,{id:e,name:t,as:"select",opacity:0,width:0,height:0,position:"absolute",value:o,disabled:i,readOnly:l,onChange:u,multiple:a,...c,children:d.length>0&&d.map(p=>n.jsx("option",{value:p.value,children:p.label},p.value))})},Nd=({size:e,views:t={},options:o,callback:r=()=>{},highlightedIndex:a,setHighlightedIndex:i,selectedValue:l})=>{const d=u=>r(u),c=u=>Array.isArray(l)?l.includes(u):l===u;return n.jsx(s.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...Ld,style:Ad,...t==null?void 0:t.dropDown,children:o&&o.length>0&&o.map((u,p)=>n.jsx(Fd,{size:e,style:t.text,option:u,callback:d,isSelected:c(u.value),isHovered:p===a,setIsHovered:()=>{},onMouseEnter:()=>i(p)},u.value))})},Ud=({option:e,size:t="md",removeOption:o=()=>{},...r})=>{const a=()=>o(e);return n.jsxs(s.Horizontal,{gap:6,alignItems:"center",onClick:i=>i.stopPropagation(),...Bd,_hover:{backgroundColor:"color-gray-200"},...r,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[t],fontWeight:"500",color:"color-gray-700",children:e}),n.jsx(xe,{role:"close-button",color:"color-gray-500",widthHeight:Un[t],onClick:a,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},qn=({id:e,name:t,label:o,value:r,placeholder:a,helperText:i,hide:l=!1,error:d=!1,isMulti:c=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:x=[],shadow:f={},size:b="md",shape:y="default",variant:k="default",views:j={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:S=()=>{},setHide:C=()=>{},setValue:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:R,highlightedIndex:E,...W})=>{const{ref:T,relation:$,updateRelation:D}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),z=g.useRef(null),V=()=>{var Y;if(!T.current)return{};const A=T.current.getBoundingClientRect(),O={position:"fixed",left:A.left,width:A.width,zIndex:1e4};return((Y=$==null?void 0:$.space)==null?void 0:Y.vertical)==="top"?{...O,bottom:window.innerHeight-A.top+8}:{...O,top:A.bottom+8}};g.useEffect(()=>{const A=()=>C(!0);return document.addEventListener("closeAllSelects",A),()=>document.removeEventListener("closeAllSelects",A)},[C]),g.useEffect(()=>{const A=O=>{!O.target.closest(`#${e}`)&&!l&&C(!0)};return document.addEventListener("click",A),()=>{document.removeEventListener("click",A)}},[e,l,C]);const _=!!(u&&o),P=()=>I(!p),L=()=>M(!0),H=A=>{document.dispatchEvent(new Event("closeAllSelects")),A&&A.stopPropagation&&A.stopPropagation();const O=!l;C(O),M(!O)},B=g.useCallback(A=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),c&&Array.isArray(r)){if(!r.includes(A)){const O=[...r,A];w(O),S&&S(A)}}else w(A),S&&S(A);M(!0)},[c,r,C,w,S,M]),F=A=>{if(Array.isArray(r)&&r.includes(A)){const O=r.filter(G=>G!==A);w(O.length===0?[]:O)}};return n.jsx(Ie,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:i,error:d,views:j,onClick:A=>{A.stopPropagation(),m||h||H(A)},children:n.jsxs(Ve,{label:o,size:b,error:d,shape:y,views:j,shadow:f,variant:k,value:r,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:u,showLabel:_,onMouseEnter:P,onMouseLeave:P,position:"relative",children:[n.jsxs(ot,{children:[_&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...j,children:o}),n.jsx(vd,{id:e,name:t,options:x,onChange:S,value:r,isDisabled:m,isReadOnly:h,isMulti:c,onFocus:L,...W}),n.jsx(Od,{options:x,size:b,views:j,value:r,isDisabled:m,placeholder:a,removeOption:F})]}),n.jsx(cr,{children:!h&&!m&&n.jsx(s.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Mr.closed:Mr.open,children:n.jsx(ie,{color:"inherit",widthHeight:Un[b],style:j.icon,orientation:"down"})})}),!l&&x.length>0&&n.jsx(On,{children:n.jsx(s.Element,{ref:z,onClick:A=>A.stopPropagation(),style:{...V(),...Dd.enter},children:n.jsx(Nd,{size:b,views:j,options:x,callback:B,highlightedIndex:E,setHighlightedIndex:R,selectedValue:r})})})]})})},qd=e=>{const t={...e,options:e.options||[]},o=Fn(t);return n.jsx(qn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},Gd=qd,Gn=({isDisabled:e,isChecked:t})=>{const[o,r]=g.useState(!1),[a,i]=g.useState(t||!1),[l,d]=g.useState(t||!1);return g.useEffect(()=>{t!==void 0&&(i(t),d(t))},[t]),{isHovered:o,setIsHovered:r,on:a,setOn:i,value:l,setValue:d}},Yd={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Xd={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Kd={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},We={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},Rr={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},Qd=e=>n.jsx(s.Input,{type:"checkbox",...e}),Yn=({id:e,name:t,label:o,inActiveChild:r,isChecked:a,activeChild:i,labelPosition:l="right",shadow:d={},size:c="sm",value:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:x,setOn:f,onChange:b,setValue:y=()=>{},setIsHovered:k=()=>{},helperText:j,views:S={slider:{},circle:{},label:{}},...C})=>{const w=E=>{if(!h&&!m){const W=E.target.checked;y(W),f(W),b&&b(W)}},I=()=>k(!0),M=()=>k(!1),R={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:m?"not-allowed":h?"default":"pointer",opacity:m?.6:1,transition:"all 0.2s ease",...S.label}};return n.jsxs(jt,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...R.container,...C,children:[n.jsx(Qd,{id:e,name:t,opacity:0,width:0,height:0,checked:u,onChange:w,disabled:m,readOnly:h,...C}),l==="left"&&o&&n.jsx(s.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:o}),n.jsxs(s.View,{display:"flex",alignItems:"center",justifyContent:u?i?"space-between":"flex-end":r?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?We.default.disabled:u?p?We.states.hover.active:We.default.active:p?We.states.hover.inactive:We.default.inactive,opacity:!m&&u&&p?We.states.hover.activeOpacity:1,cursor:"pointer",...Rr.slider,...d,...Kd[c],...Xd[c],...S.slider,children:[i&&u&&n.jsx(s.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:i}),n.jsx(s.View,{borderRadius:"50%",backgroundColor:We.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...Rr.knob,zIndex:1,...Yd[c],...S.circle}),r&&!u&&n.jsx(s.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:r})]}),l==="right"&&o&&n.jsx(s.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:o})]})},Jd=e=>{const t=Gn(e);return n.jsx(Yn,{...t,...e})},Zd=Jd,Xn=({placeholder:e,isMulti:t,options:o,id:r=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?t?[]:"":Array.isArray(o)&&o.length>0?o[0].value:t?[]:"",[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(a),[m,h]=g.useState(0),[x,f]=g.useState(!0);return{id:r,value:u,setValue:p,hide:x,setHide:f,isHovered:i,setIsHovered:l,isFocused:d,setIsFocused:c,highlightedIndex:m,setHighlightedIndex:h}},Kn=({id:e,name:t,label:o,value:r,size:a,views:i={},options:l=[],onChange:d=()=>{},setValue:c=()=>{},...u})=>{const{getColor:p}=s.useTheme(),m=g.useCallback(h=>{c(h.value),d&&d(h.value)},[c,d]);return n.jsxs(Ie,{id:e,width:"100%",views:i,children:[o&&n.jsxs(s.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[n.jsx(Re,{widthHeight:14})," ",n.jsx(s.Text,{children:o})]}),n.jsx(s.Horizontal,{gap:0,children:l.map((h,x,f)=>{const b=r===h.value;let y=p("color-gray-200"),k=p("color-gray-500"),j="transparent";if(b){if(h.color)h.color,y=p(h.color),k=p(h.color),j="rgba(0,0,0,0.05)";else{const S=p("theme-primary");y=S,k=S,j="color-gray-50"}h.color?(y=p(h.color),k=p(h.color),j="transparent"):(y=p("theme-primary"),k=p("theme-primary"),j="transparent")}return n.jsx(Le,{onClick:()=>m(h),flex:1,...a?{size:a}:{paddingVertical:6,fontSize:"12px"},fontWeight:b?"bold":"normal",style:{borderTop:`1px solid ${b?y:p("color-gray-200")}`,borderBottom:`1px solid ${b?y:p("color-gray-200")}`,borderLeft:`1px solid ${b?y:p("color-gray-200")}`,borderRight:x===f.length-1||b?`1px solid ${b?y:p("color-gray-200")}`:"none",backgroundColor:j,color:k,borderRadius:x===0?"6px 0 0 6px":x===f.length-1?"0 6px 6px 0":"0",zIndex:b?1:0,boxShadow:"none"},...i.item,children:h.label},h.value)})}),n.jsx("input",{type:"hidden",id:e,name:t,value:Array.isArray(r)?r.join(","):r,onChange:()=>{}})]})},eu=e=>{const t={...e,options:e.options||[]},o=Xn(t);return n.jsx(Kn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},tu=eu,Qn=({label:e,placeholder:t,value:o})=>{const[r,a]=g.useState(e??t),[i,l]=g.useState(!1),[d,c]=g.useState(o||""),[u,p]=g.useState(!1);return g.useMemo(()=>{a(u&&!d?t??"":e??t)},[d,u,e,t]),{hint:r,setHint:a,isHovered:i,setIsHovered:l,value:d,setValue:c,isFocused:u,setIsFocused:p}},Jn=({id:e,name:t,hint:o,error:r,value:a,label:i,shadow:l,helperText:d,placeholder:c,size:u="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:x=!1,isEditable:f=!1,isReadOnly:b=!1,isDisabled:y=!1,isAutoFocus:k=!1,isMultiline:j=!1,maxRows:S=3,maxCols:C=30,onBlur:w=()=>{},onChange:I,onFocus:M,setHint:R=()=>{},setValue:E=()=>{},setIsFocused:W=()=>{},setIsHovered:T=()=>{},views:$={label:{},helperText:{}},...D})=>{const z=!!(x&&i),V={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[u],lineHeight:`${Math.round(s.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:y?"color-gray-400":"color-gray-900",cursor:y?"not-allowed":"text",opacity:y?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...$.field},_=()=>T(!h),P=()=>{W(!0),M&&M()},L=B=>{w(B),W(!1)},H=B=>{typeof B=="string"?(E(B),I&&I(B)):(E(B.target.value),I&&I(B.target.value))};return n.jsx(Ie,{helperText:d,error:r,views:$,...D,children:n.jsx(Ve,{label:i,size:u,error:r,shape:p,views:$,shadow:l,variant:m,value:a,color:"theme-primary",isHovered:h,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:z,onMouseEnter:_,onMouseLeave:_,...$==null?void 0:$.content,children:n.jsxs(ot,{...$==null?void 0:$.warper,children:[z&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:r,...$==null?void 0:$.label,children:i}),n.jsx(s.Element,{as:"textarea",id:e,name:t,rows:S,cols:C,value:a,readOnly:b,disabled:y,autoFocus:k,editable:`${!!f.toString()}`,placeholder:o,onBlur:L,onFocus:P,multiline:`${!!j.toString()}`,onChange:B=>H(B),...V,style:{resize:y||b?"none":"vertical"},...$==null?void 0:$.textarea})]})})})},ou=e=>{const t=Qn(e);return n.jsx(Jn,{...t,...e})},ru=ou,sr=({label:e,placeholder:t,value:o})=>{const[r,a]=g.useState(e??t),[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(o);return g.useMemo(()=>{a(i&&!u?t??"":e??t)},[u,i,e,t]),{hint:r,setHint:a,isFocused:i,setIsFocused:l,isHovered:d,setIsHovered:c,setValue:p,value:u}},nu=e=>n.jsx(s.Input,{type:"text",...e}),St=({id:e,name:t,label:o,hint:r,value:a,onChange:i,left:l,right:d,helperText:c,placeholder:u,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:x="md",shape:f="default",variant:b="default",error:y=!1,isFocused:k=!1,isHovered:j=!1,isDisabled:S=!1,isReadOnly:C=!1,isClearable:w=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:R=()=>{},setIsHovered:E=()=>{},setValue:W=()=>{},onClick:T=()=>{},onFocus:$,onBlur:D=()=>{},themeMode:z,...V})=>{const{getColor:_,themeMode:P}=s.useTheme(),L=_("color-blueGray-700",{themeMode:z||P}),H=!!(k&&o),B={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[x],lineHeight:`${Math.round(s.Typography.fontSizes[x]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:S?"color-gray-400":"color-gray-900",cursor:S?"not-allowed":"text",opacity:S?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...h.field},F=()=>{R(!0),$&&$()},A=()=>E(!j),O=q=>{D&&D(q),R(!1)},G=q=>{typeof q=="string"?(W(q),p&&p(q),i&&i(q)):(W(q.target.value),p&&p(q.target.value),i&&i(q.target.value))},Y=()=>{W(""),i&&(D({target:{name:t}}),p&&p(""),i&&i("")),typeof document>"u"&&p&&p("")};return n.jsx(Ie,{helperText:c,error:y,views:h,children:n.jsxs(Ve,{label:o,size:x,error:y,shape:f,views:h,shadow:m,variant:b,value:a,color:"theme-primary",isHovered:j,isDisabled:S,isReadOnly:C,isFocused:k,showLabel:H,onMouseEnter:A,onMouseLeave:A,children:[l,n.jsxs(ot,{children:[H&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:y,...h,children:o}),n.jsx(nu,{id:e,name:t,readOnly:C,disabled:S,autoFocus:I,placeholder:r,onFocus:F,onBlur:O,autoComplete:"off",...B,...V,onChange:G,value:a})]}),w&&a&&!C&&!S&&n.jsx(cr,{children:n.jsx(xe,{size:20,color:L,onClick:Y,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},au=e=>{const t=sr(e);return n.jsx(St,{...t,...e})},wt=au,Zn=({defaultIsSelected:e=!1})=>{const[t,o]=g.useState(!1),[r,a]=g.useState(e);return{isHovered:t,setIsHovered:o,isSelected:r,setIsSelected:a}},iu={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},zr={xs:10,sm:14,md:16,lg:20,xl:24},lu={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},ko={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},ea=({id:e,icon:t,name:o,label:r,isChecked:a,onChange:i,onValueChange:l,shadow:d={},labelPosition:c="right",size:u="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:x=!1,isReadOnly:f=!1,isIndeterminate:b=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:j=()=>{},views:S={checkbox:{},label:{}},infoText:C,helperText:w,...I})=>{const M=()=>j(!h),R=()=>{!f&&!x&&(k&&k(!m),i&&i(!a),l&&l(!a))},E=b?"indeterminate":a||m?"selected":"unselected",W=p?ko.error[E]:x?ko.disabled[E]:h?ko.hover[E]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":x?"color-gray-400":"color-gray-700",cursor:x?"not-allowed":f?"default":"pointer",opacity:x?.6:1,transition:"all 0.2s ease",...S.label},checkbox:{...lu[E],...W,borderRadius:"4px",...iu[u],transition:"all 0.2s ease",...d,...S.checkbox}};return n.jsxs(jt,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[u],...T.container,...I,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",c==="left"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:r}),n.jsx(s.Center,{...T.checkbox,children:b?n.jsx(tn,{widthHeight:zr[u],color:"white",transition:"all 0.2s ease"}):(a||m)&&(t??n.jsx(oo,{widthHeight:zr[u],color:"white",transition:"all 0.2s ease"}))}),c==="right"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:c==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...S==null?void 0:S.infoText,children:C})]}),p&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},cu=e=>{const t=Zn(e);return n.jsx(ea,{...t,...e})},su=cu,ta=e=>{const{value:t,defaultValue:o="",onChange:r,onChangeComplete:a,onOpen:i,onClose:l,closeOnSelect:d=!0,maxRecentColors:c=8,showRecentColors:u=!0,isAutoFocus:p=!1}=e,[m,h]=g.useState(!1),[x,f]=g.useState(t??o),[b,y]=g.useState(""),[k,j]=g.useState([]),[S,C]=g.useState(!1),[w,I]=g.useState(!1),M=g.useRef(null),R=g.useRef(null);g.useEffect(()=>{t!==void 0&&f(t)},[t]),g.useEffect(()=>{if(u)try{const _=localStorage.getItem("colorInput-recentColors");_&&j(JSON.parse(_))}catch(_){console.warn("Failed to load recent colors from localStorage:",_)}},[u]),g.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),g.useEffect(()=>{const _=P=>{m&&M.current&&R.current&&!M.current.contains(P.target)&&!R.current.contains(P.target)&&z()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[m]);const E=g.useCallback(_=>{u&&j(P=>{const L=P.filter(B=>B!==_),H=[_,...L].slice(0,c);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(H))}catch(B){console.warn("Failed to save recent colors to localStorage:",B)}return H})},[u,c]),W=g.useCallback(()=>{const _=!m;h(_),_?i==null||i():l==null||l()},[m,i,l]),T=g.useCallback(_=>{f(_),E(_),r==null||r(_),a==null||a(_),d&&(h(!1),l==null||l())},[r,a,d,l,E]),$=g.useCallback(_=>{y(_)},[]),D=g.useCallback(()=>{b&&(T(b),y(""))},[b,T]),z=g.useCallback(()=>{h(!1),l==null||l()},[l]),V=g.useCallback(_=>{f(_),r==null||r(_)},[r]);return{isOpen:m,selectedColor:x,recentColors:k,customColor:b,isFocused:S,isHovered:w,handleToggle:W,handleColorSelect:T,handleCustomColorChange:$,handleCustomColorSubmit:D,handleClose:z,setIsFocused:C,setIsHovered:I,setValue:V,triggerRef:M,dropdownRef:R}},ct={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},du={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},uu={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},pu={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},gu=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],oa=({id:e,name:t,label:o,placeholder:r="Select a color",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",shadow:u,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:x=!1,isHovered:f=!1,predefinedColors:b=gu,showCustomInput:y=!0,showRecentColors:k=!0,isOpen:j=!1,selectedColor:S="",recentColors:C=[],customColor:w="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:R=()=>{},handleCustomColorSubmit:E=()=>{},setIsFocused:W=()=>{},setIsHovered:T=()=>{},triggerRef:$,dropdownRef:D,onChange:z,...V})=>{const{getColor:_}=s.useTheme(),P={...ct.container,...i==null?void 0:i.container},L={...ct.trigger,...du[l],...uu[d],...pu[c],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...x&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...f&&!m&&{borderColor:"color-gray-400"},...i==null?void 0:i.trigger,...u&&u},H={...ct.dropdown,...i==null?void 0:i.dropdown},B={...ct.colorGrid,...i==null?void 0:i.colorGrid},F={...ct.recentColors,...i==null?void 0:i.recentColors},A=S||"color-gray-200";return n.jsxs(s.View,{...P,...V,children:[o&&n.jsx(jt,{htmlFor:e,size:l,isDisabled:m,error:p,views:i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:$,onClick:m||h?void 0:I,onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),onFocus:()=>W(!0),onBlur:()=>W(!1),tabIndex:m?-1:0,role:"button","aria-expanded":j,"aria-haspopup":"listbox","aria-label":o||r,width:"fit-content",gap:8,...L,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:A,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:j?"up":"down"})]}),j&&n.jsxs(s.View,{ref:D,...H,children:[n.jsx(s.View,{...B,children:b.map((O,G)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:O.value,borderWidth:"2px",borderStyle:"solid",borderColor:S===O.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O.value),title:O.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...i==null?void 0:i.colorSwatch},G))}),k&&C.length>0&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:4,flexWrap:"wrap",...F,children:C.map((O,G)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:S===O?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O),title:O,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},G))})]}),y&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),n.jsxs(s.Horizontal,{gap:8,children:[n.jsx(wt,{value:w,onChange:O=>R(O.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:i==null?void 0:i.customInput}),n.jsx(s.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:E,_hover:{backgroundColor:"color-blue-600"},children:n.jsx(s.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),a&&n.jsx(s.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a}),p&&typeof p=="string"&&n.jsx(s.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...i==null?void 0:i.error,children:p})]})},mu=e=>{const t=ta(e);return n.jsx(oa,{...t,...e})},hu=mu,Wo=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],ra=({placeholder:e})=>{const[t,o]=g.useState(Wo),[r,a]=g.useState(e??Wo[0].name),[i,l]=g.useState(!0),[d,c]=g.useState(!1),[u,p]=g.useState(!1);return{hide:i,setHide:l,newOptions:t,setNewOptions:o,isHovered:u,setIsHovered:p,isFocused:d,setIsFocused:c,value:r,setValue:a}},Er={xs:8,sm:10,md:12,lg:14,xl:16},fu=({size:e,...t})=>n.jsx(s.Element,{as:"ul",...t}),xu=e=>n.jsx(s.Input,{type:"country",...e}),bu=({size:e,...t})=>n.jsx(s.Element,{as:"li",...t}),yu=({option:e,size:t="md",callback:o=()=>{},views:r={text:{}}})=>{const a=i=>{i&&i.stopPropagation&&i.stopPropagation(),o(e)};return n.jsx(bu,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:a,fontSize:s.Typography.fontSizes[t],_hover:{opacity:.8},...r.text,children:e})},ku=({size:e,views:t={dropDown:{}},options:o=[],callback:r=()=>{}})=>{const a=i=>r(i);return n.jsx(fu,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...t.dropDown,children:o.map(i=>n.jsx(yu,{size:e,option:i.name,callback:a,...t.text},i.code))})},na=({id:e,name:t,label:o,value:r,placeholder:a,helperText:i,hide:l=!1,error:d=!1,isHovered:c=!1,isFocused:u=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:x={},newOptions:f=[],size:b="md",variant:y="default",shape:k="default",onChange:j,onBlur:S=()=>{},setHide:C=()=>{},setNewOptions:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:R=()=>{},views:E={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:W,...T})=>{const{getColor:$,themeMode:D}=s.useTheme(),z=$("color-blueGray-700",{themeMode:W||D}),V=()=>M(!0),_=A=>{C(!l),R(A),j&&j(A)},P=()=>{!m&&!h&&C(!l)},L=A=>{const O=A.target.value,G=Wo.filter(Y=>Y.name.toLowerCase().startsWith(O.toLowerCase()));l&&C(!1),w(G),j&&j(O)},H=A=>{S(A),M(!1)},B=!!(o&&(u||r)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[b],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...E.field};return n.jsxs(Ie,{helperText:i,error:d,views:E,onClick:P,children:[n.jsxs(Ve,{label:o,size:b,error:d,shape:k,views:E,shadow:x,variant:y,value:r,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:u,showLabel:B,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[n.jsxs(ot,{children:[B&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...E,children:o}),n.jsx(xu,{id:e,name:t,placeholder:a,readOnly:h,disabled:m,autoFocus:p,onBlur:H,onFocus:V,...F,...T,value:r,onChange:L})]}),n.jsx(cr,{children:l?n.jsx(ie,{orientation:"down",widthHeight:Er[b],color:z,style:E.icon}):n.jsx(ie,{orientation:"up",widthHeight:Er[b],color:z,style:E.icon})})]}),!l&&n.jsx(ku,{size:b,views:E,options:f,callback:_})]})},Cu=e=>{const t=ra(e);return n.jsx(na,{...t,...e})},ju=Cu;function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function ge(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Su(e){return ge(1,arguments),e instanceof Date||Xt(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){ge(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Xt(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wu(e){if(ge(1,arguments),!Su(e)&&typeof e!="number")return!1;var t=je(e);return!isNaN(Number(t))}function De(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Iu(e,t){ge(2,arguments);var o=je(e).getTime(),r=De(t);return new Date(o+r)}function Tu(e,t){ge(2,arguments);var o=De(t);return Iu(e,-o)}var Mu=864e5;function Ru(e){ge(1,arguments);var t=je(e),o=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=o-r;return Math.floor(a/Mu)+1}function Kt(e){ge(1,arguments);var t=1,o=je(e),r=o.getUTCDay(),a=(r<t?7:0)+r-t;return o.setUTCDate(o.getUTCDate()-a),o.setUTCHours(0,0,0,0),o}function aa(e){ge(1,arguments);var t=je(e),o=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(o+1,0,4),r.setUTCHours(0,0,0,0);var a=Kt(r),i=new Date(0);i.setUTCFullYear(o,0,4),i.setUTCHours(0,0,0,0);var l=Kt(i);return t.getTime()>=a.getTime()?o+1:t.getTime()>=l.getTime()?o:o-1}function zu(e){ge(1,arguments);var t=aa(e),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var r=Kt(o);return r}var Eu=6048e5;function Vu(e){ge(1,arguments);var t=je(e),o=Kt(t).getTime()-zu(t).getTime();return Math.round(o/Eu)+1}var Pu={};function po(){return Pu}function Qt(e,t){var o,r,a,i,l,d,c,u;ge(1,arguments);var p=po(),m=De((o=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:p.weekStartsOn)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=je(e),x=h.getUTCDay(),f=(x<m?7:0)+x-m;return h.setUTCDate(h.getUTCDate()-f),h.setUTCHours(0,0,0,0),h}function ia(e,t){var o,r,a,i,l,d,c,u;ge(1,arguments);var p=je(e),m=p.getUTCFullYear(),h=po(),x=De((o=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setUTCFullYear(m+1,0,x),f.setUTCHours(0,0,0,0);var b=Qt(f,t),y=new Date(0);y.setUTCFullYear(m,0,x),y.setUTCHours(0,0,0,0);var k=Qt(y,t);return p.getTime()>=b.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function _u(e,t){var o,r,a,i,l,d,c,u;ge(1,arguments);var p=po(),m=De((o=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:1),h=ia(e,t),x=new Date(0);x.setUTCFullYear(h,0,m),x.setUTCHours(0,0,0,0);var f=Qt(x,t);return f}var Wu=6048e5;function $u(e,t){ge(1,arguments);var o=je(e),r=Qt(o,t).getTime()-_u(o,t).getTime();return Math.round(r/Wu)+1}function te(e,t){for(var o=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return o+r}var Te={y:function(t,o){var r=t.getUTCFullYear(),a=r>0?r:1-r;return te(o==="yy"?a%100:a,o.length)},M:function(t,o){var r=t.getUTCMonth();return o==="M"?String(r+1):te(r+1,2)},d:function(t,o){return te(t.getUTCDate(),o.length)},a:function(t,o){var r=t.getUTCHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,o){return te(t.getUTCHours()%12||12,o.length)},H:function(t,o){return te(t.getUTCHours(),o.length)},m:function(t,o){return te(t.getUTCMinutes(),o.length)},s:function(t,o){return te(t.getUTCSeconds(),o.length)},S:function(t,o){var r=o.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return te(i,o.length)}},Oe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lu={G:function(t,o,r){var a=t.getUTCFullYear()>0?1:0;switch(o){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,o,r){if(o==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return Te.y(t,o)},Y:function(t,o,r,a){var i=ia(t,a),l=i>0?i:1-i;if(o==="YY"){var d=l%100;return te(d,2)}return o==="Yo"?r.ordinalNumber(l,{unit:"year"}):te(l,o.length)},R:function(t,o){var r=aa(t);return te(r,o.length)},u:function(t,o){var r=t.getUTCFullYear();return te(r,o.length)},Q:function(t,o,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(o){case"Q":return String(a);case"QQ":return te(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,o,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(o){case"q":return String(a);case"qq":return te(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,o,r){var a=t.getUTCMonth();switch(o){case"M":case"MM":return Te.M(t,o);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,o,r){var a=t.getUTCMonth();switch(o){case"L":return String(a+1);case"LL":return te(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,o,r,a){var i=$u(t,a);return o==="wo"?r.ordinalNumber(i,{unit:"week"}):te(i,o.length)},I:function(t,o,r){var a=Vu(t);return o==="Io"?r.ordinalNumber(a,{unit:"week"}):te(a,o.length)},d:function(t,o,r){return o==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Te.d(t,o)},D:function(t,o,r){var a=Ru(t);return o==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):te(a,o.length)},E:function(t,o,r){var a=t.getUTCDay();switch(o){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,o,r,a){var i=t.getUTCDay(),l=(i-a.weekStartsOn+8)%7||7;switch(o){case"e":return String(l);case"ee":return te(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,o,r,a){var i=t.getUTCDay(),l=(i-a.weekStartsOn+8)%7||7;switch(o){case"c":return String(l);case"cc":return te(l,o.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,o,r){var a=t.getUTCDay(),i=a===0?7:a;switch(o){case"i":return String(i);case"ii":return te(i,o.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,o,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(o){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,o,r){var a=t.getUTCHours(),i;switch(a===12?i=Oe.noon:a===0?i=Oe.midnight:i=a/12>=1?"pm":"am",o){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,o,r){var a=t.getUTCHours(),i;switch(a>=17?i=Oe.evening:a>=12?i=Oe.afternoon:a>=4?i=Oe.morning:i=Oe.night,o){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,o,r){if(o==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return Te.h(t,o)},H:function(t,o,r){return o==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Te.H(t,o)},K:function(t,o,r){var a=t.getUTCHours()%12;return o==="Ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,o.length)},k:function(t,o,r){var a=t.getUTCHours();return a===0&&(a=24),o==="ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,o.length)},m:function(t,o,r){return o==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Te.m(t,o)},s:function(t,o,r){return o==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Te.s(t,o)},S:function(t,o){return Te.S(t,o)},X:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();if(l===0)return"Z";switch(o){case"X":return Pr(l);case"XXXX":case"XX":return $e(l);case"XXXXX":case"XXX":default:return $e(l,":")}},x:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"x":return Pr(l);case"xxxx":case"xx":return $e(l);case"xxxxx":case"xxx":default:return $e(l,":")}},O:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"O":case"OO":case"OOO":return"GMT"+Vr(l,":");case"OOOO":default:return"GMT"+$e(l,":")}},z:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"z":case"zz":case"zzz":return"GMT"+Vr(l,":");case"zzzz":default:return"GMT"+$e(l,":")}},t:function(t,o,r,a){var i=a._originalDate||t,l=Math.floor(i.getTime()/1e3);return te(l,o.length)},T:function(t,o,r,a){var i=a._originalDate||t,l=i.getTime();return te(l,o.length)}};function Vr(e,t){var o=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return o+String(a);var l=t;return o+String(a)+l+te(i,2)}function Pr(e,t){if(e%60===0){var o=e>0?"-":"+";return o+te(Math.abs(e)/60,2)}return $e(e,t)}function $e(e,t){var o=t||"",r=e>0?"-":"+",a=Math.abs(e),i=te(Math.floor(a/60),2),l=te(a%60,2);return r+i+o+l}var _r=function(t,o){switch(t){case"P":return o.date({width:"short"});case"PP":return o.date({width:"medium"});case"PPP":return o.date({width:"long"});case"PPPP":default:return o.date({width:"full"})}},la=function(t,o){switch(t){case"p":return o.time({width:"short"});case"pp":return o.time({width:"medium"});case"ppp":return o.time({width:"long"});case"pppp":default:return o.time({width:"full"})}},Du=function(t,o){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return _r(t,o);var l;switch(a){case"P":l=o.dateTime({width:"short"});break;case"PP":l=o.dateTime({width:"medium"});break;case"PPP":l=o.dateTime({width:"long"});break;case"PPPP":default:l=o.dateTime({width:"full"});break}return l.replace("{{date}}",_r(a,o)).replace("{{time}}",la(i,o))},Hu={p:la,P:Du};function Bu(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Au=["D","DD"],Fu=["YY","YYYY"];function Ou(e){return Au.indexOf(e)!==-1}function vu(e){return Fu.indexOf(e)!==-1}function Wr(e,t,o){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Nu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Uu=function(t,o,r){var a,i=Nu[t];return typeof i=="string"?a=i:o===1?a=i.one:a=i.other.replace("{{count}}",o.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function Co(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=t.width?String(t.width):e.defaultWidth,r=e.formats[o]||e.formats[e.defaultWidth];return r}}var qu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Yu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xu={date:Co({formats:qu,defaultWidth:"full"}),time:Co({formats:Gu,defaultWidth:"full"}),dateTime:Co({formats:Yu,defaultWidth:"full"})},Ku={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qu=function(t,o,r,a){return Ku[t]};function st(e){return function(t,o){var r=o!=null&&o.context?String(o.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=e.formattingValues[l]||e.formattingValues[i]}else{var d=e.defaultWidth,c=o!=null&&o.width?String(o.width):e.defaultWidth;a=e.values[c]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(t):t;return a[u]}}var Ju={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ep={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},op={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},np=function(t,o){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ap={ordinalNumber:np,era:st({values:Ju,defaultWidth:"wide"}),quarter:st({values:Zu,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:st({values:ep,defaultWidth:"wide"}),day:st({values:tp,defaultWidth:"wide"}),dayPeriod:st({values:op,defaultWidth:"wide",formattingValues:rp,defaultFormattingWidth:"wide"})};function dt(e){return function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=o.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(d)?lp(d,function(m){return m.test(l)}):ip(d,function(m){return m.test(l)}),u;u=e.valueCallback?e.valueCallback(c):c,u=o.valueCallback?o.valueCallback(u):u;var p=t.slice(l.length);return{value:u,rest:p}}}function ip(e,t){for(var o in e)if(e.hasOwnProperty(o)&&t(e[o]))return o}function lp(e,t){for(var o=0;o<e.length;o++)if(t(e[o]))return o}function cp(e){return function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var l=e.valueCallback?e.valueCallback(i[0]):i[0];l=o.valueCallback?o.valueCallback(l):l;var d=t.slice(a.length);return{value:l,rest:d}}}var sp=/^(\d+)(th|st|nd|rd)?/i,dp=/\d+/i,up={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pp={any:[/^b/i,/^(a|c)/i]},gp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mp={any:[/1/i,/2/i,/3/i,/4/i]},hp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},fp={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},xp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kp={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Cp={ordinalNumber:cp({matchPattern:sp,parsePattern:dp,valueCallback:function(t){return parseInt(t,10)}}),era:dt({matchPatterns:up,defaultMatchWidth:"wide",parsePatterns:pp,defaultParseWidth:"any"}),quarter:dt({matchPatterns:gp,defaultMatchWidth:"wide",parsePatterns:mp,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:dt({matchPatterns:hp,defaultMatchWidth:"wide",parsePatterns:fp,defaultParseWidth:"any"}),day:dt({matchPatterns:xp,defaultMatchWidth:"wide",parsePatterns:bp,defaultParseWidth:"any"}),dayPeriod:dt({matchPatterns:yp,defaultMatchWidth:"any",parsePatterns:kp,defaultParseWidth:"any"})},jp={code:"en-US",formatDistance:Uu,formatLong:Xu,formatRelative:Qu,localize:ap,match:Cp,options:{weekStartsOn:0,firstWeekContainsDate:1}},Sp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ip=/^'([^]*?)'?$/,Tp=/''/g,Mp=/[a-zA-Z]/;function Rp(e,t,o){var r,a,i,l,d,c,u,p,m,h,x,f,b,y;ge(2,arguments);var k=String(t),j=po(),S=(r=(a=void 0)!==null&&a!==void 0?a:j.locale)!==null&&r!==void 0?r:jp,C=De((i=(l=(d=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&d!==void 0?d:j.firstWeekContainsDate)!==null&&l!==void 0?l:(u=j.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=De((m=(h=(x=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&x!==void 0?x:j.weekStartsOn)!==null&&h!==void 0?h:(b=j.locale)===null||b===void 0||(y=b.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!wu(I))throw new RangeError("Invalid time value");var M=Bu(I),R=Tu(I,M),E={firstWeekContainsDate:C,weekStartsOn:w,locale:S,_originalDate:I},W=k.match(wp).map(function(T){var $=T[0];if($==="p"||$==="P"){var D=Hu[$];return D(T,S.formatLong)}return T}).join("").match(Sp).map(function(T){if(T==="''")return"'";var $=T[0];if($==="'")return zp(T);var D=Lu[$];if(D)return vu(T)&&Wr(T,t,String(e)),Ou(T)&&Wr(T,t,String(e)),D(R,T,S.localize,E);if($.match(Mp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return T}).join("");return W}function zp(e){var t=e.match(Ip);return t?t[1].replace(Tp,"'"):e}const ca=()=>{const[e,t]=g.useState(!1),[o,r]=g.useState(!1),[a,i]=g.useState(Rp(new Date,"yyyy-MM-dd"));return{date:a,setDate:i,isHovered:e,setIsHovered:t,isFocused:o,setIsFocused:r}},Ep=e=>n.jsx(s.Input,{type:"date",...e}),sa=({id:e,icon:t,name:o,label:r,date:a,children:i,helperText:l,shadow:d={},size:c="md",variant:u="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:x=!1,isFocused:f=!1,isDisabled:b=!1,isReadOnly:y=!1,setDate:k=()=>{},setIsFocused:j=()=>{},setIsHovered:S=()=>{},onChange:C,onChangeText:w,...I})=>{const M=!!(f&&r),R=()=>S(!x),E=()=>j(!0),W=$=>{typeof $=="string"?(k($),w&&w($)):(k($.target.value),C&&C($.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:s.Typography.fontSizes[c],backgroundColor:"transparent",color:b?"color-trueGray-600":"color-blueGray-700",cursor:b?"not-allowed":y?"auto":"pointer",...m.field};return n.jsx(Ie,{helperText:l,error:h,views:m,children:n.jsx(Ve,{label:r,size:c,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:u,value:a,isHovered:x,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:M,onMouseEnter:R,onMouseLeave:R,children:n.jsxs(ot,{children:[M&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:h,...m,children:r}),n.jsx(Ep,{id:e,name:o,onFocus:E,disabled:b,readOnly:y,...T,...I,...w&&{onChangeText:W},onChange:W})]})})})},Vp=e=>{const t=ca();return n.jsx(sa,{...t,...e})},Pp=Vp,da=e=>{const t=sr(e),[o,r]=g.useState(!1);return{isVisible:o,setIsVisible:r,...e,...t}},_p=({visibleIcon:e=n.jsx(Go,{widthHeight:14}),hiddenIcon:t=n.jsx(qo,{widthHeight:14}),...o})=>{const{isVisible:r,setIsVisible:a,...i}=da(o);return n.jsx(St,{...i,type:r?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{o.isDisabled||a(!r)},children:r?e:t})})},Wp=_p,ua=(e,t,o)=>{const[r,a]=g.useState(e),[i,l]=g.useState(t?{value:t,label:t}:e[0]),[d,c]=g.useState([]),[u,p]=g.useState(0),[m,h]=g.useState(o??""),[x,f]=g.useState(!1);return{filteredItems:r,setFilteredItems:a,selectedItem:i,setSelectedItem:l,selectedItems:d,setSelectedItems:c,highlightedIndex:u,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:x,setIsDropdownVisible:f}},$p={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},$r={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},Lp={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},Dp={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},Hp={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},Lr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Bp={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},pa=({placeholder:e,items:t,showTick:o=!0,onSelect:r,searchEnabled:a=!0,left:i,right:l,label:d,filteredItems:c,setSelectedItem:u,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:x,setHighlightedIndex:f,searchQuery:b,setSearchQuery:y,setFilteredItems:k,views:j,isDropdownVisible:S,setIsDropdownVisible:C,isMulti:w=!1,...I})=>{const{ref:M,relation:R}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),E=g.useRef(null),[W,T]=g.useState(!1),[$,D]=g.useState(!1),z=()=>{var O;const H=$?$r.enter:$r.initial;if(!M.current)return{};const B=M.current.getBoundingClientRect(),F={position:"fixed",left:B.left,width:B.width,zIndex:1e4,...H};return((O=R==null?void 0:R.space)==null?void 0:O.vertical)==="top"?{...F,bottom:window.innerHeight-B.top+6}:{...F,top:B.bottom+6}};g.useEffect(()=>{if(S){const H=setTimeout(()=>D(!0),10);return()=>clearTimeout(H)}D(!1)},[S]),g.useEffect(()=>{const H=B=>{!B.composedPath().some(O=>(O==null?void 0:O.id)==="combobox-dropdown")&&M.current&&!M.current.contains(B.target)&&C(!1)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const V=H=>{if(y(H),H==="")k(t);else{const B=t.filter(F=>F.label.toLowerCase().includes(H.toLowerCase()));k(B)}f(0)},_=H=>{if(w){const B=m.some(A=>A.value===H.value);let F;B?F=m.filter(A=>A.value!==H.value):F=[...m,H],h(F),r==null||r(F)}else u(H),r==null||r(H),C(!1)},P=(H,B)=>{H.stopPropagation();const F=m.filter(A=>A.value!==B.value);h(F),r==null||r(F)},L=H=>w?m.some(B=>B.value===H.value):H.value===p.value;return n.jsxs(s.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&n.jsx(s.Text,{views:j==null?void 0:j.label,htmlFor:I.id,children:d}),n.jsxs(s.View,{position:"relative",width:"100%",children:[n.jsx("div",{ref:M,onClick:()=>C(!S),style:{width:"100%"},children:n.jsxs(Ve,{isHovered:W,isFocused:S,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:j==null?void 0:j.container},children:[n.jsxs(s.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:w?"wrap":"nowrap",...j==null?void 0:j.labelContainer,children:[i,w?m.length>0?n.jsx(s.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(H=>n.jsxs(s.Horizontal,{...Bp,_hover:{backgroundColor:"color-gray-200"},children:[H.icon&&n.jsx(s.View,{flexShrink:0,children:H.icon}),n.jsx(s.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:H.label}),n.jsx(xe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:B=>P(B,H)})]},H.value))}):n.jsx(s.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...j==null?void 0:j.label,children:e}):n.jsxs(n.Fragment,{children:[p.icon&&p.label!==e&&n.jsx(s.View,{children:p.icon}),n.jsx(s.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...j==null?void 0:j.label,children:p.label})]})]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[l,n.jsx(s.View,{style:S?Lr.open:Lr.closed,children:n.jsx(ie,{widthHeight:16,orientation:"down",color:S?"color-gray-700":"color-gray-400"})})]})]})}),S&&n.jsx(On,{children:n.jsxs(s.View,{ref:E,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...$p,style:z(),...j==null?void 0:j.dropdown,children:[a&&n.jsx(s.View,{...Lp,children:n.jsx(St,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:b,onChange:H=>V(H),hint:e||"Search...",isClearable:!1,left:n.jsx(vt,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...j==null?void 0:j.text},field:{fontSize:"13px"}}})}),c.length>0&&n.jsx(s.View,{margin:0,padding:"4px",children:c.map((H,B)=>{const F=L(H),A=B===x;return n.jsxs(s.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...Dp,backgroundColor:F&&A?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":A?"color-gray-100":"transparent",onMouseEnter:()=>f(B),onClick:()=>_(H),...j==null?void 0:j.item,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[H.icon&&n.jsx(s.View,{flexShrink:0,children:H.icon}),n.jsx(s.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:H.label})]}),F&&o&&n.jsx(oo,{widthHeight:16,color:"theme-primary"})]},H.value)})}),c.length===0&&n.jsxs(s.Vertical,{...Hp,children:[n.jsx(vt,{widthHeight:24,color:"color-gray-300"}),n.jsx(s.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),n.jsx(s.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},Ap=({id:e,name:t,items:o,placeholder:r,searchPlaceholder:a,...i})=>{const l=ua(o,r,a);return n.jsx(pa,{id:e,name:t,items:o,...l,...i})},Fp=Ap,ga=e=>{const{tags:t,defaultTags:o=[],onTagsChange:r,onTagAdd:a,onTagRemove:i,maxTags:l,minTagLength:d=1,maxTagLength:c=50,allowDuplicates:u=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[x,f]=g.useState(""),[b,y]=g.useState(()=>(t||o||[]).map((z,V)=>({id:`tag-${V}-${Date.now()}`,value:z}))),[k,j]=g.useState(!1),[S,C]=g.useState(!1),w=t&&Array.isArray(t)?t.map((D,z)=>({id:`tag-${z}-${Date.now()}`,value:D})):b;g.useEffect(()=>{t&&Array.isArray(t)&&y(t.map((D,z)=>({id:`tag-${z}-${Date.now()}`,value:D})))},[t]);const I=g.useCallback(D=>{const z=D.trim();return!(z.length<d||z.length>c||!u&&w.map(_=>_.value.toLowerCase()).includes(z.toLowerCase())||l&&w.length>=l)},[w,d,c,u,l]),M=g.useCallback(D=>{if(m||h)return;const z=D.trim();if(!z||!I(z))return;const V={id:`tag-${Date.now()}-${Math.random()}`,value:z},_=[...w,V],P=_.map(L=>L.value);t||y(_),r==null||r(P),a==null||a(z),f("")},[w,I,r,a,m,h,t]),R=g.useCallback(D=>{if(m||h)return;const z=w[D];if(!z)return;const V=w.filter((P,L)=>L!==D),_=V.map(P=>P.value);t||y(V),r==null||r(_),i==null||i(z.value,D)},[w,r,i,m,h,t]),E=g.useCallback(D=>{if(m||h)return;const z=D.target.value;if(p.includes("comma")&&z.includes(",")){const V=z.split(","),_=V[0],P=V.slice(1).join(",");_.trim()&&M(_),f(P);return}f(z)},[M,p,m,h]),W=g.useCallback(D=>{if(m||h)return;const{key:z}=D;if(p.includes("enter")&&z==="Enter"){D.preventDefault(),x.trim()&&M(x);return}if(p.includes("tab")&&z==="Tab"&&x.trim()){D.preventDefault(),M(x);return}if(p.includes("space")&&z===" "&&x.trim()){D.preventDefault(),M(x);return}if(z==="Backspace"&&!x&&w.length>0){D.preventDefault(),R(w.length-1);return}},[M,R,x,w,p,m,h]),T=g.useCallback(()=>{var D;j(!0),(D=e.onFocus)==null||D.call(e)},[e.onFocus]),$=g.useCallback(()=>{var D;j(!1),x.trim()&&M(x),(D=e.onBlur)==null||D.call(e)},[M,x,e.onBlur]);return{inputValue:x,setInputValue:f,tags:w,setTags:y,isFocused:k,setIsFocused:j,isHovered:S,setIsHovered:C,addTag:M,removeTag:R,handleInputChange:E,handleKeyDown:W,handleFocus:T,handleBlur:$,validateTag:I}},Op=({tag:e,onRemove:t,isRemovable:o,size:r,views:a,isDisabled:i,isReadOnly:l})=>{const[d,c]=g.useState(!1),u={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[r]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return n.jsxs(s.Horizontal,{alignItems:"center",gap:6,padding:u.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:i?.6:1,_hover:!i&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...a==null?void 0:a.tag,children:[n.jsx(s.Text,{fontSize:u.fontSize,color:i?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...a==null?void 0:a.tagText,children:e}),o&&!i&&!l&&n.jsx(s.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:p=>{p.stopPropagation(),t()},_hover:{backgroundColor:"color-red-50"},...a==null?void 0:a.tagRemove,children:n.jsx(xe,{widthHeight:u.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},ma=({id:e,name:t,label:o,placeholder:r="Type and press Enter to add tags...",helperText:a,error:i=!1,inputValue:l="",tags:d=[],left:c,right:u,shadow:p={},views:m={},size:h="md",shape:x="default",variant:f="default",isDisabled:b=!1,isReadOnly:y=!1,isAutoFocus:k=!1,isRemovable:j=!0,isFocused:S=!1,isHovered:C=!1,maxTags:w,handleInputChange:I,handleKeyDown:M,handleFocus:R,handleBlur:E,removeTag:W,setIsHovered:T,onClick:$,...D})=>{const{getColor:z,themeMode:V}=s.useTheme(),_=!!(o&&(S||d.length>0||l)),P=w&&d.length>=w,L={...vn[x],...Nn[f],...m==null?void 0:m.inputContainer},H={border:"none",outline:"none",backgroundColor:"transparent",fontSize:s.Typography.fontSizes[h],color:b?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return n.jsx(Ie,{error:!!i,helperText:typeof i=="string"?i:a,views:m,...D,children:n.jsxs(Ve,{label:o,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:x,variant:f,error:!!i,showLabel:_,isFocused:S,isHovered:C,isDisabled:b,isReadOnly:y,views:m,onClick:$,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...L,children:[c,n.jsxs(ot,{children:[o&&n.jsx(He,{size:h,error:!!i,views:m,children:o}),n.jsxs(s.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:s.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((B,F)=>n.jsx(Op,{tag:B.value,onRemove:()=>W==null?void 0:W(F),isRemovable:j,size:h,views:m,isDisabled:b,isReadOnly:y},B.id)),!P&&n.jsx(s.Input,{id:e,name:t,type:"text",value:l,placeholder:d.length===0?r:"",disabled:b,readOnly:y,autoFocus:k,onChange:I,onKeyDown:M,onFocus:R,onBlur:E,autoComplete:"off",...H}),P&&n.jsxs(s.Text,{fontSize:s.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",w," tags reached"]})]})]}),u]})})},vp=e=>{const t=ga(e),{tags:o,...r}=e;return n.jsx(ma,{...t,...r})},Np=vp;function Up(e){const t=setTimeout(e,0),o=setTimeout(e,10),r=setTimeout(e,50);return[t,o,r]}const ha=({value:e,defaultValue:t="",length:o=6,onChange:r,onChangeText:a,onComplete:i,onKeyDown:l,onKeyPress:d,onBlur:c,onFocus:u,isReadOnly:p,isDisabled:m,pattern:h,stepValues:x,pasteTransformer:f})=>{var G,Y;const b=e!==void 0,y=b?e:t,[k,j]=g.useState((y==null?void 0:y.slice(0,o))||""),[S,C]=g.useState(!1),[w,I]=g.useState(!1),[M,R]=g.useState(null),[E,W]=g.useState(null),T=g.useRef(null),$=g.useRef(null),D=g.useRef({value:k,onChange:r||(()=>{}),isIOS:typeof window<"u"&&((Y=(G=window==null?void 0:window.CSS)==null?void 0:G.supports)==null?void 0:Y.call(G,"-webkit-touch-callout","none"))}),z=g.useRef({prev:[null,null,"none"]}),V=h?typeof h=="string"?new RegExp(h):h:null;g.useEffect(()=>{b&&e!==k&&j((e==null?void 0:e.slice(0,o))||"")},[b,e,o,k]);const _=g.useCallback(q=>{let X=q;if(x&&x.length>0&&q){const ee=parseInt(q,10);if(!isNaN(ee)){let oe=x[0],re=Math.abs(ee-oe);for(let ne=1;ne<x.length;ne++){const ue=Math.abs(ee-x[ne]);ue<re&&(re=ue,oe=x[ne])}X=oe.toString()}}j(X),r&&r(X),a&&a(X),i&&X.length===o&&i(X)},[r,a,i,o,x]),P=g.useCallback(q=>{q&&T.current!==q&&Object.defineProperty(T,"current",{value:q,writable:!0})},[]),L=g.useCallback(q=>{const X=q.currentTarget.value.slice(0,o);if(X.length>0&&V&&!V.test(X)){q.preventDefault();return}_(X),T.current&&(T.current.value=X)},[o,V,_,T]),H=g.useCallback(()=>{var q;if(T.current){const X=Math.min(T.current.value.length,o-1),ee=T.current.value.length;(q=T.current)==null||q.setSelectionRange(X,ee),R(X),W(ee)}C(!0)},[o]),B=g.useCallback(()=>{C(!1)},[]),F=g.useCallback(q=>{l&&l(q)},[]),A=g.useCallback(q=>{d&&d(q)},[]),O=g.useCallback(q=>{const X=T.current;if(!q.clipboardData||!X)return;const ee=q.clipboardData.getData("text/plain"),oe=f?f(ee):ee;q.preventDefault();const re=X.selectionStart||0,ne=X.selectionEnd||0,U=(re!==ne?k.slice(0,re)+oe+k.slice(ne):k.slice(0,re)+oe+k.slice(re)).slice(0,o);if(U.length>0&&V&&!V.test(U))return;X.value=U,_(U),j(U);const v=Math.min(U.length,o-1),K=U.length;X.setSelectionRange(v,K),R(v),W(K)},[o,f,V,_,k,j]);return g.useEffect(()=>{const q=T.current,X=$.current;if(!q||!X)return;D.current.value!==q.value&&D.current.onChange&&D.current.onChange(q.value),z.current.prev=[q.selectionStart,q.selectionEnd,q.selectionDirection];function ee(){if(document.activeElement!==q){R(null),W(null);return}const ne=(q==null?void 0:q.selectionStart)??null,ue=(q==null?void 0:q.selectionEnd)??null,be=(q==null?void 0:q.selectionDirection)??null,U=(q==null?void 0:q.maxLength)??0,v=(q==null?void 0:q.value)??"",K=z.current.prev;let J=-1,Z=-1,pe="none";if(v.length!==0&&ne!==null&&ue!==null){const me=ne===ue,zt=ne===v.length&&v.length<U;if(me&&!zt){const _e=ne;if(_e===0)J=0,Z=1,pe="forward";else if(_e===U)J=_e-1,Z=_e,pe="backward";else if(U>1&&v.length>1){let fo=0;if(K[0]!==null&&K[1]!==null){pe=_e<K[1]?"backward":"forward";const Wi=K[0]===K[1]&&K[0]<U;pe==="backward"&&!Wi&&(fo=-1)}J=fo+_e,Z=fo+_e+1}}J!==-1&&Z!==-1&&J!==Z&&T.current&&T.current.setSelectionRange(J,Z,pe)}const he=J!==-1?J:ne,ye=Z!==-1?Z:ue,ae=pe!=="none"?pe:be;R(he),W(ye),z.current.prev=[he,ye,ae]}document.addEventListener("selectionchange",ee,{capture:!0}),ee(),document.activeElement===q&&C(!0);const oe=()=>{X&&X.style.setProperty("--root-height",`${q.clientHeight}px`)};oe();const re=new window.ResizeObserver(oe);return re.observe(q),()=>{document.removeEventListener("selectionchange",ee,{capture:!0}),re.disconnect()}},[]),g.useEffect(()=>{Up(()=>{var oe,re,ne,ue;(oe=T.current)==null||oe.dispatchEvent(new Event("input"));const q=(re=T.current)==null?void 0:re.selectionStart,X=(ne=T.current)==null?void 0:ne.selectionEnd,ee=(ue=T.current)==null?void 0:ue.selectionDirection;q!==null&&X!==null&&q!==void 0&&X!==void 0&&(R(q),W(X),z.current.prev=[q,X,ee||"none"])})},[k,S]),{value:k,setValue:_,isFocused:S,setIsFocused:C,isHovered:w,setIsHovered:I,inputRef:T,containerRef:$,mirrorSelectionStart:M,mirrorSelectionEnd:E,setMirrorSelectionStart:R,setMirrorSelectionEnd:W,setInputRef:P,handleChange:L,handleFocus:H,handleBlur:B,handleKeyDown:F,handleKeyPress:A,handlePaste:O}},qp=g.createContext({slots:[],isFocused:!1,isHovering:!1}),Gp=`
33
+ `,backgroundSize:`200% ${X}px, ${X}px 200%, 200% ${X}px, ${X}px 200%`,backgroundPosition:F,transitionProperty:"background-position",transitionDuration:`${W}s`,transitionTimingFunction:"linear",transitionDelay:Y,_hover:{backgroundPosition:A,transitionDelay:O},width:i?"fit-content":l?"100%":void 0,...h==null?void 0:h.container,...R,children:n.jsx(s.View,{as:o?"div":"button",disabled:!!(r||a),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...m,...x,...f,backgroundColor:(m==null?void 0:m.backgroundColor)||j,color:b,borderWidth:0,cursor:r?"default":"pointer",children:_})})}return n.jsx(s.Element,{as:e==="link"&&o?"div":"button",type:e==="link"&&o?void 0:"button",disabled:!!(r||a),...x,...f,display:"inline-flex",alignItems:"center",justifyContent:"center",width:i?"fit-content":l?"100%":void 0,borderRadius:mt[c],boxShadow:u,transition:"all 0.2s ease",cursor:r?"default":"pointer",onClick:p,...m,...h==null?void 0:h.container,...R,children:_})},Os=({variant:e="filled",size:t="md",shape:o="rounded",iconPosition:r="left",loaderPosition:a="left",backgroundColor:i,color:l,textColor:d,reversed:c=!1,isAuto:u=!0,isFilled:p,isDisabled:h,isLoading:m,isIconRounded:x,isHovered:f,icon:b,children:y,to:k,isExternal:j,shadow:S,onClick:C,views:w={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:R="#705CFF",animatedStrokeTextColor:E="#333333",..._})=>{const{getColorHex:T}=s.useTheme();let z=T(h?"theme-disabled":m?"theme-loading":i??l??"theme-button-background");(z==="theme-button-background"||z==="theme-loading")&&(z=T(m?"color-dark-500":"theme-primary"));let W=T(d??"theme-button-text");W==="theme-button-text"&&(W=T("color-white"));const L=g.useMemo(()=>Ls(z,W,c),[z,W,c])[e],H=(L==null?void 0:L.color)??W,B=n.jsx(Ds,{icon:b,isLoading:m,iconPosition:r,loaderPosition:a,size:t,resolvedTextColor:H,isIconRounded:x,views:w,children:y}),F=Rn[t],A=x?zn[t]:{};return n.jsx(Fs,{variant:e,animation:_.animation,to:k,isDisabled:h,isLoading:m,isAuto:u,isFilled:p,isExternal:j,shape:o,shadow:S,onClick:C,views:w,baseStyles:L,sizeStyles:F,iconPad:A,resolvedTextColor:H,content:B,size:t,mainTone:z,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:R,animatedStrokeTextColor:E,getColor:T,..._})},vs=e=>{const[t,o]=s.useHover();return n.jsx(Os,{ref:t,isHovered:o,...e})},Le=vs,Ns={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},Us={square:0,rounded:"8px",pill:"24px"},qs=e=>{const t=e==="dark";return{default:{backgroundColor:t?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:t?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:t?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:t?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:t?"color-gray-900":"color-white",boxShadow:t?"0px 4px 12px rgba(0, 0, 0, 0.3)":"0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",border:"none",transition:"box-shadow 0.2s ease",_hover:{boxShadow:t?"0px 8px 16px rgba(0, 0, 0, 0.4)":"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"}}}},co=e=>{const t=e.themeMode==="dark";return{container:{backgroundColor:t?"color-gray-900":"color-white",color:t?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:t?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:t?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:t?"color-gray-800":"color-gray-100"}}},En=g.createContext({}),ar=()=>g.useContext(En),Eo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).header,c={...d,...l==null?void 0:l.header,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.header)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:8,...c,children:e})},Vo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).content,c={...d,...l==null?void 0:l.content,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.content)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:12,...c,children:e})},Po=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ar(),d=co(i).footer,c={...d,...l==null?void 0:l.footer,...a,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.footer)==null?void 0:u.style,...o}};return n.jsx(s.Vertical,{gap:8,...c,children:e})},Gs=({variant:e="default",size:t="md",shape:o="rounded",children:r,header:a,footer:i,isFullWidth:l=!1,views:d,style:c,themeMode:u,...p})=>{var C,w;const h=s.useTheme(),m=co(h),x=((C=Ns[t])==null?void 0:C.padding)||"16px",f=g.useMemo(()=>({styles:{container:{...m.container,borderRadius:Us[o],...d==null?void 0:d.container},header:{...m.header,padding:x,...d==null?void 0:d.header},content:{...m.content,padding:x,...d==null?void 0:d.content},footer:{...m.footer,padding:x,...d==null?void 0:d.footer}}}),[m,d,x,o]),b=g.Children.toArray(r).some(I=>g.isValidElement(I)&&(I.type===Eo||I.type===Vo||I.type===Po)),{themeMode:y}=h,j=qs(u||y)[e],S={width:l?"100%":"auto",overflow:"hidden",...j,...f.styles.container,...p,style:{...(w=f.styles.container)==null?void 0:w.style,...c}};return n.jsx(En.Provider,{value:f,children:n.jsx(s.View,{...S,children:b?r:n.jsxs(s.Vertical,{width:"100%",children:[a&&n.jsx(Eo,{children:a}),n.jsx(Vo,{children:r}),i&&n.jsx(Po,{children:i})]})})})},Ys=e=>n.jsx(Gs,{...e}),so=Ys;so.Header=Eo;so.Content=Vo;so.Footer=Po;const Xs=({defaultActiveIndex:e=0,activeIndex:t,onChange:o,autoPlay:r=!1,autoPlayInterval:a=3e3,pauseOnHover:i=!0,infinite:l=!0,totalSlides:d,stepIndices:c})=>{const u=g.useRef(d||0),[p,h]=g.useState(d||0),m=g.useRef(new Set),x=g.useRef(0),f=g.useMemo(()=>Ao("carousel-content"),[]),[b,y]=g.useState(t!==void 0?t:e),[k,j]=g.useState(!1),[S,C]=g.useState(!1),[w,I]=g.useState(0),[M,R]=g.useState(0),E=g.useRef(null);g.useEffect(()=>{t!==void 0&&y(t)},[t]);const _=g.useCallback(A=>{let O=A;l?A<0?O=p-1:A>=p&&(O=0):O=Math.max(0,Math.min(A,p-1)),c&&c.length>0&&(c.includes(O)||(O=c.reduce((X,U)=>Math.abs(U-O)<Math.abs(X-O)?U:X))),t===void 0&&y(O),o&&o(O)},[t,l,o,p]),T=g.useCallback(()=>{_(b+1)},[b,_]),$=g.useCallback(()=>{_(b-1)},[b,_]);g.useEffect(()=>(r&&!k&&!S&&(E.current=setInterval(()=>{T()},a)),()=>{E.current&&clearInterval(E.current)}),[r,a,k,S,T,i]);const D=g.useCallback(()=>{i&&j(!0)},[i]),z=g.useCallback(()=>{j(!1)},[]),V=g.useCallback(A=>{C(!0),"touches"in A?(I(A.touches[0].clientX),R(A.touches[0].clientY)):(I(A.clientX),R(A.clientY))},[]),W=g.useCallback(A=>{if(!S)return;let O,Y;"touches"in A?(O=A.touches[0].clientX,Y=A.touches[0].clientY):(O=A.clientX,Y=A.clientY);const X=O-w,U=Y-M;Math.abs(X)>Math.abs(U)&&Math.abs(X)>50&&(X>0?$():T(),C(!1))},[S,w,M,T,$]),P=g.useCallback(()=>{C(!1)},[]),L=g.useCallback(()=>{const A=x.current++;m.current.add(A);const O=m.current.size;return u.current=O,h(O),A},[]),H=g.useCallback(A=>{m.current.delete(A);const O=m.current.size;if(u.current=O,h(O),O>0&&b>=O){const Y=Math.max(0,O-1);t===void 0&&y(Y),o&&o(Y)}},[b,t,o]),B=l||b>0,F=l||b<p-1;return{activeIndex:b,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:$,canGoNext:F,canGoPrevious:B,handleMouseEnter:D,handleMouseLeave:z,handleDragStart:V,handleDragMove:W,handleDragEnd:P,registerSlide:L,unregisterSlide:H,contentId:f,infinite:l}},Ks={dot:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},line:{width:"20px",height:"4px",borderRadius:"2px",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",transition:"background-color 0.3s ease"},number:{minWidth:"24px",height:"24px",borderRadius:"50%",backgroundColor:"color-gray-300",margin:"0 4px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",transition:"background-color 0.3s ease"}},Qs={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Ut={width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"color-white",color:"color-gray-800",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.1)",zIndex:1,transition:"background-color 0.3s ease",_hover:{backgroundColor:"color-gray-100"}},Ct=()=>({container:{position:"relative",overflow:"hidden"},content:{overflow:"hidden",width:"100%",height:"100%"},innerContainer:{display:"flex",transitionProperty:"transform",transitionDuration:"300ms",transitionTimingFunction:"ease-in-out",height:"100%"},item:{flex:"0 0 100%",minWidth:0,position:"relative",height:"100%"},prevButton:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)",zIndex:10,...Ut},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Ut}}),Vn=g.createContext(null),uo=()=>{const e=g.useContext(Vn);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Pn=({children:e,isActive:t,views:o,...r})=>n.jsx(s.View,{flexShrink:0,width:"100%",height:"100%",display:t?"block":"none",...o,...r,children:e}),Wn=({views:e,children:t,...o})=>{const{goToPrevious:r,canGoPrevious:a,styles:i}=uo(),d={...Ct().prevButton,...i==null?void 0:i.prevButton,...e==null?void 0:e.prevButton};return n.jsx(Le,{"aria-label":"Previous slide",onClick:()=>r(),isDisabled:!a,...d,...o,children:t??n.jsx(ie,{orientation:"left",widthHeight:16})})},_n=({views:e,children:t,...o})=>{const{goToNext:r,canGoNext:a,styles:i}=uo(),d={...Ct().nextButton,...i==null?void 0:i.nextButton,...e==null?void 0:e.nextButton};return n.jsx(Le,{"aria-label":"Next slide",onClick:()=>r(),isDisabled:!a,...d,...o,children:t??n.jsx(ie,{orientation:"right",widthHeight:16})})},$n=({children:e,views:t,...o})=>{const{registerSlide:r,unregisterSlide:a,styles:i}=uo(),l=g.useRef(null);g.useEffect(()=>{const u=r();return l.current=u,()=>{l.current!==null&&a(l.current)}},[r,a]);const c={...Ct().item,...i==null?void 0:i.item,...t==null?void 0:t.item};return n.jsx(s.View,{role:"group","aria-roledescription":"slide",...c,...o,children:e})},Ln=({children:e,views:t,style:o,...r})=>{const{currentIndex:a,styles:i,contentId:l}=uo(),d=Ct(),c={...d.content,...i==null?void 0:i.content,...t==null?void 0:t.content},u={...d.innerContainer,...i==null?void 0:i.innerContainer,...t==null?void 0:t.innerContainer},p=`-${a*100}%`;return n.jsx(s.View,{...c,...r,style:{...c==null?void 0:c.style,...o},id:l,"aria-live":"polite",children:n.jsx(s.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${p})`},children:e})})},Js=({children:e,defaultActiveIndex:t=0,activeIndex:o,onChange:r,showNavigation:a=!0,navigationPosition:i="inside",prevButton:l,nextButton:d,showIndicators:c=!0,indicatorPosition:u="bottom",indicatorVariant:p="dot",autoPlay:h=!1,autoPlayInterval:m=3e3,pauseOnHover:x=!0,infinite:f=!0,direction:b="horizontal",transitionDuration:y=300,views:k,stepIndices:j,themeMode:S,...C})=>{const w=g.useMemo(()=>g.Children.toArray(e),[e]),I=Xs({defaultActiveIndex:t,activeIndex:o,onChange:r,autoPlay:h,autoPlayInterval:m,pauseOnHover:x,infinite:f,totalSlides:w.length}),{activeIndex:M,totalSlides:R,goToSlide:E,nextSlide:_,prevSlide:T,handleMouseEnter:$,handleMouseLeave:D,handleDragStart:z,handleDragMove:V,handleDragEnd:W}=I,P=()=>{if(!a)return null;const B=l||n.jsx(s.View,{as:"button","aria-label":"Previous slide",...Ut,...k==null?void 0:k.prevButton,children:"❮"}),F=d||n.jsx(s.View,{as:"button","aria-label":"Next slide",...Ut,...k==null?void 0:k.nextButton,children:"❯"});return n.jsxs(n.Fragment,{children:[n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:i==="inside"?"10px":"-40px",onClick:T,cursor:!f&&M===0?"not-allowed":"pointer",opacity:!f&&M===0?.5:1,children:B}),n.jsx(s.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:i==="inside"?"10px":"-40px",onClick:_,cursor:!f&&M===w.length-1?"not-allowed":"pointer",opacity:!f&&M===w.length-1?.5:1,children:F})]})},L=()=>c?n.jsx(s.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:w.map((B,F)=>n.jsx(s.View,{onClick:()=>E(F),cursor:"pointer",...Ks[p],...F===M?{...Qs[p]}:{},...k==null?void 0:k.indicator,...F===M?k==null?void 0:k.activeIndicator:{},children:p==="number"&&F+1},F))}):null;return g.useMemo(()=>g.Children.toArray(e).some(B=>g.isValidElement(B)&&(B.type===Ln||B.type===$n||B.type===Wn||B.type===_n)),[e])?n.jsx(Vn.Provider,{value:{currentIndex:M,totalSlides:R,goToSlide:E,goToNext:_,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...Ct(),...k},contentId:I.contentId,infinite:f},children:n.jsx(s.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...C,children:e})}):n.jsxs(s.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:$,onMouseLeave:D,onTouchStart:z,onTouchMove:V,onTouchEnd:W,onMouseDown:z,onMouseMove:V,onMouseUp:W,...k==null?void 0:k.container,...C,children:[n.jsx(s.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:w.map((B,F)=>n.jsx(Pn,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:B},F))}),P(),L()]})},Zs=e=>n.jsx(Js,{...e}),tt=Zs;tt.Slide=Pn;tt.Content=Ln;tt.Item=$n;tt.Previous=Wn;tt.Next=_n;const Ce={blue:"color-blue-500",green:"color-green-500",purple:"color-purple-500",orange:"color-orange-500",red:"color-red-500",teal:"color-teal-500",pink:"color-pink-500",indigo:"color-indigo-500",yellow:"color-yellow-500",cyan:"color-cyan-500"},ed=[Ce.blue,Ce.green,Ce.purple,Ce.orange,Ce.red,Ce.teal,Ce.pink,Ce.indigo,Ce.yellow,Ce.cyan],Ye=ed,td={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},od={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},rd={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},nd={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},ad={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},id={fontSize:"14px"},Dn={stroke:"color-gray-200",strokeWidth:"1px"},qt={stroke:"color-gray-300",strokeWidth:"1px"},Gt={fontSize:"12px",fill:"color-gray-600"},ld={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},cd={strokeWidth:"2px",fill:"none"},sd={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Vt={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},ir={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",borderRadius:"4px",zIndex:10,padding:"16px",textAlign:"center"},dd={...ir},ud={...ir,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},pd={...ir,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},gd=({data:e,dataPoints:t,animated:o=!0,animationDuration:r=500,showTooltips:a=!0})=>{const[i,l]=g.useState(o?0:1),[d,c]=g.useState({visible:!1,x:0,y:0,content:null}),u=g.useRef(null),p=g.useRef(null);g.useEffect(()=>{if(!o){l(1);return}const b=Date.now(),y=()=>{const k=Date.now()-b,j=Math.min(k/r,1);l(j),j<1&&(u.current=requestAnimationFrame(y))};return u.current=requestAnimationFrame(y),()=>{u.current&&cancelAnimationFrame(u.current)}},[o,r]);const h=g.useCallback(()=>e?{...e,series:e.series.map((b,y)=>({...b,color:b.color||Ye[y%Ye.length]}))}:t?t.map((b,y)=>({...b,color:b.color||Ye[y%Ye.length]})):null,[e,t]),m=g.useCallback((b,y,k)=>{a&&c({visible:!0,x:b,y,content:k})},[a]),x=g.useCallback(()=>{c(b=>({...b,visible:!1}))},[]),f=g.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:b,height:y}=p.current.getBoundingClientRect();return{width:b,height:y}},[]);return{animationProgress:i,tooltip:d,containerRef:p,processedData:h,showTooltip:m,hideTooltip:x,getChartDimensions:f}},hd=({data:e,width:t,height:o,animationProgress:r,showGrid:a=!0,onBarClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),p={top:20,right:20,bottom:40,left:50},h=t-p.left-p.right,m=o-p.top-p.bottom,x=g.useMemo(()=>{let w=0;return e.series.forEach(I=>{I.data.forEach(M=>{w=Math.max(w,M)})}),w},[e]),f=e.labels.length,b=e.series.length,y=h/f,k=y*.8/b,j=y*.2/(b+1),S=x||10,C=g.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const R=S/5*M;I.push(R)}return I},[x]);return n.jsxs("svg",{width:t,height:o,children:[n.jsx("line",{x1:p.left,y1:o-p.bottom,x2:t-p.right,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),n.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),e.labels.map((w,I)=>{const M=p.left+(I+.5)*y,R=o-p.bottom+20;return n.jsx("text",{x:M,y:R,textAnchor:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:w},`x-label-${I}`)}),C.map((w,I)=>{const M=o-p.bottom-w/S*m;return n.jsxs(g.Fragment,{children:[n.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:w.toFixed(0)}),a&&n.jsx("line",{x1:p.left,y1:M,x2:t-p.right,y2:M,...Dn,...c==null?void 0:c.grid})]},`y-tick-${I}`)}),e.series.map((w,I)=>n.jsx(g.Fragment,{children:w.data.map((M,R)=>{const E=M/S*m*r,_=p.left+R*y+j*(I+1)+k*I,T=o-p.bottom-E,$=e.labels[R],D=e.series.reduce((L,H)=>{const B=H.data[R];return L+(typeof B=="number"?B:0)},0),z=D>0?(M/D*100).toFixed(1):null,V=w.color?u(w.color):"black",W=L=>{const H=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:w.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:V})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:$}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),z!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${z}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:D.toLocaleString()})]})]})]});l(L.clientX,L.clientY,H)},P=()=>{i&&i(w.name,R)};return n.jsx("rect",{x:_,y:T,width:k,height:E,fill:V,onMouseEnter:W,onMouseLeave:d,onClick:P,...ld,...c==null?void 0:c.bar},`bar-${I}-${R}`)})},`series-${I}`))]})},md=({data:e,width:t,height:o,animationProgress:r,showGrid:a=!0,onPointClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),p={top:20,right:20,bottom:40,left:50},h=t-p.left-p.right,m=o-p.top-p.bottom,x=g.useMemo(()=>{let j=0;return e.series.forEach(S=>{S.data.forEach(C=>{j=Math.max(j,C)})}),j},[e]),f=x||10,b=g.useMemo(()=>{const S=[];for(let C=0;C<=5;C++){const w=f/5*C;S.push(w)}return S},[x]),y=j=>`M ${j.map((C,w)=>{const I=p.left+w/(e.labels.length-1)*h,M=o-p.bottom-C/f*m*r;return`${I},${M}`}).join(" L ")}`,k=j=>{const S=p.left,C=p.left+h,w=o-p.bottom,I=j.map((M,R)=>{const E=p.left+R/(e.labels.length-1)*h,_=o-p.bottom-M/f*m*r;return`${E},${_}`});return`M ${S},${w} L ${I.join(" L ")} L ${C},${w} Z`};return n.jsxs("svg",{width:t,height:o,children:[n.jsx("line",{x1:p.left,y1:o-p.bottom,x2:t-p.right,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),n.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:o-p.bottom,...qt,...c==null?void 0:c.axis}),e.labels.map((j,S)=>{const C=p.left+S/(e.labels.length-1)*h,w=o-p.bottom+20;return n.jsx("text",{x:C,y:w,textAnchor:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:j},`x-label-${S}`)}),b.map((j,S)=>{const C=o-p.bottom-j/f*m;return n.jsxs(g.Fragment,{children:[n.jsx("text",{x:p.left-10,y:C,textAnchor:"end",dominantBaseline:"middle",...Gt,...c==null?void 0:c.axisLabel,style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.2)",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))"},children:j.toFixed(0)}),a&&n.jsx("line",{x1:p.left,y1:C,x2:t-p.right,y2:C,...Dn,...c==null?void 0:c.grid})]},`y-tick-${S}`)}),e.series.map((j,S)=>{const C=j.color?u(j.color):"black";return n.jsxs(g.Fragment,{children:[n.jsx("path",{d:k(j.data),fill:C,opacity:.1,...c==null?void 0:c.area}),n.jsx("path",{d:y(j.data),stroke:C,...cd,...c==null?void 0:c.line}),j.data.map((w,I)=>{const M=p.left+I/(e.labels.length-1)*h,R=o-p.bottom-w/f*m*r,E=e.labels[I],_=e.series.reduce((P,L)=>{const H=L.data[I];return P+(typeof H=="number"?H:0)},0),T=_>0?(w/_*100).toFixed(1):null,$=I>0&&typeof j.data[I-1]=="number"?j.data[I-1]:null,D=typeof $=="number"?w-$:null,z=typeof D=="number"?`${D>=0?"+":""}${D.toLocaleString()}`:null,V=P=>{const L=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:j.name}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C})]}),n.jsx(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:E}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),z!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Change"}),n.jsx(s.Text,{fontWeight:"medium",children:z})]}),T!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:`${T}%`})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Category total"}),n.jsx(s.Text,{fontWeight:"medium",children:_.toLocaleString()})]})]})]});l(P.clientX,P.clientY,L)},W=()=>{i&&i(j.name,I)};return n.jsx("circle",{cx:M,cy:R,fill:C,onMouseEnter:V,onMouseLeave:d,onClick:W,...sd,...c==null?void 0:c.point},`point-${S}-${I}`)})]},`series-${S}`)})]})},fd=({dataPoints:e,width:t,height:o,animationProgress:r,isDonut:a=!1,onSliceClick:i,showTooltip:l,hideTooltip:d,views:c})=>{const{getColor:u}=s.useTheme(),{ref:p,relation:h}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),m=g.useRef(null);g.useEffect(()=>{m.current&&p&&(p.current=m.current)},[m,p]);const f=Math.min(t,o)/2*.8,b=t/2,y=o/2,k=a?f*.6:0,j=g.useMemo(()=>e.reduce((C,w)=>C+w.value,0),[e]),S=g.useMemo(()=>{if(j===0)return[{path:a?[`M ${b} ${y-f}`,`A ${f} ${f} 0 1 1 ${b} ${y+f}`,`A ${f} ${f} 0 1 1 ${b} ${y-f}`,`M ${b} ${y-k}`,`A ${k} ${k} 0 1 0 ${b} ${y+k}`,`A ${k} ${k} 0 1 0 ${b} ${y-k}`,"Z"].join(" "):[`M ${b} ${y}`,`M ${b} ${y-f}`,`A ${f} ${f} 0 1 1 ${b} ${y+f}`,`A ${f} ${f} 0 1 1 ${b} ${y-f}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:b,labelY:y,startAngle:0,endAngle:Math.PI*2,index:-1}];const C=[];let w=-Math.PI/2;for(let I=0;I<e.length;I++){const R=e[I].value/j,E=R*2*Math.PI*r,_=w+E,T=b+Math.cos(w)*f,$=y+Math.sin(w)*f,D=b+Math.cos(_)*f,z=y+Math.sin(_)*f,V=b+Math.cos(w)*k,W=y+Math.sin(w)*k,P=b+Math.cos(_)*k,L=y+Math.sin(_)*k,H=E>Math.PI?1:0;let B;a?B=[`M ${T} ${$}`,`A ${f} ${f} 0 ${H} 1 ${D} ${z}`,`L ${P} ${L}`,`A ${k} ${k} 0 ${H} 0 ${V} ${W}`,"Z"].join(" "):B=[`M ${b} ${y}`,`L ${T} ${$}`,`A ${f} ${f} 0 ${H} 1 ${D} ${z}`,"Z"].join(" ");const F=w+E/2,A=f*.7,O=b+Math.cos(F)*A,Y=y+Math.sin(F)*A,X=`${(R*100).toFixed(1)}%`,U=e[I].color||Ye[I%Ye.length],K=u(U);C.push({path:B,color:K,label:e[I].label,value:e[I].value,percentage:X,labelX:O,labelY:Y,startAngle:w,endAngle:_,index:I}),w=_}return C},[e,j,f,b,y,k,r,a]);return n.jsxs("svg",{ref:m,width:t,height:o,style:{overflow:"visible"},children:[a&&n.jsx("circle",{cx:b,cy:y,r:k,fill:"white",pointerEvents:"none"}),S.map((C,w)=>{const I=E=>{const _=j>0?C.value/j*100:0,T=j>0?Math.max(0,100-_):null,$=n.jsxs(s.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"semibold",children:C.label}),n.jsx(s.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:C.color})]}),n.jsxs(s.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",C.index+1," of ",e.length]}),n.jsxs(s.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[n.jsxs(s.View,{display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Value"}),n.jsx(s.Text,{fontWeight:"medium",children:C.value.toLocaleString()})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Share"}),n.jsx(s.Text,{fontWeight:"medium",children:C.percentage})]}),n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Total"}),n.jsx(s.Text,{fontWeight:"medium",children:j.toLocaleString()})]}),T!==null&&n.jsxs(s.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[n.jsx(s.Text,{color:"color-gray-500",children:"Remaining"}),n.jsx(s.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let D=E.clientX,z=E.clientY;if(h&&m.current){const V=m.current.getBoundingClientRect();E.clientX-V.left,E.clientY-V.top,h.space.horizontal==="left"?D=E.clientX-100:D=E.clientX+10,h.space.vertical==="top"?z=E.clientY-30:z=E.clientY+10}l(D,z,$)},M=()=>{C.index!==-1&&i&&i(e[C.index],C.index)},R=C.index===-1;return n.jsxs("g",{children:[n.jsx("path",{d:C.path,fill:C.color,onMouseEnter:R?void 0:I,onMouseLeave:R?void 0:d,onClick:M,...Vt,style:{...Vt==null?void 0:Vt.style,cursor:R?"default":"pointer"},...c==null?void 0:c.pie}),!R&&C.endAngle-C.startAngle>.2&&n.jsx("text",{x:C.labelX,y:C.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontWeight:"bold",pointerEvents:"none",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3)",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))"},children:C.percentage})]},`slice-${w}`)})]})},xd=({visible:e,x:t,y:o,content:r,maxDistance:a=100,views:i})=>{const l=g.useRef(null),[d,c]=g.useState({left:0,top:0});return g.useEffect(()=>{if(!e||!l.current)return;const p=l.current.getBoundingClientRect(),h=p.width,m=p.height,x=10,f=15;let b=t-f,y=o-f;const k=t-b,j=o-y;k>a&&(b=t-a),j>a&&(y=o-a),b+h>window.innerWidth-x&&(b=window.innerWidth-h-x,t-b>a&&(b=t-a)),b<x&&(b=x),y+m>window.innerHeight-x&&(y=window.innerHeight-m-x,o-y>a&&(y=o-a)),y<x&&(y=x),c({left:b,top:y})},[e,t,o,a]),e?n.jsx(s.View,{ref:l,position:"fixed",left:`${d.left}px`,top:`${d.top}px`,backgroundColor:"color-white",padding:"12px 16px",borderRadius:"8px",boxShadow:"0px 12px 24px rgba(15, 23, 42, 0.18)",border:"1px solid color-gray-200",fontSize:"14px",display:"flex",flexDirection:"column",pointerEvents:"none",zIndex:10,...i==null?void 0:i.tooltip,children:r}):null},bd=({type:e,data:t,dataPoints:o,title:r,showLegend:a=!0,legendPosition:i="bottom",showGrid:l=!0,showTooltips:d=!0,animated:c=!0,animationDuration:u=500,responsive:p=!0,aspectRatio:h=16/9,width:m=200,height:x=200,views:f,onDataPointClick:b,onSeriesClick:y,isLoading:k=!1,error:j,noData:S,loadingIndicator:C,errorIndicator:w,noDataIndicator:I,"aria-label":M,themeMode:R,...E})=>{const{animationProgress:_,tooltip:T,containerRef:$,processedData:D,showTooltip:z,hideTooltip:V,getChartDimensions:W}=gd({data:t,dataPoints:o,animated:c,animationDuration:u,showTooltips:d}),P=D(),{width:L,height:H}=W(),B=m||L,F=x||(p?L/h:H),A=()=>{if(!a||!P)return null;let ne=[];return e==="pie"||e==="donut"?Array.isArray(P)&&(ne=P):P&&P.series&&(ne=P.series),!ne||ne.length===0?null:n.jsx(s.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:i==="bottom"?"16px":0,marginBottom:i==="top"?"16px":0,...rd,...f==null?void 0:f.legend,children:ne.map((ae,oe)=>n.jsxs(s.View,{...nd,...f==null?void 0:f.legendItem,children:[n.jsx(s.View,{backgroundColor:ae.color,...ad}),n.jsx(s.Text,{...id,children:ae.name||ae.label})]},`legend-${oe}`))})},O=()=>{if(!P)return null;switch(e){case"bar":return n.jsx(hd,{data:P,width:B,height:F,animationProgress:_,showGrid:l,onBarClick:y,showTooltip:z,hideTooltip:V,views:f});case"line":case"area":return n.jsx(md,{data:P,width:B,height:F,animationProgress:_,showGrid:l,onPointClick:y,showTooltip:z,hideTooltip:V,views:f});case"pie":case"donut":return n.jsx(fd,{dataPoints:P,width:B,height:F,animationProgress:_,isDonut:e==="donut",onSliceClick:b,showTooltip:z,hideTooltip:V,views:f});default:return null}},Y=()=>k?n.jsx(s.View,{...dd,...f==null?void 0:f.loadingOverlay,children:C||n.jsx(s.Center,{children:n.jsx(ft,{size:"lg"})})}):null,X=()=>j?n.jsx(s.View,{...ud,...f==null?void 0:f.errorOverlay,children:w||n.jsx(s.Text,{fontWeight:"medium",children:typeof j=="string"?j:"An error occurred"})}):null,U=()=>S?n.jsx(s.View,{...pd,...f==null?void 0:f.noDataOverlay,children:I||n.jsx(s.Text,{children:typeof S=="string"?S:"No data available"})}):null,K=M??(typeof r=="string"?r:"Chart"),ee=!j&&!k&&!S;return n.jsxs(s.View,{ref:$,role:"region","aria-label":K,"aria-busy":k,...td,...f==null?void 0:f.container,...E,children:[r&&n.jsx(s.Text,{...od,children:r}),ee&&i==="top"&&A(),n.jsxs(s.View,{flex:1,width:"100%",position:"relative",...f==null?void 0:f.chart,children:[ee&&O(),Y(),X(),U()]}),ee&&i==="bottom"&&A(),n.jsx(xd,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:f})]})},yd=e=>n.jsx(bd,{...e}),kd=yd,Cd=(e=365)=>{const[t,o]=g.useState(!1),[r,a]=g.useState(null),i="app-studio-cookie-consent";g.useEffect(()=>{const u=localStorage.getItem(i);a(u!==null?u==="true":!1)},[]);const l=u=>{localStorage.setItem(i,String(u));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${i}-expires`,p.toISOString()),a(u)};return{isHovered:t,setIsHovered:o,hasConsent:r,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(i),localStorage.removeItem(`${i}-expires`),a(!1)}}},jd=e=>{const t=e==="dark";return{default:{container:{backgroundColor:t?"#1f2937":"#ffffff",borderColor:t?"#374151":"#e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:t?"#e5e7eb":"#4b5563",borderColor:t?"#4b5563":"#d1d5db",hoverBackgroundColor:t?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:t?"#1e3a8a":"#eff6ff",borderColor:t?"#1e40af":"#bfdbfe",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:t?"#bfdbfe":"#1e40af",borderColor:t?"#3b82f6":"#93c5fd",hoverBackgroundColor:t?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:t?"#0c4a6e":"#f0f9ff",borderColor:t?"#0369a1":"#bae6fd",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},content:{color:t?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:t?"#bae6fd":"#0369a1",borderColor:t?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:t?"#0369a1":"#e0f2fe"}}}},Sd=({title:e="Nous utilisons des cookies",description:t="Ce site utilise des cookies pour améliorer votre expérience. En continuant à naviguer sur ce site, vous acceptez notre utilisation des cookies conformément à notre politique de confidentialité.",acceptButtonText:o="Accepter",customizeButtonText:r="Personnaliser",position:a="bottom",variant:i="default",onAccept:l,onCustomize:d,views:c,showCustomizeButton:u=!0,cookieExpiration:p=365,themeMode:h,...m})=>{const{themeMode:x}=s.useTheme(),f=h||x||"light",{hasConsent:b,acceptCookies:y}=Cd(p),j=jd(f)[i];if(b)return null;const S=()=>{y(),l&&l()},C=()=>{d&&d()};return n.jsx(s.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...a==="bottom"?{bottom:16}:{top:16},...j.container,...c==null?void 0:c.container,...m,children:n.jsxs(s.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&n.jsx(s.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...c==null?void 0:c.title,children:e}),t&&n.jsx(s.Text,{fontSize:14,color:"color-black",...c==null?void 0:c.description,children:t}),n.jsxs(s.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...c==null?void 0:c.buttonGroup,children:[u&&n.jsx(Le,{variant:"outline",onClick:C,size:"sm",...c==null?void 0:c.customizeButton,children:r}),n.jsx(Le,{variant:"primary",onClick:S,size:"sm",...c==null?void 0:c.acceptButton,children:o})]})]})})},wd=e=>n.jsx(Sd,{...e}),Id=wd,Td=e=>{const{size:t,variant:o,onOpenChange:r}=e||{},[a,i]=g.useState(!1),[l,d]=g.useState({x:0,y:0}),[c,u]=g.useState(null),p=g.useRef(null),h=g.useRef(null),m=g.useMemo(()=>Ao("contextmenu-content"),[]),x=g.useCallback(b=>{d({x:b.clientX,y:b.clientY}),i(!0),r==null||r(!0)},[r]),f=g.useCallback(()=>{i(!1),u(null),r==null||r(!1)},[r]);return g.useEffect(()=>{const b=j=>{h.current&&!h.current.contains(j.target)&&f()},y=()=>{a&&f()},k=j=>{j.key==="Escape"&&a&&f()};return document.addEventListener("mousedown",b),window.addEventListener("resize",y),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",b),window.removeEventListener("resize",y),document.removeEventListener("keydown",k)}},[a,f]),{isOpen:a,setIsOpen:i,position:l,setPosition:d,activeSubmenuId:c,setActiveSubmenuId:u,size:t,variant:o,triggerRef:p,contentRef:h,contentId:m,openMenu:x,closeMenu:f}},Ir={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Md={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Tr={hover:{backgroundColor:"color-gray-100"}},Hn=g.createContext({isOpen:!1,setIsOpen:()=>{},position:{x:0,y:0},setPosition:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null},contentRef:{current:null},contentId:"contextmenu-content",closeMenu:()=>{},openMenu:()=>{}}),Rd=({children:e,value:t})=>n.jsx(Hn.Provider,{value:t,children:e}),Yt=()=>{const e=g.useContext(Hn);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Bn=({children:e,disableNativeContextMenu:t=!0,asChild:o=!1,isDisabled:r=!1,views:a,...i})=>{const{triggerRef:l,contentId:d,openMenu:c}=Yt(),p={ref:l,onContextMenu:h=>{if(!r)if(t&&h.preventDefault(),c)c(h);else{const{setIsOpen:m,setPosition:x}=Yt();x({x:h.clientX,y:h.clientY}),m(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":r?"":void 0,...o&&g.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:r},...a==null?void 0:a.container,...i};if(o&&g.isValidElement(e)){const h=g.Children.only(e);return g.cloneElement(h,{...p,...h.props})}return n.jsx(s.View,{...p,children:e})},lr=({items:e,children:t,position:o,side:r="right",align:a="start",views:i,style:l,...d})=>{const{isOpen:c,position:u,contentRef:p,contentId:h,variant:m}=Yt(),x=g.useRef(null),f=p||x,{ref:b,relation:y}=s.useElementPosition({}),[k,j]=g.useState({x:0,y:0});if(g.useEffect(()=>{if(c&&f.current){const C=o||u,w=f.current.offsetWidth,I=f.current.offsetHeight,M=window.innerWidth,R=window.innerHeight;let E=C.x,_=C.y;y&&(y.space.horizontal==="left"?E=C.x-w:E=C.x,y.space.vertical==="top"?_=C.y-I:_=C.y),E+w>M&&(E=M-w-8),E<8&&(E=8),_+I>R&&(_=R-I-8),_<8&&(_=8),j({x:E,y:_})}},[c,u,o,r,a,f,y]),!c)return null;const S={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return n.jsxs(s.View,{id:h||"context-menu",ref:f,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...S,...l},...Md[m],...i==null?void 0:i.menu,...i==null?void 0:i.content,...d,children:[e&&e.map((C,w)=>C.divider?n.jsx(Fn,{views:i},`divider-${w}`):n.jsx(An,{item:C,views:i},C.id)),t]})},An=({item:e,children:t,onSelect:o,isDisabled:r=!1,views:a,...i})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:c,closeMenu:u}=Yt();if(e){const[h,m]=g.useState(!1),x=e.items&&e.items.length>0,f=l===e.id,[b,y]=g.useState({x:0,y:0}),k=e.disabled||r,j=()=>{m(!0),x&&d(e.id)},S=()=>{m(!1)},C=()=>{k||!x&&e.onClick&&(e.onClick(),u&&u())},{ref:w,relation:I}=s.useElementPosition({});return g.useEffect(()=>{if(f&&w.current){const M=w.current.getBoundingClientRect(),R=window.innerWidth,E=200;let _=!1;if(I)_=I.space.horizontal==="left";else{const T=R-M.right,$=M.left;_=T<E&&$>T}y({x:_?M.left-E:M.right,y:M.top})}},[f,e.items,I]),n.jsxs(s.View,{ref:w,role:"menuitem",display:"flex",alignItems:"center",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,position:"relative","aria-disabled":k,"data-disabled":k?"":void 0,...Ir[c],_hover:k?{}:Tr.hover,backgroundColor:h&&!k?"color-gray-100":"transparent",onMouseEnter:j,onMouseLeave:S,onClick:C,...a==null?void 0:a.item,...i,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),x&&n.jsx(s.View,{marginLeft:8,...a==null?void 0:a.submenuIndicator,children:n.jsx(ie,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),f&&x&&n.jsx(lr,{items:e.items||[],position:b,side:"right",align:"start",views:a})]})}const p=h=>{r||(o==null||o(h),u&&u())};return n.jsx(s.View,{role:"menuitem",onClick:p,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,"aria-disabled":r,"data-disabled":r?"":void 0,...Ir[c],_hover:r?{}:Tr.hover,...a==null?void 0:a.item,...i,children:t})},Fn=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...t}),zd=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...t}),Ed=({children:e,items:t,size:o="md",variant:r="default",disableNativeContextMenu:a=!0,views:i,themeMode:l,...d})=>!t||t.length===0?n.jsx(n.Fragment,{children:e}):n.jsxs(n.Fragment,{children:[n.jsx(Bn,{disableNativeContextMenu:a,views:i,...d,children:e}),n.jsx(lr,{items:t,views:i})]}),Vd=({children:e,items:t,size:o="md",variant:r="default",disableNativeContextMenu:a=!0,onOpenChange:i,views:l,...d})=>{const c=Td({size:o,variant:r,onOpenChange:i}),{isOpen:u,setIsOpen:p,position:h,setPosition:m,activeSubmenuId:x,setActiveSubmenuId:f,triggerRef:b,contentRef:y,contentId:k,openMenu:j,closeMenu:S}=c;return n.jsx(Rd,{value:{isOpen:u,setIsOpen:p,position:h,setPosition:m,activeSubmenuId:x,setActiveSubmenuId:f,size:o,variant:r,triggerRef:b,contentRef:y,contentId:k,openMenu:j,closeMenu:S,styles:l},children:n.jsx(Ed,{items:t,size:o,variant:r,disableNativeContextMenu:a,views:l,...d,children:e})})},ot=Vd;ot.Trigger=Bn;ot.Content=lr;ot.Item=An;ot.Divider=Fn;ot.Separator=zd;const Pd=({src:e,color:t,views:o,themeMode:r,...a})=>{const{getColor:i,themeMode:l}=s.useTheme(),d=t?{fill:i(t,{themeMode:l}),stroke:i(t,{themeMode:l})}:{};return n.jsx(s.Center,{...a,...o==null?void 0:o.container,children:n.jsx(s.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...o==null?void 0:o.image})})},Wd=({path:e,...t})=>n.jsx(s.Image,{src:e,...t}),On=({placeholder:e,isMulti:t,options:o,id:r=`select-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?t?[]:"":Array.isArray(o)&&o.length>0?o[0].value:t?[]:"",[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(a),[h,m]=g.useState(0),[x,f]=g.useState(!0);return{id:r,value:u,setValue:p,hide:x,setHide:f,isHovered:i,setIsHovered:l,isFocused:d,setIsFocused:c,highlightedIndex:h,setHighlightedIndex:m}},vn=({children:e,containerId:t="portal-root"})=>{const[o,r]=g.useState(null);return g.useEffect(()=>{let a=document.getElementById(t),i=!1;return a||(i=!0,a=document.createElement("div"),a.setAttribute("id",t),document.body.appendChild(a)),r(a),()=>{i&&a&&a.parentNode&&a.childNodes.length===0&&a.parentNode.removeChild(a)}},[t]),o?Di.createPortal(e,o):null},Wo=({children:e,views:t={helperText:{}},...o})=>n.jsx(s.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...t.helperText,...o,children:e}),Te=g.forwardRef(({children:e,helperText:t,error:o=!1,views:r,...a},i)=>n.jsxs(s.Vertical,{ref:i,gap:8,position:"relative",width:"100%",marginVertical:4,...a,...r==null?void 0:r.container,children:[e,!o&&t&&n.jsx(Wo,{marginTop:4,...r==null?void 0:r.helperText,children:t}),o&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...r==null?void 0:r.error,children:o})]}));Te.displayName="FieldContainer";const Nn={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Mr={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},Un={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",transition:"border-color 200ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out",_hover:{borderColor:"color-gray-300",backgroundColor:"color-gray-50"},_focus:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"},_focusVisible:{borderColor:"theme-primary",backgroundColor:"color-white",outline:"none",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"}},default:{borderWidth:0,borderBottomWidth:"1.5px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",borderRadius:0,backgroundColor:"transparent",transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out",_hover:{borderBottomColor:"color-gray-400",backgroundColor:"color-gray-50"},_focus:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"},_focusVisible:{borderBottomColor:"theme-primary",borderBottomWidth:"2px",backgroundColor:"transparent",outline:"none"}},none:{border:"none",backgroundColor:"transparent",transition:"background-color 200ms ease-out",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"},_focusVisible:{outline:"none",backgroundColor:"color-gray-100"}}},_d={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},$d={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},Ve=({label:e,shadow:t,children:o,value:r,size:a="md",shape:i="default",variant:l="default",error:d=!1,showLabel:c=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:h=!1,isReadOnly:m=!1,views:x={pickerBox:{}},...f})=>{const y=d?"color-red-500":(p||u)&&!h?"theme-primary":"color-gray-300";return n.jsx(s.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:y,backgroundColor:"color-white",fontSize:s.Typography.fontSizes[a],cursor:h?"not-allowed":m?"auto":"text",opacity:h?.7:1,transition:"border-color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out, opacity 200ms ease-out",...c?_d:$d,...t,...Nn[i],...Un[l],...x==null?void 0:x.container,...f,children:o})},cr=({children:e,...t})=>n.jsx(s.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...t,children:e}),Ld={h1:{fontSize:96,lineHeight:112,letterSpacing:-1.5},h2:{fontSize:60,lineHeight:71,letterSpacing:-.5},h3:{fontSize:48,lineHeight:57,letterSpacing:0},h4:{fontSize:34,lineHeight:40,letterSpacing:.25},h5:{fontSize:24,lineHeight:28,letterSpacing:0},h6:{fontSize:20,lineHeight:24,letterSpacing:.15}},Dd=({children:e,heading:t,isItalic:o=!1,isUnderlined:r=!1,isStriked:a=!1,weight:i="normal",size:l="sm",dropDown:d,...c})=>{const u=t?Ld[t]:{};return n.jsx(s.Element,{as:"label",width:"100%",fontSize:l,fontStyle:o?"italic":"normal",fontWeight:s.Typography.fontWeights[i],textDecoration:a?"line-through":r?"underline":"none",...u,...c,children:e})},Hd=e=>n.jsx(Dd,{...e}),jt=Hd,He=({children:e,size:t="md",error:o=!1,color:r="theme-primary",views:a={label:{}},helperText:i,...l})=>n.jsx(jt,{top:0,zIndex:-10,position:"absolute",fontSize:Mr[t],lineHeight:Mr[t],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:o?"color-red-500":r,transition:"color 200ms ease-out",...a.label,...l,children:e}),rt=({children:e,...t})=>n.jsx(s.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...t,children:e}),qn={xs:12,sm:14,md:16,lg:20,xl:24},Bd={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},Ad={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Fd={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},Pt={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Rr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Od={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},vd={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},Nd=({isHovered:e,setIsHovered:t,option:o,size:r="md",callback:a=()=>{},style:i,isSelected:l=!1,...d})=>{const c=(h,m)=>{h.stopPropagation(),h.preventDefault(),typeof a=="function"&&a(m)},u=()=>t(!e),p=()=>l&&e?Pt.selectedHighlighted:l?Pt.selected:e?Pt.highlighted:Pt.default;return n.jsxs(s.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...Fd,...p(),onMouseEnter:u,onMouseLeave:u,onClick:h=>c(h,o.value),...d,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[r],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...i,children:o.label}),l&&n.jsx(s.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},Ud=({size:e="md",views:t={field:{},text:{}},value:o,isDisabled:r,placeholder:a,removeOption:i=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:s.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:r?"color-gray-400":"color-gray-900",cursor:r?"not-allowed":"pointer",transition:"all 0.2s ease",...t.field,...t.text},c=l.length>0&&l.find(u=>u.value===o);return n.jsx(s.Text,{...d,children:(o===""||Array.isArray(o)&&o.length===0)&&a?a:n.jsx(n.Fragment,{children:typeof o=="string"?(c&&c.label)??o:Array.isArray(o)&&o.length>0?n.jsx(s.Horizontal,{gap:6,children:o.map(u=>n.jsx(Yd,{option:u,removeOption:i},u))}):n.jsx("span",{children:o})})})},qd=({id:e,name:t,value:o,onChange:r,isMulti:a=!1,isDisabled:i=!1,isReadOnly:l=!1,options:d=[],...c})=>{const u=p=>{r&&r(p)};return n.jsx(s.Element,{id:e,name:t,as:"select",opacity:0,width:0,height:0,position:"absolute",value:o,disabled:i,readOnly:l,onChange:u,multiple:a,...c,children:d.length>0&&d.map(p=>n.jsx("option",{value:p.value,children:p.label},p.value))})},Gd=({size:e,views:t={},options:o,callback:r=()=>{},highlightedIndex:a,setHighlightedIndex:i,selectedValue:l})=>{const d=u=>r(u),c=u=>Array.isArray(l)?l.includes(u):l===u;return n.jsx(s.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...Bd,style:vd,...t==null?void 0:t.dropDown,children:o&&o.length>0&&o.map((u,p)=>n.jsx(Nd,{size:e,style:t.text,option:u,callback:d,isSelected:c(u.value),isHovered:p===a,setIsHovered:()=>{},onMouseEnter:()=>i(p)},u.value))})},Yd=({option:e,size:t="md",removeOption:o=()=>{},...r})=>{const a=()=>o(e);return n.jsxs(s.Horizontal,{gap:6,alignItems:"center",onClick:i=>i.stopPropagation(),...Od,_hover:{backgroundColor:"color-gray-200"},...r,children:[n.jsx(s.Text,{fontSize:s.Typography.fontSizes[t],fontWeight:"500",color:"color-gray-700",children:e}),n.jsx(ye,{role:"close-button",color:"color-gray-500",widthHeight:qn[t],onClick:a,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},Gn=({id:e,name:t,label:o,value:r,placeholder:a,helperText:i,hide:l=!1,error:d=!1,isMulti:c=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:h=!1,isReadOnly:m=!1,options:x=[],shadow:f={},size:b="md",shape:y="default",variant:k="default",views:j={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:S=()=>{},setHide:C=()=>{},setValue:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:R,highlightedIndex:E,..._})=>{const{ref:T,relation:$,updateRelation:D}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),z=g.useRef(null),V=()=>{var X;if(!T.current)return{};const A=T.current.getBoundingClientRect(),O={position:"fixed",left:A.left,width:A.width,zIndex:1e4};return((X=$==null?void 0:$.space)==null?void 0:X.vertical)==="top"?{...O,bottom:window.innerHeight-A.top+8}:{...O,top:A.bottom+8}};g.useEffect(()=>{const A=()=>C(!0);return document.addEventListener("closeAllSelects",A),()=>document.removeEventListener("closeAllSelects",A)},[C]),g.useEffect(()=>{const A=O=>{!O.target.closest(`#${e}`)&&!l&&C(!0)};return document.addEventListener("click",A),()=>{document.removeEventListener("click",A)}},[e,l,C]);const W=!!(u&&o),P=()=>I(!p),L=()=>M(!0),H=A=>{document.dispatchEvent(new Event("closeAllSelects")),A&&A.stopPropagation&&A.stopPropagation();const O=!l;C(O),M(!O)},B=g.useCallback(A=>{if(C(!0),document.dispatchEvent(new Event("closeAllSelects")),c&&Array.isArray(r)){if(!r.includes(A)){const O=[...r,A];w(O),S&&S(A)}}else w(A),S&&S(A);M(!0)},[c,r,C,w,S,M]),F=A=>{if(Array.isArray(r)&&r.includes(A)){const O=r.filter(Y=>Y!==A);w(O.length===0?[]:O)}};return n.jsx(Te,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:i,error:d,views:j,onClick:A=>{A.stopPropagation(),h||m||H(A)},children:n.jsxs(Ve,{label:o,size:b,error:d,shape:y,views:j,shadow:f,variant:k,value:r,color:"theme-primary",isHovered:p,isDisabled:h,isReadOnly:m,isFocused:u,showLabel:W,onMouseEnter:P,onMouseLeave:P,position:"relative",children:[n.jsxs(rt,{children:[W&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...j,children:o}),n.jsx(qd,{id:e,name:t,options:x,onChange:S,value:r,isDisabled:h,isReadOnly:m,isMulti:c,onFocus:L,..._}),n.jsx(Ud,{options:x,size:b,views:j,value:r,isDisabled:h,placeholder:a,removeOption:F})]}),n.jsx(cr,{children:!m&&!h&&n.jsx(s.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Rr.closed:Rr.open,children:n.jsx(ie,{color:"inherit",widthHeight:qn[b],style:j.icon,orientation:"down"})})}),!l&&x.length>0&&n.jsx(vn,{children:n.jsx(s.Element,{ref:z,onClick:A=>A.stopPropagation(),style:{...V(),...Ad.enter},children:n.jsx(Gd,{size:b,views:j,options:x,callback:B,highlightedIndex:E,setHighlightedIndex:R,selectedValue:r})})})]})})},Xd=e=>{const t={...e,options:e.options||[]},o=On(t);return n.jsx(Gn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},Kd=Xd,Yn=({isDisabled:e,isChecked:t})=>{const[o,r]=g.useState(!1),[a,i]=g.useState(t||!1),[l,d]=g.useState(t||!1);return g.useEffect(()=>{t!==void 0&&(i(t),d(t))},[t]),{isHovered:o,setIsHovered:r,on:a,setOn:i,value:l,setValue:d}},Qd={xs:{height:"8px",width:"8px"},sm:{height:"12px",width:"12px"},md:{height:"16px",width:"16px"},lg:{height:"20px",width:"20px"},xl:{height:"24px",width:"24px"}},Jd={xs:{height:"16px",width:"36px"},sm:{height:"20px",width:"44px"},md:{height:"24px",width:"52px"},lg:{height:"28px",width:"60px"},xl:{height:"32px",width:"68px"}},Zd={xs:{paddingVertical:4,paddingHorizontal:2},sm:{paddingVertical:4,paddingHorizontal:2},md:{paddingVertical:4,paddingHorizontal:4},lg:{paddingVertical:4,paddingHorizontal:4},xl:{paddingVertical:4,paddingHorizontal:4}},_e={default:{active:"theme-primary",inactive:"color-gray-300",knob:"white",disabled:"color-gray-200"},states:{hover:{active:"theme-primary",inactive:"color-gray-400",activeOpacity:.9}}},zr={slider:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},knob:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},eu=e=>n.jsx(s.Input,{type:"checkbox",...e}),Xn=({id:e,name:t,label:o,inActiveChild:r,isChecked:a,activeChild:i,labelPosition:l="right",shadow:d={},size:c="sm",value:u=!1,isHovered:p=!1,isDisabled:h=!1,isReadOnly:m=!1,on:x,setOn:f,onChange:b,setValue:y=()=>{},setIsHovered:k=()=>{},helperText:j,views:S={slider:{},circle:{},label:{}},...C})=>{const w=E=>{if(!m&&!h){const _=E.target.checked;y(_),f(_),b&&b(_)}},I=()=>k(!0),M=()=>k(!1),R={container:{gap:12,display:"flex",height:"fit-content",width:"fit-content",alignItems:"center",cursor:h?"not-allowed":m?"default":"pointer",opacity:h?.6:1,transition:"all 0.2s ease",...S.label}};return n.jsxs(jt,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...R.container,...C,children:[n.jsx(eu,{id:e,name:t,opacity:0,width:0,height:0,checked:u,onChange:w,disabled:h,readOnly:m,...C}),l==="left"&&o&&n.jsx(s.Text,{fontWeight:"500",color:h?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:o}),n.jsxs(s.View,{display:"flex",alignItems:"center",justifyContent:u?i?"space-between":"flex-end":r?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:h?_e.default.disabled:u?p?_e.states.hover.active:_e.default.active:p?_e.states.hover.inactive:_e.default.inactive,opacity:!h&&u&&p?_e.states.hover.activeOpacity:1,cursor:"pointer",...zr.slider,...d,...Zd[c],...Jd[c],...S.slider,children:[i&&u&&n.jsx(s.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:i}),n.jsx(s.View,{borderRadius:"50%",backgroundColor:_e.default.knob,boxShadow:p?"0 2px 4px rgba(0, 0, 0, 0.2)":"0 1px 2px rgba(0, 0, 0, 0.1)",transform:p?"scale(1.05)":"scale(1)",...zr.knob,zIndex:1,...Qd[c],...S.circle}),r&&!u&&n.jsx(s.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:r})]}),l==="right"&&o&&n.jsx(s.Text,{fontWeight:"500",color:h?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:o})]})},tu=e=>{const t=Yn(e);return n.jsx(Xn,{...t,...e})},ou=tu,Kn=({placeholder:e,isMulti:t,options:o,id:r=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const a=e?t?[]:"":Array.isArray(o)&&o.length>0?o[0].value:t?[]:"",[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(a),[h,m]=g.useState(0),[x,f]=g.useState(!0);return{id:r,value:u,setValue:p,hide:x,setHide:f,isHovered:i,setIsHovered:l,isFocused:d,setIsFocused:c,highlightedIndex:h,setHighlightedIndex:m}},Qn=({id:e,name:t,label:o,value:r,size:a,views:i={},options:l=[],onChange:d=()=>{},setValue:c=()=>{},...u})=>{const{getColor:p}=s.useTheme(),h=g.useCallback(m=>{c(m.value),d&&d(m.value)},[c,d]);return n.jsxs(Te,{id:e,width:"100%",views:i,children:[o&&n.jsxs(s.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[n.jsx(ze,{widthHeight:14})," ",n.jsx(s.Text,{children:o})]}),n.jsx(s.Horizontal,{gap:0,children:l.map((m,x,f)=>{const b=r===m.value;let y=p("color-gray-200"),k=p("color-gray-500"),j="transparent";if(b){if(m.color)m.color,y=p(m.color),k=p(m.color),j="rgba(0,0,0,0.05)";else{const S=p("theme-primary");y=S,k=S,j="color-gray-50"}m.color?(y=p(m.color),k=p(m.color),j="transparent"):(y=p("theme-primary"),k=p("theme-primary"),j="transparent")}return n.jsx(Le,{onClick:()=>h(m),flex:1,...a?{size:a}:{paddingVertical:6,fontSize:"12px"},fontWeight:b?"bold":"normal",style:{borderTop:`1px solid ${b?y:p("color-gray-200")}`,borderBottom:`1px solid ${b?y:p("color-gray-200")}`,borderLeft:`1px solid ${b?y:p("color-gray-200")}`,borderRight:x===f.length-1||b?`1px solid ${b?y:p("color-gray-200")}`:"none",backgroundColor:j,color:k,borderRadius:x===0?"6px 0 0 6px":x===f.length-1?"0 6px 6px 0":"0",zIndex:b?1:0,boxShadow:"none"},...i.item,children:m.label},m.value)})}),n.jsx("input",{type:"hidden",id:e,name:t,value:Array.isArray(r)?r.join(","):r,onChange:()=>{}})]})},ru=e=>{const t={...e,options:e.options||[]},o=Kn(t);return n.jsx(Qn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},nu=ru,Jn=({label:e,placeholder:t,value:o})=>{const[r,a]=g.useState(e??t),[i,l]=g.useState(!1),[d,c]=g.useState(o||""),[u,p]=g.useState(!1);return g.useMemo(()=>{a(u&&!d?t??"":e??t)},[d,u,e,t]),{hint:r,setHint:a,isHovered:i,setIsHovered:l,value:d,setValue:c,isFocused:u,setIsFocused:p}},Zn=({id:e,name:t,hint:o,error:r,value:a,label:i,shadow:l,helperText:d,placeholder:c,size:u="sm",shape:p="default",variant:h="default",isHovered:m=!1,isFocused:x=!1,isEditable:f=!1,isReadOnly:b=!1,isDisabled:y=!1,isAutoFocus:k=!1,isMultiline:j=!1,maxRows:S=3,maxCols:C=30,onBlur:w=()=>{},onChange:I,onFocus:M,setHint:R=()=>{},setValue:E=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},views:$={label:{},helperText:{}},...D})=>{const z=!!(x&&i),V={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[u],lineHeight:`${Math.round(s.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:y?"color-gray-400":"color-gray-900",cursor:y?"not-allowed":"text",opacity:y?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...$.field},W=()=>T(!m),P=()=>{_(!0),M&&M()},L=B=>{w(B),_(!1)},H=B=>{typeof B=="string"?(E(B),I&&I(B)):(E(B.target.value),I&&I(B.target.value))};return n.jsx(Te,{helperText:d,error:r,views:$,...D,children:n.jsx(Ve,{label:i,size:u,error:r,shape:p,views:$,shadow:l,variant:h,value:a,color:"theme-primary",isHovered:m,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:z,onMouseEnter:W,onMouseLeave:W,...$==null?void 0:$.content,children:n.jsxs(rt,{...$==null?void 0:$.warper,children:[z&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:r,...$==null?void 0:$.label,children:i}),n.jsx(s.Element,{as:"textarea",id:e,name:t,rows:S,cols:C,value:a,readOnly:b,disabled:y,autoFocus:k,editable:`${!!f.toString()}`,placeholder:o,onBlur:L,onFocus:P,multiline:`${!!j.toString()}`,onChange:B=>H(B),...V,style:{resize:y||b?"none":"vertical"},...$==null?void 0:$.textarea})]})})})},au=e=>{const t=Jn(e);return n.jsx(Zn,{...t,...e})},iu=au,sr=({label:e,placeholder:t,value:o})=>{const[r,a]=g.useState(e??t),[i,l]=g.useState(!1),[d,c]=g.useState(!1),[u,p]=g.useState(o);return g.useMemo(()=>{a(i&&!u?t??"":e??t)},[u,i,e,t]),{hint:r,setHint:a,isFocused:i,setIsFocused:l,isHovered:d,setIsHovered:c,setValue:p,value:u}},lu=e=>n.jsx(s.Input,{type:"text",...e}),St=({id:e,name:t,label:o,hint:r,value:a,onChange:i,left:l,right:d,helperText:c,placeholder:u,onChangeText:p,shadow:h={},views:m={container:{},field:{},label:{},helperText:{},text:{}},size:x="md",shape:f="default",variant:b="default",error:y=!1,isFocused:k=!1,isHovered:j=!1,isDisabled:S=!1,isReadOnly:C=!1,isClearable:w=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:R=()=>{},setIsHovered:E=()=>{},setValue:_=()=>{},onClick:T=()=>{},onFocus:$,onBlur:D=()=>{},themeMode:z,...V})=>{const{getColor:W,themeMode:P}=s.useTheme(),L=W("color-blueGray-700",{themeMode:z||P}),H=!!(k&&o),B={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[x],lineHeight:`${Math.round(s.Typography.fontSizes[x]*1.4)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:S?"color-gray-400":"color-gray-900",cursor:S?"not-allowed":"text",opacity:S?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",...m.field},F=()=>{R(!0),$&&$()},A=()=>E(!j),O=U=>{D&&D(U),R(!1)},Y=U=>{typeof U=="string"?(_(U),p&&p(U),i&&i(U)):(_(U.target.value),p&&p(U.target.value),i&&i(U.target.value))},X=()=>{_(""),i&&(D({target:{name:t}}),p&&p(""),i&&i("")),typeof document>"u"&&p&&p("")};return n.jsx(Te,{helperText:c,error:y,views:m,children:n.jsxs(Ve,{label:o,size:x,error:y,shape:f,views:m,shadow:h,variant:b,value:a,color:"theme-primary",isHovered:j,isDisabled:S,isReadOnly:C,isFocused:k,showLabel:H,onMouseEnter:A,onMouseLeave:A,children:[l,n.jsxs(rt,{children:[H&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:y,...m,children:o}),n.jsx(lu,{id:e,name:t,readOnly:C,disabled:S,autoFocus:I,placeholder:r,onFocus:F,onBlur:O,autoComplete:"off",...B,...V,onChange:Y,value:a})]}),w&&a&&!C&&!S&&n.jsx(cr,{children:n.jsx(ye,{size:20,color:L,onClick:X,cursor:"pointer",borderRadius:"50%",transition:"background-color 150ms ease-out, transform 150ms ease-out",_hover:{backgroundColor:"color-gray-100",transform:"scale(1.05)"},_active:{transform:"scale(0.95)"}})}),d]})})},cu=e=>{const t=sr(e);return n.jsx(St,{...t,...e})},wt=cu,ea=({defaultIsSelected:e=!1})=>{const[t,o]=g.useState(!1),[r,a]=g.useState(e);return{isHovered:t,setIsHovered:o,isSelected:r,setIsSelected:a}},su={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},Er={xs:10,sm:14,md:16,lg:20,xl:24},du={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-black",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},ko={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},ta=({id:e,icon:t,name:o,label:r,isChecked:a,onChange:i,onValueChange:l,shadow:d={},labelPosition:c="right",size:u="md",error:p=!1,isSelected:h=!1,isHovered:m=!1,isDisabled:x=!1,isReadOnly:f=!1,isIndeterminate:b=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:j=()=>{},views:S={checkbox:{},label:{}},infoText:C,helperText:w,...I})=>{const M=()=>j(!m),R=()=>{!f&&!x&&(k&&k(!h),i&&i(!a),l&&l(!a))},E=b?"indeterminate":a||h?"selected":"unselected",_=p?ko.error[E]:x?ko.disabled[E]:m?ko.hover[E]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":x?"color-gray-400":"color-gray-700",cursor:x?"not-allowed":f?"default":"pointer",opacity:x?.6:1,transition:"all 0.2s ease",...S.label},checkbox:{...du[E],..._,borderRadius:"4px",...su[u],transition:"all 0.2s ease",...d,...S.checkbox}};return n.jsxs(jt,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[u],...T.container,...I,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",c==="left"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:r}),n.jsx(s.Center,{...T.checkbox,children:b?n.jsx(on,{widthHeight:Er[u],color:"white",transition:"all 0.2s ease"}):(a||h)&&(t??n.jsx(oo,{widthHeight:Er[u],color:"white",transition:"all 0.2s ease"}))}),c==="right"&&r&&n.jsx(s.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:c==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...S==null?void 0:S.infoText,children:C})]}),p&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},uu=e=>{const t=ea(e);return n.jsx(ta,{...t,...e})},pu=uu,oa=e=>{const{value:t,defaultValue:o="",onChange:r,onChangeComplete:a,onOpen:i,onClose:l,closeOnSelect:d=!0,maxRecentColors:c=8,showRecentColors:u=!0,isAutoFocus:p=!1}=e,[h,m]=g.useState(!1),[x,f]=g.useState(t??o),[b,y]=g.useState(""),[k,j]=g.useState([]),[S,C]=g.useState(!1),[w,I]=g.useState(!1),M=g.useRef(null),R=g.useRef(null);g.useEffect(()=>{t!==void 0&&f(t)},[t]),g.useEffect(()=>{if(u)try{const W=localStorage.getItem("colorInput-recentColors");W&&j(JSON.parse(W))}catch(W){console.warn("Failed to load recent colors from localStorage:",W)}},[u]),g.useEffect(()=>{p&&M.current&&M.current.focus()},[p]),g.useEffect(()=>{const W=P=>{h&&M.current&&R.current&&!M.current.contains(P.target)&&!R.current.contains(P.target)&&z()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[h]);const E=g.useCallback(W=>{u&&j(P=>{const L=P.filter(B=>B!==W),H=[W,...L].slice(0,c);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(H))}catch(B){console.warn("Failed to save recent colors to localStorage:",B)}return H})},[u,c]),_=g.useCallback(()=>{const W=!h;m(W),W?i==null||i():l==null||l()},[h,i,l]),T=g.useCallback(W=>{f(W),E(W),r==null||r(W),a==null||a(W),d&&(m(!1),l==null||l())},[r,a,d,l,E]),$=g.useCallback(W=>{y(W)},[]),D=g.useCallback(()=>{b&&(T(b),y(""))},[b,T]),z=g.useCallback(()=>{m(!1),l==null||l()},[l]),V=g.useCallback(W=>{f(W),r==null||r(W)},[r]);return{isOpen:h,selectedColor:x,recentColors:k,customColor:b,isFocused:S,isHovered:w,handleToggle:_,handleColorSelect:T,handleCustomColorChange:$,handleCustomColorSubmit:D,handleClose:z,setIsFocused:C,setIsHovered:I,setValue:V,triggerRef:M,dropdownRef:R}},st={container:{position:"relative",display:"inline-block",width:"fit-content"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",padding:"8px 12px"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px"},recentColors:{display:"flex",gap:"4px",flexWrap:"wrap"}},gu={xs:{height:"28px",fontSize:"10px",padding:"4px 8px"},sm:{height:"32px",fontSize:"12px",padding:"6px 10px"},md:{height:"40px",fontSize:"14px",padding:"8px 12px"},lg:{height:"48px",fontSize:"16px",padding:"12px 16px"},xl:{height:"56px",fontSize:"20px",padding:"16px 20px"}},hu={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},mu={default:{backgroundColor:"color-white",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},outline:{backgroundColor:"transparent",borderColor:"color-gray-300",borderWidth:"1px",borderStyle:"solid"},none:{backgroundColor:"transparent",borderColor:"transparent",borderWidth:"0px"}},fu=[{name:"Red 500",value:"color-red-500"},{name:"Orange 500",value:"color-orange-500"},{name:"Yellow 500",value:"color-yellow-500"},{name:"Green 500",value:"color-green-500"},{name:"Blue 500",value:"color-blue-500"},{name:"Indigo 500",value:"color-indigo-500"},{name:"Purple 500",value:"color-purple-500"},{name:"Pink 500",value:"color-pink-500"},{name:"Red 300",value:"color-red-300"},{name:"Orange 300",value:"color-orange-300"},{name:"Yellow 300",value:"color-yellow-300"},{name:"Green 300",value:"color-green-300"},{name:"Blue 300",value:"color-blue-300"},{name:"Indigo 300",value:"color-indigo-300"},{name:"Purple 300",value:"color-purple-300"},{name:"Pink 300",value:"color-pink-300"},{name:"Red 700",value:"color-red-700"},{name:"Orange 700",value:"color-orange-700"},{name:"Yellow 700",value:"color-yellow-700"},{name:"Green 700",value:"color-green-700"},{name:"Blue 700",value:"color-blue-700"},{name:"Indigo 700",value:"color-indigo-700"},{name:"Purple 700",value:"color-purple-700"},{name:"Pink 700",value:"color-pink-700"},{name:"Gray 100",value:"color-gray-100"},{name:"Gray 300",value:"color-gray-300"},{name:"Gray 500",value:"color-gray-500"},{name:"Gray 700",value:"color-gray-700"},{name:"Gray 900",value:"color-gray-900"},{name:"White",value:"color-white"},{name:"Black",value:"color-black"},{name:"Transparent",value:"transparent"}],ra=({id:e,name:t,label:o,placeholder:r="Select a color",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",shadow:u,error:p=!1,isDisabled:h=!1,isReadOnly:m=!1,isFocused:x=!1,isHovered:f=!1,predefinedColors:b=fu,showCustomInput:y=!0,showRecentColors:k=!0,isOpen:j=!1,selectedColor:S="",recentColors:C=[],customColor:w="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:R=()=>{},handleCustomColorSubmit:E=()=>{},setIsFocused:_=()=>{},setIsHovered:T=()=>{},triggerRef:$,dropdownRef:D,onChange:z,...V})=>{const{getColor:W}=s.useTheme(),P={...st.container,...i==null?void 0:i.container},L={...st.trigger,...gu[l],...hu[d],...mu[c],...p&&{borderColor:"color-red-500"},...h&&{opacity:.6,cursor:"not-allowed"},...x&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...f&&!h&&{borderColor:"color-gray-400"},...i==null?void 0:i.trigger,...u&&u},H={...st.dropdown,...i==null?void 0:i.dropdown},B={...st.colorGrid,...i==null?void 0:i.colorGrid},F={...st.recentColors,...i==null?void 0:i.recentColors},A=S||"color-gray-200";return n.jsxs(s.View,{...P,...V,children:[o&&n.jsx(jt,{htmlFor:e,size:l,isDisabled:h,error:p,views:i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:$,onClick:h||m?void 0:I,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),onFocus:()=>_(!0),onBlur:()=>_(!1),tabIndex:h?-1:0,role:"button","aria-expanded":j,"aria-haspopup":"listbox","aria-label":o||r,width:"fit-content",gap:8,...L,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:A,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!m&&!h&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:j?"up":"down"})]}),j&&n.jsxs(s.View,{ref:D,...H,children:[n.jsx(s.View,{...B,children:b.map((O,Y)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:O.value,borderWidth:"2px",borderStyle:"solid",borderColor:S===O.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O.value),title:O.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...i==null?void 0:i.colorSwatch},Y))}),k&&C.length>0&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:4,flexWrap:"wrap",...F,children:C.map((O,Y)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:O,borderWidth:"1px",borderStyle:"solid",borderColor:S===O?"color-blue-500":"color-gray-300",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>M(O),title:O,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"}},Y))})]}),y&&n.jsxs(s.Vertical,{gap:8,marginTop:"16px",children:[n.jsx(s.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),n.jsxs(s.Horizontal,{gap:8,children:[n.jsx(wt,{value:w,onChange:O=>R(O.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:i==null?void 0:i.customInput}),n.jsx(s.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:E,_hover:{backgroundColor:"color-blue-600"},children:n.jsx(s.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),a&&n.jsx(s.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a}),p&&typeof p=="string"&&n.jsx(s.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...i==null?void 0:i.error,children:p})]})},xu=e=>{const t=oa(e);return n.jsx(ra,{...t,...e})},bu=xu,_o=[{name:"Afghanistan",dial_code:"+93",emoji:"🇦🇫",code:"AF"},{name:"Aland Islands",dial_code:"+358",emoji:"🇦🇽",code:"AX"},{name:"Albania",dial_code:"+355",emoji:"🇦🇱",code:"AL"},{name:"Algeria",dial_code:"+213",emoji:"🇩🇿",code:"DZ"},{name:"AmericanSamoa",dial_code:"+1684",emoji:"🇦🇸",code:"AS"},{name:"Andorra",dial_code:"+376",emoji:"🇦🇩",code:"AD"},{name:"Angola",dial_code:"+244",emoji:"🇦🇴",code:"AO"},{name:"Anguilla",dial_code:"+1264",emoji:"🇦🇮",code:"AI"},{name:"Antarctica",dial_code:"+672",emoji:"🇦🇶",code:"AQ"},{name:"Antigua and Barbuda",dial_code:"+1268",emoji:"🇦🇬",code:"AG"},{name:"Argentina",dial_code:"+54",emoji:"🇦🇷",code:"AR"},{name:"Armenia",dial_code:"+374",emoji:"🇦🇲",code:"AM"},{name:"Aruba",dial_code:"+297",emoji:"🇦🇼",code:"AW"},{name:"Australia",dial_code:"+61",emoji:"🇦🇺",code:"AU"},{name:"Austria",dial_code:"+43",emoji:"🇦🇹",code:"AT"},{name:"Azerbaijan",dial_code:"+994",emoji:"🇦🇿",code:"AZ"},{name:"Bahamas",dial_code:"+1242",emoji:"🇧🇸",code:"BS"},{name:"Bahrain",dial_code:"+973",emoji:"🇧🇭",code:"BH"},{name:"Bangladesh",dial_code:"+880",emoji:"🇧🇩",code:"BD"},{name:"Barbados",dial_code:"+1246",emoji:"🇧🇧",code:"BB"},{name:"Belarus",dial_code:"+375",emoji:"🇧🇾",code:"BY"},{name:"Belgium",dial_code:"+32",emoji:"🇧🇪",code:"BE"},{name:"Belize",dial_code:"+501",emoji:"🇧🇿",code:"BZ"},{name:"Benin",dial_code:"+229",emoji:"🇧🇯",code:"BJ"},{name:"Bermuda",dial_code:"+1441",emoji:"🇧🇲",code:"BM"},{name:"Bhutan",dial_code:"+975",emoji:"🇧🇹",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"+591",emoji:"🇧🇴",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"+387",emoji:"🇧🇦",code:"BA"},{name:"Botswana",dial_code:"+267",emoji:"🇧🇼",code:"BW"},{name:"Brazil",dial_code:"+55",emoji:"🇧🇷",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"+246",emoji:"🇮🇴",code:"IO"},{name:"Brunei Darussalam",dial_code:"+673",emoji:"🇧🇳",code:"BN"},{name:"Bulgaria",dial_code:"+359",emoji:"🇧🇬",code:"BG"},{name:"Burkina Faso",dial_code:"+226",emoji:"🇧🇫",code:"BF"},{name:"Burundi",dial_code:"+257",emoji:"🇧🇮",code:"BI"},{name:"Cambodia",dial_code:"+855",emoji:"🇰🇭",code:"KH"},{name:"Cameroon",dial_code:"+237",emoji:"🇨🇲",code:"CM"},{name:"Canada",dial_code:"+1",emoji:"🇨🇦",code:"CA"},{name:"Cape Verde",dial_code:"+238",emoji:"🇨🇻",code:"CV"},{name:"Cayman Islands",dial_code:"+345",emoji:"🇰🇾",code:"KY"},{name:"Central African Republic",dial_code:"+236",emoji:"🇨🇫",code:"CF"},{name:"Chad",dial_code:"+235",emoji:"🇹🇩",code:"TD"},{name:"Chile",dial_code:"+56",emoji:"🇨🇱",code:"CL"},{name:"China",dial_code:"+86",emoji:"🇨🇳",code:"CN"},{name:"Christmas Island",dial_code:"+61",emoji:"🇨🇽",code:"CX"},{name:"Cocos (Keeling) Islands",dial_code:"+61",emoji:"🇨🇨",code:"CC"},{name:"Colombia",dial_code:"+57",emoji:"🇨🇴",code:"CO"},{name:"Comoros",dial_code:"+269",emoji:"🇰🇲",code:"KM"},{name:"Congo",dial_code:"+242",emoji:"🇨🇬",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",emoji:"🇨🇩",code:"CD"},{name:"Cook Islands",dial_code:"+682",emoji:"🇨🇰",code:"CK"},{name:"Costa Rica",dial_code:"+506",emoji:"🇨🇷",code:"CR"},{name:"Cote d'Ivoire",dial_code:"+225",emoji:"🇨🇮",code:"CI"},{name:"Croatia",dial_code:"+385",emoji:"🇭🇷",code:"HR"},{name:"Cuba",dial_code:"+53",emoji:"🇨🇺",code:"CU"},{name:"Cyprus",dial_code:"+357",emoji:"🇨🇾",code:"CY"},{name:"Czech Republic",dial_code:"+420",emoji:"🇨🇿",code:"CZ"},{name:"Denmark",dial_code:"+45",emoji:"🇩🇰",code:"DK"},{name:"Djibouti",dial_code:"+253",emoji:"🇩🇯",code:"DJ"},{name:"Dominica",dial_code:"+1767",emoji:"🇩🇲",code:"DM"},{name:"Dominican Republic",dial_code:"+1849",emoji:"🇩🇴",code:"DO"},{name:"Ecuador",dial_code:"+593",emoji:"🇪🇨",code:"EC"},{name:"Egypt",dial_code:"+20",emoji:"🇪🇬",code:"EG"},{name:"El Salvador",dial_code:"+503",emoji:"🇸🇻",code:"SV"},{name:"Equatorial Guinea",dial_code:"+240",emoji:"🇬🇶",code:"GQ"},{name:"Eritrea",dial_code:"+291",emoji:"🇪🇷",code:"ER"},{name:"Estonia",dial_code:"+372",emoji:"🇪🇪",code:"EE"},{name:"Ethiopia",dial_code:"+251",emoji:"🇪🇹",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",emoji:"🇫🇰",code:"FK"},{name:"Faroe Islands",dial_code:"+298",emoji:"🇫🇴",code:"FO"},{name:"Fiji",dial_code:"+679",emoji:"🇫🇯",code:"FJ"},{name:"Finland",dial_code:"+358",emoji:"🇫🇮",code:"FI"},{name:"France",dial_code:"+33",emoji:"🇫🇷",code:"FR"},{name:"French Guiana",dial_code:"+594",emoji:"🇬🇫",code:"GF"},{name:"French Polynesia",dial_code:"+689",emoji:"🇵🇫",code:"PF"},{name:"Gabon",dial_code:"+241",emoji:"🇬🇦",code:"GA"},{name:"Gambia",dial_code:"+220",emoji:"🇬🇲",code:"GM"},{name:"Georgia",dial_code:"+995",emoji:"🇬🇪",code:"GE"},{name:"Germany",dial_code:"+49",emoji:"🇩🇪",code:"DE"},{name:"Ghana",dial_code:"+233",emoji:"🇬🇭",code:"GH"},{name:"Gibraltar",dial_code:"+350",emoji:"🇬🇮",code:"GI"},{name:"Greece",dial_code:"+30",emoji:"🇬🇷",code:"GR"},{name:"Greenland",dial_code:"+299",emoji:"🇬🇱",code:"GL"},{name:"Grenada",dial_code:"+1473",emoji:"🇬🇩",code:"GD"},{name:"Guadeloupe",dial_code:"+590",emoji:"🇬🇵",code:"GP"},{name:"Guam",dial_code:"+1671",emoji:"🇬🇺",code:"GU"},{name:"Guatemala",dial_code:"+502",emoji:"🇬🇹",code:"GT"},{name:"Guernsey",dial_code:"+44",emoji:"🇬🇬",code:"GG"},{name:"Guinea",dial_code:"+224",emoji:"🇬🇳",code:"GN"},{name:"Guinea-Bissau",dial_code:"+245",emoji:"🇬🇼",code:"GW"},{name:"Guyana",dial_code:"+595",emoji:"🇬🇾",code:"GY"},{name:"Haiti",dial_code:"+509",emoji:"🇭🇹",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"+379",emoji:"🇻🇦",code:"VA"},{name:"Honduras",dial_code:"+504",emoji:"🇭🇳",code:"HN"},{name:"Hong Kong",dial_code:"+852",emoji:"🇭🇰",code:"HK"},{name:"Hungary",dial_code:"+36",emoji:"🇭🇺",code:"HU"},{name:"Iceland",dial_code:"+354",emoji:"🇮🇸",code:"IS"},{name:"India",dial_code:"+91",emoji:"🇮🇳",code:"IN"},{name:"Indonesia",dial_code:"+62",emoji:"🇮🇩",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",emoji:"🇮🇷",code:"IR"},{name:"Iraq",dial_code:"+964",emoji:"🇮🇷",code:"IQ"},{name:"Ireland",dial_code:"+353",emoji:"🇮🇪",code:"IE"},{name:"Isle of Man",dial_code:"+44",emoji:"🇮🇲",code:"IM"},{name:"Israel",dial_code:"+972",emoji:"🇮🇱",code:"IL"},{name:"Italy",dial_code:"+39",emoji:"🇮🇹",code:"IT"},{name:"Jamaica",dial_code:"+1876",emoji:"🇯🇲",code:"JM"},{name:"Japan",dial_code:"+81",emoji:"🇯🇵",code:"JP"},{name:"Jersey",dial_code:"+44",emoji:"🇯🇪",code:"JE"},{name:"Jordan",dial_code:"+962",emoji:"🇯🇴",code:"JO"},{name:"Kazakhstan",dial_code:"+77",emoji:"🇰🇿",code:"KZ"},{name:"Kenya",dial_code:"+254",emoji:"🇰🇪",code:"KE"},{name:"Kiribati",dial_code:"+686",emoji:"🇰🇮",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",emoji:"🇰🇵",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"+82",emoji:"🇰🇷",code:"KR"},{name:"Kuwait",dial_code:"+965",emoji:"🇰🇼",code:"KW"},{name:"Kyrgyzstan",dial_code:"+996",emoji:"🇰🇬",code:"KG"},{name:"Laos",dial_code:"+856",emoji:"🇱🇦",code:"LA"},{name:"Latvia",dial_code:"+371",emoji:"🇱🇻",code:"LV"},{name:"Lebanon",dial_code:"+961",emoji:"🇱🇧",code:"LB"},{name:"Lesotho",dial_code:"+266",emoji:"🇱🇸",code:"LS"},{name:"Liberia",dial_code:"+231",emoji:"🇱🇷",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",emoji:"🇱🇾",code:"LY"},{name:"Liechtenstein",dial_code:"+423",emoji:"🇱🇮",code:"LI"},{name:"Lithuania",dial_code:"+370",emoji:"🇱🇹",code:"LT"},{name:"Luxembourg",dial_code:"+352",emoji:"🇱🇺",code:"LU"},{name:"Macao",dial_code:"+853",emoji:"🇲🇴",code:"MO"},{name:"Macedonia",dial_code:"+389",emoji:"🇲🇰",code:"MK"},{name:"Madagascar",dial_code:"+261",emoji:"🇲🇬",code:"MG"},{name:"Malawi",dial_code:"+265",emoji:"🇲🇼",code:"MW"},{name:"Malaysia",dial_code:"+60",emoji:"🇲🇾",code:"MY"},{name:"Maldives",dial_code:"+960",emoji:"🇲🇻",code:"MV"},{name:"Mali",dial_code:"+223",emoji:"🇲🇱",code:"ML"},{name:"Malta",dial_code:"+356",emoji:"🇲🇹",code:"MT"},{name:"Marshall Islands",dial_code:"+692",emoji:"🇲🇭",code:"MH"},{name:"Martinique",dial_code:"+596",emoji:"🇲🇶",code:"MQ"},{name:"Mauritania",dial_code:"+222",emoji:"🇲🇷",code:"MR"},{name:"Mauritius",dial_code:"+230",emoji:"🇲🇺",code:"MU"},{name:"Mayotte",dial_code:"+262",emoji:"🇾🇹",code:"YT"},{name:"Mexico",dial_code:"+52",emoji:"🇲🇽",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",emoji:"🇫🇲",code:"FM"},{name:"Moldova",dial_code:"+373",emoji:"🇲🇩",code:"MD"},{name:"Monaco",dial_code:"+377",emoji:"🇲🇨",code:"MC"},{name:"Mongolia",dial_code:"+976",emoji:"🇲🇳",code:"MN"},{name:"Montenegro",dial_code:"+382",emoji:"🇲🇪",code:"ME"},{name:"Montserrat",dial_code:"+1664",emoji:"🇲🇸",code:"MS"},{name:"Morocco",dial_code:"+212",emoji:"🇲🇦",code:"MA"},{name:"Mozambique",dial_code:"+258",emoji:"🇲🇿",code:"MZ"},{name:"Myanmar",dial_code:"+95",emoji:"🇲🇲",code:"MM"},{name:"Namibia",emoji:"🇳🇦",dial_code:"+264",code:"NA"},{name:"Nauru",dial_code:"+674",emoji:"🇳🇷",code:"NR"},{name:"Nepal",dial_code:"+977",emoji:"🇳🇵",code:"NP"},{name:"Netherlands",dial_code:"+31",emoji:"🇳🇱",code:"NL"},{name:"Netherlands Antilles",dial_code:"+599",emoji:"🇧🇶",code:"AN"},{name:"New Caledonia",dial_code:"+687",emoji:"🇳🇨",code:"NC"},{name:"New Zealand",dial_code:"+64",emoji:"🇳🇿",code:"NZ"},{name:"Nicaragua",dial_code:"+505",emoji:"🇳🇮",code:"NI"},{name:"Niger",dial_code:"+227",emoji:"🇳🇪",code:"NE"},{name:"Nigeria",dial_code:"+234",emoji:"🇳🇬",code:"NG"},{name:"Niue",dial_code:"+683",emoji:"🇳🇺",code:"NU"},{name:"Norfolk Island",dial_code:"+672",emoji:"🇳🇫",code:"NF"},{name:"Northern Mariana Islands",dial_code:"+1670",emoji:"🇲🇵",code:"MP"},{name:"Norway",dial_code:"+47",emoji:"🇳🇴",code:"NO"},{name:"Oman",dial_code:"+968",emoji:"🇴🇲",code:"OM"},{name:"Pakistan",dial_code:"+92",emoji:"🇵🇰",code:"PK"},{name:"Palau",dial_code:"+680",emoji:"🇵🇼",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",emoji:"🇵🇸",code:"PS"},{name:"Panama",dial_code:"+507",emoji:"🇵🇦",code:"PA"},{name:"Papua New Guinea",dial_code:"+675",emoji:"🇵🇬",code:"PG"},{name:"Paraguay",dial_code:"+595",emoji:"🇵🇾",code:"PY"},{name:"Peru",dial_code:"+51",emoji:"🇵🇪",code:"PE"},{name:"Philippines",dial_code:"+63",emoji:"🇵🇭",code:"PH"},{name:"Pitcairn",dial_code:"+872",emoji:"🇵🇳",code:"PN"},{name:"Poland",dial_code:"+48",emoji:"🇵🇱",code:"PL"},{name:"Portugal",dial_code:"+351",emoji:"🇵🇹",code:"PT"},{name:"Puerto Rico",dial_code:"+1939",emoji:"🇵🇷",code:"PR"},{name:"Qatar",dial_code:"+974",emoji:"🇶🇦",code:"QA"},{name:"Romania",dial_code:"+40",emoji:"🇷🇴",code:"RO"},{name:"Russia",dial_code:"+7",emoji:"🇷🇺",code:"RU"},{name:"Rwanda",dial_code:"+250",emoji:"🇷🇼",code:"RW"},{name:"Reunion",dial_code:"+262",emoji:"🇷🇪",code:"RE"},{name:"Saint Barthelemy",dial_code:"+590",emoji:"🇧🇱",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",emoji:"🇸🇭",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"+1869",emoji:"🇰🇳",code:"KN"},{name:"Saint Lucia",dial_code:"+1758",emoji:"🇱🇨",code:"LC"},{name:"Saint Martin",dial_code:"+590",emoji:"🇲🇫",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",emoji:"🇵🇲",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",emoji:"🇻🇨",code:"VC"},{name:"Samoa",dial_code:"+685",emoji:"🇼🇸",code:"WS"},{name:"San Marino",dial_code:"+378",emoji:"🇸🇲",code:"SM"},{name:"Sao Tome and Principe",dial_code:"+239",emoji:"🇸🇹",code:"ST"},{name:"Saudi Arabia",dial_code:"+966",emoji:"🇸🇦",code:"SA"},{name:"Senegal",dial_code:"+221",emoji:"🇸🇳",code:"SN"},{name:"Serbia",dial_code:"+381",emoji:"🇷🇸",code:"RS"},{name:"Seychelles",dial_code:"+248",emoji:"🇸🇨",code:"SC"},{name:"Sierra Leone",dial_code:"+232",emoji:"🇸🇱",code:"SL"},{name:"Singapore",dial_code:"+65",emoji:"🇸🇬",code:"SG"},{name:"Slovakia",dial_code:"+421",emoji:"🇸🇰",code:"SK"},{name:"Slovenia",dial_code:"+386",emoji:"🇸🇮",code:"SI"},{name:"Solomon Islands",dial_code:"+677",emoji:"🇸🇧",code:"SB"},{name:"Somalia",dial_code:"+252",emoji:"🇸🇴",code:"SO"},{name:"South Africa",dial_code:"+27",emoji:"🇿🇦",code:"ZA"},{name:"South Sudan",dial_code:"+211",emoji:"🇸🇸",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",emoji:"🇬🇸",code:"GS"},{name:"Spain",dial_code:"+34",emoji:"🇪🇸",code:"ES"},{name:"Sri Lanka",dial_code:"+94",emoji:"🇱🇰",code:"LK"},{name:"Sudan",dial_code:"+249",emoji:"🇸🇩",code:"SD"},{name:"Suriname",dial_code:"+597",emoji:"🇸🇷",code:"SR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",emoji:"🇸🇯",code:"SJ"},{name:"Swaziland",dial_code:"+268",emoji:"🇸🇿",code:"SZ"},{name:"Sweden",dial_code:"+46",emoji:"🇸🇪",code:"SE"},{name:"Switzerland",dial_code:"+41",emoji:"🇨🇭",code:"CH"},{name:"Syrian Arab Republic",dial_code:"+963",emoji:"🇸🇾",code:"SY"},{name:"Taiwan",dial_code:"+886",emoji:"🇹🇼",code:"TW"},{name:"Tajikistan",dial_code:"+992",emoji:"🇹🇯",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",emoji:"🇹🇿",code:"TZ"},{name:"Thailand",dial_code:"+66",emoji:"🇹🇭",code:"TH"},{name:"Timor-Leste",dial_code:"+670",emoji:"🇹🇱",code:"TL"},{name:"Togo",dial_code:"+228",emoji:"🇹🇬",code:"TG"},{name:"Tokelau",dial_code:"+690",emoji:"🇹🇰",code:"TK"},{name:"Tonga",dial_code:"+676",emoji:"🇹🇴",code:"TO"},{name:"Trinidad and Tobago",dial_code:"+1868",emoji:"🇹🇹",code:"TT"},{name:"Tunisia",dial_code:"+216",emoji:"🇹🇳",code:"TN"},{name:"Turkey",dial_code:"+90",emoji:"🇹🇷",code:"TR"},{name:"Turkmenistan",dial_code:"+993",emoji:"🇹🇲",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"+1649",emoji:"🇹🇨",code:"TC"},{name:"Tuvalu",dial_code:"+688",emoji:"🇹🇻",code:"TV"},{name:"Uganda",dial_code:"+256",emoji:"🇺🇬",code:"UG"},{name:"Ukraine",dial_code:"+380",emoji:"🇺🇦",code:"UA"},{name:"United Arab Emirates",dial_code:"+971",emoji:"🇦🇪",code:"AE"},{name:"United Kingdom",dial_code:"+44",emoji:"🇬🇧",code:"GB"},{name:"United States",dial_code:"+1",emoji:"🇺🇸",code:"US"},{name:"Uruguay",dial_code:"+598",emoji:"🇺🇾",code:"UY"},{name:"Uzbekistan",dial_code:"+998",emoji:"🇺🇿",code:"UZ"},{name:"Vanuatu",dial_code:"+678",emoji:"🇻🇺",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",emoji:"🇻🇪",code:"VE"},{name:"Vietnam",dial_code:"+84",emoji:"🇻🇳",code:"VN"},{name:"Virgin Islands, British",dial_code:"+1284",emoji:"🇻🇬",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"+1340",emoji:"🇻🇮",code:"VI"},{name:"Wallis and Futuna",dial_code:"+681",emoji:"🇼🇫",code:"WF"},{name:"Yemen",dial_code:"+967",emoji:"🇾🇪",code:"YE"},{name:"Zambia",dial_code:"+260",emoji:"🇿🇲",code:"ZM"},{name:"Zimbabwe",dial_code:"+263",emoji:"🇿🇼",code:"ZW"}],na=({placeholder:e})=>{const[t,o]=g.useState(_o),[r,a]=g.useState(e??_o[0].name),[i,l]=g.useState(!0),[d,c]=g.useState(!1),[u,p]=g.useState(!1);return{hide:i,setHide:l,newOptions:t,setNewOptions:o,isHovered:u,setIsHovered:p,isFocused:d,setIsFocused:c,value:r,setValue:a}},Vr={xs:8,sm:10,md:12,lg:14,xl:16},yu=({size:e,...t})=>n.jsx(s.Element,{as:"ul",...t}),ku=e=>n.jsx(s.Input,{type:"country",...e}),Cu=({size:e,...t})=>n.jsx(s.Element,{as:"li",...t}),ju=({option:e,size:t="md",callback:o=()=>{},views:r={text:{}}})=>{const a=i=>{i&&i.stopPropagation&&i.stopPropagation(),o(e)};return n.jsx(Cu,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:a,fontSize:s.Typography.fontSizes[t],_hover:{opacity:.8},...r.text,children:e})},Su=({size:e,views:t={dropDown:{}},options:o=[],callback:r=()=>{}})=>{const a=i=>r(i);return n.jsx(yu,{role:"dropDown",margin:0,padding:0,top:"100%",width:"100%",display:"flex",zIndex:1e3,overflow:"auto",maxHeight:"300px",borderRadius:4,position:"absolute",flexDirection:"column",backgroundColor:"color-white",boxShadow:"rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px",...t.dropDown,children:o.map(i=>n.jsx(ju,{size:e,option:i.name,callback:a,...t.text},i.code))})},aa=({id:e,name:t,label:o,value:r,placeholder:a,helperText:i,hide:l=!1,error:d=!1,isHovered:c=!1,isFocused:u=!1,isAutoFocus:p=!1,isDisabled:h=!1,isReadOnly:m=!1,shadow:x={},newOptions:f=[],size:b="md",variant:y="default",shape:k="default",onChange:j,onBlur:S=()=>{},setHide:C=()=>{},setNewOptions:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:R=()=>{},views:E={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:_,...T})=>{const{getColor:$,themeMode:D}=s.useTheme(),z=$("color-blueGray-700",{themeMode:_||D}),V=()=>M(!0),W=A=>{C(!l),R(A),j&&j(A)},P=()=>{!h&&!m&&C(!l)},L=A=>{const O=A.target.value,Y=_o.filter(X=>X.name.toLowerCase().startsWith(O.toLowerCase()));l&&C(!1),w(Y),j&&j(O)},H=A=>{S(A),M(!1)},B=!!(o&&(u||r)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:s.Typography.fontSizes[b],backgroundColor:"transparent",color:h?"color-trueGray-600":"color-blueGray-700",cursor:h?"not-allowed":m?"auto":"pointer",...E.field};return n.jsxs(Te,{helperText:i,error:d,views:E,onClick:P,children:[n.jsxs(Ve,{label:o,size:b,error:d,shape:k,views:E,shadow:x,variant:y,value:r,color:"theme-primary",isDisabled:h,isReadOnly:m,isFocused:u,showLabel:B,_hover:!h&&!d?{borderColor:"theme-primary"}:void 0,children:[n.jsxs(rt,{children:[B&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:d,...E,children:o}),n.jsx(ku,{id:e,name:t,placeholder:a,readOnly:m,disabled:h,autoFocus:p,onBlur:H,onFocus:V,...F,...T,value:r,onChange:L})]}),n.jsx(cr,{children:l?n.jsx(ie,{orientation:"down",widthHeight:Vr[b],color:z,style:E.icon}):n.jsx(ie,{orientation:"up",widthHeight:Vr[b],color:z,style:E.icon})})]}),!l&&n.jsx(Su,{size:b,views:E,options:f,callback:W})]})},wu=e=>{const t=na(e);return n.jsx(aa,{...t,...e})},Iu=wu;function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function he(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Tu(e){return he(1,arguments),e instanceof Date||Xt(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function je(e){he(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Xt(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Mu(e){if(he(1,arguments),!Tu(e)&&typeof e!="number")return!1;var t=je(e);return!isNaN(Number(t))}function De(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ru(e,t){he(2,arguments);var o=je(e).getTime(),r=De(t);return new Date(o+r)}function zu(e,t){he(2,arguments);var o=De(t);return Ru(e,-o)}var Eu=864e5;function Vu(e){he(1,arguments);var t=je(e),o=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=o-r;return Math.floor(a/Eu)+1}function Kt(e){he(1,arguments);var t=1,o=je(e),r=o.getUTCDay(),a=(r<t?7:0)+r-t;return o.setUTCDate(o.getUTCDate()-a),o.setUTCHours(0,0,0,0),o}function ia(e){he(1,arguments);var t=je(e),o=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(o+1,0,4),r.setUTCHours(0,0,0,0);var a=Kt(r),i=new Date(0);i.setUTCFullYear(o,0,4),i.setUTCHours(0,0,0,0);var l=Kt(i);return t.getTime()>=a.getTime()?o+1:t.getTime()>=l.getTime()?o:o-1}function Pu(e){he(1,arguments);var t=ia(e),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var r=Kt(o);return r}var Wu=6048e5;function _u(e){he(1,arguments);var t=je(e),o=Kt(t).getTime()-Pu(t).getTime();return Math.round(o/Wu)+1}var $u={};function po(){return $u}function Qt(e,t){var o,r,a,i,l,d,c,u;he(1,arguments);var p=po(),h=De((o=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:p.weekStartsOn)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&o!==void 0?o:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=je(e),x=m.getUTCDay(),f=(x<h?7:0)+x-h;return m.setUTCDate(m.getUTCDate()-f),m.setUTCHours(0,0,0,0),m}function la(e,t){var o,r,a,i,l,d,c,u;he(1,arguments);var p=je(e),h=p.getUTCFullYear(),m=po(),x=De((o=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:m.firstWeekContainsDate)!==null&&r!==void 0?r:(c=m.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setUTCFullYear(h+1,0,x),f.setUTCHours(0,0,0,0);var b=Qt(f,t),y=new Date(0);y.setUTCFullYear(h,0,x),y.setUTCHours(0,0,0,0);var k=Qt(y,t);return p.getTime()>=b.getTime()?h+1:p.getTime()>=k.getTime()?h:h-1}function Lu(e,t){var o,r,a,i,l,d,c,u;he(1,arguments);var p=po(),h=De((o=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(l=t.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:1),m=la(e,t),x=new Date(0);x.setUTCFullYear(m,0,h),x.setUTCHours(0,0,0,0);var f=Qt(x,t);return f}var Du=6048e5;function Hu(e,t){he(1,arguments);var o=je(e),r=Qt(o,t).getTime()-Lu(o,t).getTime();return Math.round(r/Du)+1}function te(e,t){for(var o=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return o+r}var Me={y:function(t,o){var r=t.getUTCFullYear(),a=r>0?r:1-r;return te(o==="yy"?a%100:a,o.length)},M:function(t,o){var r=t.getUTCMonth();return o==="M"?String(r+1):te(r+1,2)},d:function(t,o){return te(t.getUTCDate(),o.length)},a:function(t,o){var r=t.getUTCHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,o){return te(t.getUTCHours()%12||12,o.length)},H:function(t,o){return te(t.getUTCHours(),o.length)},m:function(t,o){return te(t.getUTCMinutes(),o.length)},s:function(t,o){return te(t.getUTCSeconds(),o.length)},S:function(t,o){var r=o.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return te(i,o.length)}},Oe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bu={G:function(t,o,r){var a=t.getUTCFullYear()>0?1:0;switch(o){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,o,r){if(o==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return Me.y(t,o)},Y:function(t,o,r,a){var i=la(t,a),l=i>0?i:1-i;if(o==="YY"){var d=l%100;return te(d,2)}return o==="Yo"?r.ordinalNumber(l,{unit:"year"}):te(l,o.length)},R:function(t,o){var r=ia(t);return te(r,o.length)},u:function(t,o){var r=t.getUTCFullYear();return te(r,o.length)},Q:function(t,o,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(o){case"Q":return String(a);case"QQ":return te(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,o,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(o){case"q":return String(a);case"qq":return te(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,o,r){var a=t.getUTCMonth();switch(o){case"M":case"MM":return Me.M(t,o);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,o,r){var a=t.getUTCMonth();switch(o){case"L":return String(a+1);case"LL":return te(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,o,r,a){var i=Hu(t,a);return o==="wo"?r.ordinalNumber(i,{unit:"week"}):te(i,o.length)},I:function(t,o,r){var a=_u(t);return o==="Io"?r.ordinalNumber(a,{unit:"week"}):te(a,o.length)},d:function(t,o,r){return o==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Me.d(t,o)},D:function(t,o,r){var a=Vu(t);return o==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):te(a,o.length)},E:function(t,o,r){var a=t.getUTCDay();switch(o){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,o,r,a){var i=t.getUTCDay(),l=(i-a.weekStartsOn+8)%7||7;switch(o){case"e":return String(l);case"ee":return te(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,o,r,a){var i=t.getUTCDay(),l=(i-a.weekStartsOn+8)%7||7;switch(o){case"c":return String(l);case"cc":return te(l,o.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,o,r){var a=t.getUTCDay(),i=a===0?7:a;switch(o){case"i":return String(i);case"ii":return te(i,o.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,o,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(o){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,o,r){var a=t.getUTCHours(),i;switch(a===12?i=Oe.noon:a===0?i=Oe.midnight:i=a/12>=1?"pm":"am",o){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,o,r){var a=t.getUTCHours(),i;switch(a>=17?i=Oe.evening:a>=12?i=Oe.afternoon:a>=4?i=Oe.morning:i=Oe.night,o){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,o,r){if(o==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return Me.h(t,o)},H:function(t,o,r){return o==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Me.H(t,o)},K:function(t,o,r){var a=t.getUTCHours()%12;return o==="Ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,o.length)},k:function(t,o,r){var a=t.getUTCHours();return a===0&&(a=24),o==="ko"?r.ordinalNumber(a,{unit:"hour"}):te(a,o.length)},m:function(t,o,r){return o==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Me.m(t,o)},s:function(t,o,r){return o==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Me.s(t,o)},S:function(t,o){return Me.S(t,o)},X:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();if(l===0)return"Z";switch(o){case"X":return Wr(l);case"XXXX":case"XX":return $e(l);case"XXXXX":case"XXX":default:return $e(l,":")}},x:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"x":return Wr(l);case"xxxx":case"xx":return $e(l);case"xxxxx":case"xxx":default:return $e(l,":")}},O:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"O":case"OO":case"OOO":return"GMT"+Pr(l,":");case"OOOO":default:return"GMT"+$e(l,":")}},z:function(t,o,r,a){var i=a._originalDate||t,l=i.getTimezoneOffset();switch(o){case"z":case"zz":case"zzz":return"GMT"+Pr(l,":");case"zzzz":default:return"GMT"+$e(l,":")}},t:function(t,o,r,a){var i=a._originalDate||t,l=Math.floor(i.getTime()/1e3);return te(l,o.length)},T:function(t,o,r,a){var i=a._originalDate||t,l=i.getTime();return te(l,o.length)}};function Pr(e,t){var o=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return o+String(a);var l=t;return o+String(a)+l+te(i,2)}function Wr(e,t){if(e%60===0){var o=e>0?"-":"+";return o+te(Math.abs(e)/60,2)}return $e(e,t)}function $e(e,t){var o=t||"",r=e>0?"-":"+",a=Math.abs(e),i=te(Math.floor(a/60),2),l=te(a%60,2);return r+i+o+l}var _r=function(t,o){switch(t){case"P":return o.date({width:"short"});case"PP":return o.date({width:"medium"});case"PPP":return o.date({width:"long"});case"PPPP":default:return o.date({width:"full"})}},ca=function(t,o){switch(t){case"p":return o.time({width:"short"});case"pp":return o.time({width:"medium"});case"ppp":return o.time({width:"long"});case"pppp":default:return o.time({width:"full"})}},Au=function(t,o){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return _r(t,o);var l;switch(a){case"P":l=o.dateTime({width:"short"});break;case"PP":l=o.dateTime({width:"medium"});break;case"PPP":l=o.dateTime({width:"long"});break;case"PPPP":default:l=o.dateTime({width:"full"});break}return l.replace("{{date}}",_r(a,o)).replace("{{time}}",ca(i,o))},Fu={p:ca,P:Au};function Ou(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var vu=["D","DD"],Nu=["YY","YYYY"];function Uu(e){return vu.indexOf(e)!==-1}function qu(e){return Nu.indexOf(e)!==-1}function $r(e,t,o){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(o,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Gu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Yu=function(t,o,r){var a,i=Gu[t];return typeof i=="string"?a=i:o===1?a=i.one:a=i.other.replace("{{count}}",o.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function Co(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=t.width?String(t.width):e.defaultWidth,r=e.formats[o]||e.formats[e.defaultWidth];return r}}var Xu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ku={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ju={date:Co({formats:Xu,defaultWidth:"full"}),time:Co({formats:Ku,defaultWidth:"full"}),dateTime:Co({formats:Qu,defaultWidth:"full"})},Zu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ep=function(t,o,r,a){return Zu[t]};function dt(e){return function(t,o){var r=o!=null&&o.context?String(o.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=e.formattingValues[l]||e.formattingValues[i]}else{var d=e.defaultWidth,c=o!=null&&o.width?String(o.width):e.defaultWidth;a=e.values[c]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(t):t;return a[u]}}var tp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},op={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},np={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ap={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ip={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},lp=function(t,o){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},cp={ordinalNumber:lp,era:dt({values:tp,defaultWidth:"wide"}),quarter:dt({values:op,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:dt({values:rp,defaultWidth:"wide"}),day:dt({values:np,defaultWidth:"wide"}),dayPeriod:dt({values:ap,defaultWidth:"wide",formattingValues:ip,defaultFormattingWidth:"wide"})};function ut(e){return function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=o.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(d)?dp(d,function(h){return h.test(l)}):sp(d,function(h){return h.test(l)}),u;u=e.valueCallback?e.valueCallback(c):c,u=o.valueCallback?o.valueCallback(u):u;var p=t.slice(l.length);return{value:u,rest:p}}}function sp(e,t){for(var o in e)if(e.hasOwnProperty(o)&&t(e[o]))return o}function dp(e,t){for(var o=0;o<e.length;o++)if(t(e[o]))return o}function up(e){return function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var l=e.valueCallback?e.valueCallback(i[0]):i[0];l=o.valueCallback?o.valueCallback(l):l;var d=t.slice(a.length);return{value:l,rest:d}}}var pp=/^(\d+)(th|st|nd|rd)?/i,gp=/\d+/i,hp={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mp={any:[/^b/i,/^(a|c)/i]},fp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xp={any:[/1/i,/2/i,/3/i,/4/i]},bp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yp={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kp={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Cp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},jp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Sp={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},wp={ordinalNumber:up({matchPattern:pp,parsePattern:gp,valueCallback:function(t){return parseInt(t,10)}}),era:ut({matchPatterns:hp,defaultMatchWidth:"wide",parsePatterns:mp,defaultParseWidth:"any"}),quarter:ut({matchPatterns:fp,defaultMatchWidth:"wide",parsePatterns:xp,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ut({matchPatterns:bp,defaultMatchWidth:"wide",parsePatterns:yp,defaultParseWidth:"any"}),day:ut({matchPatterns:kp,defaultMatchWidth:"wide",parsePatterns:Cp,defaultParseWidth:"any"}),dayPeriod:ut({matchPatterns:jp,defaultMatchWidth:"any",parsePatterns:Sp,defaultParseWidth:"any"})},Ip={code:"en-US",formatDistance:Yu,formatLong:Ju,formatRelative:ep,localize:cp,match:wp,options:{weekStartsOn:0,firstWeekContainsDate:1}},Tp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rp=/^'([^]*?)'?$/,zp=/''/g,Ep=/[a-zA-Z]/;function Vp(e,t,o){var r,a,i,l,d,c,u,p,h,m,x,f,b,y;he(2,arguments);var k=String(t),j=po(),S=(r=(a=void 0)!==null&&a!==void 0?a:j.locale)!==null&&r!==void 0?r:Ip,C=De((i=(l=(d=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&d!==void 0?d:j.firstWeekContainsDate)!==null&&l!==void 0?l:(u=j.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=De((h=(m=(x=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&x!==void 0?x:j.weekStartsOn)!==null&&m!==void 0?m:(b=j.locale)===null||b===void 0||(y=b.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var I=je(e);if(!Mu(I))throw new RangeError("Invalid time value");var M=Ou(I),R=zu(I,M),E={firstWeekContainsDate:C,weekStartsOn:w,locale:S,_originalDate:I},_=k.match(Mp).map(function(T){var $=T[0];if($==="p"||$==="P"){var D=Fu[$];return D(T,S.formatLong)}return T}).join("").match(Tp).map(function(T){if(T==="''")return"'";var $=T[0];if($==="'")return Pp(T);var D=Bu[$];if(D)return qu(T)&&$r(T,t,String(e)),Uu(T)&&$r(T,t,String(e)),D(R,T,S.localize,E);if($.match(Ep))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return T}).join("");return _}function Pp(e){var t=e.match(Rp);return t?t[1].replace(zp,"'"):e}const sa=()=>{const[e,t]=g.useState(!1),[o,r]=g.useState(!1),[a,i]=g.useState(Vp(new Date,"yyyy-MM-dd"));return{date:a,setDate:i,isHovered:e,setIsHovered:t,isFocused:o,setIsFocused:r}},Wp=e=>n.jsx(s.Input,{type:"date",...e}),da=({id:e,icon:t,name:o,label:r,date:a,children:i,helperText:l,shadow:d={},size:c="md",variant:u="default",shape:p="default",views:h={container:{},label:{},helperText:{},text:{},field:{}},error:m=!1,isHovered:x=!1,isFocused:f=!1,isDisabled:b=!1,isReadOnly:y=!1,setDate:k=()=>{},setIsFocused:j=()=>{},setIsHovered:S=()=>{},onChange:C,onChangeText:w,...I})=>{const M=!!(f&&r),R=()=>S(!x),E=()=>j(!0),_=$=>{typeof $=="string"?(k($),w&&w($)):(k($.target.value),C&&C($.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:s.Typography.fontSizes[c],backgroundColor:"transparent",color:b?"color-trueGray-600":"color-blueGray-700",cursor:b?"not-allowed":y?"auto":"pointer",...h.field};return n.jsx(Te,{helperText:l,error:m,views:h,children:n.jsx(Ve,{label:r,size:c,error:m,shape:p,views:h,shadow:d,color:"theme-primary",variant:u,value:a,isHovered:x,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:M,onMouseEnter:R,onMouseLeave:R,children:n.jsxs(rt,{children:[M&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:m,...h,children:r}),n.jsx(Wp,{id:e,name:o,onFocus:E,disabled:b,readOnly:y,...T,...I,...w&&{onChangeText:_},onChange:_})]})})})},_p=e=>{const t=sa();return n.jsx(da,{...t,...e})},$p=_p,ua=e=>{const t=sr(e),[o,r]=g.useState(!1);return{isVisible:o,setIsVisible:r,...e,...t}},Lp=({visibleIcon:e=n.jsx(Go,{widthHeight:14}),hiddenIcon:t=n.jsx(qo,{widthHeight:14}),...o})=>{const{isVisible:r,setIsVisible:a,...i}=ua(o);return n.jsx(St,{...i,type:r?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{o.isDisabled||a(!r)},children:r?e:t})})},Dp=Lp,pa=(e,t,o)=>{const[r,a]=g.useState(e),[i,l]=g.useState(t?{value:t,label:t}:e[0]),[d,c]=g.useState([]),[u,p]=g.useState(0),[h,m]=g.useState(o??""),[x,f]=g.useState(!1);return{filteredItems:r,setFilteredItems:a,selectedItem:i,setSelectedItem:l,selectedItems:d,setSelectedItems:c,highlightedIndex:u,setHighlightedIndex:p,searchQuery:h,setSearchQuery:m,isDropdownVisible:x,setIsDropdownVisible:f}},Hp={maxHeight:"280px",overflowY:"auto",zIndex:1e3,backgroundColor:"color-white",borderRadius:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02)"},Lr={enter:{opacity:1,transform:"translateY(0) scale(1)",transition:"opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},initial:{opacity:0,transform:"translateY(-8px) scale(0.96)"}},Bp={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},Ap={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},Fp={padding:"24px 16px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},Dr={open:{transform:"rotate(180deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},closed:{transform:"rotate(0deg)",transition:"transform 0.2s cubic-bezier(0.16, 1, 0.3, 1)"}},Op={display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"color-gray-100",borderRadius:"4px",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},ga=({placeholder:e,items:t,showTick:o=!0,onSelect:r,searchEnabled:a=!0,left:i,right:l,label:d,filteredItems:c,setSelectedItem:u,selectedItem:p,selectedItems:h,setSelectedItems:m,highlightedIndex:x,setHighlightedIndex:f,searchQuery:b,setSearchQuery:y,setFilteredItems:k,views:j,isDropdownVisible:S,setIsDropdownVisible:C,isMulti:w=!1,...I})=>{const{ref:M,relation:R}=s.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),E=g.useRef(null),[_,T]=g.useState(!1),[$,D]=g.useState(!1),z=()=>{var O;const H=$?Lr.enter:Lr.initial;if(!M.current)return{};const B=M.current.getBoundingClientRect(),F={position:"fixed",left:B.left,width:B.width,zIndex:1e4,...H};return((O=R==null?void 0:R.space)==null?void 0:O.vertical)==="top"?{...F,bottom:window.innerHeight-B.top+6}:{...F,top:B.bottom+6}};g.useEffect(()=>{if(S){const H=setTimeout(()=>D(!0),10);return()=>clearTimeout(H)}D(!1)},[S]),g.useEffect(()=>{const H=B=>{!B.composedPath().some(O=>(O==null?void 0:O.id)==="combobox-dropdown")&&M.current&&!M.current.contains(B.target)&&C(!1)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const V=H=>{if(y(H),H==="")k(t);else{const B=t.filter(F=>F.label.toLowerCase().includes(H.toLowerCase()));k(B)}f(0)},W=H=>{if(w){const B=h.some(A=>A.value===H.value);let F;B?F=h.filter(A=>A.value!==H.value):F=[...h,H],m(F),r==null||r(F)}else u(H),r==null||r(H),C(!1)},P=(H,B)=>{H.stopPropagation();const F=h.filter(A=>A.value!==B.value);m(F),r==null||r(F)},L=H=>w?h.some(B=>B.value===H.value):H.value===p.value;return n.jsxs(s.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&n.jsx(s.Text,{views:j==null?void 0:j.label,htmlFor:I.id,children:d}),n.jsxs(s.View,{position:"relative",width:"100%",children:[n.jsx("div",{ref:M,onClick:()=>C(!S),style:{width:"100%"},children:n.jsxs(Ve,{isHovered:_,isFocused:S,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:j==null?void 0:j.container},children:[n.jsxs(s.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:w?"wrap":"nowrap",...j==null?void 0:j.labelContainer,children:[i,w?h.length>0?n.jsx(s.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:h.map(H=>n.jsxs(s.Horizontal,{...Op,_hover:{backgroundColor:"color-gray-200"},children:[H.icon&&n.jsx(s.View,{flexShrink:0,children:H.icon}),n.jsx(s.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:H.label}),n.jsx(ye,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:B=>P(B,H)})]},H.value))}):n.jsx(s.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...j==null?void 0:j.label,children:e}):n.jsxs(n.Fragment,{children:[p.icon&&p.label!==e&&n.jsx(s.View,{children:p.icon}),n.jsx(s.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...j==null?void 0:j.label,children:p.label})]})]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[l,n.jsx(s.View,{style:S?Dr.open:Dr.closed,children:n.jsx(ie,{widthHeight:16,orientation:"down",color:S?"color-gray-700":"color-gray-400"})})]})]})}),S&&n.jsx(vn,{children:n.jsxs(s.View,{ref:E,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...Hp,style:z(),...j==null?void 0:j.dropdown,children:[a&&n.jsx(s.View,{...Bp,children:n.jsx(St,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:b,onChange:H=>V(H),hint:e||"Search...",isClearable:!1,left:n.jsx(vt,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...j==null?void 0:j.text},field:{fontSize:"13px"}}})}),c.length>0&&n.jsx(s.View,{margin:0,padding:"4px",children:c.map((H,B)=>{const F=L(H),A=B===x;return n.jsxs(s.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...Ap,backgroundColor:F&&A?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":A?"color-gray-100":"transparent",onMouseEnter:()=>f(B),onClick:()=>W(H),...j==null?void 0:j.item,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[H.icon&&n.jsx(s.View,{flexShrink:0,children:H.icon}),n.jsx(s.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:H.label})]}),F&&o&&n.jsx(oo,{widthHeight:16,color:"theme-primary"})]},H.value)})}),c.length===0&&n.jsxs(s.Vertical,{...Fp,children:[n.jsx(vt,{widthHeight:24,color:"color-gray-300"}),n.jsx(s.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),n.jsx(s.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},vp=({id:e,name:t,items:o,placeholder:r,searchPlaceholder:a,...i})=>{const l=pa(o,r,a);return n.jsx(ga,{id:e,name:t,items:o,...l,...i})},Np=vp,ha=e=>{const{tags:t,defaultTags:o=[],onTagsChange:r,onTagAdd:a,onTagRemove:i,maxTags:l,minTagLength:d=1,maxTagLength:c=50,allowDuplicates:u=!1,separators:p=["enter","comma"],isDisabled:h=!1,isReadOnly:m=!1}=e,[x,f]=g.useState(""),[b,y]=g.useState(()=>(t||o||[]).map((z,V)=>({id:`tag-${V}-${Date.now()}`,value:z}))),[k,j]=g.useState(!1),[S,C]=g.useState(!1),w=t&&Array.isArray(t)?t.map((D,z)=>({id:`tag-${z}-${Date.now()}`,value:D})):b;g.useEffect(()=>{t&&Array.isArray(t)&&y(t.map((D,z)=>({id:`tag-${z}-${Date.now()}`,value:D})))},[t]);const I=g.useCallback(D=>{const z=D.trim();return!(z.length<d||z.length>c||!u&&w.map(W=>W.value.toLowerCase()).includes(z.toLowerCase())||l&&w.length>=l)},[w,d,c,u,l]),M=g.useCallback(D=>{if(h||m)return;const z=D.trim();if(!z||!I(z))return;const V={id:`tag-${Date.now()}-${Math.random()}`,value:z},W=[...w,V],P=W.map(L=>L.value);t||y(W),r==null||r(P),a==null||a(z),f("")},[w,I,r,a,h,m,t]),R=g.useCallback(D=>{if(h||m)return;const z=w[D];if(!z)return;const V=w.filter((P,L)=>L!==D),W=V.map(P=>P.value);t||y(V),r==null||r(W),i==null||i(z.value,D)},[w,r,i,h,m,t]),E=g.useCallback(D=>{if(h||m)return;const z=D.target.value;if(p.includes("comma")&&z.includes(",")){const V=z.split(","),W=V[0],P=V.slice(1).join(",");W.trim()&&M(W),f(P);return}f(z)},[M,p,h,m]),_=g.useCallback(D=>{if(h||m)return;const{key:z}=D;if(p.includes("enter")&&z==="Enter"){D.preventDefault(),x.trim()&&M(x);return}if(p.includes("tab")&&z==="Tab"&&x.trim()){D.preventDefault(),M(x);return}if(p.includes("space")&&z===" "&&x.trim()){D.preventDefault(),M(x);return}if(z==="Backspace"&&!x&&w.length>0){D.preventDefault(),R(w.length-1);return}},[M,R,x,w,p,h,m]),T=g.useCallback(()=>{var D;j(!0),(D=e.onFocus)==null||D.call(e)},[e.onFocus]),$=g.useCallback(()=>{var D;j(!1),x.trim()&&M(x),(D=e.onBlur)==null||D.call(e)},[M,x,e.onBlur]);return{inputValue:x,setInputValue:f,tags:w,setTags:y,isFocused:k,setIsFocused:j,isHovered:S,setIsHovered:C,addTag:M,removeTag:R,handleInputChange:E,handleKeyDown:_,handleFocus:T,handleBlur:$,validateTag:I}},Up=({tag:e,onRemove:t,isRemovable:o,size:r,views:a,isDisabled:i,isReadOnly:l})=>{const[d,c]=g.useState(!1),u={xs:{padding:"2px 8px",fontSize:"10px",iconSize:10},sm:{padding:"4px 10px",fontSize:"12px",iconSize:12},md:{padding:"6px 14px",fontSize:"14px",iconSize:14},lg:{padding:"8px 16px",fontSize:"16px",iconSize:16},xl:{padding:"10px 18px",fontSize:"18px",iconSize:18}}[r]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return n.jsxs(s.Horizontal,{alignItems:"center",gap:6,padding:u.padding,backgroundColor:"color-gray-100-100",borderRadius:"16px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-100",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:i?.6:1,_hover:!i&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...a==null?void 0:a.tag,children:[n.jsx(s.Text,{fontSize:u.fontSize,color:i?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...a==null?void 0:a.tagText,children:e}),o&&!i&&!l&&n.jsx(s.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:p=>{p.stopPropagation(),t()},_hover:{backgroundColor:"color-red-50"},...a==null?void 0:a.tagRemove,children:n.jsx(ye,{widthHeight:u.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},ma=({id:e,name:t,label:o,placeholder:r="Type and press Enter to add tags...",helperText:a,error:i=!1,inputValue:l="",tags:d=[],left:c,right:u,shadow:p={},views:h={},size:m="md",shape:x="default",variant:f="default",isDisabled:b=!1,isReadOnly:y=!1,isAutoFocus:k=!1,isRemovable:j=!0,isFocused:S=!1,isHovered:C=!1,maxTags:w,handleInputChange:I,handleKeyDown:M,handleFocus:R,handleBlur:E,removeTag:_,setIsHovered:T,onClick:$,...D})=>{const{getColor:z,themeMode:V}=s.useTheme(),W=!!(o&&(S||d.length>0||l)),P=w&&d.length>=w,L={...Nn[x],...Un[f],...h==null?void 0:h.inputContainer},H={border:"none",outline:"none",backgroundColor:"transparent",fontSize:s.Typography.fontSizes[m],color:b?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...h==null?void 0:h.input};return n.jsx(Te,{error:!!i,helperText:typeof i=="string"?i:a,views:h,...D,children:n.jsxs(Ve,{label:o,shadow:p,value:d.length>0||l?"has-content":"",size:m,shape:x,variant:f,error:!!i,showLabel:W,isFocused:S,isHovered:C,isDisabled:b,isReadOnly:y,views:h,onClick:$,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...L,children:[c,n.jsxs(rt,{children:[o&&n.jsx(He,{size:m,error:!!i,views:h,children:o}),n.jsxs(s.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:s.Typography.fontSizes[m],padding:"8px 0",...h==null?void 0:h.tagsContainer,children:[d.map((B,F)=>n.jsx(Up,{tag:B.value,onRemove:()=>_==null?void 0:_(F),isRemovable:j,size:m,views:h,isDisabled:b,isReadOnly:y},B.id)),!P&&n.jsx(s.Input,{id:e,name:t,type:"text",value:l,placeholder:d.length===0?r:"",disabled:b,readOnly:y,autoFocus:k,onChange:I,onKeyDown:M,onFocus:R,onBlur:E,autoComplete:"off",...H}),P&&n.jsxs(s.Text,{fontSize:s.Typography.fontSizes[m],color:"color-gray-500",fontStyle:"italic",...h==null?void 0:h.placeholder,children:["Maximum ",w," tags reached"]})]})]}),u]})})},qp=e=>{const t=ha(e),{tags:o,...r}=e;return n.jsx(ma,{...t,...r})},Gp=qp;function Yp(e){const t=setTimeout(e,0),o=setTimeout(e,10),r=setTimeout(e,50);return[t,o,r]}const fa=({value:e,defaultValue:t="",length:o=6,onChange:r,onChangeText:a,onComplete:i,onKeyDown:l,onKeyPress:d,onBlur:c,onFocus:u,isReadOnly:p,isDisabled:h,pattern:m,stepValues:x,pasteTransformer:f})=>{var Y,X;const b=e!==void 0,y=b?e:t,[k,j]=g.useState((y==null?void 0:y.slice(0,o))||""),[S,C]=g.useState(!1),[w,I]=g.useState(!1),[M,R]=g.useState(null),[E,_]=g.useState(null),T=g.useRef(null),$=g.useRef(null),D=g.useRef({value:k,onChange:r||(()=>{}),isIOS:typeof window<"u"&&((X=(Y=window==null?void 0:window.CSS)==null?void 0:Y.supports)==null?void 0:X.call(Y,"-webkit-touch-callout","none"))}),z=g.useRef({prev:[null,null,"none"]}),V=m?typeof m=="string"?new RegExp(m):m:null;g.useEffect(()=>{b&&e!==k&&j((e==null?void 0:e.slice(0,o))||"")},[b,e,o,k]);const W=g.useCallback(U=>{let K=U;if(x&&x.length>0&&U){const ee=parseInt(U,10);if(!isNaN(ee)){let ne=x[0],ae=Math.abs(ee-ne);for(let oe=1;oe<x.length;oe++){const de=Math.abs(ee-x[oe]);de<ae&&(ae=de,ne=x[oe])}K=ne.toString()}}j(K),r&&r(K),a&&a(K),i&&K.length===o&&i(K)},[r,a,i,o,x]),P=g.useCallback(U=>{U&&T.current!==U&&Object.defineProperty(T,"current",{value:U,writable:!0})},[]),L=g.useCallback(U=>{const K=U.currentTarget.value.slice(0,o);if(K.length>0&&V&&!V.test(K)){U.preventDefault();return}W(K),T.current&&(T.current.value=K)},[o,V,W,T]),H=g.useCallback(()=>{var U;if(T.current){const K=Math.min(T.current.value.length,o-1),ee=T.current.value.length;(U=T.current)==null||U.setSelectionRange(K,ee),R(K),_(ee)}C(!0)},[o]),B=g.useCallback(()=>{C(!1)},[]),F=g.useCallback(U=>{l&&l(U)},[]),A=g.useCallback(U=>{d&&d(U)},[]),O=g.useCallback(U=>{const K=T.current;if(!U.clipboardData||!K)return;const ee=U.clipboardData.getData("text/plain"),ne=f?f(ee):ee;U.preventDefault();const ae=K.selectionStart||0,oe=K.selectionEnd||0,N=(ae!==oe?k.slice(0,ae)+ne+k.slice(oe):k.slice(0,ae)+ne+k.slice(ae)).slice(0,o);if(N.length>0&&V&&!V.test(N))return;K.value=N,W(N),j(N);const q=Math.min(N.length,o-1),Z=N.length;K.setSelectionRange(q,Z),R(q),_(Z)},[o,f,V,W,k,j]);return g.useEffect(()=>{const U=T.current,K=$.current;if(!U||!K)return;D.current.value!==U.value&&D.current.onChange&&D.current.onChange(U.value),z.current.prev=[U.selectionStart,U.selectionEnd,U.selectionDirection];function ee(){if(document.activeElement!==U){R(null),_(null);return}const oe=(U==null?void 0:U.selectionStart)??null,de=(U==null?void 0:U.selectionEnd)??null,xe=(U==null?void 0:U.selectionDirection)??null,N=(U==null?void 0:U.maxLength)??0,q=(U==null?void 0:U.value)??"",Z=z.current.prev;let G=-1,J=-1,ce="none";if(q.length!==0&&oe!==null&&de!==null){const fe=oe===de,zt=oe===q.length&&q.length<N;if(fe&&!zt){const We=oe;if(We===0)G=0,J=1,ce="forward";else if(We===N)G=We-1,J=We,ce="backward";else if(N>1&&q.length>1){let fo=0;if(Z[0]!==null&&Z[1]!==null){ce=We<Z[1]?"backward":"forward";const $i=Z[0]===Z[1]&&Z[0]<N;ce==="backward"&&!$i&&(fo=-1)}G=fo+We,J=fo+We+1}}G!==-1&&J!==-1&&G!==J&&T.current&&T.current.setSelectionRange(G,J,ce)}const ge=G!==-1?G:oe,me=J!==-1?J:de,re=ce!=="none"?ce:xe;R(ge),_(me),z.current.prev=[ge,me,re]}document.addEventListener("selectionchange",ee,{capture:!0}),ee(),document.activeElement===U&&C(!0);const ne=()=>{K&&K.style.setProperty("--root-height",`${U.clientHeight}px`)};ne();const ae=new window.ResizeObserver(ne);return ae.observe(U),()=>{document.removeEventListener("selectionchange",ee,{capture:!0}),ae.disconnect()}},[]),g.useEffect(()=>{Yp(()=>{var ne,ae,oe,de;(ne=T.current)==null||ne.dispatchEvent(new Event("input"));const U=(ae=T.current)==null?void 0:ae.selectionStart,K=(oe=T.current)==null?void 0:oe.selectionEnd,ee=(de=T.current)==null?void 0:de.selectionDirection;U!==null&&K!==null&&U!==void 0&&K!==void 0&&(R(U),_(K),z.current.prev=[U,K,ee||"none"])})},[k,S]),{value:k,setValue:W,isFocused:S,setIsFocused:C,isHovered:w,setIsHovered:I,inputRef:T,containerRef:$,mirrorSelectionStart:M,mirrorSelectionEnd:E,setMirrorSelectionStart:R,setMirrorSelectionEnd:_,setInputRef:P,handleChange:L,handleFocus:H,handleBlur:B,handleKeyDown:F,handleKeyPress:A,handlePaste:O}},Xp=g.createContext({slots:[],isFocused:!1,isHovering:!1}),Kp=`
34
34
  @keyframes blink {
35
35
  0%, 100% { opacity: 1; }
36
36
  50% { opacity: 0; }
@@ -49,17 +49,17 @@
49
49
  border-radius: 4px !important;
50
50
  width: 100% !important;
51
51
  }
52
- `;function ve(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}const fa=({id:e,name:t,label:o,value:r="",length:a=6,onChange:i,onChangeText:l,onComplete:d,helperText:c,placeholder:u="",shadow:p,views:m={},size:h="md",shape:x="rounded",variant:f="outline",gap:b=8,type:y="text",error:k=!1,isFocused:j=!1,isHovered:S=!1,isDisabled:C=!1,isReadOnly:w=!1,isAutoFocus:I=!1,setValue:M,setIsFocused:R,setIsHovered:E,inputRef:W,containerRef:T,mirrorSelectionStart:$,mirrorSelectionEnd:D,setMirrorSelectionStart:z,setMirrorSelectionEnd:V,handlePaste:_,handleChange:P,handleFocus:L,handleBlur:H,handleKeyDown:B,handleKeyPress:F,secureTextEntry:A,isFirstColumn:O,stepValues:G,setInputRef:Y,onBlur:q=()=>{},onClick:X=()=>{},onFocus:ee=()=>{},...oe})=>{s.useTheme();const re=!!o,ne=g.useMemo(()=>({slots:Array.from({length:a}).map((U,v)=>{const K=j&&$!==null&&D!==null&&($===D&&v===$||v>=$&&v<D),J=r[v]!==void 0?r[v]:null,Z=r[0]!==void 0?null:(u==null?void 0:u[v])??null;return{char:J,placeholderChar:Z,isActive:K,hasFakeCaret:K&&J===null}}),isFocused:j,isHovering:!C&&S}),[j,S,C,a,D,$,u,r]);g.useEffect(()=>{I&&W.current&&W.current.focus()},[I,W]),g.useEffect(()=>{if(!document.getElementById("input-otp-style")){const U=document.createElement("style");if(U.id="input-otp-style",document.head.appendChild(U),U.sheet){const v="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";ve(U.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),ve(U.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),ve(U.sheet,`[data-input-otp]:autofill { ${v} }`),ve(U.sheet,`[data-input-otp]:-webkit-autofill { ${v} }`),ve(U.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),ve(U.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ue=()=>n.jsx(s.Horizontal,{gap:b,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:ne.slots.map((U,v)=>n.jsxs(Ve,{size:h,error:k,shape:x,views:m,variant:f,value:U.char||"",color:"theme-primary",isHovered:S,isDisabled:C,isReadOnly:w,isFocused:U.isActive,showLabel:!1,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:[U.char?n.jsx(s.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:y==="password"?"•":U.char}):U.placeholderChar?n.jsx(s.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...m.text,children:U.placeholderChar}):null,U.hasFakeCaret&&n.jsx(s.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||t}-${v}`))}),be={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return n.jsxs(n.Fragment,{children:[n.jsx("noscript",{children:n.jsx("style",{children:Gp})}),n.jsxs(Ie,{helperText:c,error:k,views:m,...oe,children:[re&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:k,...m.label,children:o}),n.jsxs(s.View,{ref:T,"data-input-otp-container":!0,position:"relative",cursor:C?"default":"text",userSelect:"none",pointerEvents:"none",children:[n.jsx(qp.Provider,{value:ne,children:ue()}),n.jsx(s.View,{position:"absolute",inset:0,pointerEvents:"none",children:n.jsx(s.Input,{ref:U=>Y(U),"data-input-otp":!0,"data-input-otp-placeholder-shown":r.length===0||void 0,"data-input-otp-mss":$,"data-input-otp-mse":D,id:e||t,name:t,type:y==="password"?"password":"text",inputMode:y!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:w,disabled:C,placeholder:u,value:r,onChange:P,onKeyDown:B,onPaste:_,onFocus:L,onBlur:H,onClick:X,onMouseOver:()=>E(!0),onMouseLeave:()=>E(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:be,...m.input})})]})]})]})},Yp=e=>{const{value:t}=e,{value:o,setValue:r,isFocused:a,setIsFocused:i,isHovered:l,setIsHovered:d,inputRef:c,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:x,setInputRef:f,handleChange:b,handleFocus:y,handleBlur:k,handleKeyDown:j,handlePaste:S,handleKeyPress:C}=ha(e),w=t!==void 0?t:o;return n.jsx(fa,{...e,value:w,setValue:r,isFocused:a,setIsFocused:i,isHovered:l,setIsHovered:d,inputRef:c,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:x,setInputRef:f,handleChange:b,handleFocus:y,handleBlur:k,handleKeyDown:j,handleKeyPress:C,handlePaste:S,stepValues:e.stepValues})},Xp=Yp,xa=g.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Kp=()=>g.useContext(xa),Qp=({children:e,autoFocus:t=!1,initFocus:o,onChange:r=()=>{},...a})=>{const i=ke.useFormikContext();g.useEffect(()=>{r(i.values)},[i.values]);const l=g.useRef({}),d=g.useRef([]),c=(m,h)=>{l.current[m]=h,d.current.includes(m)||d.current.push(m)},u=m=>{var h;if(t){const f=d.current.indexOf(m)+1;f<d.current.length?(h=l.current[d.current[f]])==null||h.focus():i.onSubmit&&i.onSubmit(i.values)}},p={active:t,focusNextInput:u,setInputRef:c,handleSubmitEditing:u,getReturnKeyType:m=>d.current.indexOf(m)===d.current.length-1?"done":"next"};return g.useEffect(()=>{var m,h;t&&(o&&l.current[o]?(m=l.current[o])==null||m.focus():d.current[0]&&((h=l.current[d.current[0]])==null||h.focus()))},[t,o]),n.jsx(xa.Provider,{value:p,children:n.jsx(s.Form,{...a,children:e})})},Jp=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},de=({name:e,type:t,...o})=>{const r=Kp(),{touched:a,errors:i,submitCount:l,values:d,setFieldTouched:c,setFieldValue:u}=ke.useFormikContext(),p=k=>{var j;u(e,k),(j=o.onChangeText)==null||j.call(o,k)},m=k=>{var j;u(e,k),(j=o.onChange)==null||j.call(o,k)},h=()=>{c(e,!0)},x=k=>{k.key==="Enter"&&(k.preventDefault(),r.focusNextInput(e))},f=["text","password","email","digits"].includes(t),b=ke.getIn(a,e)||l>0?ke.getIn(i,e):void 0,y=ke.getIn(d,e);return{...Jp(t),...o,value:y,error:b,onBlur:h,onKeyPress:x,...f?{onChangeText:p}:{onChange:m},...r.active?{handleKeyPress:x}:{}}},Zp=e=>{let{value:t,...o}=de(e);o.isChecked=t;const r=Zn(e);return n.jsx(ea,{...r,...o})},eg=Zp,tg=({defaultIsSelected:e=!1,isChecked:t})=>{const[o,r]=g.useState(!1),[a,i]=g.useState(t!==void 0?t:e);return g.useEffect(()=>{t!==void 0&&i(t)},[t]),{isHovered:o,setIsHovered:r,isSelected:a,setIsSelected:i}},og={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},rg={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},ng={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},ag={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},jo={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},So={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{backgroundColor:"transparent"}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{backgroundColor:"transparent",opacity:.6}},error:{selected:{backgroundColor:"color-red-500"},unselected:{backgroundColor:"transparent"}}},ig=({id:e,icon:t,name:o,label:r,value:a,isChecked:i,onChange:l,onValueChange:d,shadow:c={},labelPosition:u="right",size:p="md",error:m=!1,isSelected:h=!1,isHovered:x=!1,isDisabled:f=!1,isReadOnly:b=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:j=()=>{},views:S={radio:{},label:{}},infoText:C,helperText:w,...I})=>{const M=()=>j(!x),R=()=>{!b&&!f&&(k&&k(!0),l&&l(a),d&&d(a))},E=i||h?"selected":"unselected",W=m?jo.error[E]:f?jo.disabled[E]:x?jo.hover[E]:{},T=m?So.error[E]:f?So.disabled[E]:x?So.hover[E]:{},$={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:m?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":b?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...S.label},radio:{...ng[E],...W,borderRadius:"50%",backgroundColor:"color-white",...og[p],transition:"all 0.2s ease",...c,...S.radio},dot:{...ag[E],...T,borderRadius:"50%",...rg[p],transition:"all 0.2s ease"}};return n.jsxs(jt,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[p],...$.container,...I,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&r&&n.jsx(s.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:r}),n.jsx(s.Center,{...$.radio,children:(i||h)&&n.jsx(s.View,{...$.dot})}),u==="right"&&r&&n.jsx(s.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...S==null?void 0:S.infoText,children:C})]}),m&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:m})]})},lg=e=>{let{value:t,...o}=de(e);o.isChecked=t===e.value;const r=tg(e);return n.jsx(ig,{...r,...o})},cg=lg,ba=e=>{const{value:t,onChange:o,onSubmit:r,autoFocus:a=!0,loading:i=!1,disabled:l=!1,isAgentRunning:d=!1,onStopAgent:c,sandboxId:u,onUploadProgress:p,onUploadSuccess:m,onUploadError:h,onFileUpload:x}=e,f=t!==void 0&&o!==void 0,[b,y]=g.useState(""),k=f?t:b,[j,S]=g.useState([]),[C,w]=g.useState([]),[I,M]=g.useState(!1),[R,E]=g.useState(0),[W,T]=g.useState([]),[$,D]=g.useState(!1),z=g.useRef(null),[V,_]=g.useState(!1),[P,L]=g.useState("gpt-4"),[H]=g.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),B=g.useRef(null),F=g.useRef(null),[A,O]=g.useState(e.showGuideTip||!1);g.useEffect(()=>{a&&B.current&&B.current.focus()},[a]),g.useEffect(()=>()=>{j.forEach(v=>{})},[j]);const G=v=>{f&&o?o(v):y(v)},Y=v=>{if(v.preventDefault(),!k.trim()&&j.length===0||i||l&&!d)return;if(d&&c){c();return}let K=k;if(j.length>0){const pe=j.map(he=>`[Uploaded File: ${URL.createObjectURL(he)}}]`).join(`
53
- `);K=K?`${K}
52
+ `;function ve(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}const xa=({id:e,name:t,label:o,value:r="",length:a=6,onChange:i,onChangeText:l,onComplete:d,helperText:c,placeholder:u="",shadow:p,views:h={},size:m="md",shape:x="rounded",variant:f="outline",gap:b=8,type:y="text",error:k=!1,isFocused:j=!1,isHovered:S=!1,isDisabled:C=!1,isReadOnly:w=!1,isAutoFocus:I=!1,setValue:M,setIsFocused:R,setIsHovered:E,inputRef:_,containerRef:T,mirrorSelectionStart:$,mirrorSelectionEnd:D,setMirrorSelectionStart:z,setMirrorSelectionEnd:V,handlePaste:W,handleChange:P,handleFocus:L,handleBlur:H,handleKeyDown:B,handleKeyPress:F,secureTextEntry:A,isFirstColumn:O,stepValues:Y,setInputRef:X,onBlur:U=()=>{},onClick:K=()=>{},onFocus:ee=()=>{},...ne})=>{s.useTheme();const ae=!!o,oe=g.useMemo(()=>({slots:Array.from({length:a}).map((N,q)=>{const Z=j&&$!==null&&D!==null&&($===D&&q===$||q>=$&&q<D),G=r[q]!==void 0?r[q]:null,J=r[0]!==void 0?null:(u==null?void 0:u[q])??null;return{char:G,placeholderChar:J,isActive:Z,hasFakeCaret:Z&&G===null}}),isFocused:j,isHovering:!C&&S}),[j,S,C,a,D,$,u,r]);g.useEffect(()=>{I&&_.current&&_.current.focus()},[I,_]),g.useEffect(()=>{if(!document.getElementById("input-otp-style")){const N=document.createElement("style");if(N.id="input-otp-style",document.head.appendChild(N),N.sheet){const q="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";ve(N.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),ve(N.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),ve(N.sheet,`[data-input-otp]:autofill { ${q} }`),ve(N.sheet,`[data-input-otp]:-webkit-autofill { ${q} }`),ve(N.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),ve(N.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const de=()=>n.jsx(s.Horizontal,{gap:b,width:"100%",justifyContent:"center",minHeight:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...h.container,children:oe.slots.map((N,q)=>n.jsxs(Ve,{size:m,error:k,shape:x,views:h,variant:f,value:N.char||"",color:"theme-primary",isHovered:S,isDisabled:C,isReadOnly:w,isFocused:N.isActive,showLabel:!1,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),justifyContent:"center",alignItems:"center",width:"100%",position:"relative",height:m==="xs"?"32px":m==="sm"?"36px":m==="md"?"40px":m==="lg"?"48px":"56px",...h.container,children:[N.char?n.jsx(s.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",fontWeight:"medium",...h.text,children:y==="password"?"•":N.char}):N.placeholderChar?n.jsx(s.View,{textAlign:"center",fontSize:m==="xs"?"14px":m==="sm"?"16px":m==="md"?"18px":m==="lg"?"20px":"24px",color:"color-gray-400",opacity:.5,...h.text,children:N.placeholderChar}):null,N.hasFakeCaret&&n.jsx(s.View,{position:"absolute",width:"2px",height:"60%",backgroundColor:"theme-primary",animation:"blink 1s step-start infinite",style:{animationName:"blink",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"step-start"}})]},`${e||t}-${q}`))}),xe={position:"absolute",inset:0,width:"100%",height:"100%",display:"flex",textAlign:"center",opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"};return n.jsxs(n.Fragment,{children:[n.jsx("noscript",{children:n.jsx("style",{children:Kp})}),n.jsxs(Te,{helperText:c,error:k,views:h,...ne,children:[ae&&n.jsx(He,{htmlFor:e,color:"theme-primary",error:k,...h.label,children:o}),n.jsxs(s.View,{ref:T,"data-input-otp-container":!0,position:"relative",cursor:C?"default":"text",userSelect:"none",pointerEvents:"none",children:[n.jsx(Xp.Provider,{value:oe,children:de()}),n.jsx(s.View,{position:"absolute",inset:0,pointerEvents:"none",children:n.jsx(s.Input,{ref:N=>X(N),"data-input-otp":!0,"data-input-otp-placeholder-shown":r.length===0||void 0,"data-input-otp-mss":$,"data-input-otp-mse":D,id:e||t,name:t,type:y==="password"?"password":"text",inputMode:y!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:a,readOnly:w,disabled:C,placeholder:u,value:r,onChange:P,onKeyDown:B,onPaste:W,onFocus:L,onBlur:H,onClick:K,onMouseOver:()=>E(!0),onMouseLeave:()=>E(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${a} digits`,style:xe,...h.input})})]})]})]})},Qp=e=>{const{value:t}=e,{value:o,setValue:r,isFocused:a,setIsFocused:i,isHovered:l,setIsHovered:d,inputRef:c,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:h,setMirrorSelectionStart:m,setMirrorSelectionEnd:x,setInputRef:f,handleChange:b,handleFocus:y,handleBlur:k,handleKeyDown:j,handlePaste:S,handleKeyPress:C}=fa(e),w=t!==void 0?t:o;return n.jsx(xa,{...e,value:w,setValue:r,isFocused:a,setIsFocused:i,isHovered:l,setIsHovered:d,inputRef:c,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:h,setMirrorSelectionStart:m,setMirrorSelectionEnd:x,setInputRef:f,handleChange:b,handleFocus:y,handleBlur:k,handleKeyDown:j,handleKeyPress:C,handlePaste:S,stepValues:e.stepValues})},Jp=Qp,ba=g.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Zp=()=>g.useContext(ba),eg=({children:e,autoFocus:t=!1,initFocus:o,onChange:r=()=>{},...a})=>{const i=ke.useFormikContext();g.useEffect(()=>{r(i.values)},[i.values]);const l=g.useRef({}),d=g.useRef([]),c=(h,m)=>{l.current[h]=m,d.current.includes(h)||d.current.push(h)},u=h=>{var m;if(t){const f=d.current.indexOf(h)+1;f<d.current.length?(m=l.current[d.current[f]])==null||m.focus():i.onSubmit&&i.onSubmit(i.values)}},p={active:t,focusNextInput:u,setInputRef:c,handleSubmitEditing:u,getReturnKeyType:h=>d.current.indexOf(h)===d.current.length-1?"done":"next"};return g.useEffect(()=>{var h,m;t&&(o&&l.current[o]?(h=l.current[o])==null||h.focus():d.current[0]&&((m=l.current[d.current[0]])==null||m.focus()))},[t,o]),n.jsx(ba.Provider,{value:p,children:n.jsx(s.Form,{...a,children:e})})},tg=e=>{switch(e){case"email":return{autoCorrect:"off",inputMode:"email",autoCapitalize:"none"};case"password":return{autoCorrect:"off",secureTextEntry:!0,autoCapitalize:"none"};case"digits":return{inputMode:"tel"};case"numeric":return{inputMode:"numeric"};case"name":return{autoCorrect:"off"};default:return{}}},pe=({name:e,type:t,...o})=>{const r=Zp(),{touched:a,errors:i,submitCount:l,values:d,setFieldTouched:c,setFieldValue:u}=ke.useFormikContext(),p=k=>{var j;u(e,k),(j=o.onChangeText)==null||j.call(o,k)},h=k=>{var j;u(e,k),(j=o.onChange)==null||j.call(o,k)},m=()=>{c(e,!0)},x=k=>{k.key==="Enter"&&(k.preventDefault(),r.focusNextInput(e))},f=["text","password","email","digits"].includes(t),b=ke.getIn(a,e)||l>0?ke.getIn(i,e):void 0,y=ke.getIn(d,e);return{...tg(t),...o,value:y,error:b,onBlur:m,onKeyPress:x,...f?{onChangeText:p}:{onChange:h},...r.active?{handleKeyPress:x}:{}}},og=e=>{let{value:t,...o}=pe(e);o.isChecked=t;const r=ea(e);return n.jsx(ta,{...r,...o})},rg=og,ng=({defaultIsSelected:e=!1,isChecked:t})=>{const[o,r]=g.useState(!1),[a,i]=g.useState(t!==void 0?t:e);return g.useEffect(()=>{t!==void 0&&i(t)},[t]),{isHovered:o,setIsHovered:r,isSelected:a,setIsSelected:i}},ag={xs:{height:"16px",width:"16px"},sm:{height:"20px",width:"20px"},md:{height:"24px",width:"24px"},lg:{height:"28px",width:"28px"},xl:{height:"32px",width:"32px"}},ig={xs:{height:"8px",width:"8px"},sm:{height:"10px",width:"10px"},md:{height:"12px",width:"12px"},lg:{height:"14px",width:"14px"},xl:{height:"16px",width:"16px"}},lg={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},cg={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},jo={hover:{selected:{borderColor:"color-blue-600"},unselected:{borderColor:"color-gray-400"}},disabled:{selected:{borderColor:"color-gray-300",opacity:.6},unselected:{borderColor:"color-gray-300",opacity:.6}},error:{selected:{borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"}}},So={hover:{selected:{backgroundColor:"color-blue-600"},unselected:{backgroundColor:"transparent"}},disabled:{selected:{backgroundColor:"color-gray-300",opacity:.6},unselected:{backgroundColor:"transparent",opacity:.6}},error:{selected:{backgroundColor:"color-red-500"},unselected:{backgroundColor:"transparent"}}},sg=({id:e,icon:t,name:o,label:r,value:a,isChecked:i,onChange:l,onValueChange:d,shadow:c={},labelPosition:u="right",size:p="md",error:h=!1,isSelected:m=!1,isHovered:x=!1,isDisabled:f=!1,isReadOnly:b=!1,defaultIsSelected:y=!1,setIsSelected:k=()=>{},setIsHovered:j=()=>{},views:S={radio:{},label:{}},infoText:C,helperText:w,...I})=>{const M=()=>j(!x),R=()=>{!b&&!f&&(k&&k(!0),l&&l(a),d&&d(a))},E=i||m?"selected":"unselected",_=h?jo.error[E]:f?jo.disabled[E]:x?jo.hover[E]:{},T=h?So.error[E]:f?So.disabled[E]:x?So.hover[E]:{},$={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:h?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":b?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...S.label},radio:{...lg[E],..._,borderRadius:"50%",backgroundColor:"color-white",...ag[p],transition:"all 0.2s ease",...c,...S.radio},dot:{...cg[E],...T,borderRadius:"50%",...ig[p],transition:"all 0.2s ease"}};return n.jsxs(jt,{htmlFor:e,as:"div",onClick:R,onMouseEnter:M,onMouseLeave:M,size:s.Typography.fontSizes[p],...$.container,...I,children:[n.jsxs(s.Vertical,{gap:8,children:[" ",n.jsxs(s.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&r&&n.jsx(s.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:r}),n.jsx(s.Center,{...$.radio,children:(i||m)&&n.jsx(s.View,{...$.dot})}),u==="right"&&r&&n.jsx(s.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:r})]}),C&&n.jsx(s.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...S==null?void 0:S.infoText,children:C})]}),h&&n.jsx(s.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:h})]})},dg=e=>{let{value:t,...o}=pe(e);o.isChecked=t===e.value;const r=ng(e);return n.jsx(sg,{...r,...o})},ug=dg,ya=e=>{const{value:t,onChange:o,onSubmit:r,autoFocus:a=!0,loading:i=!1,disabled:l=!1,isAgentRunning:d=!1,onStopAgent:c,sandboxId:u,onUploadProgress:p,onUploadSuccess:h,onUploadError:m,onFileUpload:x}=e,f=t!==void 0&&o!==void 0,[b,y]=g.useState(""),k=f?t:b,[j,S]=g.useState([]),[C,w]=g.useState([]),[I,M]=g.useState(!1),[R,E]=g.useState(0),[_,T]=g.useState([]),[$,D]=g.useState(!1),z=g.useRef(null),[V,W]=g.useState(!1),[P,L]=g.useState("gpt-4"),[H]=g.useState([{id:"gpt-3.5-turbo",name:"GPT-3.5"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4-thinking",name:"GPT-4 (Thinking)",isThinking:!0},{id:"claude-3-5-sonnet",name:"Claude 3.5 Sonnet"}]),B=g.useRef(null),F=g.useRef(null),[A,O]=g.useState(e.showGuideTip||!1);g.useEffect(()=>{a&&B.current&&B.current.focus()},[a]),g.useEffect(()=>()=>{j.forEach(G=>{})},[j]);const Y=G=>{f&&o?o(G):y(G)},X=G=>{if(G.preventDefault(),!k.trim()&&j.length===0||i||l&&!d)return;if(d&&c){c();return}let J=k;if(j.length>0){const me=j.map(re=>`[Uploaded File: ${URL.createObjectURL(re)}}]`).join(`
53
+ `);J=J?`${J}
54
54
 
55
- ${pe}`:pe}let J=P,Z=!1;P.endsWith("-thinking")&&(J=P.replace(/-thinking$/,""),Z=!0),r(K,{model_name:J,enable_thinking:Z}),f||y(""),S([]),w([])},q=v=>{S(K=>K.filter((J,Z)=>Z!==v)),!u&&C.length>v&&w(K=>K.filter((J,Z)=>Z!==v))},X=v=>{v.preventDefault(),v.stopPropagation(),_(!0)},ee=v=>{v.preventDefault(),v.stopPropagation(),_(!1)},oe=g.useCallback(v=>{!v||v.length===0||(w(K=>[...K,...v]),S(K=>[...K,...v]),T(K=>[...K,...v]),M(!0))},[w,S]),re=g.useCallback(()=>{if(W.length>0&&!$&&x){D(!0);const v=W[0];z.current=v,E(0);try{x(v)}catch(K){T(J=>J.slice(1)),D(!1),z.current=null,E(0),M(J=>W.length-1>0||!1),h==null||h(K)}}else W.length===0&&I&&(M(!1),E(0))},[W,$,x,I,h]);return g.useEffect(()=>{re()},[W,$,re]),{value:k,handleChange:G,handleSubmit:Y,editableRef:B,fileInputRef:F,isUploading:I,uploadProgress:R,isDraggingOver:V,uploadedFiles:j,pendingFiles:C,removeUploadedFile:q,setPendingFiles:w,setUploadedFiles:S,setIsUploading:M,startUpload:oe,selectedModel:P,handleModelChange:L,modelOptions:H,subscriptionStatus:"active",canAccessModel:v=>!0,handleDragOver:X,handleDragLeave:ee,isGuideTipShown:A,hideGuideTip:()=>{O(!1),e.onGuideClose&&e.onGuideClose()},handlePromptExampleSelect:v=>{f&&o?o(v.text):y(v.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(v),B.current&&B.current.focus()}}},sg={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},Dr={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"all 0.2s ease",media:{mobile:{borderRadius:"8px"}}},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",media:{mobile:{padding:"10px",borderRadius:"8px"}}}},dg={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},ug={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},pg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},Hr=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,gg=({openDelay:e=200,closeDelay:t=300}={})=>{const[o,r]=g.useState(!1),a=g.useRef(null),i=g.useRef(null),l=g.useRef(null),d=g.useRef(null),c=g.useMemo(()=>Hr("hovercard-content"),[]),u=g.useMemo(()=>Hr("hovercard-trigger"),[]),p=g.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),m=g.useCallback(()=>{p(),o||(a.current=setTimeout(()=>{r(!0)},e))},[o,e,p]),h=g.useCallback(()=>{p(),o&&(i.current=setTimeout(()=>{r(!1)},t))},[o,t,p]),x=g.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return g.useEffect(()=>()=>p(),[p]),{isOpen:o,openCard:m,closeCard:h,cancelCloseTimer:x,triggerRef:l,contentRef:d,contentId:c,triggerId:u}},ya=g.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),mg=({children:e,value:t})=>n.jsx(ya.Provider,{value:t,children:e}),ka=()=>{const e=g.useContext(ya);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},hg=({children:e,views:t,asChild:o=!1,...r})=>{const{openCard:a,closeCard:i,triggerRef:l,contentId:d,triggerId:c}=ka(),x={ref:l,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:c,"aria-describedby":d,...t==null?void 0:t.container,...r};if(o&&g.isValidElement(e)){const f=g.Children.only(e);return g.cloneElement(f,{...x,...f.props})}return n.jsx(s.View,{position:"relative",display:"inline-block",...x,children:e})},fg=({children:e,views:t,side:o="bottom",align:r="center",sideOffset:a=8,style:i,backgroundColor:l="white",borderRadius:d="4px",boxShadow:c="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:p="50px",maxWidth:m="300px",...h})=>{const{isOpen:x,cancelCloseTimer:f,closeCard:b,contentRef:y,triggerRef:k,contentId:j,triggerId:S}=ka(),{ref:C,relation:w}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});g.useEffect(()=>{k!=null&&k.current&&(C==null?void 0:C.current)!==k.current&&C&&(C.current=k.current)},[k,C,x]);const I=()=>f(),M=()=>b();if(!x)return null;const R=()=>{if(!w||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const T=k.current.getBoundingClientRect();let $=o;o==="bottom"&&w.space.vertical==="top"?$="top":o==="top"&&w.space.vertical==="bottom"?$="bottom":o==="right"&&w.space.horizontal==="left"?$="left":o==="left"&&w.space.horizontal==="right"&&($="right");let D=0,z=0;switch($){case"bottom":D=T.left+T.width/2,z=T.bottom+a;break;case"top":D=T.left+T.width/2,z=T.top-a;break;case"right":D=T.right+a,z=T.top+T.height/2;break;case"left":D=T.left-a,z=T.top+T.height/2;break}return{position:"fixed",left:D,top:z,zIndex:1e3,transform:E($)}},E=T=>{switch(T){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},W=R();return n.jsx(s.View,{ref:y,id:j,role:"tooltip","aria-labelledby":S,onMouseEnter:I,onMouseLeave:M,backgroundColor:l,borderRadius:d,boxShadow:c,padding:u,minWidth:p,maxWidth:m,style:{...W,...i},...t==null?void 0:t.container,...h,children:e})},xg=({children:e,views:t,openDelay:o,closeDelay:r,...a})=>{const i=gg({openDelay:o,closeDelay:r});return n.jsx(mg,{value:i,children:n.jsx(s.View,{position:"relative",display:"inline-block",...t==null?void 0:t.container,...a,children:e})})},fe=xg;fe.Trigger=hg;fe.Content=fg;const bg=({files:e,sandboxId:t,onRemove:o,layout:r="inline",maxHeight:a="120px",showPreviews:i=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(c=>c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...l==null?void 0:l.container,children:e.map((c,u)=>{const p=URL.createObjectURL(c)||(c==null?void 0:c.path)||(c==null?void 0:c.url)||"",m=c.type.startsWith("image/"),h=c.type.startsWith("video/"),x=c.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:i&&n.jsxs(fe,{children:[n.jsxs(fe.Trigger,{children:[m&&n.jsx(s.Image,{src:p,alt:c.name,width:"60px",height:"60px",objectFit:"cover"}),h&&n.jsx(s.View,{as:"video",src:p,alt:c.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!m&&!h&&!x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),o&&n.jsx(s.Button,{...sg.attachmentRemove,onClick:f=>{f.stopPropagation(),o(u)},"aria-label":`Remove ${c.name}`,children:"×"})]}),n.jsxs(fe.Content,{children:[m&&n.jsx(s.Image,{src:p,alt:c.name,maxWidth:"100%"}),h&&n.jsx(s.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),x&&n.jsx(s.View,{as:"audio",src:p,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[c.name," (",d(c.size),")"]})]})]})},u)})})},Ca=g.forwardRef(({value:e,onChange:t,placeholder:o="Type your message...",disabled:r=!1,autoFocus:a=!0,suggestions:i=[],onSuggestionSelect:l,showSuggestions:d=!1,mentionData:c=[],mentionTrigger:u="@",onMentionSelect:p,maxHeight:m="200px",minHeight:h="40px",views:x={}},f)=>{var ue,be;const b=g.useRef(e),[y,k]=g.useState(-1),[j,S]=g.useState(!e),C=g.useRef(null),[w,I]=g.useState(!1),[M,R]=g.useState(!1),[E,W]=g.useState(""),[T,$]=g.useState(-1),[D,z]=g.useState(-1),[V,_]=g.useState([]),{ref:P,relation:L}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[H,B]=g.useState({x:0,y:0}),[F,A]=g.useState({x:0,y:0});g.useEffect(()=>{const U=f;U.current&&e!==b.current&&(U.current.textContent=e,b.current=e,S(!e))},[e,f]),g.useEffect(()=>{a&&f&&typeof f=="object"&&f.current&&f.current.focus()},[a,f]);const O=()=>{const U=window.getSelection();if(!U||U.rangeCount===0)return-1;const v=U.getRangeAt(0),K=v.cloneRange();return K.selectNodeContents(f&&typeof f=="object"&&f.current?f.current:document.body),K.setEnd(v.endContainer,v.endOffset),K.toString().length},G=g.useCallback((U,v)=>{const K=U.substring(0,v),J=K.lastIndexOf(u);if(J!==-1){const Z=K.substring(J+1);if(!Z.includes(" ")){const he=Z.toLowerCase(),ye=c.filter(me=>me.name.toLowerCase().includes(he));W(he),$(J),_(ye),R(ye.length>0),z(0);const ae=Y();B(ae);return}}R(!1),W(""),$(-1),z(-1)},[c,u]);g.useEffect(()=>{C.current&&P&&(P.current=C.current)},[C,P]);const Y=g.useCallback((U=200)=>{if(!C.current)return{x:0,y:0};const v=C.current.getBoundingClientRect();if(L){const pe=L.space.vertical==="top";return{x:v.left,y:pe?v.top-U-8:v.bottom+8}}const K=window.innerHeight,J={top:v.top,bottom:K-v.bottom},Z=J.bottom<U+8&&J.top>J.bottom;return{x:v.left,y:Z?v.top-U-8:v.bottom+8}},[L]),q=g.useCallback(()=>{I(!0);const U=Y();A(U)},[Y]),X=g.useCallback(()=>{setTimeout(()=>{I(!1),k(-1)},150)},[]),ee=U=>{const v=U.currentTarget.textContent||"";if(v!==b.current){t(v),b.current=v,S(!v);const K=O();G(v,K)}},oe=g.useCallback(U=>{if(f&&typeof f=="object"&&f.current){const v=f.current.textContent||"",K=v.substring(0,T),J=v.substring(T+u.length+E.length),Z=K+u+U.name+" "+J;t(Z),b.current=Z,f.current.textContent=Z;const pe=K.length+u.length+U.name.length+1;setTimeout(()=>{var he;if(f.current){const ye=document.createRange(),ae=window.getSelection(),me=f.current.firstChild;me&&ae&&(ye.setStart(me,Math.min(pe,((he=me.textContent)==null?void 0:he.length)||0)),ye.collapse(!0),ae.removeAllRanges(),ae.addRange(ye))}},0)}R(!1),W(""),$(-1),z(-1),p&&p(U)},[T,u,E,t,p,f]),re=g.useCallback(U=>{l&&l(U),k(-1)},[l]),ne=U=>{if(M&&V.length>0){if(U.key==="ArrowDown"){U.preventDefault(),z(v=>v<V.length-1?v+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),z(v=>v>0?v-1:V.length-1);return}if((U.key==="Tab"||U.key==="Enter")&&D>=0){U.preventDefault(),oe(V[D]);return}if(U.key==="Escape"){R(!1),z(-1);return}}if(d&&i.length>0){if(U.key==="ArrowDown"){U.preventDefault(),k(v=>v<i.length-1?v+1:0);return}if(U.key==="ArrowUp"){U.preventDefault(),k(v=>v>0?v-1:i.length-1);return}if(U.key==="Tab"&&y>=0){U.preventDefault(),re(i[y]);return}if(U.key==="Escape"){k(-1);return}}};return n.jsxs(s.View,{ref:C,width:"100%",position:"relative",...x==null?void 0:x.container,children:[n.jsxs(s.View,{width:"100%",minHeight:h,maxHeight:m,overflowY:"auto",position:"relative",children:[j&&n.jsx(s.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...x==null?void 0:x.placeholder,children:o}),n.jsx(s.View,{as:"div",ref:f,contentEditable:!r,suppressContentEditableWarning:!0,onInput:ee,onKeyDown:ne,onFocus:q,onBlur:X,role:"textbox","aria-multiline":"true","aria-placeholder":o,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...x==null?void 0:x.input})]}),M&&V.length>0&&n.jsx(s.View,{position:"fixed",left:H.x,top:H.y,width:((ue=C.current)==null?void 0:ue.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...x==null?void 0:x.mentionContainer,children:n.jsxs(s.Vertical,{gap:0,children:[V.map((U,v)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===D?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>oe(U),onMouseEnter:()=>z(v),_hover:{backgroundColor:"color-blue-50"},...x==null?void 0:x.mentionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsxs(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,U.name]}),U.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",L&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),d&&i.length>0&&!M&&w&&!e&&n.jsx(s.View,{position:"fixed",left:F.x,top:F.y,width:((be=C.current)==null?void 0:be.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...x==null?void 0:x.suggestionsContainer,children:n.jsxs(s.Vertical,{gap:0,children:[i.map((U,v)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:v===y?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>re(U),onMouseEnter:()=>k(v),_hover:{backgroundColor:"color-blue-50"},...x==null?void 0:x.suggestionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsx(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:U.text}),U.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:U.description})]})},U.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",L&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})})]})});Ca.displayName="EditableInput";const yg=({examples:e,onSelect:t,views:o={}})=>{const{getColor:r}=s.useTheme();return!e||e.length===0?null:n.jsx(s.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...o==null?void 0:o.container,children:e.map(a=>n.jsx(s.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"4px",backgroundColor:"color-gray-100",border:"none",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>t(a),_hover:{backgroundColor:"color-gray-200"},...o==null?void 0:o.item,children:n.jsx(s.Text,{fontSize:"14px",color:"color-gray-700",...o==null?void 0:o.text,children:a.text})},a.id))})},kg=({onRecordingComplete:e,onRecordingStart:t,views:o={}})=>{const{recording:r,paused:a,audioBlob:i,analyserNode:l,startRecording:d,stopRecording:c}=pn();g.useEffect(()=>{if(i){const p=new File([i],`recording-${Date.now()}.webm`,{type:i.type||"audio/webm;codecs=opus"});e(p)}},[i]);const u=g.useCallback(()=>{d(),t==null||t()},[]);return n.jsxs(s.Horizontal,{alignItems:"center",gap:4,children:[n.jsx(s.View,{minWidth:90,children:r&&l&&n.jsx(Ko,{analyserNode:l,isPaused:a})}),n.jsx(s.View,{as:"button",type:"button",onClick:r?c:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r?"theme-error":"color-gray-100",color:r?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:r?"color-red-600":"color-gray-200"},...o.button,children:r?n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(vo,{widthHeight:16,color:"currentColor",filled:!1})})]})},ja=({onSubmit:e,placeholder:t="Say what you want and Kimmy will surprise you",loading:o=!1,disabled:r=!1,isAgentRunning:a=!1,enableAudioRecording:i=!1,leftButtons:l,rightButtons:d,onStopAgent:c,loadingText:u="Agent is working...",autoFocus:p=!0,sandboxId:m,hideAttachments:h=!1,attachmentText:x="",promptExamples:f=[],suggestions:b=[],errorMessage:y,size:k="md",shape:j="rounded",variant:S="default",views:C={},mentionData:w=[],mentionTrigger:I="@",onMentionSelect:M,onAudioRecordingStart:R,onAudioRecordingStop:E,value:W,handleChange:T,handleSubmit:$,editableRef:D,fileInputRef:z,isUploading:V,uploadProgress:_,isDraggingOver:P,uploadedFiles:L,removeUploadedFile:H,setPendingFiles:B,setUploadedFiles:F,setIsUploading:A,startUpload:O,selectedModel:G,handleModelChange:Y,modelOptions:q,subscriptionStatus:X,canAccessModel:ee,isGuideTipShown:oe,hideGuideTip:re,handlePromptExampleSelect:ne,handleDragOver:ue,handleDragLeave:be,onChange:U,...v})=>{s.useTheme();const K={...Dr.container,...dg[j],...C==null?void 0:C.container},J={...Dr.content,...ug[k],...pg[S],...C==null?void 0:C.content},Z=((W==null?void 0:W.trim().length)??0)>0||L.length>0,pe=g.useCallback(ae=>{O([ae]),E==null||E(ae)},[O,E]),he=g.useCallback(ae=>{const me=ae.filter(zt=>zt.size>52428800?(console.error(`File size exceeds 50MB limit: ${zt.name}`),!1):!0);me.length>0&&O(me)},[O]),ye=[...w||[],...L.map((ae,me)=>({id:`file-${me}`,name:ae.name}))];return n.jsxs(s.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...K,...v,onDragOver:ue,onDragLeave:be,onDrop:ae=>{if(ae.preventDefault(),ae.stopPropagation(),be(ae),ae.dataTransfer.files.length>0){const me=Array.from(ae.dataTransfer.files);he(me)}},children:[f.length>0&&n.jsx(yg,{examples:f,onSelect:ne,views:{container:C==null?void 0:C.promptExamples,item:C==null?void 0:C.promptExampleItem}}),a&&n.jsxs(s.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...C==null?void 0:C.loadingIndicator,children:[n.jsx(Uo,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",children:u})]}),n.jsx(s.View,{position:"relative",width:"100%",overflow:"visible",children:n.jsxs(s.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...J,...K,paddingHorizontal:16,paddingVertical:10,backgroundColor:P?"color-blue-50":void 0,children:[n.jsx(bg,{files:L,sandboxId:m,onRemove:H,showPreviews:!0,views:{container:C==null?void 0:C.attachments,item:C==null?void 0:C.attachmentItem,name:C==null?void 0:C.attachmentName,size:C==null?void 0:C.attachmentSize,removeButton:C==null?void 0:C.attachmentRemove}}),n.jsx(Ca,{ref:D,value:W||"",onChange:T,placeholder:t,disabled:r&&!a,autoFocus:p,suggestions:b||[],showSuggestions:b&&b.length>0&&!W,onSuggestionSelect:ae=>{T(ae.text)},mentionData:ye,mentionTrigger:I,onMentionSelect:M,views:{container:{},input:C==null?void 0:C.editableInput}}),n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[!h&&n.jsx(ao,{accept:"*/*",icon:n.jsx(bt,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:he,isLoading:V,progress:_||0,text:x,fileType:"file",renderError:({errorMessage:ae})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...C==null?void 0:C.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:j==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:ae=>ae.size>50*1024*1024?"File size exceeds 50MB limit":null}),l]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[i&&n.jsx(kg,{onRecordingStart:R,onRecordingComplete:pe,views:{button:C==null?void 0:C.recordButton}}),n.jsx(s.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":Z?"theme-primary":"color-gray-300",color:"color-white",borderRadius:j==="rounded"?"50%":4,border:"none",cursor:Z?"pointer":"not-allowed",disabled:!Z||o||r&&!a,transition:"all 0.2s ease",_hover:{backgroundColor:a?"color-red-600":Z?"color-blue-600":"color-gray-300"},...C==null?void 0:C.submitButton,children:a?n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1}):o?n.jsx(ft,{type:"quarter",size:16,color:"color-white"}):n.jsx(No,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),y&&n.jsx(s.Text,{color:"theme-error",marginTop:"4px",...C==null?void 0:C.bottomTip,children:y})]})},Cg=e=>{const{name:t,onSubmit:o,...r}=e,[a,i]=g.useState([]),l=de({name:t,type:"text"}),d=h=>{l.onChangeText&&l.onChangeText(h)},c=(h,x)=>{o?o(h,x):d(h)},u=()=>a,p=()=>i([]),m=ba({...r,value:l.value||"",onChange:d,onSubmit:c,getPendingFiles:u,clearPendingFiles:p});return n.jsx(ja,{...r,...m,value:l.value||"",onChange:d,onSubmit:c,error:l.error,getPendingFiles:u,clearPendingFiles:p})},jg=Cg,Sg=e=>{const t=de(e),o=ta(t);return n.jsx(oa,{...o,...t})},wg=Sg,Ig=e=>{const t=de(e),o=ca();return n.jsx(sa,{...o,...t})},Tg=Ig,Mg=e=>{const t=de(e),o=ra(e);return n.jsx(na,{...o,...t})},Rg=Mg,zg=e=>{let t=de(e);t.selected=t.value;const o=Fn(e);return n.jsx(qn,{...o,...t})},Eg=zg,Vg=e=>{const t=de(e),o=Gn(e);return n.jsx(Yn,{...o,...t})},Pg=Vg,_g=e=>{const{name:t,...o}=e,{values:r,errors:a,touched:i,submitCount:l,setFieldValue:d,setFieldTouched:c}=ke.useFormikContext(),u=ke.getIn(r,t)||[],p=ke.getIn(i,t)||l>0?ke.getIn(a,t):void 0,m=g.useCallback(y=>{var j;const k=Array.isArray(y)?y.filter(S=>typeof S=="string"):[];d(t,k),(j=e.onTagsChange)==null||j.call(e,k)},[t,d,e.onTagsChange]),h=g.useCallback(()=>{var y;c(t,!0),(y=e.onBlur)==null||y.call(e)},[t,c,e.onBlur]),x=ga({...o,tags:u,onTagsChange:m,onBlur:h}),{tags:f,...b}=x;return n.jsx(ma,{...b,...o,tags:f,error:p})},Wg=_g,$g=e=>{const t=de(e),o=Qn(e);return n.jsx(Jn,{...o,...t})},Lg=$g,Dg=e=>{const t=de(e),{value:o,...r}=sr(e);return n.jsx(St,{...r,...t})},Hg=Dg,Bg=({visibleIcon:e=n.jsx(Go,{widthHeight:14}),hiddenIcon:t=n.jsx(qo,{widthHeight:14}),...o})=>{const r=de(o),{isVisible:a,setIsVisible:i,...l}=da(r);return n.jsx(St,{...l,type:a?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{o.isDisabled||i(!a)},children:a?e:t})})},Ag=Bg,Fg=({items:e,placeholder:t,searchPlaceholder:o,isMulti:r=!1,...a})=>{const i=de(a),l=ua(e,t,o);g.useEffect(()=>{if(r&&Array.isArray(i.value))l.setSelectedItems(i.value);else if(!r&&i.value){const c=typeof i.value=="object"?i.value:e.find(u=>u.value===i.value);c&&l.setSelectedItem(c)}},[i.value,r,e]);const d=c=>{i.onChange(c)};return n.jsx(pa,{...l,...i,items:e,placeholder:t,isMulti:r,onSelect:d})},Og=Fg,Ke=(e,t,o)=>Math.min(Math.max(e,t),o),vg=(e,t,o,r,a,i,l)=>{const d=r-o;let c;if(i==="horizontal"){const u=t.width,p=e-t.left;c=Ke(p/u,0,1)}else{const u=t.height,p=t.bottom-e;c=Ke(p/u,0,1)}if(l&&l.length>0){const u=o+c*d;let p=l[0],m=Math.abs(u-p);for(let h=1;h<l.length;h++){const x=Math.abs(u-l[h]);x<m&&(m=x,p=l[h])}return p}else{const u=o+c*d,p=Math.round(u/a)*a;return Ke(p,o,r)}},Sa=({min:e=0,max:t=100,step:o=1,value:r=0,defaultValue:a,onChange:i,onDrag:l,orientation:d="horizontal",isDisabled:c=!1,stepValues:u})=>{const p=Ke(r??a??e,e,t),[m,h]=g.useState(p),[x,f]=g.useState(!1),[b,y]=g.useState(!1),k=g.useRef(null),j=g.useRef(null),S=r!==void 0,C=S?r:m;g.useEffect(()=>{S&&h(Ke(r,e,t))},[r,S,e,t]);const w=g.useCallback($=>{const D=Ke($,e,t);S||h(D),i&&D!==C&&i(D),x&&l&&l(D)},[S,e,t,i,C,x,l]),I=g.useCallback($=>{if(c||!k.current)return;const D=k.current.getBoundingClientRect();let z;"touches"in $?z=d==="horizontal"?$.touches[0].clientX:$.touches[0].clientY:z=d==="horizontal"?$.clientX:$.clientY;const V=vg(z,D,e,t,o,d,u);w(V)},[e,t,o,d,w,c,u]),M=g.useCallback($=>{if(c)return;$.preventDefault(),f(!0),I($);const D=V=>{I(V)},z=()=>{f(!1),document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",D),document.removeEventListener("touchend",z)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",z),document.addEventListener("touchmove",D),document.addEventListener("touchend",z)},[I,c]),R=g.useCallback($=>{j.current&&j.current.contains($.target)||M($)},[M]),E=g.useCallback($=>{if(c)return;let D=C;switch($.key){case"ArrowLeft":case"ArrowDown":D=C-o;break;case"ArrowRight":case"ArrowUp":D=C+o;break;case"Home":D=e;break;case"End":D=t;break;default:return}$.preventDefault(),w(D)},[C,e,t,o,w,c]),W=t-e,T=W===0?0:(C-e)/W*100;return{currentValue:C,isDragging:x,isHovered:b,setIsHovered:y,trackRef:k,thumbRef:j,handleThumbMouseDown:M,handleTrackMouseDown:R,handleKeyDown:E,thumbPositionPercent:T}},Br={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},Ar={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},Fr={square:0,rounded:4,pill:24},Ng=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",transition:"border-color 0.15s ease"}}),Or=Ng(),Ug={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},qg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},wa=({min:e=0,max:t=100,step:o=1,currentValue:r,stepValues:a,shape:i="rounded",size:l="md",variant:d="default",orientation:c="horizontal",isDisabled:u=!1,showValue:p=!1,showTooltip:m=!1,backgroundColor:h="theme-primary",label:x,helperText:f,themeMode:b,shadow:y={},isDragging:k,isHovered:j,setIsHovered:S,trackRef:C,thumbRef:w,handleThumbMouseDown:I,handleTrackMouseDown:M,handleKeyDown:R,thumbPositionPercent:E,ariaLabel:W="Slider",views:T={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:$,onDrag:D,...z})=>{var Y,q;const{getColorHex:V,themeMode:_}=s.useTheme(),P=V(h,{themeMode:b||_}),L=V("theme-disabled",{themeMode:b||_}),H=V(Or[d].backgroundColor,{themeMode:b||_}),B=c==="vertical",{trackCrossAxisSize:F,thumbSize:A}=Ug[l]||{trackCrossAxisSize:Br[l].height,thumbSize:Ar[l].width||16},O=n.jsxs(s.Vertical,{width:"100%",gap:8,...T.container,...z,children:[x&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...T.label,children:x}),p&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:M,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),...Br[l],borderRadius:Fr[i],backgroundColor:H,...Or[d],...y,...T.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(X=>{const ee=(X-e)/(t-e)*100;return n.jsx(s.View,{position:"absolute",top:"50%",left:`${ee}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?L:P,zIndex:1,...T.stepMarks},X)})}),n.jsx(s.View,{position:"absolute",top:0,left:0,height:"100%",width:`${E}%`,backgroundColor:u?L:P,borderRadius:Fr[i],transition:"width 0.1s ease-in-out",...T.progress,...T.filledTrack}),n.jsx(s.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":r,"aria-orientation":c,"aria-disabled":u,"aria-label":W,position:"absolute",top:"50%",left:`${E}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${u?L:P}`,transition:k?"none":"transform 0.1s ease-in-out",transform:j?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:I,onTouchStart:I,onKeyDown:R,...Ar[l],...T.thumb,children:m&&(j||k)&&n.jsx(s.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...T.tooltip,children:n.jsx(s.Text,{...(Y=T.tooltip)==null?void 0:Y.text,children:r==null?void 0:r.toFixed(o<1?1:0)})})})]}),f&&n.jsx(_o,{children:f})]}),G=n.jsxs(s.Center,{...qg[c],position:"relative",onMouseEnter:()=>!u&&S(!0),onMouseLeave:()=>!u&&S(!1),...z,...T==null?void 0:T.container,children:[x&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...T.label,children:x}),p&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",borderRadius:F/2,backgroundColor:u?L:H,cursor:u?"not-allowed":"pointer",width:B?`${F}px`:"100%",height:B?"100%":`${F}px`,onMouseDown:M,onTouchStart:M,...T==null?void 0:T.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(X=>{const ee=(X-e)/(t-e)*100;return n.jsx(s.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?L:P,zIndex:1,...B?{bottom:`${ee}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${ee}%`,top:"50%",transform:"translate(-50%, -50%)"},...T.stepMarks},X)})}),n.jsx(s.View,{position:"absolute",borderRadius:F/2,backgroundColor:u?L:P,...B?{bottom:0,left:0,width:"100%",height:`${E}%`}:{top:0,left:0,height:"100%",width:`${E}%`},...T==null?void 0:T.filledTrack,...T==null?void 0:T.progress}),n.jsx(s.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":r,"aria-orientation":c,"aria-disabled":u,"aria-label":W,position:"absolute",width:`${A}px`,height:`${A}px`,borderRadius:"50%",backgroundColor:u?L:P,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:B?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...B?{left:"50%",bottom:`${E}%`}:{top:"50%",left:`${E}%`},onMouseDown:I,onTouchStart:I,onKeyDown:R,...T==null?void 0:T.thumb,children:m&&(j||k)&&n.jsx(s.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...B?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...T==null?void 0:T.tooltip,children:n.jsx(s.Text,{...(q=T==null?void 0:T.tooltip)==null?void 0:q.text,children:r==null?void 0:r.toFixed(o<1?1:0)})})})]}),f&&n.jsx(_o,{marginTop:8,children:f})]});return B||m?G:O},Gg=e=>{const t=de(e),o=Sa({...e,value:t.value!==void 0?Number(t.value):void 0,onChange:r=>{var a;t.onChange(r),(a=e.onChange)==null||a.call(e,r)}});return n.jsx(wa,{...e,...o,...t})},Yg=Gg,Xg=e=>{const t=de(e),{isFocused:o,setIsFocused:r,isHovered:a,setIsHovered:i,inputRef:l,containerRef:d,mirrorSelectionStart:c,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleFocus:x,handleBlur:f,handleKeyDown:b,handlePaste:y}=ha(e),k=g.useCallback(S=>{t.onChange&&t.onChange(S),e.onComplete&&S.length===(e.length||6)&&e.onComplete(S),l.current&&(l.current.value=S)},[t,e,l]),j=g.useCallback(S=>{const C=S.currentTarget.value.slice(0,e.length||6);k(C),l.current&&(l.current.value=C)},[e.length,k,l]);return n.jsx(fa,{...e,...t,setValue:k,isFocused:o,setIsFocused:r,isHovered:a,setIsHovered:i,inputRef:l,containerRef:d,mirrorSelectionStart:c,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleChange:j,handleFocus:x,handleBlur:f,handleKeyDown:b,handlePaste:y,stepValues:e.stepValues})},Kg=Xg,Qg=e=>Array.isArray(e)?e:e==null?[]:[e],Ia=({name:e,uploadFile:t,onUploadSuccess:o,onUploadError:r,transformResponse:a,onMultipleFileSelect:i,onFileSelect:l,multiple:d=!0,...c})=>{const{setFieldValue:u,setFieldTouched:p,values:m}=ke.useFormikContext(),[h,x]=g.useState(!1),[f,b]=g.useState(0),y=g.useCallback(async S=>{if(!S||S.length===0)return;p(e,!0,!0),x(!0);const C=[];for(const w of S){b(0);try{const I=await t(w,R=>{b(R??0)}),M=a?a(I,w):I;C.push(M),o==null||o(w,M)}catch(I){r==null||r(w,I)}}if(C.length>0){const w=Qg(ke.getIn(m,e));u(e,[...w,...C],!0),b(100)}else b(0);x(!1)},[e,r,o,p,u,a,t,m]),k=g.useCallback(async S=>{i==null||i(S),await y(S)},[y,i]),j=g.useCallback(async S=>{l==null||l(S),await y([S])},[y,l]);return n.jsx(ao,{...c,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:j,isLoading:h,progress:f})};Ia.displayName="FormikUploader";const Jg=e=>{let t=de(e);t.selected=t.value;const o=Xn(e);return n.jsx(Kn,{...o,...t})},Zg=Jg,Ta=e=>{const[t,o]=g.useState(!1),[r,a]=g.useState(e);return{isHovered:t,setIsHovered:o,isToggle:r,setIsToggled:a}},em={square:0,rounded:4,pill:24},tm=(e,t)=>({outline:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:e,_hover:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(-1px)"},_active:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(0)"},transition:"all 0.2s ease"}});function om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rm=function(t){t.charAt&&t.charAt(0)==="#"&&(t=nm(t)),t.length===3&&(t=am(t));var o=parseInt(t,16),r=o>>16&255,a=o>>8&255,i=o&255;return[r,a,i]};function nm(e){var t=e.split("");return t.shift(),t.join("")}function am(e){return e.split("").reduce(function(t,o){return t.concat([o,o])},[]).join("")}var im=rm,lm=function(t){var o=im(t),r=Math.round((parseInt(o[0])*299+parseInt(o[1])*587+parseInt(o[2])*114)/1e3);return r<=180?"dark":"light"};const cm=om(lm),Ma=({children:e,shape:t="rounded",variant:o="ghost",isHovered:r,setIsHovered:a,isDisabled:i,isToggle:l,setIsToggled:d,onToggle:c,views:u,backgroundColor:p,color:m,themeMode:h,...x})=>{const{getColor:f,themeMode:b}=s.useTheme(),j=f(i?"theme-disabled":p??m??"theme-primary",{themeMode:h??b}),S=cm(j),w=g.useMemo(()=>tm(j,S==="light"),[j,S])[o],I=!!(l||r),M=()=>a(!r),R=()=>{i||d(E=>{const W=!E;return c&&c(W),W})};return n.jsx(s.Center,{role:"Toggle",padding:t==="pill"?"10px 12px":"8px",width:"fit-content",cursor:i?"not-allowed":"pointer",borderRadius:em[t],onClick:R,onMouseEnter:M,onMouseLeave:()=>a(!1),...w,...I&&{backgroundColor:j,color:S==="light"?"color-black":"color-white"},...x,...u==null?void 0:u.container,children:e})},sm=({children:e,shape:t,variant:o,isDisabled:r,isToggled:a=!1,onToggle:i,...l})=>{const d=de(l),{isHovered:c,setIsHovered:u,isToggle:p,setIsToggled:m}=Ta(d.value??a);g.useEffect(()=>{m(d.value??a)},[d.value,a]);const h=x=>{m(x),d.onChange(x),i==null||i(x)};return n.jsx(Ma,{shape:t,variant:o,isDisabled:r,isHovered:c,setIsHovered:u,isToggle:p,setIsToggled:m,onToggle:h,...l,children:e})},dm=sm,Ra=()=>{const[e,t]=g.useState([]);return{activeToggles:e,setActiveToggles:t}},um=({children:e,shape:t,variant:o,isDisabled:r,isToggled:a=!1,onToggle:i,...l})=>{const{isHovered:d,setIsHovered:c,isToggle:u,setIsToggled:p}=Ta(a);return g.useEffect(()=>{p(a)},[a]),n.jsx(Ma,{shape:t,variant:o,isDisabled:r,isHovered:d,setIsHovered:c,isToggle:u,setIsToggled:p,onToggle:i,...l,children:e})},za=um,Ea=({items:e,onToggleChange:t,activeToggles:o,setActiveToggles:r,shape:a="rounded",variant:i="ghost",views:l})=>{const d=g.useCallback((c,u)=>{r(p=>{let m;return u?m=p.includes(c)?p:[...p,c]:m=p.filter(h=>h!==c),t==null||t(m),m})},[t,r]);return n.jsx(s.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...l==null?void 0:l.container,children:e.map(c=>n.jsx(za,{role:`toggle-${c.id}`,shape:a,variant:i,isToggled:o.includes(c.id)||c.isActive,onToggle:u=>d(c.id,u),isDisabled:c.isDisabled,views:l==null?void 0:l.toggle,children:c.value},c.id))})},pm=({items:e,shape:t,variant:o,onToggleChange:r,...a})=>{const i=de(a),{activeToggles:l,setActiveToggles:d}=Ra();g.useEffect(()=>{Array.isArray(i.value)&&d(i.value)},[i.value]);const c=u=>{d(u),i.onChange(u),r==null||r(u)};return n.jsx(Ea,{items:e,shape:t,variant:o,activeToggles:l,setActiveToggles:d,onToggleChange:c,...a})},gm=pm,vr=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],Va=e=>{const{value:t,defaultValue:o,onChange:r,isOpen:a,onOpen:i,onClose:l,closeOnSelect:d=!0}=e,[c,u]=g.useState(a??!1),[p,m]=g.useState(t??o??""),[h,x]=g.useState(""),f=g.useRef(null),b=g.useRef(null);g.useEffect(()=>{t!==void 0&&m(t)},[t]),g.useEffect(()=>{a!==void 0&&u(a)},[a]);const y=g.useMemo(()=>h?vr.filter(w=>w.toLowerCase().includes(h.toLowerCase())).slice(0,100):vr.slice(0,100),[h]);g.useEffect(()=>{const w=I=>{c&&f.current&&b.current&&!f.current.contains(I.target)&&!b.current.contains(I.target)&&k()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const k=g.useCallback(()=>{a===void 0&&u(!1),l&&l()},[l,a]),j=g.useCallback(()=>{const w=!c;a===void 0&&u(w),w?(i&&i(),x("")):l&&l()},[c,i,l,a]),S=g.useCallback(w=>{t===void 0&&m(w),r&&r(w),d&&k()},[r,d,k,t]),C=g.useCallback(w=>{x(w)},[]);return{isOpen:c,selectedIcon:p,searchQuery:h,filteredIcons:y,handleToggle:j,handleIconSelect:S,handleSearchChange:C,handleClose:k,triggerRef:f,dropdownRef:b}},Ne={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",transition:"all 0.2s ease"}},mm={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},hm={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},fm={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Pa=({label:e,placeholder:t="Select an icon",helperText:o,views:r={},size:a="md",shape:i="default",variant:l="default",error:d=!1,isDisabled:c=!1,isReadOnly:u=!1,showSearch:p=!0,isOpen:m,selectedIcon:h,searchQuery:x,filteredIcons:f,handleToggle:b,handleIconSelect:y,handleSearchChange:k,triggerRef:j,dropdownRef:S,handleClose:C,onChange:w,...I})=>{const{getColor:M}=s.useTheme(),R={...Ne.container,...r==null?void 0:r.container},E={...Ne.trigger,...mm[a],...hm[i],...fm[l],...d&&{borderColor:"color-red-500"},...c&&{opacity:.6,cursor:"not-allowed"},...r==null?void 0:r.trigger},W={...Ne.dropdown,...r==null?void 0:r.dropdown},T={...Ne.iconGrid,...r==null?void 0:r.iconGrid};return n.jsxs(s.View,{...R,...I,children:[e&&n.jsx(s.Text,{fontSize:a==="xs"?"12px":a==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...r==null?void 0:r.label,children:e}),n.jsxs(s.View,{ref:j,onClick:c||u?void 0:b,...E,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?n.jsxs(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[n.jsx(Ot,{name:h,widthHeight:16}),n.jsx(s.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):n.jsx(s.Text,{color:"color-gray-500",fontSize:"inherit",children:t})}),!u&&!c&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:m?"up":"down"})]}),m&&n.jsxs(s.View,{ref:S,...W,children:[p&&n.jsx(s.View,{...Ne.searchInput,...r==null?void 0:r.searchInput,children:n.jsx(wt,{placeholder:"Search icons...",value:x,onChange:$=>k($),size:"sm",autoFocus:!0})}),n.jsx(s.View,{...T,children:f.length>0?f.map($=>n.jsx(s.View,{...Ne.iconItem,onClick:()=>y($),title:$,_hover:{backgroundColor:"color-gray-100"},backgroundColor:h===$?"color-blue-100":"transparent",...r==null?void 0:r.iconItem,children:n.jsx(Ot,{name:$,widthHeight:20})},$)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:"No icons found"})})})]}),o&&n.jsx(s.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...r==null?void 0:r.helperText,children:o})]})},xm=e=>{const t=de(e),o={...e,value:t.value??e.value??e.defaultValue},r=Va(o),a=i=>{r.handleIconSelect(i),t.onChange(i)};return n.jsx(Pa,{...r,...o,handleIconSelect:a})},bm=xm,Me={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",borderBottom:"1px solid color-gray-200",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",fontSize:"20px",transition:"all 0.2s ease"}},ym={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},km={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Cm={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},jm={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Sm=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],_a=e=>{const{value:t,defaultValue:o="",onChange:r,onEmojiSelect:a,isOpen:i,onOpen:l,onClose:d,closeOnSelect:c=!0,maxRecentEmojis:u=16,showRecentEmojis:p=!0,enabledCategories:m=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[x,f]=g.useState(i??!1),[b,y]=g.useState(t??o),[k,j]=g.useState(""),[S,C]=g.useState("smileys"),[w,I]=g.useState([]),M=g.useRef(null),R=g.useRef(null),E=g.useMemo(()=>[...Sm,...h],[h]),W=g.useMemo(()=>{let P=E;if(S!=="recent"?P=P.filter(L=>L.category===S):P=w,k){const L=k.toLowerCase();P=P.filter(H=>H.name.toLowerCase().includes(L)||H.keywords.some(B=>B.toLowerCase().includes(L)))}return P},[E,S,w,k]);g.useEffect(()=>{t!==void 0&&y(t)},[t]),g.useEffect(()=>{i!==void 0&&f(i)},[i]),g.useEffect(()=>{if(p){const P=localStorage.getItem("emojiPicker-recentEmojis");if(P)try{I(JSON.parse(P))}catch{}}},[p]),g.useEffect(()=>{const P=L=>{x&&M.current&&R.current&&!M.current.contains(L.target)&&!R.current.contains(L.target)&&_()};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[x]);const T=g.useCallback(P=>{p&&I(L=>{const H=L.filter(F=>F.emoji!==P.emoji),B=[P,...H].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(B)),B})},[p,u]),$=g.useCallback(()=>{const P=!x;f(P),P?(l==null||l(),j(""),p&&w.length>0?C("recent"):C("smileys")):d==null||d()},[x,l,d,p,w.length]),D=g.useCallback(P=>{y(P.emoji),T(P),r==null||r(P.emoji),a==null||a(P),c&&(f(!1),d==null||d())},[r,a,c,d,T]),z=g.useCallback(P=>{j(P),P&&S==="recent"&&C("smileys")},[S]),V=g.useCallback(P=>{C(P),j("")},[]),_=g.useCallback(()=>{f(!1),d==null||d()},[d]);return{isOpen:x,selectedEmoji:b,recentEmojis:w,searchQuery:k,activeCategory:S,filteredEmojis:W,handleToggle:$,handleEmojiSelect:D,handleSearchChange:z,handleCategoryChange:V,handleClose:_,triggerRef:M,dropdownRef:R}},Wa=({id:e,name:t,label:o,placeholder:r="Select an emoji",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",error:u=!1,isDisabled:p=!1,isReadOnly:m=!1,showSearch:h=!0,showCategories:x=!0,showRecentEmojis:f=!0,enabledCategories:b=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:y,selectedEmoji:k,recentEmojis:j,searchQuery:S,activeCategory:C,filteredEmojis:w,handleToggle:I,handleEmojiSelect:M,handleSearchChange:R,handleCategoryChange:E,triggerRef:W,dropdownRef:T,onChange:$,...D})=>{const{getColor:z}=s.useTheme(),V={...Me.container,...i==null?void 0:i.container},_={...Me.trigger,...ym[l],...km[d],...Cm[c],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...i==null?void 0:i.trigger},P={...Me.dropdown,...i==null?void 0:i.dropdown},L={...Me.categoryTabs,...i==null?void 0:i.categoryTabs},H={...Me.emojiGrid,...i==null?void 0:i.emojiGrid},B=b.filter(F=>F==="recent"?f&&j.length>0:!0);return n.jsxs(s.View,{...V,...D,children:[o&&n.jsx(s.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:W,onClick:p||m?void 0:I,..._,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,children:n.jsx(s.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||r})}),!m&&!p&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&n.jsxs(s.View,{ref:T,...P,children:[h&&n.jsx(s.View,{...Me.searchInput,...i==null?void 0:i.searchInput,children:n.jsx(wt,{placeholder:"Search emojis...",value:S,onChange:F=>R(F.target.value),size:"sm"})}),x&&n.jsx(s.View,{...L,children:B.map(F=>n.jsx(s.View,{...Me.categoryTab,...C===F&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>E(F),title:F.charAt(0).toUpperCase()+F.slice(1),...i==null?void 0:i.categoryTab,children:jm[F]},F))}),n.jsx(s.View,{...H,children:w.length>0?w.map((F,A)=>n.jsx(s.View,{...Me.emoji,onClick:()=>M(F),title:F.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...i==null?void 0:i.emoji,children:F.emoji},`${F.emoji}-${A}`)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:S?"No emojis found":"No emojis in this category"})})})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},wm=e=>{const t=de(e),o={...e,value:t.value??e.value??e.defaultValue},r=_a(o),a=i=>{var l;r.handleEmojiSelect(i),t.onChange(i.emoji),(l=e.onEmojiSelect)==null||l.call(e,i)};return n.jsx(Wa,{...r,...o,handleEmojiSelect:a})},Im=wm,Tm=({files:e,onRemove:t,maxHeight:o="120px",views:r={}})=>{if(e.length===0)return null;const a=g.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:o,overflowY:"auto",...r==null?void 0:r.container,children:e.map((i,l)=>{const d=i.url||"",c=i.type.startsWith("image/"),u=i.type.startsWith("video/"),p=i.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...r==null?void 0:r.item,children:n.jsxs(fe,{children:[n.jsx(fe.Trigger,{children:n.jsxs(s.View,{position:"relative",children:[c&&d&&n.jsx(s.Image,{src:d,alt:i.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),p&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!c&&!u&&!p&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),t&&n.jsx(s.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",_hover:{backgroundColor:"color-red-600"},onClick:m=>{m.stopPropagation(),t(l)},"aria-label":`Remove ${i.name}`,children:"×"})]})}),n.jsxs(fe.Content,{children:[c&&d&&n.jsx(s.Image,{src:d,alt:i.name,maxWidth:"300px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),p&&d&&n.jsx(s.View,{as:"audio",src:d,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...r==null?void 0:r.name,children:[i.name," (",a(i.size),")"]})]})]})},l)})})},Mm=e=>{const t=Sa(e);return n.jsx(wa,{...e,...t})},Rm=Mm,zm=({url:e,type:t,name:o,onOpen:r})=>{const a=t.toLowerCase(),i=a.startsWith("image"),l=a.startsWith("video"),d=a.startsWith("audio"),c=()=>{r&&r()};return n.jsxs(s.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:c,children:[i&&n.jsx(s.Image,{src:e,alt:o,width:"100%",height:"100%",objectFit:"cover"}),l&&n.jsx(s.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),d&&n.jsx(s.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!i&&!l&&!d&&n.jsx(xt,{widthHeight:24,color:"color-gray-600"})]})},ze=Bo.create(e=>({modals:[],onHide:t=>t,onShow:(t,o)=>({name:t,props:o}),show:(t,o={},r={})=>{e(a=>({...a,modals:[...a.modals,{name:t,props:{...o,isVisible:!0},overlayProps:r}]}))},hide:t=>{e(o=>t?{...o,modals:o.modals.filter(r=>r.name!==t)}:{modals:[]})},setOnHide:t=>{e(o=>({...o,onHide:t}))},setOnShow:t=>{e(o=>({...o,onShow:t}))}})),Em=(e,t={},o={})=>{ze.getState().show(e,t,o),ze.getState().onShow(e,t)},dr=e=>{console.log("hideModal",e),ze.getState().onHide(e),ze.getState().hide(typeof e=="string"?e:void 0)},Vm={square:{borderRadius:0},rounded:{borderRadius:"8px"}},Pm={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},_m={xs:12,sm:16,md:20,lg:24,xl:28},_t={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},$a=({children:e,blur:t,isOpen:o=!1,isClosePrevented:r=!1,onClose:a=()=>{},position:i="center",views:l,...d})=>{const c=()=>{r||a()};return n.jsx(s.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:c,visibility:o?"visible":"hidden",transition:"all 0.3s ease",...l==null?void 0:l.container,children:n.jsx(s.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:t?`blur(${t}px)`:void 0,transition:"all 0.3s ease",onClick:c,...Pm[i],...d,...l==null?void 0:l.view,children:e})})},Wm=({children:e,shadow:t,isFullScreen:o=!1,shape:r="rounded",views:a,isOpen:i,...l})=>{const d=typeof document!==void 0?{boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"}:{elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},c=u=>{u&&u.stopPropagation&&u.stopPropagation()};return n.jsx(s.Vertical,{cursor:"default",backgroundColor:"color-white",width:o?"100%":600,height:o?"100%":"fit-content",onClick:c,transition:"all 0.3s ease",...t||d,...Vm[r],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...l,...a==null?void 0:a.container,children:e})},$m=({children:e,buttonColor:t="theme-primary",iconSize:o="md",buttonPosition:r="right",views:a,...i})=>{const l=i.onClose?i.onClose:dr,d=n.jsx(s.View,{onClick:l,children:n.jsx(xe,{widthHeight:_m[o],color:t})});return n.jsxs(s.Horizontal,{justifyContent:r==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...i,...a==null?void 0:a.header,children:[r==="left"&&d,e,r==="right"&&d]})},Lm=({children:e,views:t,...o})=>n.jsx(s.View,{paddingVertical:16,paddingHorizontal:24,fontSize:_t.body.fontSize,fontWeight:_t.body.fontWeight,lineHeight:_t.body.lineHeight,color:_t.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...o,...t==null?void 0:t.view,children:e}),Dm=({children:e,views:t,...o})=>n.jsx(s.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...o,...t==null?void 0:t.container,children:e}),Hm=({modals:e,onShow:t,onHide:o})=>{const r=ze(a=>a.modals);return t&&ze.getState().setOnShow(t),o&&ze.getState().setOnHide(o),r.length===0?null:n.jsx(g.Fragment,{children:r.map((a,i)=>{const l=e[a.name];return l?n.jsx($a,{isOpen:a.props.isVisible,onClose:()=>dr(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+i},children:n.jsx(l,{...a.props})},i):(console.error(`${a.name} modal doesn't exist`),null)})})},Be=({children:e})=>n.jsx(n.Fragment,{children:e});Be.Overlay=$a;Be.Container=Wm;Be.Header=$m;Be.Body=Lm;Be.Footer=Dm;Be.Layout=Hm;const Nr={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},Bm={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},La=({isOpen:e,onClose:t,isClosePrevented:o,blur:r,children:a,...i})=>{const l=()=>{o||t()};return g.useEffect(()=>{const d=c=>{c.key==="Escape"&&e&&!o&&t()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,o,t]),n.jsx(s.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:l,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:r?`blur(${r}px)`:void 0,pointerEvents:e?"auto":"none",...i,children:a})},Da=({placement:e="right",size:t="md",children:o,...r})=>{const a=d=>{d.stopPropagation()},l=e==="top"||e==="bottom"?{height:t==="full"?"100vh":Nr[t]||t,maxHeight:"100vh"}:{width:t==="full"?"100vw":Nr[t]||t,maxWidth:"100vw"};return n.jsx(s.Vertical,{position:"absolute",backgroundColor:"color-white",...Bm[e],...l,onClick:a,transition:"transform 0.3s ease",...r,children:o})},Am=({children:e,onClose:t,buttonPosition:o="right",...r})=>{const a=t&&n.jsx(s.View,{onClick:t,cursor:"pointer",padding:8,children:n.jsx(xe,{widthHeight:20,color:"color-gray-500"})});return n.jsxs(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:o==="none"?"center":"space-between",...r,children:[o==="left"&&a,e,o==="right"&&a]})},Fm=({children:e,...t})=>n.jsx(s.Vertical,{padding:24,flex:1,overflowY:"auto",...t,children:e}),Om=({children:e,...t})=>n.jsx(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...t,children:e}),vm=({isOpen:e,onClose:t,placement:o="right",size:r="md",isClosePrevented:a,children:i,...l})=>{const d=e?{}:{transform:o==="left"||o==="right"?`translateX(${o==="left"?"-100%":"100%"})`:`translateY(${o==="top"?"-100%":"100%"})`};return n.jsx(La,{isOpen:e,onClose:t,isClosePrevented:a,...l,children:n.jsx(Da,{placement:o,size:r,style:d,children:i})})},rt=vm;rt.Overlay=La;rt.Container=Da;rt.Header=Am;rt.Body=Fm;rt.Footer=Om;const Nm=(e=null,t=[])=>{const[o,r]=g.useState(e),[a,i]=g.useState(t),l=g.useRef({});return{activeItemId:o,setActiveItemId:r,expandedItemIds:a,toggleExpandedItem:u=>{i(p=>p.includes(u)?p.filter(h=>h!==u):[...p,u])},isItemExpanded:u=>a.includes(u),triggerRefs:l}},$o={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"12px 16px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"10px 14px",fontSize:"13px"}}},lg:{padding:"16px 20px",fontSize:"16px",fontWeight:"500",media:{mobile:{padding:"12px 16px",fontSize:"14px"}}}},Lo={default:{backgroundColor:"transparent",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"}},Ha={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Xe={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},Ba=g.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),Um=({children:e,value:t})=>n.jsx(Ba.Provider,{value:t,children:e}),It=()=>{const e=g.useContext(Ba);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},ur=({children:e,views:t})=>{const{orientation:o}=It(),r=o==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(r,{width:"100%",...Ha[o],transition:"all 0.2s ease",borderRadius:"4px",...t==null?void 0:t.container,children:e})},Aa=g.createContext({itemValue:null,isDisabled:!1}),qm=()=>{const e=g.useContext(Aa);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},pr=({item:e,value:t,isDisabled:o=!1,children:r,views:a})=>{var k;const{activeItemId:i,setActiveItemId:l,orientation:d,size:c,variant:u,onItemActivate:p}=It(),m=(e==null?void 0:e.id)||t,h=i===m,x=(e==null?void 0:e.items)&&e.items.length>0,f=(e==null?void 0:e.disabled)||o,b=()=>{f||m&&(l(m),p&&p(m))},y=d==="horizontal"?s.Horizontal:s.Vertical;return r?n.jsx(Aa.Provider,{value:{itemValue:m||null,isDisabled:f},children:n.jsx(s.View,{width:"100%",cursor:f?"not-allowed":"pointer",opacity:f?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...$o[c],...Lo[u],...h?Xe.active:{},_hover:f?{}:Xe.hover,...a==null?void 0:a.item,children:r})}):x&&e?n.jsxs(y,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[n.jsxs(Fa,{itemId:e.id,disabled:e.disabled,views:a,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}),n.jsx(Oa,{itemId:e.id,children:n.jsx(ur,{children:(k=e.items)==null?void 0:k.map(j=>n.jsx(pr,{item:j},j.id))})})]}):e?n.jsxs(s.View,{as:e.href?"a":"div",to:e.href,onClick:b,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"4px",transition:"all 0.2s ease",gap:"8px",...$o[c],...Lo[u],...h?Xe.active:{},_hover:e.disabled?{}:Xe.hover,...a==null?void 0:a.item,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}):null},Fa=({children:e,itemId:t,disabled:o,views:r})=>{const{activeItemId:a,toggleExpandedItem:i,isItemExpanded:l,size:d,variant:c,triggerRefs:u}=It(),p=g.useRef(null),m=a===t,h=l(t);g.useEffect(()=>(p.current&&t&&(u.current[t]=p.current),()=>{t&&delete u.current[t]}),[t,u]);const x=f=>{f.preventDefault(),!o&&i(t)};return n.jsxs(s.View,{ref:p,onClick:x,cursor:o?"not-allowed":"pointer",opacity:o?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:4,transition:"background-color 0.2s ease",...$o[d],...Lo[c],...m?Xe.active:{},_hover:o?{}:Xe.hover,...r==null?void 0:r.trigger,children:[n.jsx(s.View,{display:"flex",alignItems:"center",children:e}),n.jsx(s.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...r==null?void 0:r.indicator,children:n.jsx(ie,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},Oa=({children:e,itemId:t,views:o})=>{const{isItemExpanded:r,orientation:a,triggerRefs:i}=It(),l=g.useRef(null),[d,c]=g.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(t);if(g.useEffect(()=>{if(u&&l.current&&t&&i.current[t]&&a==="horizontal"){const m=l.current.getBoundingClientRect(),h=i.current[t].getBoundingClientRect(),x=Math.max(m.width||200,200),f=Math.max(m.height||150,150),b=window.innerWidth,y=window.innerHeight,k={top:h.top,right:b-h.right,bottom:y-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:h.left,y:h.top-f-8},{placement:"right",space:k.right,fits:k.right>=x+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:h.left-x-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=x+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:h.left-x-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:h.left,y:h.top-f-8}],S=j.find(M=>M.fits);if(S){c({x:S.x,y:S.y,placement:S.placement});return}const C=j.reduce((M,R)=>R.space>M.space?R:M);let w=C.x,I=C.y;w+x>b&&(w=b-x-8),w<8&&(w=8),I+f>y&&(I=y-f-8),I<8&&(I=8),c({x:w,y:I,placement:C.placement})}},[u,a,t,i]),!u)return null;if(a==="vertical")return n.jsx(s.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...o==null?void 0:o.container,children:e});const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.View,{ref:l,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...o==null?void 0:o.container,children:e})},Gm=({href:e,children:t,views:o,...r})=>{const{itemValue:a,isDisabled:i}=qm(),{activeItemId:l,setActiveItemId:d,onItemActivate:c}=It(),u=l===a,p=m=>{if(i){m.preventDefault();return}a&&(d(a),c&&c(a)),r.onClick&&r.onClick(m)};return n.jsx(s.View,{as:"a",href:i?void 0:e,onClick:p,cursor:i?"not-allowed":"pointer",opacity:i?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":i,"data-active":u?"":void 0,"data-disabled":i?"":void 0,...u?{fontWeight:"bold"}:{},...o==null?void 0:o.container,...r,children:t})},Ym=({items:e,orientation:t,views:o,themeMode:r})=>{const a=t==="horizontal"?s.Horizontal:s.Vertical;return!e||e.length===0?null:n.jsx(a,{width:"100%",...Ha[t],...o==null?void 0:o.container,children:n.jsx(ur,{views:o,children:e.map(i=>n.jsx(pr,{item:i,views:o},i.id))})})},Xm=({items:e,children:t,orientation:o="vertical",size:r="md",variant:a="default",defaultActiveItemId:i=null,defaultExpandedItemIds:l=[],onItemActivate:d,views:c,...u})=>{const{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:x,isItemExpanded:f,triggerRefs:b}=Nm(i,l);return n.jsx(Um,{value:{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:x,isItemExpanded:f,orientation:o,size:r,variant:a,onItemActivate:d,triggerRefs:b},children:e?n.jsx(Ym,{items:e,orientation:o,size:r,variant:a,views:c,...u}):t})},nt=Xm;nt.List=ur;nt.Item=pr;nt.Trigger=Fa;nt.Content=Oa;nt.Link=Gm;const va={},Na=g.createContext({views:va,onRowClick:()=>{}}),Km=({children:e,views:t=va,onRowClick:o})=>n.jsx(Na.Provider,{value:{views:t,onRowClick:o},children:e}),Pe=()=>g.useContext(Na),se={table:{width:"100%",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderBottomColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"color-gray-700",textAlign:"left",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderBottomColor:"color-gray-100",color:"color-gray-900",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderTopColor:"color-gray-200"},caption:{margin:"8px 0",color:"color-gray-600",fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...se.th},{...se.td});({...se.tr});({...se.td},{...se.th});({...se.table},{...se.th}),{...se.td},{...se.tr},{...se.tfoot},{...se.caption};const Ua=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"table",borderCollapse:"collapse",...se.table,...t==null?void 0:t.table,...e})},qa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"thead",textAlign:"left",...se.thead,...t==null?void 0:t.thead,...e})},Ga=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"th",whiteSpace:"nowrap",...se.th,...t==null?void 0:t.th,...e})},At=e=>{const{views:t,onRowClick:o}=Pe();return n.jsx(s.Element,{as:"tr",...se.tr,...t==null?void 0:t.tr,onClick:o,...e})},Do=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...se.td,...t==null?void 0:t.td,...e})},Ya=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tbody",...se.tbody,...t==null?void 0:t.tbody,...e})},Xa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tfoot",...se.tfoot,...t==null?void 0:t.tfoot,...e})},Ka=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"caption",...se.caption,...t==null?void 0:t.caption,...e})},Qm=({data:e,columns:t,footer:o,caption:r,themeMode:a})=>n.jsxs(Ua,{role:"Table",children:[r&&n.jsx(Ka,{children:r}),n.jsx(qa,{children:n.jsx(At,{children:t.map(i=>n.jsx(Ga,{children:i.title},i.field))})}),n.jsx(Ya,{children:e.map((i,l)=>n.jsx(At,{children:t.map((d,c)=>n.jsx(Do,{isFirstColumn:c===0,children:i[d.field]},d.field))},l))}),o&&n.jsx(Xa,{children:n.jsx(At,{children:o.map((i,l)=>n.jsx(Do,{...i.props,children:i.value},l))})})]}),Se=({children:e,views:t,onClick:o})=>n.jsx(Km,{views:t,onRowClick:o,children:e});Se.Head=qa;Se.HeadCell=Ga;Se.Body=Ya;Se.Row=At;Se.Cell=Do;Se.Footer=Xa;Se.Caption=Ka;Se.Container=Ua;Se.Template=Qm;const Jm=(e,t,o)=>{const r=u=>u.value!==void 0?u.value:u.title,a=()=>{if(!(!e||e.length===0)){if(t!==void 0){const u=e.find(p=>r(p)===t);if(u)return u}return e[0]}},[i,l]=g.useState(a()),d=o!==void 0?e.find(u=>r(u)===o):i,c=u=>{o===void 0&&l(u)};return g.useEffect(()=>{if(o!==void 0)return;const u=a(),p=i&&e.some(m=>r(m)===r(i));u&&(!p||t!==void 0&&i&&r(i)!==t)?l(u):!u&&i&&l(void 0)},[e,t]),{activeTab:d,setActiveTab:c}},Zm=(e,t,o)=>{const[r,a]=g.useState(e||null);return{activeValue:t!==void 0?t:r,setActiveValue:d=>{t===void 0&&a(d),o&&o(d)}}},eh=({tab:e,isActive:t,onClick:o,iconPosition:r="left",tabStyles:a,textStyles:i})=>{const l={display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",cursor:"pointer",borderBottom:"2px solid",borderBottomColor:t?"theme-primary":"transparent",backgroundColor:"transparent",color:t?"theme-primary":"color-gray-600",fontWeight:t?"600":"500",marginBottom:"-1px",transition:"all 0.2s ease",on:{hover:{color:"theme-primary",borderBottomColor:t?"theme-primary":"color-gray-300"}}},d=()=>{switch(r){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},c=()=>["top","bottom"].includes(r)?"4px":"8px",u=e.icon&&g.isValidElement(e.icon)?g.cloneElement(e.icon,{strokeWidth:t?2.5:2}):e.icon;return n.jsxs(s.Element,{as:"div",role:"tab","aria-selected":t,tabIndex:t?0:-1,...l,...a,flexDirection:d(),gap:c(),onClick:o,"data-state":t?"active":"inactive",children:[u&&n.jsx(s.Element,{children:u},t?"active-icon":"inactive-icon"),n.jsxs(s.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[n.jsx(s.Text,{...i,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),n.jsx(s.Text,{...i,fontWeight:t?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})},th=({tabs:e=[],activeTab:t,handleTabClick:o,views:r={},renderTab:a,renderContent:i,iconPosition:l="left"})=>t?n.jsxs(s.Vertical,{width:"100%",height:"100%",...r.container,children:[n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...r.headerTabs,children:e.map(d=>{const c=(d.value!==void 0?d.value:d.title)===(t.value!==void 0?t.value:t.title),u=()=>o(d);return a?a(d,c,u):n.jsx(eh,{tab:d,isActive:c,onClick:u,iconPosition:l,tabStyles:{...r.tab,...c?r.activeTab:{}},textStyles:{...r.title,...c?r.activeText:{}}},d.title)})}),n.jsx(s.View,{width:"100%",height:"100%",...r.content,children:i?i(t):t.content})]}):null,Qa=g.createContext(null),Ja=()=>{const e=g.useContext(Qa);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},oh=({children:e,views:t})=>n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...t==null?void 0:t.container,children:e}),rh=({value:e,children:t,disabled:o=!1,views:r})=>{const{activeValue:a,setActiveValue:i}=Ja(),l=a===e,d=()=>{o||i(e)};return n.jsx(s.View,{cursor:o?"not-allowed":"pointer",opacity:o?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:l?"theme-primary":"transparent",color:l?"theme-primary":"color-gray-600",fontWeight:l?"600":"400",transition:"all 0.2s ease",_hover:o?{}:{color:"theme-primary"},onClick:d,...r==null?void 0:r.trigger,...l?r==null?void 0:r.activeState:{},children:t})},nh=({value:e,children:t,views:o})=>{const{activeValue:r}=Ja();return r!==e?null:n.jsx(s.View,{width:"100%",padding:"24px",...o==null?void 0:o.content,children:t})},ah=({tabs:e,views:t,defaultValue:o,onTabChange:r,renderTab:a,renderContent:i,iconPosition:l="left",value:d,onValueChange:c,children:u})=>{const p=Zm(o,d,c),m=Jm(e||[],o,d);if(u)return n.jsx(Qa.Provider,{value:p,children:u});if(e){const h=x=>{const f=b=>b.value!==void 0?b.value:b.title;(!m.activeTab||f(m.activeTab)!==f(x))&&(m.setActiveTab(x),r&&r(x))};return n.jsx(th,{tabs:e,views:t,activeTab:m.activeTab,handleTabClick:h,renderTab:a,renderContent:i,iconPosition:l})}return null},ih=g.memo(ah),go=ih;go.List=oh;go.Trigger=rh;go.Content=nh;const lh=e=>{const{children:t,_isInView:o=!1,alternateHighlightText:r=[],alternateAnimation:a=!1,alternateDuration:i=3e3,highlightText:l,highlightTypewriter:d=!1,highlightSlide:c=!1,highlightSlideDuration:u=500,highlightSlideStagger:p=50,highlightSlideSequential:m=!0}=e,[h,x]=g.useState(t),[f,b]=g.useState(l);return g.useEffect(()=>{if(!a||r.length===0||!o||typeof t!="string"||typeof l!="string")return x(t),b(l),()=>{};const y=t,k=l;let j=0;const S=w=>{const I=r[w],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(M,"gi"),E=y.replace(R,I);x(E),b(I)};S(j);const C=setInterval(()=>{j=(j+1)%r.length,S(j)},i);return()=>clearInterval(C)},[a,r,i,l,t,o]),{finalDisplayedText:h,activeHighlightTarget:f,highlightTypewriter:d,highlightSlide:c,highlightSlideDuration:u,highlightSlideStagger:p,highlightSlideSequential:m}},ch={xs:24,sm:36,md:48,lg:64,xl:72},sh={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,t)=>({background:`linear-gradient(135deg, ${e}, ${t||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},dh=({text:e,typingSpeed:t=50,pauseTime:o=500,onComplete:r,showCursor:a=!0,cursorColor:i="currentColor",textStyle:l,textComponent:d,as:c,...u})=>{const p=d||s.Text,m=Array.isArray(e)?e:[e],[h,x]=g.useState(m.map(()=>"")),[f,b]=g.useState(!1),[y,k]=g.useState(0),[j,S]=g.useState(0);g.useEffect(()=>{x(m.map(()=>"")),b(!1),k(0),S(0)},[e]),g.useEffect(()=>{if(f){r&&r();return}const w=m[y];if(j>=w.length){if(y>=m.length-1){b(!0);return}const M=setTimeout(()=>{k(R=>R+1),S(0)},o);return()=>clearTimeout(M)}const I=setTimeout(()=>{x(M=>{const R=[...M];return R[y]=w.substring(0,j+1),R}),S(M=>M+1)},t);return()=>clearTimeout(I)},[m,y,j,f,r,o,t]);const C=w=>{if(!w||typeof w!="string")return w;const I=w.split("|");return I.length===1?w:I.map((M,R)=>n.jsxs(g.Fragment,{children:[M,R<I.length-1&&n.jsx("br",{})]},R))};return n.jsx(n.Fragment,{children:h.map((w,I)=>n.jsxs(g.Fragment,{children:[C(w),a&&I===y&&!f&&n.jsx(p,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:i,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...l})]},I))})},uh=({text:e,duration:t=500,direction:o="up",stagger:r=50,sequential:a=!1,textStyle:i,as:l,wordProps:d,textComponent:c,...u})=>{const[p,m]=g.useState(e),[h,x]=g.useState("entering"),[f,b]=g.useState(0),y=c||s.Text,k=g.useRef(null),j=g.useRef(null);g.useEffect(()=>{e===p&&h==="visible"||e!==p&&(h==="entering"||h==="visible"?(k.current=e,x("exiting")):h==="exiting"&&(k.current=e))},[e,p,h]);const{lines:S,totalWordCount:C}=g.useMemo(()=>{const _=p.split("|").map(L=>L.trim().split(/\s+/).filter(H=>H.length>0)),P=_.reduce((L,H)=>L+H.length,0);return{lines:_,totalWordCount:P}},[p]),w=g.useMemo(()=>a?C*(t+r):(C-1)*r+t,[C,t,r,a]),I=g.useMemo(()=>a?C*(t+r):(C-1)*r+t,[C,t,r,a]);g.useEffect(()=>(j.current&&clearTimeout(j.current),h==="entering"?j.current=setTimeout(()=>{x("visible")},w+50):h==="exiting"&&(j.current=setTimeout(()=>{k.current!==null&&(m(k.current),k.current=null),b(V=>V+1),x("entering")},I+50)),()=>{j.current&&clearTimeout(j.current)}),[h,w,I]);const{style:M,...R}=d||{},E=o==="up",W=V=>a?V*(t+r):V*r,T=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...i}),[i]),$=g.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),D=g.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let z=0;return n.jsx(s.Element,{as:"span",style:T,...u,children:n.jsx("span",{style:$,children:S.map((V,_)=>n.jsx("span",{style:D,children:V.map((P,L)=>{const H=z++,B=W(H),F=L===V.length-1;let A;const O=`${t}ms`,G=`${B}ms`;h==="entering"?A=E?s.Animation.slideInUp({duration:O,delay:G,timingFunction:"ease-out",fillMode:"both"}):s.Animation.slideInDown({duration:O,delay:G,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(A=E?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:O,delay:G,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:O,delay:G,timingFunction:"ease-in",fillMode:"both"});const Y={...M,display:"inline-block",marginRight:F?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return n.jsx(y,{as:"span",animate:A,...R,...Y,children:P},`${f}-${_}-${L}`)})},`line-${_}`))})})};function Ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const wo=e=>{if(!e||typeof e!="string")return e;const t=e.split("|");return t.length===1?e:t.map((o,r)=>n.jsxs(g.Fragment,{children:[o,r<t.length-1&&n.jsx("br",{})]},r))},ph=({children:e,highlightText:t,highlightStyle:o="solid",highlightColor:r="theme-primary",highlightSecondaryColor:a,size:i="lg",views:l,highlightAnimate:d,animate:c,animationLoop:u=1,highlightAnimationLoop:p=1,highlightTypewriter:m=!1,highlightTypewriterDuration:h=3e3,highlightSlide:x=!1,highlightSlideDuration:f=500,highlightSlideStagger:b=50,highlightSlideSequential:y=!0,themeMode:k,...j})=>{const{ref:S,inView:C}=s.useInView(),{finalDisplayedText:w,activeHighlightTarget:I,highlightTypewriter:M,highlightSlide:R,highlightSlideDuration:E,highlightSlideStagger:W,highlightSlideSequential:T}=lh({children:e,highlightText:t,_isInView:C,highlightTypewriter:m,highlightSlide:x,highlightSlideDuration:f,highlightSlideStagger:b,highlightSlideSequential:y,...j}),$=ch[i],D=sh[o](r,a),z=(B,F)=>B&&(Array.isArray(B)?B.map(A=>({...A,iterationCount:F.toString()})):{...B,iterationCount:F.toString()}),V=z(c,u),_=z(d,p),P=typeof w=="string"?w:typeof e=="string"?e:"",L={ref:S,animate:C?V:void 0,as:"h1",fontSize:$},H=B=>!C&&(M||R)?n.jsx("span",{style:{opacity:0},children:B}):M?n.jsx(dh,{text:B,typingSpeed:Math.max(30,h/(B.length*10)),cursorColor:"currentColor",...D}):R?n.jsx(uh,{text:B,duration:E,stagger:W,sequential:T,direction:"up",fontSize:$,wordProps:D}):wo(B);if(typeof P=="string"&&I){const B=Array.isArray(I)?new RegExp(`(${I.map(G=>Ur(String(G))).join("|")})`,"gi"):new RegExp(`(${Ur(String(I))})`,"gi"),F=[];let A=0,O;for(;O=B.exec(P);)O.index>A&&F.push(P.substring(A,O.index)),F.push({highlight:!0,text:O[0]}),A=O.index+O[0].length;return A<P.length&&F.push(P.substring(A)),n.jsx(s.Element,{...L,...l==null?void 0:l.container,...j,children:F.map((G,Y)=>typeof G=="string"?n.jsx(s.Text,{as:"span",display:"inline",...l==null?void 0:l.text,children:wo(G)},`text-${Y}`):n.jsx(s.Text,{as:"span",display:"inline",animate:C?_:void 0,...R?{}:D,...l==null?void 0:l.highlight,children:H(G.text)},`highlight-${Y}`))})}return o&&!I?n.jsx(s.Element,{...L,...j,...l==null?void 0:l.container,children:n.jsx(s.Text,{as:"span",display:"inline",animate:C?_:void 0,...R?{}:D,...l==null?void 0:l.highlight,children:H(P)})}):n.jsx(s.Text,{...L,...j,...l==null?void 0:l.container,...l==null?void 0:l.text,children:wo(P)})},gh=e=>n.jsx(ph,{...e}),mh=gh,hh=({items:e,shape:t,variant:o,onToggleChange:r})=>{const{activeToggles:a,setActiveToggles:i}=Ra();return n.jsx(Ea,{items:e,shape:t,variant:o,activeToggles:a,setActiveToggles:i,onToggleChange:r})},fh=hh,xh=({items:e,onChange:t})=>{const[o,r]=g.useState(e),[a,i]=g.useState(null),[l,d]=g.useState(null),c=g.useRef({x:0,y:0}),u=g.useRef([]),p=g.useCallback((x,f)=>{x.preventDefault(),document.body.style.cursor="grabbing";const b="touches"in x?x.touches[0].clientX:x.clientX,y="touches"in x?x.touches[0].clientY:x.clientY;c.current={x:b,y},d(f),i(o[f])},[o]),m=g.useCallback(x=>{if(l===null)return;const f="touches"in x?x.touches[0].clientX:x.clientX,b="touches"in x?x.touches[0].clientY:x.clientY,y=u.current[l];if(!y)return;const k=f-c.current.x,j=b-c.current.y;y.style.transform=`translate(${k}px, ${j}px)`,y.style.zIndex="1000";const S=u.current.findIndex((C,w)=>{if(!C||w===l)return!1;const I=C.getBoundingClientRect();return b>=I.top&&b<=I.bottom});if(S!==-1&&S!==l){const C=[...o],[w]=C.splice(l,1);C.splice(S,0,w),r(C),d(S),t==null||t(C),c.current={x:f,y:b}}},[l,o,t]),h=g.useCallback(()=>{document.body.style.cursor="",u.current.forEach(x=>{x&&(x.style.transform="",x.style.zIndex="")}),d(null),i(null)},[l]);return g.useEffect(()=>(l!==null&&(window.addEventListener("mousemove",m),window.addEventListener("touchmove",m),window.addEventListener("mouseup",h),window.addEventListener("touchend",h)),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)}),[l,m,h]),{items:o,draggedItem:a,draggedIndex:l,itemRefs:u,handleDragStart:p}},bh=({items:e,renderItem:t,containerProps:o,itemProps:r,draggedIndex:a,itemRefs:i,handleDragStart:l,views:d,themeMode:c})=>n.jsx(s.View,{overflow:"hidden",position:"relative",...o,...d==null?void 0:d.container,children:e.map((u,p)=>n.jsx(s.View,{ref:m=>i.current[p]=m,onMouseDown:m=>l(m,p),onTouchStart:m=>l(m,p),position:"relative",cursor:"grab",transition:"transform 0.2s",...r,...d==null?void 0:d.item,children:t?t(u,p):u},p))}),Za=e=>{const{items:t,draggedIndex:o,itemRefs:r,handleDragStart:a}=xh(e);return n.jsx(bh,{...e,items:t,draggedIndex:o,itemRefs:r,handleDragStart:a})},yh=Za,kh=({onFileSelect:e,onMultipleFileSelect:t,validateFile:o,accept:r,multiple:a,disabled:i,previewUrl:l})=>{const[d,c]=g.useState(!1),[u,p]=g.useState(null),m=g.useRef(null),h=l!==void 0?l:u;g.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const x=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!0)},[i]),f=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!1)},[i]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!0)},[i]),y=g.useCallback(C=>{if(!C||C.length===0)return;const w=Array.from(C);if(!a&&w.length>0){const I=w[0];if(I.type.startsWith("image/")){const M=URL.createObjectURL(I);p(R=>(R&&URL.revokeObjectURL(R),M))}else p(null)}a?t&&t(w):w.length>0&&e&&e(w[0])},[a,t,e]),k=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),c(!1),!i&&C.dataTransfer.files&&C.dataTransfer.files.length>0&&(y(C.dataTransfer.files),C.dataTransfer.clearData())},[i,y]),j=g.useCallback(()=>{var C;i||(C=m.current)==null||C.click()},[i]),S=g.useCallback(C=>{y(C.target.files),C.target.value&&(C.target.value="")},[y]);return{isDragActive:d,handleDragEnter:x,handleDragLeave:f,handleDragOver:b,handleDrop:k,handleClick:j,handleFileChange:S,inputRef:m,preview:h}},Ch={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},ei=({files:e,sandboxId:t,onRemove:o,layout:r="inline",maxHeight:a="120px",showPreviews:i=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(c=>c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...l==null?void 0:l.container,children:e.map((c,u)=>{const p=URL.createObjectURL(c)||(c==null?void 0:c.path)||(c==null?void 0:c.url)||"",m=c.type.startsWith("image/"),h=c.type.startsWith("video/"),x=c.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:i&&n.jsxs(fe,{children:[n.jsxs(fe.Trigger,{children:[m&&n.jsx(s.Image,{src:p,alt:c.name,width:"60px",height:"60px",objectFit:"cover"}),h&&n.jsx(s.View,{as:"video",src:p,alt:c.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!m&&!h&&!x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),o&&n.jsx(s.Button,{...Ch,onClick:f=>{f.stopPropagation(),o(u)},"aria-label":`Remove ${c.name}`,children:"×"})]}),n.jsxs(fe.Content,{children:[m&&n.jsx(s.Image,{src:p,alt:c.name,maxWidth:"100%"}),h&&n.jsx(s.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),x&&n.jsx(s.View,{as:"audio",src:p,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[c.name," (",d(c.size),")"]})]})]})},u)})})},jh=({children:e,text:t="Drop files here or click to upload",textProps:o,containerProps:r,disabled:a,accept:i,multiple:l,isDragActive:d,handleDragEnter:c,handleDragLeave:u,handleDragOver:p,handleDrop:m,handleClick:h,handleFileChange:x,inputRef:f,preview:b,imageProps:y,selectedFiles:k,onRemove:j})=>n.jsxs(s.Center,{width:"100%",minHeight:"200px",height:k&&k.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:d?"primary":"rgba(0,0,0,0.1)",borderRadius:12,backgroundColor:d?"rgba(0,0,0,0.02)":"transparent",flexDirection:"column",cursor:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:h,onDragEnter:c,onDragLeave:u,onDragOver:p,onDrop:m,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...r,children:[n.jsx("input",{type:"file",ref:f,onChange:x,accept:i,multiple:l,style:{display:"none"},disabled:a}),b&&!l?n.jsxs(s.View,{width:"100%",height:"200px",position:"relative",children:[n.jsx(s.Image,{src:b,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...y}),n.jsx(s.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:n.jsx(s.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[n.jsx(Xo,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),n.jsx(s.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...o,children:t})]}),l&&k&&k.length>0&&n.jsx(s.View,{marginTop:16,width:"100%",children:n.jsx(ei,{files:k,onRemove:j||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Sh=e=>{const t=kh(e);return n.jsx(jh,{...e,...t})},wh=(e=!1)=>{const[t,o]=g.useState(e),[r,a]=g.useState(null);return g.useEffect(()=>{const i=c=>{!c.composedPath().some(m=>(m==null?void 0:m.id)==="dropdown-menu"||(m==null?void 0:m.id)==="dropdown-trigger")&&t&&(o(!1),a(null))},l=()=>{t&&(o(!1),a(null))},d=c=>{c.key==="Escape"&&t&&(o(!1),a(null))};return document.addEventListener("mousedown",i),window.addEventListener("resize",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("resize",l),document.removeEventListener("keydown",d)}},[t]),{isOpen:t,setIsOpen:o,activeSubmenuId:r,setActiveSubmenuId:a}},Ih={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Th={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Mh={hover:{backgroundColor:"color-gray-100"}},ti=g.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Rh=({children:e,value:t})=>n.jsx(ti.Provider,{value:t,children:e}),gr=()=>{const e=g.useContext(ti);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},oi=({children:e,views:t,...o})=>{const{isOpen:r,setIsOpen:a,triggerRef:i}=gr(),l=d=>{d.stopPropagation(),a(!r)};return n.jsx(s.View,{ref:i,id:"dropdown-trigger",onClick:l,cursor:"pointer",position:"relative",display:"inline-block",...t==null?void 0:t.container,...o,children:e})},mr=({items:e,side:t="bottom",align:o="start",views:r,...a})=>{const{isOpen:i,variant:l,triggerRef:d}=gr(),c=g.useRef(null),{ref:u,relation:p}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[m,h]=g.useState({x:0,y:0,placement:t});if(g.useEffect(()=>{d.current&&u&&(u.current=d.current)},[d,u,i]),g.useEffect(()=>{if(i&&c.current&&d.current){const b=d.current.getBoundingClientRect();let y=t;p&&(t==="bottom"&&p.space.vertical==="top"?y="top":t==="top"&&p.space.vertical==="bottom"?y="bottom":t==="right"&&p.space.horizontal==="left"?y="left":t==="left"&&p.space.horizontal==="right"&&(y="right"));let k=0,j=0;switch(y){case"bottom":k=o==="start"?b.left:o==="end"?b.right-180:b.left+b.width/2-90,j=b.bottom+8;break;case"top":k=o==="start"?b.left:o==="end"?b.right-180:b.left+b.width/2-90,j=b.top-8;break;case"right":k=b.right+8,j=o==="start"?b.top:o==="end"?b.bottom-100:b.top+b.height/2-50;break;case"left":k=b.left-8,j=o==="start"?b.top:o==="end"?b.bottom-100:b.top+b.height/2-50;break}h({x:k,y:j,placement:y})}},[i,t,o,d,p]),!i)return null;const f=(()=>{const b={position:"fixed",left:m.x,top:m.y,zIndex:1e3};switch(m.placement){case"top":return{...b,transform:"translateY(-100%)"};case"left":return{...b,transform:"translateX(-100%)"};case"bottom":case"right":default:return b}})();return n.jsx(s.View,{ref:c,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:f,...Th[l],...r==null?void 0:r.menu,...a,children:e.map((b,y)=>b.divider?n.jsx(ni,{views:r},`divider-${y}`):n.jsx(ri,{item:b,views:r},b.id))})},ri=({item:e,views:t,...o})=>{const{activeSubmenuId:r,setActiveSubmenuId:a,size:i}=gr(),[l,d]=g.useState(!1),c=e.items&&e.items.length>0,u=r===e.id,p=g.useRef(null),m=()=>{d(!0),c&&a(e.id)},h=()=>{d(!1)},x=f=>{f.stopPropagation(),!e.disabled&&!c&&e.onClick&&e.onClick()};return n.jsxs(s.View,{ref:p,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Ih[i],_hover:e.disabled?{}:Mh.hover,backgroundColor:l&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:m,onMouseLeave:h,onClick:x,...t==null?void 0:t.item,...o,children:[e.icon&&n.jsx(s.View,{marginRight:8,...t==null?void 0:t.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),c&&n.jsx(s.View,{marginLeft:8,...t==null?void 0:t.submenuIndicator,children:n.jsx(ie,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&c&&n.jsx(mr,{items:e.items||[],side:"right",align:"start",views:t})]})},ni=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...t}),zh=({trigger:e,items:t,side:o="bottom",align:r="start",views:a,themeMode:i,...l})=>n.jsxs(s.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...l,children:[n.jsx(oi,{views:a,children:e}),n.jsx(mr,{items:t,side:o,align:r,views:a})]}),Eh=({trigger:e,items:t,size:o="md",variant:r="default",side:a="bottom",align:i="start",defaultOpen:l=!1,views:d,...c})=>{const{isOpen:u,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h}=wh(l),x=g.useRef(null);return n.jsx(Rh,{value:{isOpen:u,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h,size:o,variant:r,triggerRef:x},children:n.jsx(zh,{trigger:e,items:t,side:a,align:i,views:d,...c})})},Tt=Eh;Tt.Trigger=oi;Tt.Content=mr;Tt.Item=ri;Tt.Divider=ni;const Vh=e=>{const{value:t,defaultValue:o="",onChange:r,onChangeComplete:a,isOpen:i,onOpen:l,onClose:d,closeOnSelect:c=!0,maxRecentColors:u=8,showRecentColors:p=!0}=e,[m,h]=g.useState(i??!1),[x,f]=g.useState(t??o),[b,y]=g.useState(""),[k,j]=g.useState([]),S=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{t!==void 0&&f(t)},[t]),g.useEffect(()=>{i!==void 0&&h(i)},[i]),g.useEffect(()=>{if(p){const T=localStorage.getItem("colorPicker-recentColors");if(T)try{j(JSON.parse(T))}catch{}}},[p]),g.useEffect(()=>{const T=$=>{m&&S.current&&C.current&&!S.current.contains($.target)&&!C.current.contains($.target)&&W()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[m]);const w=g.useCallback(T=>{p&&j($=>{const D=$.filter(V=>V!==T),z=[T,...D].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(z)),z})},[p,u]),I=g.useCallback(()=>{const T=!m;h(T),T?l==null||l():d==null||d()},[m,l,d]),M=g.useCallback(T=>{f(T),w(T),r==null||r(T),a==null||a(T),c&&(h(!1),d==null||d())},[r,a,c,d,w]),R=g.useCallback(T=>{y(T)},[]),E=g.useCallback(()=>{b&&(M(b),y(""))},[b,M]),W=g.useCallback(()=>{h(!1),d==null||d()},[d]);return{isOpen:m,selectedColor:x,recentColors:k,customColor:b,handleToggle:I,handleColorSelect:M,handleCustomColorChange:R,handleCustomColorSubmit:E,handleClose:W,triggerRef:S,dropdownRef:C}},Ue={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-200",paddingTop:"12px"}},Ph={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},_h={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Wh={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},$h=[{name:"Blue 500",value:"color-blue-500",category:"primary"},{name:"Purple 500",value:"color-purple-500",category:"primary"},{name:"Pink 500",value:"color-pink-500",category:"primary"},{name:"Red 500",value:"color-red-500",category:"primary"},{name:"Orange 500",value:"color-orange-500",category:"primary"},{name:"Yellow 500",value:"color-yellow-500",category:"primary"},{name:"Green 500",value:"color-green-500",category:"primary"},{name:"Teal 500",value:"color-teal-500",category:"primary"},{name:"Blue 300",value:"color-blue-300",category:"light"},{name:"Purple 300",value:"color-purple-300",category:"light"},{name:"Pink 300",value:"color-pink-300",category:"light"},{name:"Red 300",value:"color-red-300",category:"light"},{name:"Orange 300",value:"color-orange-300",category:"light"},{name:"Yellow 300",value:"color-yellow-300",category:"light"},{name:"Green 300",value:"color-green-300",category:"light"},{name:"Teal 300",value:"color-teal-300",category:"light"},{name:"Blue 700",value:"color-blue-700",category:"dark"},{name:"Purple 700",value:"color-purple-700",category:"dark"},{name:"Pink 700",value:"color-pink-700",category:"dark"},{name:"Red 700",value:"color-red-700",category:"dark"},{name:"Orange 700",value:"color-orange-700",category:"dark"},{name:"Yellow 700",value:"color-yellow-700",category:"dark"},{name:"Green 700",value:"color-green-700",category:"dark"},{name:"Teal 700",value:"color-teal-700",category:"dark"},{name:"Gray 100",value:"color-gray-100",category:"neutral"},{name:"Gray 300",value:"color-gray-300",category:"neutral"},{name:"Gray 500",value:"color-gray-500",category:"neutral"},{name:"Gray 700",value:"color-gray-700",category:"neutral"},{name:"Gray 900",value:"color-gray-900",category:"neutral"},{name:"Black",value:"color-black",category:"neutral"},{name:"White",value:"color-white",category:"neutral"}],Lh=({id:e,name:t,label:o,placeholder:r="Select a color",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",error:u=!1,isDisabled:p=!1,isReadOnly:m=!1,predefinedColors:h=$h,showCustomInput:x=!0,showRecentColors:f=!0,isOpen:b,selectedColor:y,recentColors:k,customColor:j,handleToggle:S,handleColorSelect:C,handleCustomColorChange:w,handleCustomColorSubmit:I,triggerRef:M,dropdownRef:R,onChange:E,...W})=>{const{getColor:T}=s.useTheme(),$={...Ue.container,...i==null?void 0:i.container},D={...Ue.trigger,...Ph[l],..._h[d],...Wh[c],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...i==null?void 0:i.trigger},z={...Ue.dropdown,...i==null?void 0:i.dropdown},V={...Ue.colorGrid,...i==null?void 0:i.colorGrid},_={...Ue.recentColors,...i==null?void 0:i.recentColors},P=y||"color-gray-200";return n.jsxs(s.View,{...$,...W,children:[o&&n.jsx(s.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:M,onClick:p||m?void 0:S,...D,children:[n.jsxs(s.Horizontal,{alignItems:"center",gap:8,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:P,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),n.jsx(s.Text,{color:y?"color-gray-800":"color-gray-500",fontSize:"inherit",children:y||r})]}),!m&&!p&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&n.jsxs(s.View,{ref:R,...z,children:[n.jsx(s.View,{...V,children:h.map((L,H)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:L.value,borderWidth:"2px",borderStyle:"solid",borderColor:y===L.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>C(L.value),title:L.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...i==null?void 0:i.colorSwatch},H))}),x&&n.jsxs(s.View,{...Ue.customInput,...i==null?void 0:i.customInput,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[n.jsx("input",{type:"color",value:j||"#000000",onChange:L=>{const H=L.target.value;w(H),C(H)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),n.jsx(wt,{placeholder:"Enter hex color (e.g., #ff0000)",value:j,onChange:L=>w(L.target.value),onKeyPress:L=>{L.key==="Enter"&&I()},size:"sm",right:j&&n.jsx(s.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:j,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:I})})]}),f&&k.length>0&&n.jsxs(s.View,{..._,children:[n.jsx(s.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((L,H)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:L,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>C(L),title:L,_hover:{transform:"scale(1.1)"}},H))})]})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},Dh=e=>{const t=Vh(e);return n.jsx(Lh,{...t,...e})},Hh=Dh,Bh=e=>{const t=_a(e);return n.jsx(Wa,{...t,...e})},Ah=Bh,Fh=e=>{const t=Va(e);return n.jsx(Pa,{...t,...e})},Oh=Fh,vh=(e=null,t=null)=>{const[o,r]=g.useState(e),[a,i]=g.useState(t),l=c=>a===c,d=c=>{i(u=>u===c?null:c)};return g.useEffect(()=>{const c=p=>{!p.composedPath().some(x=>(x==null?void 0:x.id)==="menubar-content"||(x==null?void 0:x.id)==="menubar-trigger")&&a!==null&&i(null)},u=p=>{p.key==="Escape"&&a!==null&&i(null)};return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u)}},[a]),{activeMenuId:o,setActiveMenuId:r,openMenuId:a,setOpenMenuId:i,isMenuOpen:l,toggleMenu:d}},ai={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},Nh={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Uh={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Ft={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ii=g.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),mo=()=>g.useContext(ii),qh=({value:e,children:t})=>n.jsx(ii.Provider,{value:e,children:t}),li=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",views:a,...i})=>{const l=t==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(l,{role:"menubar","aria-orientation":t,...Uh[t],...Nh[r],...a==null?void 0:a.container,...i,children:e})},ci=({children:e,id:t,disabled:o=!1,views:r})=>{const{orientation:a}=mo(),i=a==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(i,{role:"none",position:"relative",opacity:o?.5:1,pointerEvents:o?"none":"auto",...r==null?void 0:r.menu,children:g.Children.map(e,l=>g.isValidElement(l)?g.cloneElement(l,{...l.props,menuId:t}):l)})},si=({children:e,menuId:t,disabled:o=!1,views:r})=>{const{activeMenuId:a,setActiveMenuId:i,toggleMenu:l,isMenuOpen:d,size:c,triggerRefs:u}=mo(),p=g.useRef(null),m=a===t,h=d(t);g.useEffect(()=>(p.current&&t&&(u.current[t]=p.current),()=>{t&&delete u.current[t]}),[t,u]);const x=()=>{o||(i(t),l(t))};return n.jsx(s.View,{ref:p,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ai[c],...m?Ft.active:{},...o?Ft.disabled:{},_hover:o?{}:Ft.hover,onClick:x,...r==null?void 0:r.trigger,children:e})},di=({children:e,menuId:t,views:o})=>{const{isMenuOpen:r,orientation:a,triggerRefs:i}=mo(),l=g.useRef(null),[d,c]=g.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(t);if(g.useEffect(()=>{if(u&&l.current&&t&&i.current[t]){const m=l.current.getBoundingClientRect(),h=i.current[t].getBoundingClientRect(),x=Math.max(m.width||200,200),f=Math.max(m.height||150,150),b=window.innerWidth,y=window.innerHeight,k={top:h.top,right:b-h.right,bottom:y-h.bottom,left:h.left},j=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:h.left,y:h.top-f-8},{placement:"right",space:k.right,fits:k.right>=x+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:h.left-x-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=x+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:h.left-x-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:h.left,y:h.top-f-8}],S=j.find(M=>M.fits);if(S){c({x:S.x,y:S.y,placement:S.placement});return}const C=j.reduce((M,R)=>R.space>M.space?R:M);let w=C.x,I=C.y;w+x>b&&(w=b-x-8),w<8&&(w=8),I+f>y&&(I=y-f-8),I<8&&(I=8),c({x:w,y:I,placement:C.placement})}},[u,a,t,i]),!u)return null;const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.View,{ref:l,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...o==null?void 0:o.content,children:e})},ui=({children:e,icon:t,disabled:o=!1,onClick:r,views:a})=>{const{size:i}=mo(),l=()=>{o||!r||r()};return n.jsxs(s.View,{role:"menuitem",cursor:o?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:o?.5:1,...ai[i],_hover:o?{}:Ft.hover,onClick:l,...a==null?void 0:a.item,children:[t&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:t}),e]})},pi=({views:e})=>n.jsx(s.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),Gh=({items:e,orientation:t,size:o,variant:r,views:a,themeMode:i})=>n.jsx(li,{orientation:t,size:o,variant:r,views:a,children:e.map(l=>n.jsxs(ci,{id:l.id,disabled:l.disabled,views:a,children:[n.jsxs(si,{menuId:l.id,views:a,children:[l.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:l.icon}),l.label]}),l.items&&l.items.length>0&&n.jsx(di,{menuId:l.id,views:a,children:l.items.map((d,c)=>d.separator?n.jsx(pi,{views:a},`separator-${c}`):n.jsx(ui,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:a,children:d.label},d.id))})]},l.id))}),Yh=({items:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultActiveMenuId:a=null,defaultOpenMenuId:i=null,views:l,...d})=>{const{activeMenuId:c,setActiveMenuId:u,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:x}=vh(a,i),f=g.useRef({});return n.jsx(qh,{value:{activeMenuId:c,setActiveMenuId:u,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:x,orientation:t,size:o,variant:r,triggerRefs:f},children:n.jsx(Gh,{items:e,orientation:t,size:o,variant:r,views:l,...d})})},Ae=Yh;Ae.Root=li;Ae.Menu=ci;Ae.Trigger=si;Ae.Content=di;Ae.Item=ui;Ae.Separator=pi;const Xh=(e,t,o)=>{const[r,a]=g.useState([]);return g.useEffect(()=>{a((()=>{const l=[];if(t<=o)for(let d=1;d<=t;d++)l.push(d);else{l.push(1);let d=Math.max(2,e-Math.floor((o-2)/2)),c=Math.min(t-1,d+o-3);c>=t-1&&(c=t-1,d=Math.max(2,c-(o-3))),d>2&&l.push("...");for(let u=d;u<=c;u++)l.push(u);c<t-1&&l.push("..."),l.push(t)}return l})())},[e,t,o]),{visiblePageNumbers:r}},qe={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"16px",padding:"8px 16px",minWidth:"44px",height:"44px",media:{mobile:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px"}}}},ut={default:{backgroundColor:"transparent",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}}},pt={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},Kh={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Wt={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Qh=({currentPage:e,totalPages:t,onPageChange:o,pageSize:r=10,pageSizeOptions:a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:i,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:c=5,showFirstLastButtons:u=!1,size:p="md",variant:m="default",shape:h="rounded",visiblePageNumbers:x,views:f,...b})=>{const y=S=>{S<1||S>t||S===e||o(S)},k=S=>{i&&i(Number(S.target.value))},j=(S,C)=>{if(S==="...")return n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",...qe[p],...f==null?void 0:f.ellipsis,children:"..."},`ellipsis-${C}`);const w=S===e;return n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer",...qe[p],...ut[m],...pt[h],...w?Kh:{},onClick:()=>y(S),"aria-label":`Page ${S}`,"aria-current":w?"page":void 0,...w?f==null?void 0:f.activePageButton:f==null?void 0:f.pageButton,children:S},`page-${S}`)};return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,...f==null?void 0:f.container,...b,children:[u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...ut[m],...pt[h],...e===1?Wt:{},onClick:()=>y(1),"aria-label":"First page",disabled:e===1,...f==null?void 0:f.navigationButton,children:[n.jsx(ie,{orientation:"left",widthHeight:16}),n.jsx(ie,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...ut[m],...pt[h],...e===1?Wt:{},onClick:()=>y(e-1),"aria-label":"Previous page",disabled:e===1,...f==null?void 0:f.navigationButton,children:n.jsx(ie,{orientation:"left",widthHeight:16})}),x.map((S,C)=>j(S,C)),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===t?"not-allowed":"pointer",...qe[p],...ut[m],...pt[h],...e===t?Wt:{},onClick:()=>y(e+1),"aria-label":"Next page",disabled:e===t,...f==null?void 0:f.navigationButton,children:n.jsx(ie,{orientation:"right",widthHeight:16})}),u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===t?"not-allowed":"pointer",...qe[p],...ut[m],...pt[h],...e===t?Wt:{},onClick:()=>y(t),"aria-label":"Last page",disabled:e===t,...f==null?void 0:f.navigationButton,children:[n.jsx(ie,{orientation:"right",widthHeight:16}),n.jsx(ie,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&n.jsxs(s.Text,{marginLeft:16,color:"color-gray-600",...f==null?void 0:f.pageInfo,children:["Page ",e," of ",t]}),l&&i&&n.jsx(s.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:r,onChange:k,...f==null?void 0:f.pageSizeSelector,children:a.map(S=>n.jsx("option",{value:S.value,children:S.label},S.value))})]})},Jh=({currentPage:e,totalPages:t,onPageChange:o,pageSize:r=10,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:c=5,showFirstLastButtons:u=!1,size:p="md",variant:m="default",shape:h="rounded",views:x,...f})=>{const{visiblePageNumbers:b}=Xh(e,t,c);return n.jsx(Qh,{currentPage:e,totalPages:t,onPageChange:o,pageSize:r,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:l,showPageInfo:d,maxPageButtons:c,showFirstLastButtons:u,size:p,variant:m,shape:h,visiblePageNumbers:b,views:x,...f})},Zh=Jh,ef=({shape:e="linear",value:t=0,max:o=100,color:r="theme-primary",backgroundColor:a="color-gray-200",height:i,size:l,radius:d=4,strokeWidth:c=10,showLabel:u=!1,labelColor:p="theme-text-primary",animated:m=!0,animationDuration:h="0.5s",views:x,themeMode:f,...b})=>{const{getColor:y,themeMode:k}=s.useTheme(),j=f||k,C=Math.min(o,Math.max(0,t))/o*100,w=y(a,{themeMode:j}),I=y(r,{themeMode:j});if(e==="circle"){const R=l||(typeof i=="number"?i:100),E=(R-c)/2,W=2*Math.PI*E,T=W-C/100*W;return n.jsxs(s.View,{width:R,height:R,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...x==null?void 0:x.container,...b,children:[n.jsxs("svg",{width:R,height:R,viewBox:`0 0 ${R} ${R}`,style:{transform:"rotate(-90deg)"},children:[n.jsx("circle",{cx:R/2,cy:R/2,r:E,stroke:w,strokeWidth:c,fill:"transparent",...x==null?void 0:x.track}),n.jsx("circle",{cx:R/2,cy:R/2,r:E,stroke:I,strokeWidth:c,strokeDasharray:W,strokeDashoffset:T,strokeLinecap:"round",fill:"transparent",style:{transition:m?`stroke-dashoffset ${h} ease-in-out`:"none"},...x==null?void 0:x.indicator})]}),u&&n.jsx(s.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:n.jsxs(s.Text,{color:p,fontSize:`${R*.2}px`,fontWeight:"bold",...x==null?void 0:x.text,children:[Math.round(C),"%"]})})]})}const M=i||8;return n.jsx(s.View,{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":o,width:"100%",height:M,backgroundColor:w,borderRadius:d,overflow:"hidden",...x==null?void 0:x.container,...b,children:n.jsx(s.View,{width:`${C}%`,height:"100%",backgroundColor:I,borderRadius:d,style:{transition:m?`width ${h} ease-in-out`:"none"},...x==null?void 0:x.bar})})},tf=e=>n.jsx(ef,{...e}),of=tf,rf=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),nf=rf(),af={thin:"1px",medium:"2px",thick:"4px"},gt={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},lf=({orientation:e="horizontal",variant:t="solid",thickness:o="thin",color:r,spacing:a="0px",label:i,decorative:l=!1,views:d,themeMode:c,...u})=>{const{themeMode:p}=s.useTheme(),m=r||"color-gray-200",h=nf[t],x=af[o],f=l?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return i&&e==="horizontal"?n.jsxs(s.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...f,...u,children:[n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:x,borderTopStyle:h,borderTopColor:m,...gt.container,...d==null?void 0:d.container}),n.jsx(s.Text,{...gt.label,...d==null?void 0:d.label,children:i}),n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:x,borderTopStyle:h,borderTopColor:m,...gt.container,...d==null?void 0:d.container})]}):e==="horizontal"?n.jsx(s.View,{height:"0px",width:"100%",borderTopWidth:x,borderTopStyle:h,borderTopColor:m,padding:a,...gt.container,...f,...d==null?void 0:d.container,...u}):n.jsx(s.View,{width:"0px",height:"100%",borderLeftWidth:x,borderLeftStyle:h,borderLeftColor:m,padding:a,...gt.container,...f,...d==null?void 0:d.container,...u})},gi=e=>n.jsx(lf,{...e}),cf=gi,sf=gi,df={xs:12,sm:14,md:16,lg:18,xl:20},uf=({isSupported:e,isSharing:t,onShare:o,label:r,children:a,icon:i,size:l,isDisabled:d,isLoading:c,iconPosition:u,disableWhenUnsupported:p=!0,...m})=>{const h=l??"md",x=i??n.jsx(nn,{widthHeight:df[h],strokeWidth:1.5,filled:!1}),f=!!d||!e&&p,b=!!c||t;return n.jsx(Le,{...m,size:h,icon:x,iconPosition:u??"left",isDisabled:f,isLoading:b,onClick:o,children:a??r??"Share"})},qr=()=>typeof navigator>"u"?void 0:navigator,pf=(e,t)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(t)}catch{return!1}return!0},gf=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},mf=e=>{const{shareData:t,onClick:o,onUnsupported:r,onShareStart:a,onShareSuccess:i,onShareCancel:l,onShareError:d}=e,[c,u]=g.useState(!1),p=g.useMemo(()=>pf(qr(),t),[t]),m=g.useCallback((...h)=>{o==null||o(...h);const x=qr();if(!x||typeof x.share!="function"){r==null||r();return}if(!c){if(typeof x.canShare=="function")try{if(!x.canShare(t)){r==null||r();return}}catch(f){d==null||d(f);return}u(!0),a==null||a();try{x.share(t).then(()=>{i==null||i()}).catch(f=>{if(gf(f)==="AbortError"){l==null||l();return}d==null||d(f)}).finally(()=>{u(!1)})}catch(f){u(!1),d==null||d(f)}}},[c,o,l,d,a,i,r,t]);return{isSupported:p,isSharing:c,handleShare:m}},hf=e=>{const{isSupported:t,isSharing:o,handleShare:r}=mf(e),{shareData:a,onShareStart:i,onShareSuccess:l,onShareCancel:d,onShareError:c,onUnsupported:u,onClick:p,...m}=e;return n.jsx(uf,{...m,isSupported:t,isSharing:o,onShare:r})},ff=hf,xf=({label:e,status:t="default",views:o,themeMode:r,...a})=>{const{themeMode:i}=s.useTheme(),l=gn();return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...o==null?void 0:o.container,...a,children:[n.jsx(s.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...l[t].indicator,...o==null?void 0:o.indicator}),e&&n.jsx(s.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...l[t].label,...o==null?void 0:o.label,children:e})]})},bf=e=>n.jsx(xf,{...e}),yf=(e=!0,t,o,r)=>{const{on:a}=s.useResponsive(),i=a("mobile"),[l,d]=g.useState(t!==void 0?t:e);return g.useEffect(()=>{t!==void 0&&d(t)},[t]),{isExpanded:l,toggleExpanded:()=>{const m=!l;d(m),o&&o(m)},expand:()=>{l||(d(!0),o&&o(!0))},collapse:()=>{l&&(d(!1),o&&o(!1))},isMobile:i}},kf={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Cf=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"all 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease"}}),jf=Cf(),Sf={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},wf={none:{},low:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"},medium:{boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)"},high:{boxShadow:"0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"}},If={fast:"width 0.2s ease, transform 0.2s ease",normal:"width 0.3s ease, transform 0.3s ease",slow:"width 0.5s ease, transform 0.5s ease",bounce:"width 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},mi=g.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),ho=()=>g.useContext(mi),Tf=({value:e,children:t})=>n.jsx(mi.Provider,{value:e,children:t}),Mf=({children:e,showToggleButton:t=!0,views:o,...r})=>{const{isExpanded:a,toggleExpanded:i,position:l}=ho();return n.jsx(s.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...o==null?void 0:o.header,...r,children:a?n.jsxs(s.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,t&&n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...o==null?void 0:o.toggleButton,children:n.jsx(ie,{orientation:l==="left"?"left":"right",widthHeight:16,...o==null?void 0:o.toggleButtonIcon})})]}):n.jsx(s.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:t&&n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...o==null?void 0:o.toggleButton,children:n.jsx(ie,{orientation:l==="left"?"right":"left",widthHeight:16,...o==null?void 0:o.toggleButtonIcon})})})})},Rf=({children:e,views:t,...o})=>{const{isExpanded:r}=ho();return n.jsx(s.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:r?"16px":"8px",...t==null?void 0:t.content,...o,children:e})},zf=({children:e,views:t,...o})=>{const{isExpanded:r}=ho();return n.jsx(s.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...t==null?void 0:t.footer,...o,children:r?e:null})},Ef=({children:e,position:t="left",size:o="md",variant:r="default",fixed:a=!1,hasBackdrop:i=!0,expandedWidth:l,collapsedWidth:d,breakpointBehavior:c="overlay",elevation:u="none",transitionPreset:p="normal",ariaLabel:m="Sidebar navigation",isExpanded:h,isMobile:x,collapse:f,views:b,themeMode:y,...k})=>{const j=kf[o],S=h?l||j.expandedWidth:d||j.collapsedWidth,C=!x||x&&c!=="hide",w=a||x&&c==="overlay"?"fixed":"relative",I=i&&x&&h&&c==="overlay";return n.jsxs(n.Fragment,{children:[I&&n.jsx(s.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:f,...b==null?void 0:b.backdrop}),C&&n.jsx(s.Vertical,{position:w,top:0,height:"100vh",width:S,zIndex:999,transition:If[p],transform:x&&c==="overlay"&&!h?`translateX(${t==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":m,...jf[r],...Sf[t],...wf[u],...b==null?void 0:b.container,...k,children:g.Children.map(e,M=>M)})]})},Vf=({children:e,position:t="left",size:o="md",variant:r="default",defaultExpanded:a=!0,expanded:i,onExpandedChange:l,fixed:d=!1,hasBackdrop:c=!0,showToggleButton:u=!0,expandedWidth:p,collapsedWidth:m,breakpoint:h=768,breakpointBehavior:x="overlay",views:f,...b})=>{const{isExpanded:y,toggleExpanded:k,expand:j,collapse:S,isMobile:C}=yf(a,i,l);return n.jsx(Tf,{value:{isExpanded:y,toggleExpanded:k,expand:j,collapse:S,position:t,size:o,variant:r,views:f},children:n.jsx(Ef,{position:t,size:o,variant:r,fixed:d,hasBackdrop:c,showToggleButton:u,expandedWidth:p,collapsedWidth:m,breakpoint:h,breakpointBehavior:x,isExpanded:y,isMobile:C,toggleExpanded:k,expand:j,collapse:S,views:f,...b,children:e})})},Mt=Vf;Mt.Header=Mf;Mt.Content=Rf;Mt.Footer=zf;Mt.useContext=ho;const Pf=()=>({getItem:e=>{try{return localStorage.getItem(`resizable-${e}`)}catch(t){return console.warn("Failed to access localStorage:",t),null}},setItem:(e,t)=>{try{localStorage.setItem(`resizable-${e}`,t)}catch(o){console.warn("Failed to write to localStorage:",o)}}}),_f=(e,t,o,r=50,a=1/0,i=!1,l,d,c=10)=>{const[u,p]=g.useState(!1),[m,h]=g.useState([]),x=g.useRef(null),f=g.useRef(null),b=g.useRef(0),y=g.useRef([]),k=g.useRef(d||(typeof window<"u"?Pf():null)),j=g.useCallback(()=>x.current?e==="horizontal"?x.current.offsetWidth:x.current.offsetHeight:0,[e]),S=g.useCallback(()=>{if(!l||!k.current)return null;const V=k.current.getItem(l);if(!V)return null;try{const _=JSON.parse(V);return Array.isArray(_.sizes)?_.sizes:null}catch(_){return console.warn("Failed to parse saved panel sizes:",_),null}},[l]),C=g.useCallback(()=>{if(!l||!k.current||m.length===0)return;const V=m.map(_=>({id:_.id,size:_.size,collapsed:_.collapsed||!1}));k.current.setItem(l,JSON.stringify({sizes:V}))},[l,m]),w=g.useCallback((V,_,P,L,H)=>{h(B=>B.some(F=>F.id===V)?B:[...B,{id:V,size:_,minSize:P??r,maxSize:L??a,collapsible:H??i,collapsed:!1}])},[r,a,i]),I=g.useCallback(V=>{h(_=>_.filter(P=>P.id!==V))},[]),M=g.useCallback(V=>{const _=m.find(P=>P.id===V);return _?_.size:0},[m]),R=g.useCallback((V,_)=>{h(P=>P.map(L=>L.id===V?{...L,size:_}:L))},[]),E=g.useCallback(V=>{const _=m.find(P=>P.id===V);return _?!!_.collapsed:!1},[m]),W=g.useCallback(V=>{h(_=>{const P=_.findIndex(F=>F.id===V);if(P===-1)return _;const L=_[P];if(!L.collapsible)return _;const H={...L,collapsed:!L.collapsed},B=[..._];return B[P]=H,B})},[]),T=g.useCallback((V,_)=>{f.current=V,b.current=_,y.current=m.map(P=>P.size),p(!0)},[m]),$=g.useCallback(V=>{if(!u||!f.current)return;const _=f.current,P=V-b.current;let L=-1;const H=_.match(/\d+$/);if(H&&(L=parseInt(H[0],10)-1),L===-1&&m.length>=2&&(L=0),L<0||L>=m.length-1)return;const B=m[L],F=m[L+1];if(B.collapsed||F.collapsed)return;let A=y.current[L]+P,O=y.current[L+1]-P;A=Math.max(B.minSize??r,Math.min(B.maxSize??a,A)),O=Math.max(F.minSize??r,Math.min(F.maxSize??a,O)),h(G=>G.map((Y,q)=>q===L?{...Y,size:A}:q===L+1?{...Y,size:O}:Y))},[u,m,e,r,a]),D=g.useCallback(()=>{u&&o&&o(m.map(V=>V.size)),f.current=null,p(!1),l&&C()},[u,m,o,l,C]),z=g.useCallback(V=>{if(!u||!f.current)return;const _=f.current;let P=-1;const L=_.match(/\d+$/);if(L&&(P=parseInt(L[0],10)-1),P===-1&&m.length>=2&&(P=0),P<0||P>=m.length-1)return;let H=0;e==="horizontal"?(V.key==="ArrowLeft"&&(H=-c),V.key==="ArrowRight"&&(H=c),V.key==="Home"&&(H=-100),V.key==="End"&&(H=100)):(V.key==="ArrowUp"&&(H=-c),V.key==="ArrowDown"&&(H=c),V.key==="Home"&&(H=-100),V.key==="End"&&(H=100)),H!==0&&(V.preventDefault(),$(b.current+H)),V.key==="Escape"&&(h(B=>B.map((F,A)=>({...F,size:y.current[A]}))),D())},[u,m,e,$,D,c]);return g.useEffect(()=>{const V=L=>{if(!u)return;const H=e==="horizontal"?L.clientX:L.clientY;$(H)},_=L=>{if(!u||L.touches.length===0)return;const H=L.touches[0],B=e==="horizontal"?H.clientX:H.clientY;$(B)},P=()=>{u&&D()};return u&&(document.addEventListener("mousemove",V),document.addEventListener("touchmove",_),document.addEventListener("mouseup",P),document.addEventListener("touchend",P),document.addEventListener("keydown",z),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("touchmove",_),document.removeEventListener("mouseup",P),document.removeEventListener("touchend",P),document.removeEventListener("keydown",z),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,$,D,z]),g.useEffect(()=>{if(m.length!==0){if(l){const V=S();if(V){h(_=>_.map(P=>{const L=V.find(H=>H.id===P.id);return L?{...P,size:L.size,collapsed:L.collapsed||!1}:P}));return}}if(!t){const _=j()/m.length;h(P=>P.map(L=>({...L,size:_})))}}},[m.length,t,j,l,S]),g.useEffect(()=>{if(!t||t.length===0||m.length===0)return;const V=j(),_=t.map(P=>typeof P=="string"&&P.endsWith("%")?parseFloat(P)/100*V:typeof P=="number"?P:parseFloat(P));h(P=>P.map((L,H)=>({...L,size:H<_.length?_[H]:L.size})))},[t,m.length,j]),g.useEffect(()=>{m.length>0&&l&&!u&&C()},[m,l,u,C]),{isResizing:u,setIsResizing:p,containerRef:x,panels:m,registerPanel:w,unregisterPanel:I,getPanelSize:M,setPanelSize:R,isPanelCollapsed:E,togglePanelCollapse:W,startResize:T,onResize:$,endResize:D}},Wf={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},$f=(e,t)=>({sm:{width:t==="horizontal"?"4px":"100%",height:t==="vertical"?"4px":"100%"},md:{width:t==="horizontal"?"6px":"100%",height:t==="vertical"?"6px":"100%"},lg:{width:t==="horizontal"?"8px":"100%",height:t==="vertical"?"8px":"100%"}})[e],Lf=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),Df=Lf(),$t={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},hi=g.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),fi=()=>g.useContext(hi),Hf=({value:e,children:t})=>n.jsx(hi.Provider,{value:e,children:t}),Bf=({children:e,id:t,defaultSize:o,minSize:r,maxSize:a,collapsible:i,defaultCollapsed:l,onCollapseChange:d,views:c,...u})=>{const{orientation:p,registerPanel:m,unregisterPanel:h,getPanelSize:x,isPanelCollapsed:f,togglePanelCollapse:b}=fi(),y=typeof o=="string"&&o.endsWith("%")?0:typeof o=="number"?o:0;g.useEffect(()=>(m(t,y,r,a,i),()=>h(t)),[t,y,r,a,i,m,h]);const k=x(t),j=f(t);return g.useEffect(()=>{d&&j!==void 0&&d(j)},[j,d]),g.useEffect(()=>{i&&l&&!j&&b(t)},[t,i,l,j,b]),j?n.jsx(s.View,{flex:"0 0 auto",width:p==="horizontal"?"10px":"100%",height:p==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>b(t),"aria-label":`Expand panel ${t}`,role:"button",tabIndex:0,...c==null?void 0:c.collapsedPanel,...u}):n.jsx(s.View,{flex:k>0?"0 0 auto":"1",width:p==="horizontal"?`${k}px`:"100%",height:p==="vertical"?`${k}px`:"100%",overflow:"auto",...c==null?void 0:c.panel,...u,children:e})},Af=({id:e,position:t="both",disabled:o=!1,withVisualIndicator:r=!0,withCollapseButton:a=!1,collapseTarget:i,views:l,...d})=>{const{orientation:c,size:u,variant:p,startResize:m,isPanelCollapsed:h,togglePanelCollapse:x}=fi(),b=(()=>{if(i)return i;const w=e.match(/\d+$/);if(!w)return"";const I=parseInt(w[0],10);return isNaN(I)?"":`panel${I}`})(),y=h(b),k=w=>{if(o)return;w.preventDefault();const I=c==="horizontal"?w.clientX:w.clientY;m(e,I)},j=w=>{if(o||w.touches.length===0)return;w.preventDefault();const I=w.touches[0],M=c==="horizontal"?I.clientX:I.clientY;m(e,M)},S=w=>{o||(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),m(e,0))},C=w=>{w.stopPropagation(),b&&x(b)};return n.jsxs(s.View,{role:"separator","aria-orientation":c,"aria-valuemin":0,"aria-valuemax":100,tabIndex:o?-1:0,cursor:c==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...$f(u,c),...Df[p],onMouseDown:k,onTouchStart:j,onKeyDown:S,opacity:o?.5:1,pointerEvents:o?"none":"auto",...l==null?void 0:l.handle,...d,children:[r&&n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",width:c==="horizontal"?"100%":"auto",height:c==="vertical"?"100%":"auto",pointerEvents:"none",...l==null?void 0:l.handleIcon,children:c==="horizontal"?n.jsxs(s.Horizontal,{gap:1,children:[n.jsx(s.View,{...$t.horizontal}),n.jsx(s.View,{...$t.horizontal})]}):n.jsxs(s.Vertical,{gap:1,children:[n.jsx(s.View,{...$t.vertical}),n.jsx(s.View,{...$t.vertical})]})}),a&&b&&n.jsx(s.View,{position:"absolute",top:c==="horizontal"?"-20px":"50%",left:c==="horizontal"?"50%":"-20px",transform:c==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:C,"aria-label":y?`Expand panel ${b}`:`Collapse panel ${b}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...l==null?void 0:l.collapseIcon,children:n.jsx(s.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:y?n.jsxs(s.Horizontal,{children:[n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),n.jsx(s.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},Ff=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultSizes:a,minSize:i,maxSize:l,collapsible:d=!1,containerRef:c,autoSaveId:u,views:p,...m})=>{const h=t==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(h,{ref:c,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Wf[t],...p==null?void 0:p.container,...m,children:e})},Of=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultSizes:a,onSizesChange:i,minSize:l=50,maxSize:d,collapsible:c=!1,autoSaveId:u,storage:p,keyboardResizeBy:m=10,views:h,...x})=>{const{isResizing:f,setIsResizing:b,containerRef:y,registerPanel:k,unregisterPanel:j,getPanelSize:S,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:R,endResize:E}=_f(t,a,i,l,d,c,u,p,m);return n.jsx(Hf,{value:{orientation:t,size:o,variant:r,isResizing:f,setIsResizing:b,registerPanel:k,unregisterPanel:j,getPanelSize:S,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:R,endResize:E},children:n.jsx(Ff,{orientation:t,size:o,variant:r,defaultSizes:a,minSize:l,maxSize:d,collapsible:c,autoSaveId:u,keyboardResizeBy:m,containerRef:y,views:h,...x,children:e})})},hr=Of;hr.Panel=Bf;hr.Handle=Af;const Lt={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},vf={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},Nf=()=>Math.random().toString(36).substring(2,9);let Ge=new Map;const Rt=Bo.create(e=>({toasts:[],add:(t,o,r,a={})=>{const i=a.id||Nf(),l={id:i,variant:t,title:o,description:r,createdAt:Date.now(),isVisible:!0,...a};if(e(d=>({toasts:[...d.toasts,l]})),a.duration!==0){const d=a.duration||5e3,c=setTimeout(()=>{Rt.getState().remove(i)},d);Ge.set(i,c)}return i},remove:t=>{e(o=>({toasts:o.toasts.map(r=>r.id===t?{...r,isVisible:!1}:r)})),Ge.has(t)&&(clearTimeout(Ge.get(t)),Ge.delete(t)),setTimeout(()=>{e(o=>({toasts:o.toasts.filter(r=>r.id!==t)}))},300)},removeAll:()=>{Ge.forEach(clearTimeout),Ge.clear(),e(t=>({toasts:t.toasts.map(o=>({...o,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Fe=(e,t,o,r)=>Rt.getState().add(e,t,o,r),xi=(e,t,o)=>Fe("info",e,t,o),bi=(e,t,o)=>Fe("success",e,t,o),yi=(e,t,o)=>Fe("warning",e,t,o),ki=(e,t,o)=>Fe("error",e,t,o),Ci=e=>{Rt.getState().remove(e)},ji=()=>{Rt.getState().removeAll()},Si=({variant:e,title:t,description:o,onClose:r,isClosable:a=!0,action:i,actionText:l,showIcon:d=!0,theme:c,views:u,render:p,icon:m,id:h,isVisible:x=!0,themeMode:f})=>{const b=c??Lt,y=()=>{var C,w;if(m!==void 0)return m;const S=e?(w=(C=Lt[e])==null?void 0:C.icon)==null?void 0:w.color:Lt.info.icon.color;switch(e){case"info":return n.jsx(Re,{widthHeight:20,color:S});case"success":return n.jsx(Fo,{widthHeight:20,color:S});case"warning":return n.jsx(Re,{widthHeight:20,color:S,orientation:"down"});case"error":return n.jsx(eo,{widthHeight:20,color:S});default:return n.jsx(Re,{widthHeight:20,color:Lt.info.icon.color})}};if(p)return n.jsx(n.Fragment,{children:p({id:h||"",onClose:r})});const k=e==="error"?"alert":"status",j=e==="error"||e==="warning"?"assertive":"polite";return n.jsxs(s.Horizontal,{role:k,"aria-live":j,"aria-atomic":"true","data-state":x?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:b[e].container.backgroundColor,borderColor:b[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:x?1:0,transform:x?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[d&&n.jsx(s.View,{marginTop:"2px",...u==null?void 0:u.icon,children:y()}),n.jsxs(s.Vertical,{gap:4,flex:"1",children:[n.jsx(s.Text,{size:"md",fontWeight:"600",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.title,children:t}),o&&n.jsx(s.Text,{size:"sm",color:b[e].content.color,fontWeight:"400",backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.description,children:o}),i&&l&&n.jsx(s.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,onClick:S=>{S.stopPropagation(),i()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:l})]}),a&&n.jsx(s.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:S=>{S.stopPropagation(),r()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:n.jsx(xe,{widthHeight:16,color:b[e].content.color})})]})},Uf=({position:e="top-right",gap:t=8,limit:o=5,containerStyle:r})=>{const{toasts:a,remove:i}=Rt(),d=g.useMemo(()=>{const c={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(u=>{const p=u.position||e;c[p].push(u)}),Object.keys(c).forEach(u=>{c[u]=c[u].slice(-o)}),c},[a,e,o])[e];return n.jsx(s.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${t}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...vf[e],style:r,children:d.map(c=>n.jsx(s.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:n.jsx(Si,{id:c.id,variant:c.variant,title:c.title,description:c.description,onClose:()=>i(c.id),isClosable:c.isClosable,action:c.action,actionText:c.actionText,showIcon:c.showIcon,views:c.views,render:c.render,icon:c.icon,isVisible:c.isVisible})},c.id))})},qf=()=>({toast:(e,t,o,r)=>Fe(e,t,o,r),info:(e,t,o)=>xi(e,t,o),success:(e,t,o)=>bi(e,t,o),warning:(e,t,o)=>yi(e,t,o),error:(e,t,o)=>ki(e,t,o),remove:e=>Ci(e),removeAll:()=>ji()}),Gf=e=>n.jsx(Si,{...e}),Yf=Object.assign(Gf,{Container:e=>n.jsx(Uf,{...e}),show:Fe,info:xi,success:bi,warning:yi,error:ki,remove:Ci,removeAll:ji}),Xf=qf,Gr=(e,t)=>{var l,d;if(!e)return!0;const o=e.toLowerCase(),r=t.name.toLowerCase().includes(o),a=((l=t.description)==null?void 0:l.toLowerCase().includes(o))||!1,i=((d=t.keywords)==null?void 0:d.some(c=>c.toLowerCase().includes(o)))||!1;return r||a||i},Kf=({open:e,onOpenChange:t,groups:o=[],commands:r=[],filter:a})=>{const[i,l]=g.useState(""),[d,c]=g.useState(0),u=g.useRef(null),p=g.useMemo(()=>a||Gr,[a]),m=g.useMemo(()=>[...o.flatMap(y=>y.commands),...r],[o,r]),h=g.useMemo(()=>i.trim()?m.filter(b=>p(i,b)):m,[m,i,p]),x=g.useMemo(()=>{if(!i)return o;const b=a||Gr;return o.map(y=>({...y,commands:y.commands.filter(k=>b(i,k))})).filter(y=>y.commands.length)},[o,i,a]);g.useEffect(()=>{c(0)},[h.length]);const f=g.useCallback(b=>{if(e)switch(b.key){case"ArrowDown":b.preventDefault(),c(y=>y<h.length-1?y+1:y);break;case"ArrowUp":b.preventDefault(),c(y=>y>0?y-1:y);break;case"Enter":b.preventDefault(),h[d]&&(h[d].onSelect(),t(!1),l(""));break;case"Escape":b.preventDefault(),t(!1),l("");break}},[e,h,d,t]);return g.useEffect(()=>(document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}),[f]),g.useEffect(()=>{if(u.current&&e){const b=u.current.querySelector(`[data-index="${d}"]`);b&&b.scrollIntoView({block:"nearest"})}},[d,e]),g.useEffect(()=>{e?c(0):l("")},[e]),{search:i,setSearch:l,selectedIndex:d,setSelectedIndex:c,filteredCommands:h,filteredGroups:x,listRef:u}},Qf={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},Jf=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),Zf=Jf(),e0={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},t0={overflow:"auto",padding:"8px 0"},o0={marginBottom:"8px"},r0={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},n0={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},a0={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},i0={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},l0={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},c0={display:"flex",flexDirection:"column",flex:1},s0={fontSize:"14px",fontWeight:"medium"},d0={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},u0={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},p0={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},g0={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},m0=g.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),h0=({value:e,children:t})=>n.jsx(m0.Provider,{value:e,children:t}),wi=({value:e,onValueChange:t,placeholder:o="Type a command or search...",views:r,...a})=>{const i=g.useRef(null);return g.useEffect(()=>{i.current&&i.current.focus()},[]),n.jsxs(s.View,{...e0,...r==null?void 0:r.container,...a,children:[n.jsx(vt,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),n.jsx(s.View,{as:"input",type:"text",value:e,onChange:l=>t(l.target.value),placeholder:o,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:i,...r==null?void 0:r.input})]})},f0=({children:e,views:t,...o})=>n.jsx(s.View,{...t0,...t==null?void 0:t.container,...o,children:e}),Ii=({heading:e,children:t,views:o,...r})=>n.jsxs(s.View,{...o0,...o==null?void 0:o.container,...r,children:[n.jsx(s.Text,{...r0,...o==null?void 0:o.heading,children:e}),t]}),Ho=({item:e,selected:t=!1,onSelect:o,views:r,...a})=>{const i=()=>{!e.disabled&&o&&o()};return n.jsxs(s.Horizontal,{...n0,...t?a0:{},...e.disabled?i0:{},onClick:i,...r==null?void 0:r.container,...a,children:[e.icon&&n.jsx(s.View,{...l0,...r==null?void 0:r.icon,children:e.icon}),n.jsxs(s.Vertical,{...c0,...r==null?void 0:r.content,children:[n.jsx(s.Text,{...s0,...r==null?void 0:r.name,children:e.name}),e.description&&n.jsx(s.Text,{...d0,...r==null?void 0:r.description,children:e.description})]}),e.shortcut&&n.jsx(s.Text,{...u0,...r==null?void 0:r.shortcut,children:e.shortcut})]})},Ti=({children:e="No results found.",views:t,...o})=>n.jsx(s.View,{...p0,...t==null?void 0:t.container,...o,children:e}),x0=({open:e,onOpenChange:t,groups:o=[],commands:r=[],placeholder:a,size:i="md",variant:l="default",emptyState:d,footer:c,search:u,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:x,filteredGroups:f,listRef:b,views:y,filter:k,...j})=>{if(!e)return null;const S=g.useCallback(R=>{R.disabled||(R.onSelect(),t(!1),p(""))},[t,p]),C=g.useCallback(R=>R.target===R.currentTarget&&t(!1),[t]),w=g.useMemo(()=>({search:u,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:x,onSelect:S}),[u,m,x,S,p,h]),I=o.length>0,M=x.length===0;return n.jsx(s.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9999,onClick:C,...j,children:n.jsx(h0,{value:w,children:n.jsxs(s.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...Qf[i],...Zf[l],...y==null?void 0:y.container,onClick:R=>R.stopPropagation(),children:[n.jsx(wi,{value:u,onValueChange:p,placeholder:a,views:y==null?void 0:y.searchInput}),n.jsx(s.View,{ref:b,flex:1,overflow:"auto",...y==null?void 0:y.list,children:M?d||n.jsx(Ti,{views:y==null?void 0:y.empty}):I?f.map(R=>n.jsx(Ii,{heading:R.name,views:y==null?void 0:y.groupHeading,children:R.commands.map(E=>{const W=x.findIndex(T=>T.id===E.id);return n.jsx(Ho,{item:E,selected:W===m,onSelect:()=>S(E),"data-index":W,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},E.id)})},R.id)):x.map((R,E)=>n.jsx(Ho,{item:R,selected:E===m,onSelect:()=>S(R),"data-index":E,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},R.id))}),c&&n.jsx(s.View,{...g0,...y==null?void 0:y.footer,children:c})]})})})},b0=({open:e,onOpenChange:t,groups:o=[],commands:r=[],placeholder:a,size:i="md",variant:l="default",filter:d,emptyState:c,footer:u,views:p,...m})=>{const{search:h,setSearch:x,selectedIndex:f,setSelectedIndex:b,filteredCommands:y,filteredGroups:k,listRef:j}=Kf({open:e,onOpenChange:t,groups:o,commands:r,filter:d});return n.jsx(x0,{open:e,onOpenChange:t,groups:o,commands:r,placeholder:a,size:i,variant:l,emptyState:c,footer:u,search:h,setSearch:x,selectedIndex:f,setSelectedIndex:b,filteredCommands:y,filteredGroups:k,listRef:j,views:p,...m})},at=b0;at.Input=wi;at.List=f0;at.Group=Ii;at.Item=Ho;at.Empty=Ti;const Yr=()=>Math.random().toString(36).substring(2,11),y0=({defaultOpen:e=!1,openDelay:t=200,closeDelay:o=200,isDisabled:r=!1}={})=>{const[a,i]=g.useState(e),l=g.useRef(null),d=g.useRef(null),c=g.useRef(null),u=g.useRef(null),p=g.useRef(`tooltip-trigger-${Yr()}`).current,m=g.useRef(`tooltip-content-${Yr()}`).current,h=g.useCallback(()=>{r||(u.current&&(clearTimeout(u.current),u.current=null),!a&&!c.current&&(c.current=setTimeout(()=>{i(!0),c.current=null},t)))},[a,t,r]),x=g.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),a&&!u.current&&(u.current=setTimeout(()=>{i(!1),u.current=null},o))},[a,o]),f=g.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return g.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),g.useEffect(()=>{const b=y=>{y.key==="Escape"&&a&&i(!1)};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[a]),{isOpen:a,openTooltip:h,closeTooltip:x,cancelCloseTimer:f,triggerRef:l,contentRef:d,triggerId:p,contentId:m}},k0={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},C0=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),j0=C0(),S0=e=>{const t={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...t,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...t,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...t,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...t,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return t}},Mi=g.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),fr=()=>g.useContext(Mi),w0=({value:e,children:t})=>n.jsx(Mi.Provider,{value:e,children:t}),Ri=({children:e,views:t,asChild:o=!1,...r})=>{const{openTooltip:a,closeTooltip:i,triggerRef:l,contentId:d,triggerId:c}=fr(),x={ref:l,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:c,"aria-describedby":d,...t==null?void 0:t.container,...r};return o&&g.isValidElement(e)?g.cloneElement(e,x):n.jsx(s.View,{display:"inline-block",...x,children:e})},I0=({children:e,views:t,...o})=>{const{isOpen:r,contentRef:a,contentId:i,triggerId:l}=fr();return r?n.jsx(s.View,{ref:a,id:i,role:"tooltip","aria-labelledby":l,...t==null?void 0:t.container,...o,children:e}):null},T0=({content:e,children:t,position:o="top",align:r="center",size:a="md",variant:i="default",showArrow:l=!0,views:d,themeMode:c,...u})=>{const{isOpen:p,triggerRef:m,contentRef:h,contentId:x,triggerId:f}=fr(),{ref:b,relation:y}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,j]=g.useState({x:0,y:0,placement:o});g.useEffect(()=>{m!=null&&m.current&&b&&(b.current=m.current)},[m,b,p]),g.useEffect(()=>{if(p&&(h!=null&&h.current)&&(m!=null&&m.current)){const I=m.current.getBoundingClientRect();let M=o;y&&(o==="top"&&y.space.vertical==="bottom"?M="bottom":o==="bottom"&&y.space.vertical==="top"?M="top":o==="right"&&y.space.horizontal==="left"?M="left":o==="left"&&y.space.horizontal==="right"&&(M="right"));let R=0,E=0;switch(M){case"top":R=r==="start"?I.left:r==="end"?I.right-120:I.left+I.width/2-60,E=I.top-8;break;case"bottom":R=r==="start"?I.left:r==="end"?I.right-120:I.left+I.width/2-60,E=I.bottom+8;break;case"right":R=I.right+8,E=r==="start"?I.top:r==="end"?I.bottom-32:I.top+I.height/2-16;break;case"left":R=I.left-8,E=r==="start"?I.top:r==="end"?I.bottom-32:I.top+I.height/2-16;break}j({x:R,y:E,placement:M})}},[p,o,r,m,h,y]);const S=l?S0(k.placement):{},w=(()=>{const I={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...I,transform:"translateY(-100%)"};case"left":return{...I,transform:"translateX(-100%)"};case"bottom":case"right":default:return I}})();return n.jsxs(s.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...u,children:[n.jsx(Ri,{children:t}),p&&n.jsxs(s.View,{ref:h,id:x,role:"tooltip","aria-labelledby":f,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:w,...k0[a],...j0[i],...d==null?void 0:d.content,children:[typeof e=="string"?n.jsx(s.Text,{...d==null?void 0:d.text,children:e}):e,l&&n.jsx(s.View,{...S,...d==null?void 0:d.arrow})]})]})},M0=({content:e,children:t,position:o="top",align:r="center",size:a="md",variant:i="default",openDelay:l=200,closeDelay:d=200,showArrow:c=!0,defaultOpen:u=!1,isDisabled:p=!1,views:m,...h})=>{const x=y0({defaultOpen:u,openDelay:l,closeDelay:d,isDisabled:p});return n.jsx(w0,{value:x,children:n.jsx(T0,{content:e,position:o,align:r,size:a,variant:i,showArrow:c,views:m,...h,children:t})})},xr=M0;xr.Trigger=Ri;xr.Content=I0;const zi=g.forwardRef((e,t)=>{const o=ba(e);return n.jsx(ja,{...e,...o})});zi.displayName="ChatInput";const R0={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},Xr={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},Io={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},To={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},Kr={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},Dt={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},z0={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},E0=(e,t,o,r,a)=>{const i=t.map(l=>`${l.color} ${l.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${o&&Kr[o]?Kr[o]:o||"to right"}, ${i})`;case"radial":const d=a&&Dt[a]?Dt[a]:a||"center";return`radial-gradient(${r||"circle"} at ${d}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&Dt[a]?Dt[a]:a||"center"}, ${i})`;default:return`linear-gradient(to right, ${i})`}},V0={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"all 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},Qr={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},P0=({type:e="linear",direction:t="to-right",shape:o="circle",position:r="center",from:a,to:i,colors:l,animate:d=!1,animationDuration:c=3,children:u,views:p,themeMode:m,...h})=>{const x=g.useMemo(()=>l&&l.length>0?l:a&&i?[{color:a,position:"0%"},{color:i,position:"100%"}]:z0[e],[l,a,i,e]),f=g.useMemo(()=>{const y=x.map(k=>({...k,color:k.color}));return E0(e,y,t,o,r)},[e,x,t,o,r]),b=g.useMemo(()=>{if(!d)return{};const y=V0[e];return{...y,transition:y.transition.replace("3s",`${c}s`),animationDuration:`${c}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,c,e]);return n.jsx(s.View,{background:f,...Qr.container,...b,...p==null?void 0:p.container,...h,children:u&&n.jsx(s.View,{...Qr.content,...p==null?void 0:p.content,children:u})})},_0=e=>n.jsx(P0,{...e}),W0=g.createContext({}),$0=({children:e,showRadialGradient:t=!0,views:o,themeMode:r,...a})=>{const i={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},l=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],d={...Xr.gradient,backgroundImage:`
55
+ ${me}`:me}let ce=P,ge=!1;P.endsWith("-thinking")&&(ce=P.replace(/-thinking$/,""),ge=!0),r(J,{model_name:ce,enable_thinking:ge}),f||y(""),S([]),w([])},U=G=>{S(J=>J.filter((ce,ge)=>ge!==G)),!u&&C.length>G&&w(J=>J.filter((ce,ge)=>ge!==G))},K=G=>{G.preventDefault(),G.stopPropagation(),W(!0)},ee=G=>{G.preventDefault(),G.stopPropagation(),W(!1)},ne=g.useCallback(G=>{!G||G.length===0||(w(J=>[...J,...G]),S(J=>[...J,...G]),T(J=>[...J,...G]),M(!0))},[w,S]),ae=g.useCallback(()=>{if(_.length>0&&!$&&x){D(!0);const G=_[0];z.current=G,E(0);try{x(G)}catch(J){T(ce=>ce.slice(1)),D(!1),z.current=null,E(0),M(ce=>_.length-1>0||!1),m==null||m(J)}}else _.length===0&&I&&(M(!1),E(0))},[_,$,x,I,m]);g.useEffect(()=>{ae()},[_,$,ae]);const oe="active",de=G=>!0,xe=()=>{O(!1),e.onGuideClose&&e.onGuideClose()},N=G=>{f&&o?o(G.text):y(G.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(G),B.current&&B.current.focus()},q=g.useCallback(()=>C,[C]),Z=g.useCallback(()=>w([]),[]);return{onSubmit:r,getPendingFiles:q,clearPendingFiles:Z,value:k,handleChange:Y,handleSubmit:X,editableRef:B,fileInputRef:F,isUploading:I,uploadProgress:R,isDraggingOver:V,uploadedFiles:j,pendingFiles:C,removeUploadedFile:U,setPendingFiles:w,setUploadedFiles:S,setIsUploading:M,startUpload:ne,selectedModel:P,handleModelChange:L,modelOptions:H,subscriptionStatus:oe,canAccessModel:de,handleDragOver:K,handleDragLeave:ee,isGuideTipShown:A,hideGuideTip:xe,handlePromptExampleSelect:N}},pg={attachmentRemove:{position:"absolute",top:"2px",right:"2px",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"color-black-900",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",zIndex:1}},Hr={container:{width:"100%",maxWidth:"100%",borderRadius:"12px",backgroundColor:"color-white",transition:"all 0.2s ease",media:{mobile:{borderRadius:"8px"}}},content:{width:"100%",padding:"12px",borderRadius:"12px",backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",media:{mobile:{padding:"10px",borderRadius:"8px"}}}},gg={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},hg={xs:{fontSize:"10px",padding:"4px 8px"},sm:{fontSize:"12px",padding:"6px 10px"},md:{fontSize:"14px",padding:"8px 12px"},lg:{fontSize:"16px",padding:"10px 14px"},xl:{fontSize:"20px",padding:"12px 16px"}},mg={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"},none:{backgroundColor:"transparent",border:"none"}},Br=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,fg=({openDelay:e=200,closeDelay:t=300}={})=>{const[o,r]=g.useState(!1),a=g.useRef(null),i=g.useRef(null),l=g.useRef(null),d=g.useRef(null),c=g.useMemo(()=>Br("hovercard-content"),[]),u=g.useMemo(()=>Br("hovercard-trigger"),[]),p=g.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),i.current&&(clearTimeout(i.current),i.current=null)},[]),h=g.useCallback(()=>{p(),o||(a.current=setTimeout(()=>{r(!0)},e))},[o,e,p]),m=g.useCallback(()=>{p(),o&&(i.current=setTimeout(()=>{r(!1)},t))},[o,t,p]),x=g.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return g.useEffect(()=>()=>p(),[p]),{isOpen:o,openCard:h,closeCard:m,cancelCloseTimer:x,triggerRef:l,contentRef:d,contentId:c,triggerId:u}},ka=g.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),xg=({children:e,value:t})=>n.jsx(ka.Provider,{value:t,children:e}),Ca=()=>{const e=g.useContext(ka);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},bg=({children:e,views:t,asChild:o=!1,...r})=>{const{openCard:a,closeCard:i,triggerRef:l,contentId:d,triggerId:c}=Ca(),x={ref:l,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:c,"aria-describedby":d,...t==null?void 0:t.container,...r};if(o&&g.isValidElement(e)){const f=g.Children.only(e);return g.cloneElement(f,{...x,...f.props})}return n.jsx(s.View,{position:"relative",display:"inline-block",...x,children:e})},yg=({children:e,views:t,side:o="bottom",align:r="center",sideOffset:a=8,style:i,backgroundColor:l="white",borderRadius:d="4px",boxShadow:c="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:p="50px",maxWidth:h="300px",...m})=>{const{isOpen:x,cancelCloseTimer:f,closeCard:b,contentRef:y,triggerRef:k,contentId:j,triggerId:S}=Ca(),{ref:C,relation:w}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});g.useEffect(()=>{k!=null&&k.current&&(C==null?void 0:C.current)!==k.current&&C&&(C.current=k.current)},[k,C,x]);const I=()=>f(),M=()=>b();if(!x)return null;const R=()=>{if(!w||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const T=k.current.getBoundingClientRect();let $=o;o==="bottom"&&w.space.vertical==="top"?$="top":o==="top"&&w.space.vertical==="bottom"?$="bottom":o==="right"&&w.space.horizontal==="left"?$="left":o==="left"&&w.space.horizontal==="right"&&($="right");let D=0,z=0;switch($){case"bottom":D=T.left+T.width/2,z=T.bottom+a;break;case"top":D=T.left+T.width/2,z=T.top-a;break;case"right":D=T.right+a,z=T.top+T.height/2;break;case"left":D=T.left-a,z=T.top+T.height/2;break}return{position:"fixed",left:D,top:z,zIndex:1e3,transform:E($)}},E=T=>{switch(T){case"bottom":return"translate(-50%, 0)";case"top":return"translate(-50%, -100%)";case"right":return"translate(0, -50%)";case"left":return"translate(-100%, -50%)";default:return"translate(-50%, 0)"}},_=R();return n.jsx(s.View,{ref:y,id:j,role:"tooltip","aria-labelledby":S,onMouseEnter:I,onMouseLeave:M,backgroundColor:l,borderRadius:d,boxShadow:c,padding:u,minWidth:p,maxWidth:h,style:{..._,...i},...t==null?void 0:t.container,...m,children:e})},kg=({children:e,views:t,openDelay:o,closeDelay:r,...a})=>{const i=fg({openDelay:o,closeDelay:r});return n.jsx(xg,{value:i,children:n.jsx(s.View,{position:"relative",display:"inline-block",...t==null?void 0:t.container,...a,children:e})})},be=kg;be.Trigger=bg;be.Content=yg;const Cg=({files:e,sandboxId:t,onRemove:o,layout:r="inline",maxHeight:a="120px",showPreviews:i=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(c=>c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...l==null?void 0:l.container,children:e.map((c,u)=>{const p=URL.createObjectURL(c)||(c==null?void 0:c.path)||(c==null?void 0:c.url)||"",h=c.type.startsWith("image/"),m=c.type.startsWith("video/"),x=c.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:i&&n.jsxs(be,{children:[n.jsxs(be.Trigger,{children:[h&&n.jsx(s.Image,{src:p,alt:c.name,width:"60px",height:"60px",objectFit:"cover"}),m&&n.jsx(s.View,{as:"video",src:p,alt:c.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!h&&!m&&!x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),o&&n.jsx(s.Button,{...pg.attachmentRemove,onClick:f=>{f.stopPropagation(),o(u)},"aria-label":`Remove ${c.name}`,children:"×"})]}),n.jsxs(be.Content,{children:[h&&n.jsx(s.Image,{src:p,alt:c.name,maxWidth:"100%"}),m&&n.jsx(s.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),x&&n.jsx(s.View,{as:"audio",src:p,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[c.name," (",d(c.size),")"]})]})]})},u)})})},ja=g.forwardRef(({value:e,onChange:t,placeholder:o="Type your message...",disabled:r=!1,autoFocus:a=!0,suggestions:i=[],onSuggestionSelect:l,showSuggestions:d=!1,mentionData:c=[],mentionTrigger:u="@",onMentionSelect:p,maxHeight:h="200px",minHeight:m="40px",views:x={}},f)=>{var de,xe;const b=g.useRef(e),[y,k]=g.useState(-1),[j,S]=g.useState(!e),C=g.useRef(null),[w,I]=g.useState(!1),[M,R]=g.useState(!1),[E,_]=g.useState(""),[T,$]=g.useState(-1),[D,z]=g.useState(-1),[V,W]=g.useState([]),{ref:P,relation:L}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[H,B]=g.useState({x:0,y:0}),[F,A]=g.useState({x:0,y:0});g.useEffect(()=>{const N=f;N.current&&e!==b.current&&(N.current.textContent=e,b.current=e,S(!e))},[e,f]),g.useEffect(()=>{a&&f&&typeof f=="object"&&f.current&&f.current.focus()},[a,f]);const O=()=>{const N=window.getSelection();if(!N||N.rangeCount===0)return-1;const q=N.getRangeAt(0),Z=q.cloneRange();return Z.selectNodeContents(f&&typeof f=="object"&&f.current?f.current:document.body),Z.setEnd(q.endContainer,q.endOffset),Z.toString().length},Y=g.useCallback((N,q)=>{const Z=N.substring(0,q),G=Z.lastIndexOf(u);if(G!==-1){const J=Z.substring(G+1);if(!J.includes(" ")){const ge=J.toLowerCase(),me=c.filter(fe=>fe.name.toLowerCase().includes(ge));_(ge),$(G),W(me),R(me.length>0),z(0);const re=X();B(re);return}}R(!1),_(""),$(-1),z(-1)},[c,u]);g.useEffect(()=>{C.current&&P&&(P.current=C.current)},[C,P]);const X=g.useCallback((N=200)=>{if(!C.current)return{x:0,y:0};const q=C.current.getBoundingClientRect();if(L){const ce=L.space.vertical==="top";return{x:q.left,y:ce?q.top-N-8:q.bottom+8}}const Z=window.innerHeight,G={top:q.top,bottom:Z-q.bottom},J=G.bottom<N+8&&G.top>G.bottom;return{x:q.left,y:J?q.top-N-8:q.bottom+8}},[L]),U=g.useCallback(()=>{I(!0);const N=X();A(N)},[X]),K=g.useCallback(()=>{setTimeout(()=>{I(!1),k(-1)},150)},[]),ee=N=>{const q=N.currentTarget.textContent||"";if(q!==b.current){t(q),b.current=q,S(!q);const Z=O();Y(q,Z)}},ne=g.useCallback(N=>{if(f&&typeof f=="object"&&f.current){const q=f.current.textContent||"",Z=q.substring(0,T),G=q.substring(T+u.length+E.length),J=Z+u+N.name+" "+G;t(J),b.current=J,f.current.textContent=J;const ce=Z.length+u.length+N.name.length+1;setTimeout(()=>{var ge;if(f.current){const me=document.createRange(),re=window.getSelection(),fe=f.current.firstChild;fe&&re&&(me.setStart(fe,Math.min(ce,((ge=fe.textContent)==null?void 0:ge.length)||0)),me.collapse(!0),re.removeAllRanges(),re.addRange(me))}},0)}R(!1),_(""),$(-1),z(-1),p&&p(N)},[T,u,E,t,p,f]),ae=g.useCallback(N=>{l&&l(N),k(-1)},[l]),oe=N=>{if(M&&V.length>0){if(N.key==="ArrowDown"){N.preventDefault(),z(q=>q<V.length-1?q+1:0);return}if(N.key==="ArrowUp"){N.preventDefault(),z(q=>q>0?q-1:V.length-1);return}if((N.key==="Tab"||N.key==="Enter")&&D>=0){N.preventDefault(),ne(V[D]);return}if(N.key==="Escape"){R(!1),z(-1);return}}if(d&&i.length>0){if(N.key==="ArrowDown"){N.preventDefault(),k(q=>q<i.length-1?q+1:0);return}if(N.key==="ArrowUp"){N.preventDefault(),k(q=>q>0?q-1:i.length-1);return}if(N.key==="Tab"&&y>=0){N.preventDefault(),ae(i[y]);return}if(N.key==="Escape"){k(-1);return}}};return n.jsxs(s.View,{ref:C,width:"100%",position:"relative",...x==null?void 0:x.container,children:[n.jsxs(s.View,{width:"100%",minHeight:m,maxHeight:h,overflowY:"auto",position:"relative",children:[j&&n.jsx(s.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...x==null?void 0:x.placeholder,children:o}),n.jsx(s.View,{as:"div",ref:f,contentEditable:!r,suppressContentEditableWarning:!0,onInput:ee,onKeyDown:oe,onFocus:U,onBlur:K,role:"textbox","aria-multiline":"true","aria-placeholder":o,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...x==null?void 0:x.input})]}),M&&V.length>0&&n.jsx(s.View,{position:"fixed",left:H.x,top:H.y,width:((de=C.current)==null?void 0:de.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-blue-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9999,maxHeight:"200px",overflowY:"auto",...x==null?void 0:x.mentionContainer,children:n.jsxs(s.Vertical,{gap:0,children:[V.map((N,q)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:q===D?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ne(N),onMouseEnter:()=>z(q),_hover:{backgroundColor:"color-blue-50"},...x==null?void 0:x.mentionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsxs(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,N.name]}),N.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:N.description})]})},N.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",L&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})}),d&&i.length>0&&!M&&w&&!e&&n.jsx(s.View,{position:"fixed",left:F.x,top:F.y,width:((xe=C.current)==null?void 0:xe.offsetWidth)||300,backgroundColor:"color-white",border:"2px solid",borderColor:"color-green-300",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",zIndex:9998,maxHeight:"200px",overflowY:"auto",...x==null?void 0:x.suggestionsContainer,children:n.jsxs(s.Vertical,{gap:0,children:[i.map((N,q)=>n.jsx(s.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:q===y?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ae(N),onMouseEnter:()=>k(q),_hover:{backgroundColor:"color-blue-50"},...x==null?void 0:x.suggestionItem,children:n.jsxs(s.Vertical,{gap:4,children:[n.jsx(s.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:N.text}),N.description&&n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:N.description})]})},N.id)),process.env.NODE_ENV==="development"&&n.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",L&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),"Space: ",L.space.vertical,"-",L.space.horizontal]})]})]})})]})});ja.displayName="EditableInput";const jg=({examples:e,onSelect:t,views:o={}})=>{const{getColor:r}=s.useTheme();return!e||e.length===0?null:n.jsx(s.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...o==null?void 0:o.container,children:e.map(a=>n.jsx(s.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"4px",backgroundColor:"color-gray-100",border:"none",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>t(a),_hover:{backgroundColor:"color-gray-200"},...o==null?void 0:o.item,children:n.jsx(s.Text,{fontSize:"14px",color:"color-gray-700",...o==null?void 0:o.text,children:a.text})},a.id))})},Sg=({onRecordingComplete:e,onRecordingStart:t,views:o={}})=>{const{recording:r,paused:a,audioBlob:i,analyserNode:l,startRecording:d,stopRecording:c}=gn();g.useEffect(()=>{if(i){const p=new File([i],`recording-${Date.now()}.webm`,{type:i.type||"audio/webm;codecs=opus"});e(p)}},[i]);const u=g.useCallback(()=>{d(),t==null||t()},[]);return n.jsxs(s.Horizontal,{alignItems:"center",gap:4,children:[n.jsx(s.View,{minWidth:90,children:r&&l&&n.jsx(Ko,{analyserNode:l,isPaused:a})}),n.jsx(s.View,{as:"button",type:"button",onClick:r?c:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r?"theme-error":"color-gray-100",color:r?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:r?"color-red-600":"color-gray-200"},...o.button,children:r?n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(vo,{widthHeight:16,color:"currentColor",filled:!1})})]})},Sa=({onSubmit:e,placeholder:t="Say what you want and Kimmy will surprise you",loading:o=!1,disabled:r=!1,isAgentRunning:a=!1,enableAudioRecording:i=!1,leftButtons:l,rightButtons:d,onStopAgent:c,loadingText:u="Agent is working...",autoFocus:p=!0,sandboxId:h,hideAttachments:m=!1,attachmentText:x="",promptExamples:f=[],suggestions:b=[],errorMessage:y,size:k="md",shape:j="rounded",variant:S="default",views:C={},mentionData:w=[],mentionTrigger:I="@",onMentionSelect:M,onAudioRecordingStart:R,onAudioRecordingStop:E,value:_,handleChange:T,handleSubmit:$,editableRef:D,fileInputRef:z,isUploading:V,uploadProgress:W,isDraggingOver:P,uploadedFiles:L,removeUploadedFile:H,setPendingFiles:B,setUploadedFiles:F,setIsUploading:A,startUpload:O,selectedModel:Y,handleModelChange:X,modelOptions:U,subscriptionStatus:K,canAccessModel:ee,isGuideTipShown:ne,hideGuideTip:ae,handlePromptExampleSelect:oe,handleDragOver:de,handleDragLeave:xe,onChange:N,...q})=>{s.useTheme();const Z={...Hr.container,...gg[j],...C==null?void 0:C.container},G={...Hr.content,...hg[k],...mg[S],...C==null?void 0:C.content},J=((_==null?void 0:_.trim().length)??0)>0||L.length>0,ce=g.useCallback(re=>{O([re]),E==null||E(re)},[O,E]),ge=g.useCallback(re=>{const fe=re.filter(zt=>zt.size>52428800?(console.error(`File size exceeds 50MB limit: ${zt.name}`),!1):!0);fe.length>0&&O(fe)},[O]),me=[...w||[],...L.map((re,fe)=>({id:`file-${fe}`,name:re.name}))];return n.jsxs(s.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...Z,...q,onDragOver:de,onDragLeave:xe,onDrop:re=>{if(re.preventDefault(),re.stopPropagation(),xe(re),re.dataTransfer.files.length>0){const fe=Array.from(re.dataTransfer.files);ge(fe)}},children:[f.length>0&&n.jsx(jg,{examples:f,onSelect:oe,views:{container:C==null?void 0:C.promptExamples,item:C==null?void 0:C.promptExampleItem}}),a&&n.jsxs(s.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...C==null?void 0:C.loadingIndicator,children:[n.jsx(Uo,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",children:u})]}),n.jsx(s.View,{position:"relative",width:"100%",overflow:"visible",children:n.jsxs(s.View,{as:"form",onSubmit:$,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...G,...Z,paddingHorizontal:16,paddingVertical:10,backgroundColor:P?"color-blue-50":void 0,children:[n.jsx(Cg,{files:L,sandboxId:h,onRemove:H,showPreviews:!0,views:{container:C==null?void 0:C.attachments,item:C==null?void 0:C.attachmentItem,name:C==null?void 0:C.attachmentName,size:C==null?void 0:C.attachmentSize,removeButton:C==null?void 0:C.attachmentRemove}}),n.jsx(ja,{ref:D,value:_||"",onChange:T,placeholder:t,disabled:r&&!a,autoFocus:p,suggestions:b||[],showSuggestions:b&&b.length>0&&!_,onSuggestionSelect:re=>{T(re.text)},mentionData:me,mentionTrigger:I,onMentionSelect:M,views:{container:{},input:C==null?void 0:C.editableInput}}),n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[!m&&n.jsx(ao,{accept:"*/*",icon:n.jsx(bt,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:ge,isLoading:V,progress:W||0,text:x,fileType:"file",renderError:({errorMessage:re})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...C==null?void 0:C.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:j==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:re=>re.size>50*1024*1024?"File size exceeds 50MB limit":null}),l]}),n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[i&&n.jsx(Sg,{onRecordingStart:R,onRecordingComplete:ce,views:{button:C==null?void 0:C.recordButton}}),n.jsx(s.View,{as:"button",type:"button",onClick:$,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a?"theme-error":J?"theme-primary":"color-gray-300",color:"color-white",borderRadius:j==="rounded"?"50%":4,border:"none",cursor:J?"pointer":"not-allowed",disabled:!J||o||r&&!a,transition:"all 0.2s ease",_hover:{backgroundColor:a?"color-red-600":J?"color-blue-600":"color-gray-300"},...C==null?void 0:C.submitButton,children:a?n.jsx(to,{widthHeight:16,color:"currentColor",filled:!1}):o?n.jsx(ft,{type:"quarter",size:16,color:"color-white"}):n.jsx(No,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),y&&n.jsx(s.Text,{color:"theme-error",marginTop:"4px",...C==null?void 0:C.bottomTip,children:y})]})},wg=e=>{const{name:t,onSubmit:o,...r}=e,[a,i]=g.useState([]),l=pe({name:t,type:"text"}),d=m=>{l.onChangeText&&l.onChangeText(m)},c=(m,x)=>{o?o(m,x):d(m)},u=()=>a,p=()=>i([]),h=ya({...r,value:l.value||"",onChange:d,onSubmit:c,getPendingFiles:u,clearPendingFiles:p});return n.jsx(Sa,{...r,...h,value:l.value||"",onChange:d,onSubmit:c,error:l.error,getPendingFiles:u,clearPendingFiles:p})},Ig=wg,Tg=e=>{const t=pe(e),o=oa(t);return n.jsx(ra,{...o,...t})},Mg=Tg,Rg=e=>{const t=pe(e),o=sa();return n.jsx(da,{...o,...t})},zg=Rg,Eg=e=>{const t=pe(e),o=na(e);return n.jsx(aa,{...o,...t})},Vg=Eg,Pg=e=>{let t=pe(e);t.selected=t.value;const o=On(e);return n.jsx(Gn,{...o,...t})},Wg=Pg,_g=e=>{const t=pe(e),o=Yn(e);return n.jsx(Xn,{...o,...t})},$g=_g,Lg=e=>{const{name:t,...o}=e,{values:r,errors:a,touched:i,submitCount:l,setFieldValue:d,setFieldTouched:c}=ke.useFormikContext(),u=ke.getIn(r,t)||[],p=ke.getIn(i,t)||l>0?ke.getIn(a,t):void 0,h=g.useCallback(y=>{var j;const k=Array.isArray(y)?y.filter(S=>typeof S=="string"):[];d(t,k),(j=e.onTagsChange)==null||j.call(e,k)},[t,d,e.onTagsChange]),m=g.useCallback(()=>{var y;c(t,!0),(y=e.onBlur)==null||y.call(e)},[t,c,e.onBlur]),x=ha({...o,tags:u,onTagsChange:h,onBlur:m}),{tags:f,...b}=x;return n.jsx(ma,{...b,...o,tags:f,error:p})},Dg=Lg,Hg=e=>{const t=pe(e),o=Jn(e);return n.jsx(Zn,{...o,...t})},Bg=Hg,Ag=e=>{const t=pe(e),{value:o,...r}=sr(e);return n.jsx(St,{...r,...t})},Fg=Ag,Og=({visibleIcon:e=n.jsx(Go,{widthHeight:14}),hiddenIcon:t=n.jsx(qo,{widthHeight:14}),...o})=>{const r=pe(o),{isVisible:a,setIsVisible:i,...l}=ua(r);return n.jsx(St,{...l,type:a?"text":"password",isClearable:!1,right:n.jsx(s.View,{onClick:()=>{o.isDisabled||i(!a)},children:a?e:t})})},vg=Og,Ng=({items:e,placeholder:t,searchPlaceholder:o,isMulti:r=!1,...a})=>{const i=pe(a),l=pa(e,t,o);g.useEffect(()=>{if(r&&Array.isArray(i.value))l.setSelectedItems(i.value);else if(!r&&i.value){const c=typeof i.value=="object"?i.value:e.find(u=>u.value===i.value);c&&l.setSelectedItem(c)}},[i.value,r,e]);const d=c=>{i.onChange(c)};return n.jsx(ga,{...l,...i,items:e,placeholder:t,isMulti:r,onSelect:d})},Ug=Ng,Ke=(e,t,o)=>Math.min(Math.max(e,t),o),qg=(e,t,o,r,a,i,l)=>{const d=r-o;let c;if(i==="horizontal"){const u=t.width,p=e-t.left;c=Ke(p/u,0,1)}else{const u=t.height,p=t.bottom-e;c=Ke(p/u,0,1)}if(l&&l.length>0){const u=o+c*d;let p=l[0],h=Math.abs(u-p);for(let m=1;m<l.length;m++){const x=Math.abs(u-l[m]);x<h&&(h=x,p=l[m])}return p}else{const u=o+c*d,p=Math.round(u/a)*a;return Ke(p,o,r)}},wa=({min:e=0,max:t=100,step:o=1,value:r=0,defaultValue:a,onChange:i,onDrag:l,orientation:d="horizontal",isDisabled:c=!1,stepValues:u})=>{const p=Ke(r??a??e,e,t),[h,m]=g.useState(p),[x,f]=g.useState(!1),[b,y]=g.useState(!1),k=g.useRef(null),j=g.useRef(null),S=r!==void 0,C=S?r:h;g.useEffect(()=>{S&&m(Ke(r,e,t))},[r,S,e,t]);const w=g.useCallback($=>{const D=Ke($,e,t);S||m(D),i&&D!==C&&i(D),x&&l&&l(D)},[S,e,t,i,C,x,l]),I=g.useCallback($=>{if(c||!k.current)return;const D=k.current.getBoundingClientRect();let z;"touches"in $?z=d==="horizontal"?$.touches[0].clientX:$.touches[0].clientY:z=d==="horizontal"?$.clientX:$.clientY;const V=qg(z,D,e,t,o,d,u);w(V)},[e,t,o,d,w,c,u]),M=g.useCallback($=>{if(c)return;$.preventDefault(),f(!0),I($);const D=V=>{I(V)},z=()=>{f(!1),document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",D),document.removeEventListener("touchend",z)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",z),document.addEventListener("touchmove",D),document.addEventListener("touchend",z)},[I,c]),R=g.useCallback($=>{j.current&&j.current.contains($.target)||M($)},[M]),E=g.useCallback($=>{if(c)return;let D=C;switch($.key){case"ArrowLeft":case"ArrowDown":D=C-o;break;case"ArrowRight":case"ArrowUp":D=C+o;break;case"Home":D=e;break;case"End":D=t;break;default:return}$.preventDefault(),w(D)},[C,e,t,o,w,c]),_=t-e,T=_===0?0:(C-e)/_*100;return{currentValue:C,isDragging:x,isHovered:b,setIsHovered:y,trackRef:k,thumbRef:j,handleThumbMouseDown:M,handleTrackMouseDown:R,handleKeyDown:E,thumbPositionPercent:T}},Ar={xs:{height:4,width:"100%"},sm:{height:6,width:"100%"},md:{height:8,width:"100%"},lg:{height:10,width:"100%"},xl:{height:12,width:"100%"}},Fr={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24},xl:{width:28,height:28}},Or={square:0,rounded:4,pill:24},Gg=e=>({default:{backgroundColor:"color-gray-200",transition:"background-color 0.15s ease"},outline:{backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"color-gray-300",transition:"border-color 0.15s ease"}}),vr=Gg(),Yg={xs:{trackCrossAxisSize:4,thumbSize:12},sm:{trackCrossAxisSize:6,thumbSize:16},md:{trackCrossAxisSize:8,thumbSize:20},lg:{trackCrossAxisSize:10,thumbSize:24},xl:{trackCrossAxisSize:12,thumbSize:28}},Xg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},Ia=({min:e=0,max:t=100,step:o=1,currentValue:r,stepValues:a,shape:i="rounded",size:l="md",variant:d="default",orientation:c="horizontal",isDisabled:u=!1,showValue:p=!1,showTooltip:h=!1,backgroundColor:m="theme-primary",label:x,helperText:f,themeMode:b,shadow:y={},isDragging:k,isHovered:j,setIsHovered:S,trackRef:C,thumbRef:w,handleThumbMouseDown:I,handleTrackMouseDown:M,handleKeyDown:R,thumbPositionPercent:E,ariaLabel:_="Slider",views:T={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:$,onDrag:D,...z})=>{var X,U;const{getColorHex:V,themeMode:W}=s.useTheme(),P=V(m,{themeMode:b||W}),L=V("theme-disabled",{themeMode:b||W}),H=V(vr[d].backgroundColor,{themeMode:b||W}),B=c==="vertical",{trackCrossAxisSize:F,thumbSize:A}=Yg[l]||{trackCrossAxisSize:Ar[l].height,thumbSize:Fr[l].width||16},O=n.jsxs(s.Vertical,{width:"100%",gap:8,...T.container,...z,children:[x&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...T.label,children:x}),p&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:M,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),...Ar[l],borderRadius:Or[i],backgroundColor:H,...vr[d],...y,...T.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(K=>{const ee=(K-e)/(t-e)*100;return n.jsx(s.View,{position:"absolute",top:"50%",left:`${ee}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?L:P,zIndex:1,...T.stepMarks},K)})}),n.jsx(s.View,{position:"absolute",top:0,left:0,height:"100%",width:`${E}%`,backgroundColor:u?L:P,borderRadius:Or[i],transition:"width 0.1s ease-in-out",...T.progress,...T.filledTrack}),n.jsx(s.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":r,"aria-orientation":c,"aria-disabled":u,"aria-label":_,position:"absolute",top:"50%",left:`${E}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${u?L:P}`,transition:k?"none":"transform 0.1s ease-in-out",transform:j?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:I,onTouchStart:I,onKeyDown:R,...Fr[l],...T.thumb,children:h&&(j||k)&&n.jsx(s.View,{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:8,padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:4,fontSize:12,whiteSpace:"nowrap",zIndex:3,...T.tooltip,children:n.jsx(s.Text,{...(X=T.tooltip)==null?void 0:X.text,children:r==null?void 0:r.toFixed(o<1?1:0)})})})]}),f&&n.jsx(Wo,{children:f})]}),Y=n.jsxs(s.Center,{...Xg[c],position:"relative",onMouseEnter:()=>!u&&S(!0),onMouseLeave:()=>!u&&S(!1),...z,...T==null?void 0:T.container,children:[x&&n.jsxs(s.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[n.jsx(s.Text,{fontSize:14,fontWeight:500,...T.label,children:x}),p&&n.jsx(s.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:r})]}),n.jsxs(s.View,{ref:C,position:"relative",borderRadius:F/2,backgroundColor:u?L:H,cursor:u?"not-allowed":"pointer",width:B?`${F}px`:"100%",height:B?"100%":`${F}px`,onMouseDown:M,onTouchStart:M,...T==null?void 0:T.track,children:[a&&a.length>0&&n.jsx(n.Fragment,{children:a.map(K=>{const ee=(K-e)/(t-e)*100;return n.jsx(s.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?L:P,zIndex:1,...B?{bottom:`${ee}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${ee}%`,top:"50%",transform:"translate(-50%, -50%)"},...T.stepMarks},K)})}),n.jsx(s.View,{position:"absolute",borderRadius:F/2,backgroundColor:u?L:P,...B?{bottom:0,left:0,width:"100%",height:`${E}%`}:{top:0,left:0,height:"100%",width:`${E}%`},...T==null?void 0:T.filledTrack,...T==null?void 0:T.progress}),n.jsx(s.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":r,"aria-orientation":c,"aria-disabled":u,"aria-label":_,position:"absolute",width:`${A}px`,height:`${A}px`,borderRadius:"50%",backgroundColor:u?L:P,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:B?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...B?{left:"50%",bottom:`${E}%`}:{top:"50%",left:`${E}%`},onMouseDown:I,onTouchStart:I,onKeyDown:R,...T==null?void 0:T.thumb,children:h&&(j||k)&&n.jsx(s.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...B?{left:"100%",marginLeft:"8px",bottom:"0",transform:"translateY(50%)"}:{bottom:"100%",left:"50%",marginBottom:"8px",transform:"translateX(-50%)"},...T==null?void 0:T.tooltip,children:n.jsx(s.Text,{...(U=T==null?void 0:T.tooltip)==null?void 0:U.text,children:r==null?void 0:r.toFixed(o<1?1:0)})})})]}),f&&n.jsx(Wo,{marginTop:8,children:f})]});return B||h?Y:O},Kg=e=>{const t=pe(e),o=wa({...e,value:t.value!==void 0?Number(t.value):void 0,onChange:r=>{var a;t.onChange(r),(a=e.onChange)==null||a.call(e,r)}});return n.jsx(Ia,{...e,...o,...t})},Qg=Kg,Jg=e=>{const t=pe(e),{isFocused:o,setIsFocused:r,isHovered:a,setIsHovered:i,inputRef:l,containerRef:d,mirrorSelectionStart:c,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:h,setInputRef:m,handleFocus:x,handleBlur:f,handleKeyDown:b,handlePaste:y}=fa(e),k=g.useCallback(S=>{t.onChange&&t.onChange(S),e.onComplete&&S.length===(e.length||6)&&e.onComplete(S),l.current&&(l.current.value=S)},[t,e,l]),j=g.useCallback(S=>{const C=S.currentTarget.value.slice(0,e.length||6);k(C),l.current&&(l.current.value=C)},[e.length,k,l]);return n.jsx(xa,{...e,...t,setValue:k,isFocused:o,setIsFocused:r,isHovered:a,setIsHovered:i,inputRef:l,containerRef:d,mirrorSelectionStart:c,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:h,setInputRef:m,handleChange:j,handleFocus:x,handleBlur:f,handleKeyDown:b,handlePaste:y,stepValues:e.stepValues})},Zg=Jg,eh=e=>Array.isArray(e)?e:e==null?[]:[e],Ta=({name:e,uploadFile:t,onUploadSuccess:o,onUploadError:r,transformResponse:a,onMultipleFileSelect:i,onFileSelect:l,multiple:d=!0,...c})=>{const{setFieldValue:u,setFieldTouched:p,values:h}=ke.useFormikContext(),[m,x]=g.useState(!1),[f,b]=g.useState(0),y=g.useCallback(async S=>{if(!S||S.length===0)return;p(e,!0,!0),x(!0);const C=[];for(const w of S){b(0);try{const I=await t(w,R=>{b(R??0)}),M=a?a(I,w):I;C.push(M),o==null||o(w,M)}catch(I){r==null||r(w,I)}}if(C.length>0){const w=eh(ke.getIn(h,e));u(e,[...w,...C],!0),b(100)}else b(0);x(!1)},[e,r,o,p,u,a,t,h]),k=g.useCallback(async S=>{i==null||i(S),await y(S)},[y,i]),j=g.useCallback(async S=>{l==null||l(S),await y([S])},[y,l]);return n.jsx(ao,{...c,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:j,isLoading:m,progress:f})};Ta.displayName="FormikUploader";const th=e=>{let t=pe(e);t.selected=t.value;const o=Kn(e);return n.jsx(Qn,{...o,...t})},oh=th,Ma=e=>{const[t,o]=g.useState(!1),[r,a]=g.useState(e);return{isHovered:t,setIsHovered:o,isToggle:r,setIsToggled:a}},rh={square:0,rounded:4,pill:24},nh=(e,t)=>({outline:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:e,_hover:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},ghost:{backgroundColor:"transparent",color:e,borderWidth:0,borderStyle:"none",borderColor:"transparent",_hover:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:t?"color-black":"color-white",transform:"translateY(0)"},transition:"all 0.2s ease"},link:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"1px",textDecorationThickness:"1px",_hover:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(-1px)"},_active:{borderColor:e,textDecorationThickness:"2px",transform:"translateY(0)"},transition:"all 0.2s ease"}}),Ra=({children:e,shape:t="rounded",variant:o="ghost",isHovered:r,setIsHovered:a,isDisabled:i,isToggle:l,setIsToggled:d,onToggle:c,views:u,backgroundColor:p,color:h,themeMode:m,...x})=>{const{getColor:f,themeMode:b}=s.useTheme(),y=m??b,j=f(i?"theme-disabled":p??h??"theme-primary",{themeMode:y}),C=nh(j,y==="light")[o],w=!!(l||r),I=()=>a(!r),M=()=>{i||d(R=>{const E=!R;return c&&c(E),E})};return n.jsx(s.Center,{role:"Toggle",padding:t==="pill"?"10px 12px":"8px",width:"fit-content",cursor:i?"not-allowed":"pointer",borderRadius:rh[t],onClick:M,onMouseEnter:I,onMouseLeave:()=>a(!1),...C,...w&&{backgroundColor:j,color:y==="light"?"color-black":"color-white"},...x,...u==null?void 0:u.container,children:e})},ah=({children:e,shape:t,variant:o,isDisabled:r,isToggled:a=!1,onToggle:i,...l})=>{const d=pe(l),{isHovered:c,setIsHovered:u,isToggle:p,setIsToggled:h}=Ma(d.value??a);g.useEffect(()=>{h(d.value??a)},[d.value,a]);const m=x=>{h(x),d.onChange(x),i==null||i(x)};return n.jsx(Ra,{shape:t,variant:o,isDisabled:r,isHovered:c,setIsHovered:u,isToggle:p,setIsToggled:h,onToggle:m,...l,children:e})},ih=ah,za=()=>{const[e,t]=g.useState([]);return{activeToggles:e,setActiveToggles:t}},lh=({children:e,shape:t,variant:o,isDisabled:r,isToggled:a=!1,onToggle:i,...l})=>{const{isHovered:d,setIsHovered:c,isToggle:u,setIsToggled:p}=Ma(a);return g.useEffect(()=>{p(a)},[a]),n.jsx(Ra,{shape:t,variant:o,isDisabled:r,isHovered:d,setIsHovered:c,isToggle:u,setIsToggled:p,onToggle:i,...l,children:e})},Ea=lh,Va=({items:e,onToggleChange:t,activeToggles:o,setActiveToggles:r,shape:a="rounded",variant:i="ghost",views:l})=>{const d=g.useCallback((c,u)=>{r(p=>{let h;return u?h=p.includes(c)?p:[...p,c]:h=p.filter(m=>m!==c),t==null||t(h),h})},[t,r]);return n.jsx(s.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...l==null?void 0:l.container,children:e.map(c=>n.jsx(Ea,{role:`toggle-${c.id}`,shape:a,variant:i,isToggled:o.includes(c.id)||c.isActive,onToggle:u=>d(c.id,u),isDisabled:c.isDisabled,views:l==null?void 0:l.toggle,children:c.value},c.id))})},ch=({items:e,shape:t,variant:o,onToggleChange:r,...a})=>{const i=pe(a),{activeToggles:l,setActiveToggles:d}=za();g.useEffect(()=>{Array.isArray(i.value)&&d(i.value)},[i.value]);const c=u=>{d(u),i.onChange(u),r==null||r(u)};return n.jsx(Va,{items:e,shape:t,variant:o,activeToggles:l,setActiveToggles:d,onToggleChange:c,...a})},sh=ch,Nr=["zoom-out","zoom-in","zap","zap-off","youtube","x","wrench","worm","workflow","wine","wine-off","wind","wind-arrow-down","wifi","wifi-zero","wifi-sync","wifi-pen","wifi-off","wifi-low","wifi-high","wifi-cog","whole-word","wheat","wheat-off","weight","weight-tilde","webhook","webhook-off","webcam","waypoints","waves","waves-ladder","waves-arrow-up","waves-arrow-down","watch","washing-machine","warehouse","wand","wand-sparkles","wallpaper","wallet","wallet-minimal","wallet-cards","vote","volume","volume-x","volume-off","volume-2","volume-1","volleyball","voicemail","view","videotape","video","video-off","vibrate","vibrate-off","venus","venus-and-mars","venetian-mask","vegan","vector-square","vault","variable","van","utility-pole","utensils","utensils-crossed","users","users-round","user","user-x","user-star","user-search","user-round","user-round-x","user-round-search","user-round-plus","user-round-pen","user-round-minus","user-round-cog","user-round-check","user-plus","user-pen","user-minus","user-lock","user-cog","user-check","usb","upload","unplug","unlink","unlink-2","university","ungroup","unfold-vertical","unfold-horizontal","undo","undo-dot","undo-2","underline","umbrella","umbrella-off","type","type-outline","twitter","twitch","tv","tv-minimal","tv-minimal-play","turtle","turntable","turkish-lira","truck","truck-electric","trophy","triangle","triangle-right","triangle-dashed","triangle-alert","trending-up","trending-up-down","trending-down","trello","trees","tree-pine","tree-palm","tree-deciduous","trash","trash-2","transgender","tram-front","train-track","train-front","train-front-tunnel","traffic-cone","tractor","toy-brick","tower-control","touchpad","touchpad-off","torus","tornado","toolbox","tool-case","toilet","toggle-right","toggle-left","timer","timer-reset","timer-off","tickets","tickets-plane","ticket","ticket-x","ticket-slash","ticket-plus","ticket-percent","ticket-minus","ticket-check","thumbs-up","thumbs-down","thermometer","thermometer-sun","thermometer-snowflake","theater","text-wrap","text-select","text-search","text-quote","text-initial","text-cursor","text-cursor-input","text-align-start","text-align-justify","text-align-end","text-align-center","test-tubes","test-tube","test-tube-diagonal","terminal","tent","tent-tree","telescope","target","tangent","tally-5","tally-4","tally-3","tally-2","tally-1","tags","tag","tablets","tablet","tablet-smartphone","table","table-rows-split","table-properties","table-of-contents","table-columns-split","table-cells-split","table-cells-merge","table-2","syringe","swords","sword","switch-camera","swiss-franc","swatch-book","superscript","sunset","sunrise","sun","sun-snow","sun-moon","sun-medium","sun-dim","subscript","strikethrough","stretch-vertical","stretch-horizontal","store","stone","sticky-note","sticker","stethoscope","step-forward","step-back","star","star-off","star-half","stamp","squirrel","squircle","squircle-dashed","squares-unite","squares-subtract","squares-intersect","squares-exclude","square","square-x","square-user","square-user-round","square-terminal","square-stop","square-star","square-stack","square-square","square-split-vertical","square-split-horizontal","square-slash","square-sigma","square-scissors","square-round-corner","square-radical","square-power","square-plus","square-play","square-pilcrow","square-pi","square-percent","square-pen","square-pause","square-parking","square-parking-off","square-mouse-pointer","square-minus","square-menu","square-m","square-library","square-kanban","square-function","square-equal","square-dot","square-divide","square-dashed","square-dashed-top-solid","square-dashed-mouse-pointer","square-dashed-kanban","square-dashed-bottom","square-dashed-bottom-code","square-code","square-chevron-up","square-chevron-right","square-chevron-left","square-chevron-down","square-check","square-check-big","square-chart-gantt","square-bottom-dashed-scissors","square-asterisk","square-arrow-up","square-arrow-up-right","square-arrow-up-left","square-arrow-right","square-arrow-out-up-right","square-arrow-out-up-left","square-arrow-out-down-right","square-arrow-out-down-left","square-arrow-left","square-arrow-down","square-arrow-down-right","square-arrow-down-left","square-activity","sprout","spray-can","spotlight","spool","split","spline","spline-pointer","spell-check","spell-check-2","speech","speaker","sparkles","sparkle","spade","space","soup","solar-panel","sofa","soap-dispenser-droplet","snowflake","snail","smile","smile-plus","smartphone","smartphone-nfc","smartphone-charging","sliders-vertical","sliders-horizontal","slice","slash","slack","skull","skip-forward","skip-back","siren","signpost","signpost-big","signature","signal","signal-zero","signal-medium","signal-low","signal-high","sigma","shuffle","shrub","shrink","shrimp","shredder","shower-head","shovel","shopping-cart","shopping-basket","shopping-bag","shirt","ship","ship-wheel","shield","shield-x","shield-user","shield-question-mark","shield-plus","shield-off","shield-minus","shield-half","shield-ellipsis","shield-check","shield-ban","shield-alert","shell","sheet","share","share-2","shapes","settings","settings-2","server","server-off","server-crash","server-cog","separator-vertical","separator-horizontal","send","send-to-back","send-horizontal","section","search","search-x","search-slash","search-code","search-check","search-alert","scroll","scroll-text","screen-share","screen-share-off","scooter","scissors","scissors-line-dashed","school","scan","scan-text","scan-search","scan-qr-code","scan-line","scan-heart","scan-face","scan-eye","scan-barcode","scaling","scale","scale-3d","save","save-off","save-all","saudi-riyal","satellite","satellite-dish","sandwich","salad","sailboat","russian-ruble","ruler","ruler-dimension-line","rss","rows-4","rows-3","rows-2","router","route","route-off","rotate-cw","rotate-cw-square","rotate-ccw","rotate-ccw-square","rotate-ccw-key","rotate-3d","rose","roller-coaster","rocking-chair","rocket","ribbon","rewind","reply","reply-all","replace","replace-all","repeat","repeat-2","repeat-1","remove-formatting","regex","refrigerator","refresh-cw","refresh-cw-off","refresh-ccw","refresh-ccw-dot","redo","redo-dot","redo-2","recycle","rectangle-vertical","rectangle-horizontal","rectangle-goggles","rectangle-ellipsis","rectangle-circle","receipt","receipt-turkish-lira","receipt-text","receipt-swiss-franc","receipt-russian-ruble","receipt-pound-sterling","receipt-japanese-yen","receipt-indian-rupee","receipt-euro","receipt-cent","ratio","rat","rainbow","rail-symbol","radius","radio","radio-tower","radio-receiver","radical","radiation","radar","rabbit","quote","qr-code","pyramid","puzzle","proportions","projector","printer","printer-check","presentation","power","power-off","pound-sterling","popsicle","popcorn","pointer","pointer-off","podcast","pocket","pocket-knife","plus","plug","plug-zap","plug-2","play","plane","plane-takeoff","plane-landing","pizza","pipette","pin","pin-off","pill","pill-bottle","pilcrow","pilcrow-right","pilcrow-left","piggy-bank","picture-in-picture","picture-in-picture-2","pickaxe","piano","pi","phone","phone-outgoing","phone-off","phone-missed","phone-incoming","phone-forwarded","phone-call","philippine-peso","person-standing","percent","pentagon","pencil","pencil-ruler","pencil-off","pencil-line","pen","pen-tool","pen-off","pen-line","pc-case","paw-print","pause","party-popper","parking-meter","parentheses","paperclip","panels-top-left","panels-right-bottom","panels-left-bottom","panel-top","panel-top-open","panel-top-dashed","panel-top-close","panel-top-bottom-dashed","panel-right","panel-right-open","panel-right-dashed","panel-right-close","panel-left","panel-left-right-dashed","panel-left-open","panel-left-dashed","panel-left-close","panel-bottom","panel-bottom-open","panel-bottom-dashed","panel-bottom-close","panda","palette","paintbrush","paintbrush-vertical","paint-roller","paint-bucket","package","package-x","package-search","package-plus","package-open","package-minus","package-check","package-2","origami","orbit","option","omega","octagon","octagon-x","octagon-pause","octagon-minus","octagon-alert","nut","nut-off","notepad-text","notepad-text-dashed","notebook","notebook-text","notebook-tabs","notebook-pen","non-binary","nfc","newspaper","network","navigation","navigation-off","navigation-2","navigation-2-off","music","music-4","music-3","music-2","move","move-vertical","move-up","move-up-right","move-up-left","move-right","move-left","move-horizontal","move-down","move-down-right","move-down-left","move-diagonal","move-diagonal-2","move-3d","mouse","mouse-pointer","mouse-pointer-click","mouse-pointer-ban","mouse-pointer-2","mouse-pointer-2-off","mouse-off","mountain","mountain-snow","motorbike","moon","moon-star","monitor","monitor-x","monitor-up","monitor-stop","monitor-speaker","monitor-smartphone","monitor-play","monitor-pause","monitor-off","monitor-down","monitor-dot","monitor-cog","monitor-cloud","monitor-check","minus","minimize","minimize-2","milk","milk-off","milestone","microwave","microscope","microchip","mic","mic-vocal","mic-off","messages-square","message-square","message-square-x","message-square-warning","message-square-text","message-square-share","message-square-reply","message-square-quote","message-square-plus","message-square-off","message-square-more","message-square-lock","message-square-heart","message-square-dot","message-square-diff","message-square-dashed","message-square-code","message-circle","message-circle-x","message-circle-warning","message-circle-reply","message-circle-question-mark","message-circle-plus","message-circle-off","message-circle-more","message-circle-heart","message-circle-dashed","message-circle-code","merge","menu","memory-stick","meh","megaphone","megaphone-off","medal","maximize","maximize-2","martini","mars","mars-stroke","map","map-plus","map-pinned","map-pin","map-pin-x","map-pin-x-inside","map-pin-plus","map-pin-plus-inside","map-pin-pen","map-pin-off","map-pin-minus","map-pin-minus-inside","map-pin-house","map-pin-check","map-pin-check-inside","map-minus","mails","mailbox","mail","mail-x","mail-warning","mail-search","mail-question-mark","mail-plus","mail-open","mail-minus","mail-check","magnet","luggage","lollipop","logs","log-out","log-in","lock","lock-open","lock-keyhole","lock-keyhole-open","locate","locate-off","locate-fixed","loader","loader-pinwheel","loader-circle","list","list-x","list-video","list-tree","list-todo","list-start","list-restart","list-plus","list-ordered","list-music","list-minus","list-indent-increase","list-indent-decrease","list-filter","list-filter-plus","list-end","list-collapse","list-chevrons-up-down","list-chevrons-down-up","list-checks","list-check","linkedin","link","link-2","link-2-off","line-squiggle","lightbulb","lightbulb-off","ligature","life-buoy","library","library-big","lectern","leafy-green","leaf","layout-template","layout-panel-top","layout-panel-left","layout-list","layout-grid","layout-dashboard","layers","layers-plus","layers-2","laugh","lasso","lasso-select","laptop","laptop-minimal","laptop-minimal-check","languages","landmark","land-plot","lamp","lamp-wall-up","lamp-wall-down","lamp-floor","lamp-desk","lamp-ceiling","keyboard","keyboard-off","keyboard-music","key","key-square","key-round","kayak","kanban","joystick","japanese-yen","iteration-cw","iteration-ccw","italic","instagram","inspection-panel","info","infinity","indian-rupee","inbox","import","images","image","image-upscale","image-up","image-plus","image-play","image-off","image-minus","image-down","id-card","id-card-lanyard","ice-cream-cone","ice-cream-bowl","house","house-wifi","house-plus","house-plug","house-heart","hourglass","hotel","hospital","hop","hop-off","history","highlighter","hexagon","helicopter","heater","heart","heart-pulse","heart-plus","heart-off","heart-minus","heart-handshake","heart-crack","headset","headphones","headphone-off","heading","heading-6","heading-5","heading-4","heading-3","heading-2","heading-1","hdmi-port","hd","haze","hat-glasses","hash","hard-hat","hard-drive","hard-drive-upload","hard-drive-download","handshake","handbag","hand","hand-platter","hand-metal","hand-helping","hand-heart","hand-grab","hand-fist","hand-coins","hammer","hamburger","ham","guitar","group","grip","grip-vertical","grip-horizontal","grid-3x3","grid-3x2","grid-2x2","grid-2x2-x","grid-2x2-plus","grid-2x2-check","grape","graduation-cap","gpu","goal","globe","globe-lock","glasses","glass-water","gitlab","github","git-pull-request","git-pull-request-draft","git-pull-request-create","git-pull-request-create-arrow","git-pull-request-closed","git-pull-request-arrow","git-merge","git-graph","git-fork","git-compare","git-compare-arrows","git-commit-vertical","git-commit-horizontal","git-branch","git-branch-plus","git-branch-minus","gift","ghost","georgian-lari","gem","gavel","gauge","gamepad","gamepad-directional","gamepad-2","gallery-vertical","gallery-vertical-end","gallery-thumbnails","gallery-horizontal","gallery-horizontal-end","funnel","funnel-x","funnel-plus","fullscreen","fuel","frown","framer","frame","forward","form","forklift","footprints","folders","folder","folder-x","folder-up","folder-tree","folder-sync","folder-symlink","folder-search","folder-search-2","folder-root","folder-plus","folder-pen","folder-output","folder-open","folder-open-dot","folder-minus","folder-lock","folder-key","folder-kanban","folder-input","folder-heart","folder-git","folder-git-2","folder-down","folder-dot","folder-cog","folder-code","folder-closed","folder-clock","folder-check","folder-archive","fold-vertical","fold-horizontal","focus","flower","flower-2","flip-vertical","flip-vertical-2","flip-horizontal","flip-horizontal-2","flask-round","flask-conical","flask-conical-off","flashlight","flashlight-off","flame","flame-kindling","flag","flag-triangle-right","flag-triangle-left","flag-off","fishing-hook","fish","fish-symbol","fish-off","fire-extinguisher","fingerprint-pattern","film","files","file","file-x","file-x-corner","file-volume","file-video-camera","file-user","file-up","file-type","file-type-corner","file-text","file-terminal","file-symlink","file-stack","file-spreadsheet","file-sliders","file-signal","file-search","file-search-corner","file-scan","file-question-mark","file-plus","file-plus-corner","file-play","file-pen","file-pen-line","file-output","file-music","file-minus","file-minus-corner","file-lock","file-key","file-input","file-image","file-heart","file-headphone","file-exclamation-point","file-down","file-digit","file-diff","file-cog","file-code","file-code-corner","file-clock","file-check","file-check-corner","file-chart-pie","file-chart-line","file-chart-column","file-chart-column-increasing","file-braces","file-braces-corner","file-box","file-badge","file-axis-3d","file-archive","figma","ferris-wheel","fence","feather","fast-forward","fan","factory","facebook","eye","eye-off","eye-closed","external-link","expand","ev-charger","euro","ethernet-port","eraser","equal","equal-not","equal-approximately","ellipsis","ellipsis-vertical","egg","egg-off","egg-fried","eclipse","earth","earth-lock","ear","ear-off","dumbbell","drumstick","drum","droplets","droplet","droplet-off","drone","drill","dribbble","drama","drafting-compass","download","dot","door-open","door-closed","door-closed-locked","donut","dollar-sign","dog","dock","dna","dna-off","divide","disc","disc-album","disc-3","disc-2","diff","dices","dice-6","dice-5","dice-4","dice-3","dice-2","dice-1","diamond","diamond-plus","diamond-percent","diamond-minus","diameter","dessert","delete","decimals-arrow-right","decimals-arrow-left","database","database-zap","database-backup","dam","cylinder","currency","cup-soda","cuboid","crown","crosshair","cross","crop","croissant","credit-card","creative-commons","cpu","corner-up-right","corner-up-left","corner-right-up","corner-right-down","corner-left-up","corner-left-down","corner-down-right","corner-down-left","copyright","copyleft","copy","copy-x","copy-slash","copy-plus","copy-minus","copy-check","cooking-pot","cookie","contrast","container","contact","contact-round","construction","cone","concierge-bell","computer","component","compass","command","combine","columns-4","columns-3","columns-3-cog","columns-2","coins","cog","coffee","codesandbox","codepen","code","code-xml","club","clover","cloudy","cloud","cloud-upload","cloud-sync","cloud-sun","cloud-sun-rain","cloud-snow","cloud-rain","cloud-rain-wind","cloud-off","cloud-moon","cloud-moon-rain","cloud-lightning","cloud-hail","cloud-fog","cloud-drizzle","cloud-download","cloud-cog","cloud-check","cloud-backup","cloud-alert","closed-caption","clock","clock-plus","clock-fading","clock-check","clock-arrow-up","clock-arrow-down","clock-alert","clock-9","clock-8","clock-7","clock-6","clock-5","clock-4","clock-3","clock-2","clock-12","clock-11","clock-10","clock-1","clipboard","clipboard-x","clipboard-type","clipboard-plus","clipboard-pen","clipboard-pen-line","clipboard-paste","clipboard-minus","clipboard-list","clipboard-copy","clipboard-clock","clipboard-check","clapperboard","citrus","circuit-board","circle","circle-x","circle-user","circle-user-round","circle-stop","circle-star","circle-small","circle-slash","circle-slash-2","circle-question-mark","circle-power","circle-pound-sterling","circle-plus","circle-play","circle-pile","circle-percent","circle-pause","circle-parking","circle-parking-off","circle-off","circle-minus","circle-gauge","circle-fading-plus","circle-fading-arrow-up","circle-equal","circle-ellipsis","circle-dot","circle-dot-dashed","circle-dollar-sign","circle-divide","circle-dashed","circle-chevron-up","circle-chevron-right","circle-chevron-left","circle-chevron-down","circle-check","circle-check-big","circle-arrow-up","circle-arrow-right","circle-arrow-out-up-right","circle-arrow-out-up-left","circle-arrow-out-down-right","circle-arrow-out-down-left","circle-arrow-left","circle-arrow-down","circle-alert","cigarette","cigarette-off","church","chromium","chevrons-up","chevrons-up-down","chevrons-right","chevrons-right-left","chevrons-left","chevrons-left-right","chevrons-left-right-ellipsis","chevrons-down","chevrons-down-up","chevron-up","chevron-right","chevron-left","chevron-last","chevron-first","chevron-down","chess-rook","chess-queen","chess-pawn","chess-knight","chess-king","chess-bishop","cherry","chef-hat","check","check-line","check-check","chart-spline","chart-scatter","chart-pie","chart-no-axes-gantt","chart-no-axes-combined","chart-no-axes-column","chart-no-axes-column-increasing","chart-no-axes-column-decreasing","chart-network","chart-line","chart-gantt","chart-column","chart-column-stacked","chart-column-increasing","chart-column-decreasing","chart-column-big","chart-candlestick","chart-bar","chart-bar-stacked","chart-bar-increasing","chart-bar-decreasing","chart-bar-big","chart-area","cctv","cat","castle","cast","cassette-tape","case-upper","case-sensitive","case-lower","carrot","card-sim","caravan","car","car-taxi-front","car-front","captions","captions-off","cannabis","cannabis-off","candy","candy-off","candy-cane","camera","camera-off","calendars","calendar","calendar-x","calendar-x-2","calendar-sync","calendar-search","calendar-range","calendar-plus","calendar-plus-2","calendar-off","calendar-minus","calendar-minus-2","calendar-heart","calendar-fold","calendar-days","calendar-cog","calendar-clock","calendar-check","calendar-check-2","calendar-arrow-up","calendar-arrow-down","calendar-1","calculator","cake","cake-slice","cable","cable-car","bus","bus-front","building","building-2","bug","bug-play","bug-off","bubbles","brush","brush-cleaning","bring-to-front","briefcase","briefcase-medical","briefcase-conveyor-belt","briefcase-business","brick-wall","brick-wall-shield","brick-wall-fire","brain","brain-cog","brain-circuit","brackets","braces","boxes","box","bow-arrow","bottle-wine","bot","bot-off","bot-message-square","boom-box","bookmark","bookmark-x","bookmark-plus","bookmark-minus","bookmark-check","book","book-x","book-user","book-up","book-up-2","book-type","book-text","book-search","book-plus","book-open","book-open-text","book-open-check","book-minus","book-marked","book-lock","book-key","book-image","book-heart","book-headphones","book-down","book-dashed","book-copy","book-check","book-audio","book-alert","book-a","bone","bomb","bolt","bold","bluetooth","bluetooth-searching","bluetooth-off","bluetooth-connected","blocks","blinds","blend","bitcoin","birdhouse","bird","biohazard","binoculars","binary","bike","biceps-flexed","between-vertical-start","between-vertical-end","between-horizontal-start","between-horizontal-end","bell","bell-ring","bell-plus","bell-off","bell-minus","bell-electric","bell-dot","beer","beer-off","beef","bed","bed-single","bed-double","bean","bean-off","beaker","battery","battery-warning","battery-plus","battery-medium","battery-low","battery-full","battery-charging","bath","baseline","barrel","barcode","banknote","banknote-x","banknote-arrow-up","banknote-arrow-down","bandage","banana","ban","balloon","baggage-claim","badge","badge-x","badge-turkish-lira","badge-swiss-franc","badge-russian-ruble","badge-question-mark","badge-pound-sterling","badge-plus","badge-percent","badge-minus","badge-japanese-yen","badge-info","badge-indian-rupee","badge-euro","badge-dollar-sign","badge-check","badge-cent","badge-alert","backpack","baby","axis-3d","axe","award","audio-waveform","audio-lines","atom","at-sign","asterisk","arrows-up-from-line","arrow-up","arrow-up-z-a","arrow-up-wide-narrow","arrow-up-to-line","arrow-up-right","arrow-up-narrow-wide","arrow-up-left","arrow-up-from-line","arrow-up-from-dot","arrow-up-down","arrow-up-a-z","arrow-up-1-0","arrow-up-0-1","arrow-right","arrow-right-to-line","arrow-right-left","arrow-right-from-line","arrow-left","arrow-left-to-line","arrow-left-right","arrow-left-from-line","arrow-down","arrow-down-z-a","arrow-down-wide-narrow","arrow-down-up","arrow-down-to-line","arrow-down-to-dot","arrow-down-right","arrow-down-narrow-wide","arrow-down-left","arrow-down-from-line","arrow-down-a-z","arrow-down-1-0","arrow-down-0-1","arrow-big-up","arrow-big-up-dash","arrow-big-right","arrow-big-right-dash","arrow-big-left","arrow-big-left-dash","arrow-big-down","arrow-big-down-dash","armchair","archive","archive-x","archive-restore","apple","app-window","app-window-mac","aperture","anvil","antenna","annoyed","angry","anchor","amphora","ampersands","ampersand","ambulance","align-vertical-space-between","align-vertical-space-around","align-vertical-justify-start","align-vertical-justify-end","align-vertical-justify-center","align-vertical-distribute-start","align-vertical-distribute-end","align-vertical-distribute-center","align-start-vertical","align-start-horizontal","align-horizontal-space-between","align-horizontal-space-around","align-horizontal-justify-start","align-horizontal-justify-end","align-horizontal-justify-center","align-horizontal-distribute-start","align-horizontal-distribute-end","align-horizontal-distribute-center","align-end-vertical","align-end-horizontal","align-center-vertical","align-center-horizontal","album","alarm-smoke","alarm-clock","alarm-clock-plus","alarm-clock-off","alarm-clock-minus","alarm-clock-check","airplay","air-vent","activity","accessibility","a-large-small","a-arrow-up","a-arrow-down"],Pa=e=>{const{value:t,defaultValue:o,onChange:r,isOpen:a,onOpen:i,onClose:l,closeOnSelect:d=!0}=e,[c,u]=g.useState(a??!1),[p,h]=g.useState(t??o??""),[m,x]=g.useState(""),f=g.useRef(null),b=g.useRef(null);g.useEffect(()=>{t!==void 0&&h(t)},[t]),g.useEffect(()=>{a!==void 0&&u(a)},[a]);const y=g.useMemo(()=>m?Nr.filter(w=>w.toLowerCase().includes(m.toLowerCase())).slice(0,100):Nr.slice(0,100),[m]);g.useEffect(()=>{const w=I=>{c&&f.current&&b.current&&!f.current.contains(I.target)&&!b.current.contains(I.target)&&k()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const k=g.useCallback(()=>{a===void 0&&u(!1),l&&l()},[l,a]),j=g.useCallback(()=>{const w=!c;a===void 0&&u(w),w?(i&&i(),x("")):l&&l()},[c,i,l,a]),S=g.useCallback(w=>{t===void 0&&h(w),r&&r(w),d&&k()},[r,d,k,t]),C=g.useCallback(w=>{x(w)},[]);return{isOpen:c,selectedIcon:p,searchQuery:m,filteredIcons:y,handleToggle:j,handleIconSelect:S,handleSearchChange:C,handleClose:k,triggerRef:f,dropdownRef:b}},Ne={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchInput:{marginBottom:"12px",flexShrink:0},iconGrid:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"8px",overflowY:"auto",padding:"4px",color:"color-black",flexGrow:1},iconItem:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",transition:"all 0.2s ease"}},dh={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},uh={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},ph={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Wa=({label:e,placeholder:t="Select an icon",helperText:o,views:r={},size:a="md",shape:i="default",variant:l="default",error:d=!1,isDisabled:c=!1,isReadOnly:u=!1,showSearch:p=!0,isOpen:h,selectedIcon:m,searchQuery:x,filteredIcons:f,handleToggle:b,handleIconSelect:y,handleSearchChange:k,triggerRef:j,dropdownRef:S,handleClose:C,onChange:w,...I})=>{const{getColor:M}=s.useTheme(),R={...Ne.container,...r==null?void 0:r.container},E={...Ne.trigger,...dh[a],...uh[i],...ph[l],...d&&{borderColor:"color-red-500"},...c&&{opacity:.6,cursor:"not-allowed"},...r==null?void 0:r.trigger},_={...Ne.dropdown,...r==null?void 0:r.dropdown},T={...Ne.iconGrid,...r==null?void 0:r.iconGrid};return n.jsxs(s.View,{...R,...I,children:[e&&n.jsx(s.Text,{fontSize:a==="xs"?"12px":a==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...r==null?void 0:r.label,children:e}),n.jsxs(s.View,{ref:j,onClick:c||u?void 0:b,...E,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:m?n.jsxs(s.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[n.jsx(Ot,{name:m,widthHeight:16}),n.jsx(s.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}):n.jsx(s.Text,{color:"color-gray-500",fontSize:"inherit",children:t})}),!u&&!c&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:h?"up":"down"})]}),h&&n.jsxs(s.View,{ref:S,..._,children:[p&&n.jsx(s.View,{...Ne.searchInput,...r==null?void 0:r.searchInput,children:n.jsx(wt,{placeholder:"Search icons...",value:x,onChange:$=>k($),size:"sm",autoFocus:!0})}),n.jsx(s.View,{...T,children:f.length>0?f.map($=>n.jsx(s.View,{...Ne.iconItem,onClick:()=>y($),title:$,_hover:{backgroundColor:"color-gray-100"},backgroundColor:m===$?"color-blue-100":"transparent",...r==null?void 0:r.iconItem,children:n.jsx(Ot,{name:$,widthHeight:20})},$)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:"No icons found"})})})]}),o&&n.jsx(s.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...r==null?void 0:r.helperText,children:o})]})},gh=e=>{const t=pe(e),o={...e,value:t.value??e.value??e.defaultValue},r=Pa(o),a=i=>{r.handleIconSelect(i),t.onChange(i)};return n.jsx(Wa,{...r,...o,handleIconSelect:a})},hh=gh,Re={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",mixBlendMode:"normal",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"320px",maxHeight:"400px",overflow:"hidden"},searchInput:{marginBottom:"12px"},categoryTabs:{display:"flex",borderBottom:"1px solid color-gray-200",marginBottom:"12px",overflowX:"auto"},categoryTab:{padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid transparent",transition:"all 0.2s ease",fontSize:"14px",fontWeight:"500",color:"color-gray-600",whiteSpace:"nowrap"},emojiGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",maxHeight:"240px",overflowY:"auto",padding:"4px",color:"color-black"},emoji:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderRadius:"4px",fontSize:"20px",transition:"all 0.2s ease"}},mh={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},fh={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},xh={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},bh={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},yh=[{emoji:"😀",name:"grinning face",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😃",name:"grinning face with big eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😄",name:"grinning face with smiling eyes",category:"smileys",keywords:["happy","smile","joy"]},{emoji:"😁",name:"beaming face with smiling eyes",category:"smileys",keywords:["happy","smile","grin"]},{emoji:"😆",name:"grinning squinting face",category:"smileys",keywords:["happy","laugh","smile"]},{emoji:"😅",name:"grinning face with sweat",category:"smileys",keywords:["happy","sweat","relief"]},{emoji:"🤣",name:"rolling on the floor laughing",category:"smileys",keywords:["laugh","funny","rofl"]},{emoji:"😂",name:"face with tears of joy",category:"smileys",keywords:["laugh","cry","joy"]},{emoji:"🙂",name:"slightly smiling face",category:"smileys",keywords:["smile","happy"]},{emoji:"🙃",name:"upside-down face",category:"smileys",keywords:["silly","upside down"]},{emoji:"😉",name:"winking face",category:"smileys",keywords:["wink","flirt"]},{emoji:"😊",name:"smiling face with smiling eyes",category:"smileys",keywords:["happy","smile","blush"]},{emoji:"😇",name:"smiling face with halo",category:"smileys",keywords:["angel","innocent"]},{emoji:"🥰",name:"smiling face with hearts",category:"smileys",keywords:["love","hearts","adore"]},{emoji:"😍",name:"smiling face with heart-eyes",category:"smileys",keywords:["love","heart","eyes"]},{emoji:"🤩",name:"star-struck",category:"smileys",keywords:["star","struck","amazed"]},{emoji:"😘",name:"face blowing a kiss",category:"smileys",keywords:["kiss","love","flirt"]},{emoji:"😗",name:"kissing face",category:"smileys",keywords:["kiss","love"]},{emoji:"☺️",name:"smiling face",category:"smileys",keywords:["smile","happy","content"]},{emoji:"😚",name:"kissing face with closed eyes",category:"smileys",keywords:["kiss","love","closed eyes"]},{emoji:"😙",name:"kissing face with smiling eyes",category:"smileys",keywords:["kiss","love","smile"]},{emoji:"🥲",name:"smiling face with tear",category:"smileys",keywords:["happy","cry","tear","bittersweet"]},{emoji:"😋",name:"face savoring food",category:"smileys",keywords:["yum","delicious","food"]},{emoji:"😛",name:"face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"😜",name:"winking face with tongue",category:"smileys",keywords:["wink","tongue","silly"]},{emoji:"🤪",name:"zany face",category:"smileys",keywords:["crazy","silly","wild"]},{emoji:"😝",name:"squinting face with tongue",category:"smileys",keywords:["tongue","silly","playful"]},{emoji:"🤑",name:"money-mouth face",category:"smileys",keywords:["money","rich","greedy"]},{emoji:"🤗",name:"hugging face",category:"smileys",keywords:["hug","love","care"]},{emoji:"🤭",name:"face with hand over mouth",category:"smileys",keywords:["oops","secret","quiet"]},{emoji:"🫢",name:"face with open eyes and hand over mouth",category:"smileys",keywords:["surprise","shock","oops"]},{emoji:"🫣",name:"face with peeking eye",category:"smileys",keywords:["peek","shy","embarrassed"]},{emoji:"🤫",name:"shushing face",category:"smileys",keywords:["quiet","secret","shh"]},{emoji:"🤔",name:"thinking face",category:"smileys",keywords:["think","consider","hmm"]},{emoji:"🫡",name:"saluting face",category:"smileys",keywords:["salute","respect","military"]},{emoji:"🤐",name:"zipper-mouth face",category:"smileys",keywords:["quiet","secret","zip"]},{emoji:"🤨",name:"face with raised eyebrow",category:"smileys",keywords:["suspicious","doubt","skeptical"]},{emoji:"😐",name:"neutral face",category:"smileys",keywords:["neutral","meh","blank"]},{emoji:"😑",name:"expressionless face",category:"smileys",keywords:["blank","deadpan","meh"]},{emoji:"😶",name:"face without mouth",category:"smileys",keywords:["quiet","speechless","silent"]},{emoji:"🫥",name:"dotted line face",category:"smileys",keywords:["invisible","depressed","disappear"]},{emoji:"😏",name:"smirking face",category:"smileys",keywords:["smirk","smug","confident"]},{emoji:"😒",name:"unamused face",category:"smileys",keywords:["unamused","bored","annoyed"]},{emoji:"🙄",name:"face with rolling eyes",category:"smileys",keywords:["eye roll","annoyed","whatever"]},{emoji:"😬",name:"grimacing face",category:"smileys",keywords:["grimace","awkward","oops"]},{emoji:"😮‍💨",name:"face exhaling",category:"smileys",keywords:["sigh","relief","tired"]},{emoji:"🤥",name:"lying face",category:"smileys",keywords:["lie","pinocchio","dishonest"]},{emoji:"😌",name:"relieved face",category:"smileys",keywords:["relief","calm","peaceful"]},{emoji:"😔",name:"pensive face",category:"smileys",keywords:["sad","thoughtful","pensive"]},{emoji:"😪",name:"sleepy face",category:"smileys",keywords:["sleepy","tired","drowsy"]},{emoji:"🤤",name:"drooling face",category:"smileys",keywords:["drool","desire","sleep"]},{emoji:"😴",name:"sleeping face",category:"smileys",keywords:["sleep","tired","zzz"]},{emoji:"😷",name:"face with medical mask",category:"smileys",keywords:["mask","sick","doctor"]},{emoji:"🤒",name:"face with thermometer",category:"smileys",keywords:["sick","fever","ill"]},{emoji:"🤕",name:"face with head-bandage",category:"smileys",keywords:["hurt","injured","bandage"]},{emoji:"🤢",name:"nauseated face",category:"smileys",keywords:["sick","nausea","disgusted"]},{emoji:"🤮",name:"face vomiting",category:"smileys",keywords:["vomit","sick","disgusted"]},{emoji:"🤧",name:"sneezing face",category:"smileys",keywords:["sneeze","sick","gesundheit"]},{emoji:"🥵",name:"hot face",category:"smileys",keywords:["hot","heat","sweat"]},{emoji:"🥶",name:"cold face",category:"smileys",keywords:["cold","freeze","blue"]},{emoji:"🥴",name:"woozy face",category:"smileys",keywords:["dizzy","drunk","confused"]},{emoji:"😵",name:"dizzy face",category:"smileys",keywords:["dizzy","confused","knocked out"]},{emoji:"😵‍💫",name:"face with spiral eyes",category:"smileys",keywords:["dizzy","hypnotized","confused"]},{emoji:"🤯",name:"exploding head",category:"smileys",keywords:["mind blown","shocked","amazed"]},{emoji:"🤠",name:"cowboy hat face",category:"smileys",keywords:["cowboy","hat","western"]},{emoji:"🥳",name:"partying face",category:"smileys",keywords:["party","celebration","birthday"]},{emoji:"🥸",name:"disguised face",category:"smileys",keywords:["disguise","glasses","incognito"]},{emoji:"😎",name:"smiling face with sunglasses",category:"smileys",keywords:["cool","sunglasses","awesome"]},{emoji:"🤓",name:"nerd face",category:"smileys",keywords:["nerd","geek","smart"]},{emoji:"🧐",name:"face with monocle",category:"smileys",keywords:["monocle","fancy","inspection"]},{emoji:"👋",name:"waving hand",category:"people",keywords:["wave","hello","goodbye"]},{emoji:"🤚",name:"raised back of hand",category:"people",keywords:["hand","stop"]},{emoji:"🖐️",name:"hand with fingers splayed",category:"people",keywords:["hand","five"]},{emoji:"✋",name:"raised hand",category:"people",keywords:["hand","stop","high five"]},{emoji:"🖖",name:"vulcan salute",category:"people",keywords:["spock","vulcan"]},{emoji:"👌",name:"OK hand",category:"people",keywords:["ok","perfect"]},{emoji:"🤌",name:"pinched fingers",category:"people",keywords:["italian","chef kiss"]},{emoji:"🤏",name:"pinching hand",category:"people",keywords:["small","tiny"]},{emoji:"✌️",name:"victory hand",category:"people",keywords:["peace","victory"]},{emoji:"🤞",name:"crossed fingers",category:"people",keywords:["luck","hope"]},{emoji:"🤟",name:"love-you gesture",category:"people",keywords:["love","you"]},{emoji:"🤘",name:"sign of the horns",category:"people",keywords:["rock","metal"]},{emoji:"🤙",name:"call me hand",category:"people",keywords:["call","phone"]},{emoji:"👈",name:"backhand index pointing left",category:"people",keywords:["point","left"]},{emoji:"👉",name:"backhand index pointing right",category:"people",keywords:["point","right"]},{emoji:"👆",name:"backhand index pointing up",category:"people",keywords:["point","up"]},{emoji:"🖕",name:"middle finger",category:"people",keywords:["middle finger","rude"]},{emoji:"👇",name:"backhand index pointing down",category:"people",keywords:["point","down"]},{emoji:"☝️",name:"index pointing up",category:"people",keywords:["point","up","one"]},{emoji:"👍",name:"thumbs up",category:"people",keywords:["thumbs up","good","yes"]},{emoji:"👎",name:"thumbs down",category:"people",keywords:["thumbs down","bad","no"]},{emoji:"✊",name:"raised fist",category:"people",keywords:["fist","power","solidarity"]},{emoji:"👊",name:"oncoming fist",category:"people",keywords:["fist","punch","bump"]},{emoji:"🤛",name:"left-facing fist",category:"people",keywords:["fist","bump","left"]},{emoji:"🤜",name:"right-facing fist",category:"people",keywords:["fist","bump","right"]},{emoji:"👏",name:"clapping hands",category:"people",keywords:["clap","applause","bravo"]},{emoji:"🙌",name:"raising hands",category:"people",keywords:["celebration","hooray","praise"]},{emoji:"👐",name:"open hands",category:"people",keywords:["open","hug","jazz hands"]},{emoji:"🤲",name:"palms up together",category:"people",keywords:["prayer","please","hope"]},{emoji:"🤝",name:"handshake",category:"people",keywords:["handshake","deal","agreement"]},{emoji:"🙏",name:"folded hands",category:"people",keywords:["prayer","thanks","please"]},{emoji:"✍️",name:"writing hand",category:"people",keywords:["write","author","signature"]},{emoji:"💅",name:"nail polish",category:"people",keywords:["nails","beauty","manicure"]},{emoji:"🤳",name:"selfie",category:"people",keywords:["selfie","camera","phone"]},{emoji:"💪",name:"flexed biceps",category:"people",keywords:["muscle","strong","flex"]},{emoji:"🦾",name:"mechanical arm",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦿",name:"mechanical leg",category:"people",keywords:["robot","prosthetic","cyborg"]},{emoji:"🦵",name:"leg",category:"people",keywords:["leg","limb","kick"]},{emoji:"🦶",name:"foot",category:"people",keywords:["foot","kick","stomp"]},{emoji:"👂",name:"ear",category:"people",keywords:["ear","hear","listen"]},{emoji:"🦻",name:"ear with hearing aid",category:"people",keywords:["hearing aid","deaf","accessibility"]},{emoji:"👃",name:"nose",category:"people",keywords:["nose","smell","sniff"]},{emoji:"🧠",name:"brain",category:"people",keywords:["brain","smart","think"]},{emoji:"🫀",name:"anatomical heart",category:"people",keywords:["heart","organ","love"]},{emoji:"🫁",name:"lungs",category:"people",keywords:["lungs","breathe","organ"]},{emoji:"🦷",name:"tooth",category:"people",keywords:["tooth","dental","smile"]},{emoji:"🦴",name:"bone",category:"people",keywords:["bone","skeleton","dog"]},{emoji:"👀",name:"eyes",category:"people",keywords:["eyes","look","see"]},{emoji:"👁️",name:"eye",category:"people",keywords:["eye","see","watch"]},{emoji:"👅",name:"tongue",category:"people",keywords:["tongue","taste","lick"]},{emoji:"👄",name:"mouth",category:"people",keywords:["mouth","lips","kiss"]},{emoji:"🫦",name:"biting lip",category:"people",keywords:["lip","bite","nervous"]},{emoji:"👶",name:"baby",category:"people",keywords:["baby","infant","child"]},{emoji:"🧒",name:"child",category:"people",keywords:["child","kid","young"]},{emoji:"👦",name:"boy",category:"people",keywords:["boy","child","male"]},{emoji:"👧",name:"girl",category:"people",keywords:["girl","child","female"]},{emoji:"🧑",name:"person",category:"people",keywords:["person","adult","human"]},{emoji:"👱",name:"person: blond hair",category:"people",keywords:["blond","hair","person"]},{emoji:"👨",name:"man",category:"people",keywords:["man","male","adult"]},{emoji:"🧔",name:"person: beard",category:"people",keywords:["beard","man","facial hair"]},{emoji:"👩",name:"woman",category:"people",keywords:["woman","female","adult"]},{emoji:"🧓",name:"older person",category:"people",keywords:["old","elderly","senior"]},{emoji:"👴",name:"old man",category:"people",keywords:["old","man","elderly"]},{emoji:"👵",name:"old woman",category:"people",keywords:["old","woman","elderly"]},{emoji:"🐶",name:"dog face",category:"animals",keywords:["dog","pet","animal"]},{emoji:"🐱",name:"cat face",category:"animals",keywords:["cat","pet","animal"]},{emoji:"🐭",name:"mouse face",category:"animals",keywords:["mouse","animal"]},{emoji:"🐹",name:"hamster",category:"animals",keywords:["hamster","pet"]},{emoji:"🐰",name:"rabbit face",category:"animals",keywords:["rabbit","bunny"]},{emoji:"🦊",name:"fox",category:"animals",keywords:["fox","animal"]},{emoji:"🐻",name:"bear",category:"animals",keywords:["bear","animal"]},{emoji:"🐼",name:"panda",category:"animals",keywords:["panda","bear"]},{emoji:"🐨",name:"koala",category:"animals",keywords:["koala","australia","marsupial"]},{emoji:"🐯",name:"tiger face",category:"animals",keywords:["tiger","cat","wild"]},{emoji:"🦁",name:"lion",category:"animals",keywords:["lion","king","cat"]},{emoji:"🐮",name:"cow face",category:"animals",keywords:["cow","moo","farm"]},{emoji:"🐷",name:"pig face",category:"animals",keywords:["pig","oink","farm"]},{emoji:"🐽",name:"pig nose",category:"animals",keywords:["pig","nose","snout"]},{emoji:"🐸",name:"frog",category:"animals",keywords:["frog","amphibian","green"]},{emoji:"🐵",name:"monkey face",category:"animals",keywords:["monkey","primate","banana"]},{emoji:"🙈",name:"see-no-evil monkey",category:"animals",keywords:["monkey","see no evil","eyes"]},{emoji:"🙉",name:"hear-no-evil monkey",category:"animals",keywords:["monkey","hear no evil","ears"]},{emoji:"🙊",name:"speak-no-evil monkey",category:"animals",keywords:["monkey","speak no evil","mouth"]},{emoji:"🐒",name:"monkey",category:"animals",keywords:["monkey","primate","zoo"]},{emoji:"🦍",name:"gorilla",category:"animals",keywords:["gorilla","ape","strong"]},{emoji:"🦧",name:"orangutan",category:"animals",keywords:["orangutan","ape","orange"]},{emoji:"🐺",name:"wolf",category:"animals",keywords:["wolf","howl","wild"]},{emoji:"🐗",name:"boar",category:"animals",keywords:["boar","pig","wild"]},{emoji:"🐴",name:"horse face",category:"animals",keywords:["horse","neigh","ride"]},{emoji:"🐎",name:"horse",category:"animals",keywords:["horse","racing","gallop"]},{emoji:"🦄",name:"unicorn",category:"animals",keywords:["unicorn","magical","horn"]},{emoji:"🦓",name:"zebra",category:"animals",keywords:["zebra","stripes","africa"]},{emoji:"🦌",name:"deer",category:"animals",keywords:["deer","antlers","forest"]},{emoji:"🦏",name:"rhinoceros",category:"animals",keywords:["rhino","horn","africa"]},{emoji:"🦛",name:"hippopotamus",category:"animals",keywords:["hippo","water","africa"]},{emoji:"🐘",name:"elephant",category:"animals",keywords:["elephant","trunk","memory"]},{emoji:"🦒",name:"giraffe",category:"animals",keywords:["giraffe","tall","neck"]},{emoji:"🦘",name:"kangaroo",category:"animals",keywords:["kangaroo","hop","australia"]},{emoji:"🦥",name:"sloth",category:"animals",keywords:["sloth","slow","lazy"]},{emoji:"🦦",name:"otter",category:"animals",keywords:["otter","water","cute"]},{emoji:"🦨",name:"skunk",category:"animals",keywords:["skunk","smell","stripe"]},{emoji:"🦡",name:"badger",category:"animals",keywords:["badger","honey","dig"]},{emoji:"🐾",name:"paw prints",category:"animals",keywords:["paw","prints","tracks"]},{emoji:"🐔",name:"chicken",category:"animals",keywords:["chicken","rooster","farm"]},{emoji:"🐓",name:"rooster",category:"animals",keywords:["rooster","cock","morning"]},{emoji:"🐣",name:"hatching chick",category:"animals",keywords:["chick","hatching","egg"]},{emoji:"🐤",name:"baby chick",category:"animals",keywords:["chick","baby","yellow"]},{emoji:"🐥",name:"front-facing baby chick",category:"animals",keywords:["chick","baby","cute"]},{emoji:"🦆",name:"duck",category:"animals",keywords:["duck","quack","water"]},{emoji:"🦅",name:"eagle",category:"animals",keywords:["eagle","bird","freedom"]},{emoji:"🦉",name:"owl",category:"animals",keywords:["owl","wise","night"]},{emoji:"🦇",name:"bat",category:"animals",keywords:["bat","vampire","night"]},{emoji:"",name:"bug",category:"animals",keywords:["bug","insect","crawl"]},{emoji:"🦋",name:"butterfly",category:"animals",keywords:["butterfly","beautiful","fly"]},{emoji:"🐌",name:"snail",category:"animals",keywords:["snail","slow","shell"]},{emoji:"🐞",name:"lady beetle",category:"animals",keywords:["ladybug","beetle","red"]},{emoji:"🐜",name:"ant",category:"animals",keywords:["ant","work","colony"]},{emoji:"🦟",name:"mosquito",category:"animals",keywords:["mosquito","bite","buzz"]},{emoji:"🕷️",name:"spider",category:"animals",keywords:["spider","web","eight legs"]},{emoji:"🦂",name:"scorpion",category:"animals",keywords:["scorpion","sting","desert"]},{emoji:"🐢",name:"turtle",category:"animals",keywords:["turtle","slow","shell"]},{emoji:"🐍",name:"snake",category:"animals",keywords:["snake","slither","reptile"]},{emoji:"🦎",name:"lizard",category:"animals",keywords:["lizard","gecko","reptile"]},{emoji:"🐙",name:"octopus",category:"animals",keywords:["octopus","tentacles","sea"]},{emoji:"🦑",name:"squid",category:"animals",keywords:["squid","tentacles","ocean"]},{emoji:"🦐",name:"shrimp",category:"animals",keywords:["shrimp","seafood","small"]},{emoji:"🦞",name:"lobster",category:"animals",keywords:["lobster","claws","red"]},{emoji:"🦀",name:"crab",category:"animals",keywords:["crab","claws","beach"]},{emoji:"🐡",name:"blowfish",category:"animals",keywords:["blowfish","puffer","spiky"]},{emoji:"🐠",name:"tropical fish",category:"animals",keywords:["fish","tropical","colorful"]},{emoji:"🐟",name:"fish",category:"animals",keywords:["fish","swim","water"]},{emoji:"🐬",name:"dolphin",category:"animals",keywords:["dolphin","smart","ocean"]},{emoji:"🐳",name:"spouting whale",category:"animals",keywords:["whale","spout","big"]},{emoji:"🐋",name:"whale",category:"animals",keywords:["whale","ocean","huge"]},{emoji:"🦈",name:"shark",category:"animals",keywords:["shark","teeth","dangerous"]},{emoji:"🐊",name:"crocodile",category:"animals",keywords:["crocodile","teeth","swamp"]},{emoji:"🌸",name:"cherry blossom",category:"animals",keywords:["flower","spring","pink"]},{emoji:"💐",name:"bouquet",category:"animals",keywords:["flowers","bouquet","gift"]},{emoji:"🌺",name:"hibiscus",category:"animals",keywords:["flower","tropical","red"]},{emoji:"🌻",name:"sunflower",category:"animals",keywords:["sunflower","yellow","big"]},{emoji:"🌹",name:"rose",category:"animals",keywords:["rose","love","red"]},{emoji:"🥀",name:"wilted flower",category:"animals",keywords:["flower","wilted","sad"]},{emoji:"🌷",name:"tulip",category:"animals",keywords:["tulip","spring","netherlands"]},{emoji:"🌼",name:"daisy",category:"animals",keywords:["daisy","white","simple"]},{emoji:"🌱",name:"seedling",category:"animals",keywords:["plant","grow","green"]},{emoji:"🌿",name:"herb",category:"animals",keywords:["herb","green","leaf"]},{emoji:"🍀",name:"four leaf clover",category:"animals",keywords:["clover","luck","green"]},{emoji:"🌳",name:"deciduous tree",category:"animals",keywords:["tree","nature","green"]},{emoji:"🌲",name:"evergreen tree",category:"animals",keywords:["tree","pine","christmas"]},{emoji:"🌴",name:"palm tree",category:"animals",keywords:["palm","tropical","beach"]},{emoji:"🌵",name:"cactus",category:"animals",keywords:["cactus","desert","spiky"]},{emoji:"🍎",name:"red apple",category:"food",keywords:["apple","fruit"]},{emoji:"🍊",name:"tangerine",category:"food",keywords:["orange","fruit"]},{emoji:"🍋",name:"lemon",category:"food",keywords:["lemon","fruit"]},{emoji:"🍌",name:"banana",category:"food",keywords:["banana","fruit"]},{emoji:"🍉",name:"watermelon",category:"food",keywords:["watermelon","fruit"]},{emoji:"🍇",name:"grapes",category:"food",keywords:["grapes","fruit"]},{emoji:"🍓",name:"strawberry",category:"food",keywords:["strawberry","fruit"]},{emoji:"🫐",name:"blueberries",category:"food",keywords:["blueberry","fruit"]},{emoji:"🥝",name:"kiwi fruit",category:"food",keywords:["kiwi","fruit","green"]},{emoji:"🍅",name:"tomato",category:"food",keywords:["tomato","red","vegetable"]},{emoji:"🫒",name:"olive",category:"food",keywords:["olive","green","oil"]},{emoji:"🥥",name:"coconut",category:"food",keywords:["coconut","tropical","milk"]},{emoji:"🥑",name:"avocado",category:"food",keywords:["avocado","green","healthy"]},{emoji:"🍆",name:"eggplant",category:"food",keywords:["eggplant","purple","vegetable"]},{emoji:"🥔",name:"potato",category:"food",keywords:["potato","vegetable","starch"]},{emoji:"🥕",name:"carrot",category:"food",keywords:["carrot","orange","vegetable"]},{emoji:"🌽",name:"ear of corn",category:"food",keywords:["corn","yellow","vegetable"]},{emoji:"🌶️",name:"hot pepper",category:"food",keywords:["pepper","hot","spicy"]},{emoji:"🫑",name:"bell pepper",category:"food",keywords:["pepper","bell","vegetable"]},{emoji:"🥒",name:"cucumber",category:"food",keywords:["cucumber","green","vegetable"]},{emoji:"🥬",name:"leafy greens",category:"food",keywords:["lettuce","greens","salad"]},{emoji:"🥦",name:"broccoli",category:"food",keywords:["broccoli","green","vegetable"]},{emoji:"🧄",name:"garlic",category:"food",keywords:["garlic","flavor","cooking"]},{emoji:"🧅",name:"onion",category:"food",keywords:["onion","cry","cooking"]},{emoji:"🍄",name:"mushroom",category:"food",keywords:["mushroom","fungi","cooking"]},{emoji:"🥜",name:"peanuts",category:"food",keywords:["peanuts","nuts","snack"]},{emoji:"🌰",name:"chestnut",category:"food",keywords:["chestnut","nut","autumn"]},{emoji:"🍞",name:"bread",category:"food",keywords:["bread","loaf","carbs"]},{emoji:"🥐",name:"croissant",category:"food",keywords:["croissant","french","pastry"]},{emoji:"🥖",name:"baguette bread",category:"food",keywords:["baguette","french","bread"]},{emoji:"🫓",name:"flatbread",category:"food",keywords:["flatbread","bread","thin"]},{emoji:"🥨",name:"pretzel",category:"food",keywords:["pretzel","twisted","snack"]},{emoji:"🥯",name:"bagel",category:"food",keywords:["bagel","round","breakfast"]},{emoji:"🥞",name:"pancakes",category:"food",keywords:["pancakes","breakfast","syrup"]},{emoji:"🧇",name:"waffle",category:"food",keywords:["waffle","breakfast","squares"]},{emoji:"🧀",name:"cheese wedge",category:"food",keywords:["cheese","dairy","yellow"]},{emoji:"🍖",name:"meat on bone",category:"food",keywords:["meat","bone","protein"]},{emoji:"🍗",name:"poultry leg",category:"food",keywords:["chicken","leg","meat"]},{emoji:"🥩",name:"cut of meat",category:"food",keywords:["steak","meat","red"]},{emoji:"🥓",name:"bacon",category:"food",keywords:["bacon","pork","breakfast"]},{emoji:"🍔",name:"hamburger",category:"food",keywords:["burger","hamburger","fast food"]},{emoji:"🍟",name:"french fries",category:"food",keywords:["fries","potato","fast food"]},{emoji:"🍕",name:"pizza",category:"food",keywords:["pizza","slice","italian"]},{emoji:"🌭",name:"hot dog",category:"food",keywords:["hot dog","sausage","fast food"]},{emoji:"🥪",name:"sandwich",category:"food",keywords:["sandwich","bread","lunch"]},{emoji:"🌮",name:"taco",category:"food",keywords:["taco","mexican","shell"]},{emoji:"🌯",name:"burrito",category:"food",keywords:["burrito","wrap","mexican"]},{emoji:"🫔",name:"tamale",category:"food",keywords:["tamale","mexican","corn"]},{emoji:"🥙",name:"stuffed flatbread",category:"food",keywords:["pita","flatbread","stuffed"]},{emoji:"🧆",name:"falafel",category:"food",keywords:["falafel","middle eastern","chickpea"]},{emoji:"🥚",name:"egg",category:"food",keywords:["egg","protein","breakfast"]},{emoji:"🍳",name:"cooking",category:"food",keywords:["cooking","frying pan","egg"]},{emoji:"🥘",name:"shallow pan of food",category:"food",keywords:["paella","pan","cooking"]},{emoji:"🍲",name:"pot of food",category:"food",keywords:["stew","pot","cooking"]},{emoji:"🫕",name:"fondue",category:"food",keywords:["fondue","cheese","pot"]},{emoji:"🥣",name:"bowl with spoon",category:"food",keywords:["bowl","cereal","soup"]},{emoji:"🥗",name:"green salad",category:"food",keywords:["salad","healthy","greens"]},{emoji:"🍿",name:"popcorn",category:"food",keywords:["popcorn","movie","snack"]},{emoji:"🧈",name:"butter",category:"food",keywords:["butter","dairy","spread"]},{emoji:"🧂",name:"salt",category:"food",keywords:["salt","seasoning","white"]},{emoji:"🥫",name:"canned food",category:"food",keywords:["can","canned","preserved"]},{emoji:"🍱",name:"bento box",category:"food",keywords:["bento","japanese","lunch box"]},{emoji:"🍘",name:"rice cracker",category:"food",keywords:["rice","cracker","japanese"]},{emoji:"🍙",name:"rice ball",category:"food",keywords:["rice ball","onigiri","japanese"]},{emoji:"🍚",name:"cooked rice",category:"food",keywords:["rice","cooked","bowl"]},{emoji:"🍛",name:"curry rice",category:"food",keywords:["curry","rice","spicy"]},{emoji:"🍜",name:"steaming bowl",category:"food",keywords:["ramen","noodles","soup"]},{emoji:"🍝",name:"spaghetti",category:"food",keywords:["spaghetti","pasta","italian"]},{emoji:"🍠",name:"roasted sweet potato",category:"food",keywords:["sweet potato","roasted","orange"]},{emoji:"🍢",name:"oden",category:"food",keywords:["oden","japanese","skewer"]},{emoji:"🍣",name:"sushi",category:"food",keywords:["sushi","japanese","fish"]},{emoji:"🍤",name:"fried shrimp",category:"food",keywords:["shrimp","fried","tempura"]},{emoji:"🍥",name:"fish cake with swirl",category:"food",keywords:["fish cake","japanese","swirl"]},{emoji:"🥮",name:"moon cake",category:"food",keywords:["moon cake","chinese","festival"]},{emoji:"🍡",name:"dango",category:"food",keywords:["dango","japanese","sweet"]},{emoji:"🥟",name:"dumpling",category:"food",keywords:["dumpling","chinese","steamed"]},{emoji:"🥠",name:"fortune cookie",category:"food",keywords:["fortune cookie","chinese","luck"]},{emoji:"🥡",name:"takeout box",category:"food",keywords:["takeout","chinese","box"]},{emoji:"🦀",name:"crab",category:"food",keywords:["crab","seafood","claws"]},{emoji:"🦞",name:"lobster",category:"food",keywords:["lobster","seafood","red"]},{emoji:"🦐",name:"shrimp",category:"food",keywords:["shrimp","seafood","small"]},{emoji:"🦑",name:"squid",category:"food",keywords:["squid","seafood","tentacles"]},{emoji:"🦪",name:"oyster",category:"food",keywords:["oyster","seafood","shell"]},{emoji:"🍦",name:"soft ice cream",category:"food",keywords:["ice cream","soft serve","cone"]},{emoji:"🍧",name:"shaved ice",category:"food",keywords:["shaved ice","snow cone","cold"]},{emoji:"🍨",name:"ice cream",category:"food",keywords:["ice cream","dessert","cold"]},{emoji:"🍩",name:"doughnut",category:"food",keywords:["donut","doughnut","sweet"]},{emoji:"🍪",name:"cookie",category:"food",keywords:["cookie","sweet","baked"]},{emoji:"🎂",name:"birthday cake",category:"food",keywords:["cake","birthday","celebration"]},{emoji:"🍰",name:"shortcake",category:"food",keywords:["cake","slice","dessert"]},{emoji:"🧁",name:"cupcake",category:"food",keywords:["cupcake","muffin","sweet"]},{emoji:"🥧",name:"pie",category:"food",keywords:["pie","dessert","slice"]},{emoji:"🍫",name:"chocolate bar",category:"food",keywords:["chocolate","bar","sweet"]},{emoji:"🍬",name:"candy",category:"food",keywords:["candy","sweet","wrapper"]},{emoji:"🍭",name:"lollipop",category:"food",keywords:["lollipop","candy","stick"]},{emoji:"🍮",name:"custard",category:"food",keywords:["custard","pudding","dessert"]},{emoji:"🍯",name:"honey pot",category:"food",keywords:["honey","sweet","bee"]},{emoji:"🍼",name:"baby bottle",category:"food",keywords:["bottle","baby","milk"]},{emoji:"🥛",name:"glass of milk",category:"food",keywords:["milk","glass","dairy"]},{emoji:"☕",name:"hot beverage",category:"food",keywords:["coffee","tea","hot"]},{emoji:"🫖",name:"teapot",category:"food",keywords:["teapot","tea","hot"]},{emoji:"🍵",name:"teacup without handle",category:"food",keywords:["tea","green tea","cup"]},{emoji:"🍶",name:"sake",category:"food",keywords:["sake","japanese","alcohol"]},{emoji:"🍾",name:"bottle with popping cork",category:"food",keywords:["champagne","celebration","cork"]},{emoji:"🍷",name:"wine glass",category:"food",keywords:["wine","glass","alcohol"]},{emoji:"🍸",name:"cocktail glass",category:"food",keywords:["cocktail","martini","alcohol"]},{emoji:"🍹",name:"tropical drink",category:"food",keywords:["tropical","cocktail","umbrella"]},{emoji:"🍺",name:"beer mug",category:"food",keywords:["beer","mug","alcohol"]},{emoji:"🍻",name:"clinking beer mugs",category:"food",keywords:["beer","cheers","celebration"]},{emoji:"🥂",name:"clinking glasses",category:"food",keywords:["champagne","cheers","celebration"]},{emoji:"🥃",name:"tumbler glass",category:"food",keywords:["whiskey","tumbler","alcohol"]},{emoji:"🫗",name:"pouring liquid",category:"food",keywords:["pour","liquid","drink"]},{emoji:"🥤",name:"cup with straw",category:"food",keywords:["soda","straw","drink"]},{emoji:"🧋",name:"bubble tea",category:"food",keywords:["bubble tea","boba","drink"]},{emoji:"🧃",name:"beverage box",category:"food",keywords:["juice box","drink","straw"]},{emoji:"🧉",name:"mate",category:"food",keywords:["mate","tea","south american"]},{emoji:"🧊",name:"ice",category:"food",keywords:["ice","cold","cube"]},{emoji:"⚽",name:"soccer ball",category:"activities",keywords:["soccer","football","sport"]},{emoji:"🏀",name:"basketball",category:"activities",keywords:["basketball","sport"]},{emoji:"🏈",name:"american football",category:"activities",keywords:["football","sport"]},{emoji:"⚾",name:"baseball",category:"activities",keywords:["baseball","sport"]},{emoji:"🥎",name:"softball",category:"activities",keywords:["softball","sport"]},{emoji:"🎾",name:"tennis",category:"activities",keywords:["tennis","sport"]},{emoji:"🚗",name:"automobile",category:"travel",keywords:["car","vehicle"]},{emoji:"🚕",name:"taxi",category:"travel",keywords:["taxi","car"]},{emoji:"🚙",name:"sport utility vehicle",category:"travel",keywords:["suv","car"]},{emoji:"🚌",name:"bus",category:"travel",keywords:["bus","vehicle"]},{emoji:"🚎",name:"trolleybus",category:"travel",keywords:["trolley","bus"]},{emoji:"🏎️",name:"racing car",category:"travel",keywords:["race","car","fast"]},{emoji:"💡",name:"light bulb",category:"objects",keywords:["idea","light","bulb"]},{emoji:"🔋",name:"battery",category:"objects",keywords:["battery","power"]},{emoji:"🖥️",name:"desktop computer",category:"objects",keywords:["computer","desktop"]},{emoji:"💻",name:"laptop",category:"objects",keywords:["laptop","computer"]},{emoji:"📱",name:"mobile phone",category:"objects",keywords:["phone","mobile"]},{emoji:"☎️",name:"telephone",category:"objects",keywords:["phone","telephone"]},{emoji:"❤️",name:"red heart",category:"symbols",keywords:["love","heart"]},{emoji:"🧡",name:"orange heart",category:"symbols",keywords:["love","heart"]},{emoji:"💛",name:"yellow heart",category:"symbols",keywords:["love","heart"]},{emoji:"💚",name:"green heart",category:"symbols",keywords:["love","heart"]},{emoji:"💙",name:"blue heart",category:"symbols",keywords:["love","heart"]},{emoji:"💜",name:"purple heart",category:"symbols",keywords:["love","heart"]},{emoji:"🖤",name:"black heart",category:"symbols",keywords:["love","heart"]},{emoji:"🤍",name:"white heart",category:"symbols",keywords:["love","heart"]},{emoji:"🏁",name:"chequered flag",category:"flags",keywords:["flag","race","finish"]},{emoji:"🚩",name:"triangular flag",category:"flags",keywords:["flag","warning"]},{emoji:"🏳️",name:"white flag",category:"flags",keywords:["flag","surrender"]},{emoji:"🏴",name:"black flag",category:"flags",keywords:["flag","pirate"]},{emoji:"🏳️‍🌈",name:"rainbow flag",category:"flags",keywords:["flag","rainbow","pride"]}],_a=e=>{const{value:t,defaultValue:o="",onChange:r,onEmojiSelect:a,isOpen:i,onOpen:l,onClose:d,closeOnSelect:c=!0,maxRecentEmojis:u=16,showRecentEmojis:p=!0,enabledCategories:h=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:m=[]}=e,[x,f]=g.useState(i??!1),[b,y]=g.useState(t??o),[k,j]=g.useState(""),[S,C]=g.useState("smileys"),[w,I]=g.useState([]),M=g.useRef(null),R=g.useRef(null),E=g.useMemo(()=>[...yh,...m],[m]),_=g.useMemo(()=>{let P=E;if(S!=="recent"?P=P.filter(L=>L.category===S):P=w,k){const L=k.toLowerCase();P=P.filter(H=>H.name.toLowerCase().includes(L)||H.keywords.some(B=>B.toLowerCase().includes(L)))}return P},[E,S,w,k]);g.useEffect(()=>{t!==void 0&&y(t)},[t]),g.useEffect(()=>{i!==void 0&&f(i)},[i]),g.useEffect(()=>{if(p){const P=localStorage.getItem("emojiPicker-recentEmojis");if(P)try{I(JSON.parse(P))}catch{}}},[p]),g.useEffect(()=>{const P=L=>{x&&M.current&&R.current&&!M.current.contains(L.target)&&!R.current.contains(L.target)&&W()};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[x]);const T=g.useCallback(P=>{p&&I(L=>{const H=L.filter(F=>F.emoji!==P.emoji),B=[P,...H].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(B)),B})},[p,u]),$=g.useCallback(()=>{const P=!x;f(P),P?(l==null||l(),j(""),p&&w.length>0?C("recent"):C("smileys")):d==null||d()},[x,l,d,p,w.length]),D=g.useCallback(P=>{y(P.emoji),T(P),r==null||r(P.emoji),a==null||a(P),c&&(f(!1),d==null||d())},[r,a,c,d,T]),z=g.useCallback(P=>{j(P),P&&S==="recent"&&C("smileys")},[S]),V=g.useCallback(P=>{C(P),j("")},[]),W=g.useCallback(()=>{f(!1),d==null||d()},[d]);return{isOpen:x,selectedEmoji:b,recentEmojis:w,searchQuery:k,activeCategory:S,filteredEmojis:_,handleToggle:$,handleEmojiSelect:D,handleSearchChange:z,handleCategoryChange:V,handleClose:W,triggerRef:M,dropdownRef:R}},$a=({id:e,name:t,label:o,placeholder:r="Select an emoji",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",error:u=!1,isDisabled:p=!1,isReadOnly:h=!1,showSearch:m=!0,showCategories:x=!0,showRecentEmojis:f=!0,enabledCategories:b=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:y,selectedEmoji:k,recentEmojis:j,searchQuery:S,activeCategory:C,filteredEmojis:w,handleToggle:I,handleEmojiSelect:M,handleSearchChange:R,handleCategoryChange:E,triggerRef:_,dropdownRef:T,onChange:$,...D})=>{const{getColor:z}=s.useTheme(),V={...Re.container,...i==null?void 0:i.container},W={...Re.trigger,...mh[l],...fh[d],...xh[c],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...i==null?void 0:i.trigger},P={...Re.dropdown,...i==null?void 0:i.dropdown},L={...Re.categoryTabs,...i==null?void 0:i.categoryTabs},H={...Re.emojiGrid,...i==null?void 0:i.emojiGrid},B=b.filter(F=>F==="recent"?f&&j.length>0:!0);return n.jsxs(s.View,{...V,...D,children:[o&&n.jsx(s.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:_,onClick:p||h?void 0:I,...W,children:[n.jsx(s.Horizontal,{alignItems:"center",gap:8,children:n.jsx(s.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||r})}),!h&&!p&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&n.jsxs(s.View,{ref:T,...P,children:[m&&n.jsx(s.View,{...Re.searchInput,...i==null?void 0:i.searchInput,children:n.jsx(wt,{placeholder:"Search emojis...",value:S,onChange:F=>R(F.target.value),size:"sm"})}),x&&n.jsx(s.View,{...L,children:B.map(F=>n.jsx(s.View,{...Re.categoryTab,...C===F&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>E(F),title:F.charAt(0).toUpperCase()+F.slice(1),...i==null?void 0:i.categoryTab,children:bh[F]},F))}),n.jsx(s.View,{...H,children:w.length>0?w.map((F,A)=>n.jsx(s.View,{...Re.emoji,onClick:()=>M(F),title:F.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...i==null?void 0:i.emoji,children:F.emoji},`${F.emoji}-${A}`)):n.jsx(s.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:n.jsx(s.Text,{fontSize:"14px",children:S?"No emojis found":"No emojis in this category"})})})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},kh=e=>{const t=pe(e),o={...e,value:t.value??e.value??e.defaultValue},r=_a(o),a=i=>{var l;r.handleEmojiSelect(i),t.onChange(i.emoji),(l=e.onEmojiSelect)==null||l.call(e,i)};return n.jsx($a,{...r,...o,handleEmojiSelect:a})},Ch=kh,jh=({files:e,onRemove:t,maxHeight:o="120px",views:r={}})=>{if(e.length===0)return null;const a=g.useCallback(i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:o,overflowY:"auto",...r==null?void 0:r.container,children:e.map((i,l)=>{const d=i.url||"",c=i.type.startsWith("image/"),u=i.type.startsWith("video/"),p=i.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",position:"relative",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...r==null?void 0:r.item,children:n.jsxs(be,{children:[n.jsx(be.Trigger,{children:n.jsxs(s.View,{position:"relative",children:[c&&d&&n.jsx(s.Image,{src:d,alt:i.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,alt:i.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),p&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!c&&!u&&!p&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),t&&n.jsx(s.Button,{position:"absolute",top:"-4px",right:"-4px",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",backgroundColor:"color-red-500",color:"white",fontSize:14,fontWeight:"bold",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"2px solid white",_hover:{backgroundColor:"color-red-600"},onClick:h=>{h.stopPropagation(),t(l)},"aria-label":`Remove ${i.name}`,children:"×"})]})}),n.jsxs(be.Content,{children:[c&&d&&n.jsx(s.Image,{src:d,alt:i.name,maxWidth:"300px"}),u&&d&&n.jsx(s.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),p&&d&&n.jsx(s.View,{as:"audio",src:d,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...r==null?void 0:r.name,children:[i.name," (",a(i.size),")"]})]})]})},l)})})},Sh=e=>{const t=wa(e);return n.jsx(Ia,{...e,...t})},wh=Sh,Ih=({url:e,type:t,name:o,onOpen:r})=>{const a=t.toLowerCase(),i=a.startsWith("image"),l=a.startsWith("video"),d=a.startsWith("audio"),c=()=>{r&&r()};return n.jsxs(s.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:c,children:[i&&n.jsx(s.Image,{src:e,alt:o,width:"100%",height:"100%",objectFit:"cover"}),l&&n.jsx(s.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),d&&n.jsx(s.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!i&&!l&&!d&&n.jsx(xt,{widthHeight:24,color:"color-gray-600"})]})},Ee=Bo.create(e=>({modals:[],onHide:t=>t,onShow:(t,o)=>({name:t,props:o}),show:(t,o={},r={})=>{e(a=>({...a,modals:[...a.modals,{name:t,props:{...o,isVisible:!0},overlayProps:r}]}))},hide:t=>{e(o=>t?{...o,modals:o.modals.filter(r=>r.name!==t)}:{modals:[]})},setOnHide:t=>{e(o=>({...o,onHide:t}))},setOnShow:t=>{e(o=>({...o,onShow:t}))}})),Th=(e,t={},o={})=>{Ee.getState().show(e,t,o),Ee.getState().onShow(e,t)},dr=e=>{console.log("hideModal",e),Ee.getState().onHide(e),Ee.getState().hide(typeof e=="string"?e:void 0)},Mh={square:{borderRadius:0},rounded:{borderRadius:"8px"}},Rh={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},zh={xs:12,sm:16,md:20,lg:24,xl:28},Wt={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},La=({children:e,blur:t,isOpen:o=!1,isClosePrevented:r=!1,onClose:a=()=>{},position:i="center",views:l,...d})=>{const c=()=>{r||a()};return n.jsx(s.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:c,visibility:o?"visible":"hidden",transition:"all 0.3s ease",...l==null?void 0:l.container,children:n.jsx(s.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:t?`blur(${t}px)`:void 0,transition:"all 0.3s ease",onClick:c,...Rh[i],...d,...l==null?void 0:l.view,children:e})})},Eh=({children:e,shadow:t,isFullScreen:o=!1,shape:r="rounded",views:a,isOpen:i,...l})=>{const d=typeof document!==void 0?{boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"}:{elevation:5,shadowColor:"rgba(0, 0, 0, 0.15)",shadowOffset:{width:0,height:4},shadowOpacity:1,shadowRadius:16},c=u=>{u&&u.stopPropagation&&u.stopPropagation()};return n.jsx(s.Vertical,{cursor:"default",backgroundColor:"color-white",width:o?"100%":600,height:o?"100%":"fit-content",onClick:c,transition:"all 0.3s ease",...t||d,...Mh[r],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...l,...a==null?void 0:a.container,children:e})},Vh=({children:e,buttonColor:t="theme-primary",iconSize:o="md",buttonPosition:r="right",views:a,...i})=>{const l=i.onClose?i.onClose:dr,d=n.jsx(s.View,{onClick:l,children:n.jsx(ye,{widthHeight:zh[o],color:t})});return n.jsxs(s.Horizontal,{justifyContent:r==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...i,...a==null?void 0:a.header,children:[r==="left"&&d,e,r==="right"&&d]})},Ph=({children:e,views:t,...o})=>n.jsx(s.View,{paddingVertical:16,paddingHorizontal:24,fontSize:Wt.body.fontSize,fontWeight:Wt.body.fontWeight,lineHeight:Wt.body.lineHeight,color:Wt.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...o,...t==null?void 0:t.view,children:e}),Wh=({children:e,views:t,...o})=>n.jsx(s.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...o,...t==null?void 0:t.container,children:e}),_h=({modals:e,onShow:t,onHide:o})=>{const r=Ee(a=>a.modals);return t&&Ee.getState().setOnShow(t),o&&Ee.getState().setOnHide(o),r.length===0?null:n.jsx(g.Fragment,{children:r.map((a,i)=>{const l=e[a.name];return l?n.jsx(La,{isOpen:a.props.isVisible,onClose:()=>dr(a.name),blur:5,...a.overlayProps,style:{zIndex:1e3+i},children:n.jsx(l,{...a.props})},i):(console.error(`${a.name} modal doesn't exist`),null)})})},Be=({children:e})=>n.jsx(n.Fragment,{children:e});Be.Overlay=La;Be.Container=Eh;Be.Header=Vh;Be.Body=Ph;Be.Footer=Wh;Be.Layout=_h;const Ur={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},$h={left:{top:0,left:0,bottom:0,height:"100vh",borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{top:0,right:0,bottom:0,height:"100vh",borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"},top:{top:0,left:0,right:0,width:"100vw",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},bottom:{bottom:0,left:0,right:0,width:"100vw",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200"}},Da=({isOpen:e,onClose:t,isClosePrevented:o,blur:r,children:a,...i})=>{const l=()=>{o||t()};return g.useEffect(()=>{const d=c=>{c.key==="Escape"&&e&&!o&&t()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,o,t]),n.jsx(s.View,{"data-testid":"drawer-overlay",role:"dialog","aria-modal":"true",position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e3,visibility:e?"visible":"hidden",onClick:l,transition:"all 0.3s ease",backgroundColor:e?"color-blackAlpha-500":"transparent",backdropFilter:r?`blur(${r}px)`:void 0,pointerEvents:e?"auto":"none",...i,children:a})},Ha=({placement:e="right",size:t="md",children:o,...r})=>{const a=d=>{d.stopPropagation()},l=e==="top"||e==="bottom"?{height:t==="full"?"100vh":Ur[t]||t,maxHeight:"100vh"}:{width:t==="full"?"100vw":Ur[t]||t,maxWidth:"100vw"};return n.jsx(s.Vertical,{position:"absolute",backgroundColor:"color-white",...$h[e],...l,onClick:a,transition:"transform 0.3s ease",...r,children:o})},Lh=({children:e,onClose:t,buttonPosition:o="right",...r})=>{const a=t&&n.jsx(s.View,{onClick:t,cursor:"pointer",padding:8,children:n.jsx(ye,{widthHeight:20,color:"color-gray-500"})});return n.jsxs(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:o==="none"?"center":"space-between",...r,children:[o==="left"&&a,e,o==="right"&&a]})},Dh=({children:e,...t})=>n.jsx(s.Vertical,{padding:24,flex:1,overflowY:"auto",...t,children:e}),Hh=({children:e,...t})=>n.jsx(s.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...t,children:e}),Bh=({isOpen:e,onClose:t,placement:o="right",size:r="md",isClosePrevented:a,children:i,...l})=>{const d=e?{}:{transform:o==="left"||o==="right"?`translateX(${o==="left"?"-100%":"100%"})`:`translateY(${o==="top"?"-100%":"100%"})`};return n.jsx(Da,{isOpen:e,onClose:t,isClosePrevented:a,...l,children:n.jsx(Ha,{placement:o,size:r,style:d,children:i})})},nt=Bh;nt.Overlay=Da;nt.Container=Ha;nt.Header=Lh;nt.Body=Dh;nt.Footer=Hh;const Ah=(e=null,t=[])=>{const[o,r]=g.useState(e),[a,i]=g.useState(t),l=g.useRef({});return{activeItemId:o,setActiveItemId:r,expandedItemIds:a,toggleExpandedItem:u=>{i(p=>p.includes(u)?p.filter(m=>m!==u):[...p,u])},isItemExpanded:u=>a.includes(u),triggerRefs:l}},$o={sm:{padding:"8px 12px",fontSize:"12px",fontWeight:"500",media:{mobile:{padding:"6px 10px",fontSize:"11px"}}},md:{padding:"12px 16px",fontSize:"14px",fontWeight:"500",media:{mobile:{padding:"10px 14px",fontSize:"13px"}}},lg:{padding:"16px 20px",fontSize:"16px",fontWeight:"500",media:{mobile:{padding:"12px 16px",fontSize:"14px"}}}},Lo={default:{backgroundColor:"transparent",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"}},Ba={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Xe={active:{backgroundColor:"color-blue-50",color:"color-blue-700",fontWeight:"600",borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"color-blue-600"},hover:{backgroundColor:"color-gray-100",transition:"background-color 0.2s ease"}},Aa=g.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),Fh=({children:e,value:t})=>n.jsx(Aa.Provider,{value:t,children:e}),It=()=>{const e=g.useContext(Aa);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},ur=({children:e,views:t})=>{const{orientation:o}=It(),r=o==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(r,{width:"100%",...Ba[o],transition:"all 0.2s ease",borderRadius:"4px",...t==null?void 0:t.container,children:e})},Fa=g.createContext({itemValue:null,isDisabled:!1}),Oh=()=>{const e=g.useContext(Fa);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},pr=({item:e,value:t,isDisabled:o=!1,children:r,views:a})=>{var k;const{activeItemId:i,setActiveItemId:l,orientation:d,size:c,variant:u,onItemActivate:p}=It(),h=(e==null?void 0:e.id)||t,m=i===h,x=(e==null?void 0:e.items)&&e.items.length>0,f=(e==null?void 0:e.disabled)||o,b=()=>{f||h&&(l(h),p&&p(h))},y=d==="horizontal"?s.Horizontal:s.Vertical;return r?n.jsx(Fa.Provider,{value:{itemValue:h||null,isDisabled:f},children:n.jsx(s.View,{width:"100%",cursor:f?"not-allowed":"pointer",opacity:f?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...$o[c],...Lo[u],...m?Xe.active:{},_hover:f?{}:Xe.hover,...a==null?void 0:a.item,children:r})}):x&&e?n.jsxs(y,{width:"100%",flexDirection:"column",position:"relative",...a==null?void 0:a.item,children:[n.jsxs(Oa,{itemId:e.id,disabled:e.disabled,views:a,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}),n.jsx(va,{itemId:e.id,children:n.jsx(ur,{children:(k=e.items)==null?void 0:k.map(j=>n.jsx(pr,{item:j},j.id))})})]}):e?n.jsxs(s.View,{as:e.href?"a":"div",to:e.href,onClick:b,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.6:1,width:"100%",display:"flex",alignItems:"center",borderRadius:"4px",transition:"all 0.2s ease",gap:"8px",...$o[c],...Lo[u],...m?Xe.active:{},_hover:e.disabled?{}:Xe.hover,...a==null?void 0:a.item,children:[e.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:e.icon}),e.label]}):null},Oa=({children:e,itemId:t,disabled:o,views:r})=>{const{activeItemId:a,toggleExpandedItem:i,isItemExpanded:l,size:d,variant:c,triggerRefs:u}=It(),p=g.useRef(null),h=a===t,m=l(t);g.useEffect(()=>(p.current&&t&&(u.current[t]=p.current),()=>{t&&delete u.current[t]}),[t,u]);const x=f=>{f.preventDefault(),!o&&i(t)};return n.jsxs(s.View,{ref:p,onClick:x,cursor:o?"not-allowed":"pointer",opacity:o?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:4,transition:"background-color 0.2s ease",...$o[d],...Lo[c],...h?Xe.active:{},_hover:o?{}:Xe.hover,...r==null?void 0:r.trigger,children:[n.jsx(s.View,{display:"flex",alignItems:"center",children:e}),n.jsx(s.View,{transition:"transform 0.2s ease",transform:m?"rotate(180deg)":"rotate(0deg)",...r==null?void 0:r.indicator,children:n.jsx(ie,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},va=({children:e,itemId:t,views:o})=>{const{isItemExpanded:r,orientation:a,triggerRefs:i}=It(),l=g.useRef(null),[d,c]=g.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(t);if(g.useEffect(()=>{if(u&&l.current&&t&&i.current[t]&&a==="horizontal"){const h=l.current.getBoundingClientRect(),m=i.current[t].getBoundingClientRect(),x=Math.max(h.width||200,200),f=Math.max(h.height||150,150),b=window.innerWidth,y=window.innerHeight,k={top:m.top,right:b-m.right,bottom:y-m.bottom,left:m.left},j=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:m.left,y:m.top-f-8},{placement:"right",space:k.right,fits:k.right>=x+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:m.left-x-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=x+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:m.left-x-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:m.left,y:m.top-f-8}],S=j.find(M=>M.fits);if(S){c({x:S.x,y:S.y,placement:S.placement});return}const C=j.reduce((M,R)=>R.space>M.space?R:M);let w=C.x,I=C.y;w+x>b&&(w=b-x-8),w<8&&(w=8),I+f>y&&(I=y-f-8),I<8&&(I=8),c({x:w,y:I,placement:C.placement})}},[u,a,t,i]),!u)return null;if(a==="vertical")return n.jsx(s.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...o==null?void 0:o.container,children:e});const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.View,{ref:l,role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...o==null?void 0:o.container,children:e})},vh=({href:e,children:t,views:o,...r})=>{const{itemValue:a,isDisabled:i}=Oh(),{activeItemId:l,setActiveItemId:d,onItemActivate:c}=It(),u=l===a,p=h=>{if(i){h.preventDefault();return}a&&(d(a),c&&c(a)),r.onClick&&r.onClick(h)};return n.jsx(s.View,{as:"a",href:i?void 0:e,onClick:p,cursor:i?"not-allowed":"pointer",opacity:i?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":i,"data-active":u?"":void 0,"data-disabled":i?"":void 0,...u?{fontWeight:"bold"}:{},...o==null?void 0:o.container,...r,children:t})},Nh=({items:e,orientation:t,views:o,themeMode:r})=>{const a=t==="horizontal"?s.Horizontal:s.Vertical;return!e||e.length===0?null:n.jsx(a,{width:"100%",...Ba[t],...o==null?void 0:o.container,children:n.jsx(ur,{views:o,children:e.map(i=>n.jsx(pr,{item:i,views:o},i.id))})})},Uh=({items:e,children:t,orientation:o="vertical",size:r="md",variant:a="default",defaultActiveItemId:i=null,defaultExpandedItemIds:l=[],onItemActivate:d,views:c,...u})=>{const{activeItemId:p,setActiveItemId:h,expandedItemIds:m,toggleExpandedItem:x,isItemExpanded:f,triggerRefs:b}=Ah(i,l);return n.jsx(Fh,{value:{activeItemId:p,setActiveItemId:h,expandedItemIds:m,toggleExpandedItem:x,isItemExpanded:f,orientation:o,size:r,variant:a,onItemActivate:d,triggerRefs:b},children:e?n.jsx(Nh,{items:e,orientation:o,size:r,variant:a,views:c,...u}):t})},at=Uh;at.List=ur;at.Item=pr;at.Trigger=Oa;at.Content=va;at.Link=vh;const Na={},Ua=g.createContext({views:Na,onRowClick:()=>{}}),qh=({children:e,views:t=Na,onRowClick:o})=>n.jsx(Ua.Provider,{value:{views:t,onRowClick:o},children:e}),Pe=()=>g.useContext(Ua),ue={table:{width:"100%",borderRadius:"8px",overflow:"hidden",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.04)",border:"1px solid",borderColor:"color-gray-200",transition:"box-shadow 0.2s ease",media:{mobile:{overflowX:"auto",display:"block",borderRadius:"4px"}}},thead:{backgroundColor:"color-gray-50",borderBottom:"1px solid",borderBottomColor:"color-gray-200"},th:{padding:"12px 16px",fontWeight:"600",fontSize:"14px",color:"color-gray-700",textAlign:"left",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},td:{padding:"12px 16px",fontSize:"14px",borderBottom:"1px solid",borderBottomColor:"color-gray-100",color:"color-gray-900",media:{mobile:{padding:"8px 12px",fontSize:"12px"}}},tr:{transition:"background-color 0.15s ease",_hover:{backgroundColor:"color-gray-50"},_focus:{outline:"none",backgroundColor:"color-gray-100"}},tfoot:{backgroundColor:"color-gray-50",fontWeight:"600",borderTop:"2px solid",borderTopColor:"color-gray-200"},caption:{margin:"8px 0",color:"color-gray-600",fontSize:"14px",fontStyle:"italic",media:{mobile:{fontSize:"12px"}}}};({...ue.th},{...ue.td});({...ue.tr});({...ue.td},{...ue.th});({...ue.table},{...ue.th}),{...ue.td},{...ue.tr},{...ue.tfoot},{...ue.caption};const qa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"table",borderCollapse:"collapse",...ue.table,...t==null?void 0:t.table,...e})},Ga=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"thead",textAlign:"left",...ue.thead,...t==null?void 0:t.thead,...e})},Ya=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"th",whiteSpace:"nowrap",...ue.th,...t==null?void 0:t.th,...e})},At=e=>{const{views:t,onRowClick:o}=Pe();return n.jsx(s.Element,{as:"tr",...ue.tr,...t==null?void 0:t.tr,onClick:o,...e})},Do=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...ue.td,...t==null?void 0:t.td,...e})},Xa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tbody",...ue.tbody,...t==null?void 0:t.tbody,...e})},Ka=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tfoot",...ue.tfoot,...t==null?void 0:t.tfoot,...e})},Qa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"caption",...ue.caption,...t==null?void 0:t.caption,...e})},Gh=({data:e,columns:t,footer:o,caption:r,themeMode:a})=>n.jsxs(qa,{role:"Table",children:[r&&n.jsx(Qa,{children:r}),n.jsx(Ga,{children:n.jsx(At,{children:t.map(i=>n.jsx(Ya,{children:i.title},i.field))})}),n.jsx(Xa,{children:e.map((i,l)=>n.jsx(At,{children:t.map((d,c)=>n.jsx(Do,{isFirstColumn:c===0,children:i[d.field]},d.field))},l))}),o&&n.jsx(Ka,{children:n.jsx(At,{children:o.map((i,l)=>n.jsx(Do,{...i.props,children:i.value},l))})})]}),Se=({children:e,views:t,onClick:o})=>n.jsx(qh,{views:t,onRowClick:o,children:e});Se.Head=Ga;Se.HeadCell=Ya;Se.Body=Xa;Se.Row=At;Se.Cell=Do;Se.Footer=Ka;Se.Caption=Qa;Se.Container=qa;Se.Template=Gh;const Yh=(e,t,o)=>{const r=u=>u.value!==void 0?u.value:u.title,a=()=>{if(!(!e||e.length===0)){if(t!==void 0){const u=e.find(p=>r(p)===t);if(u)return u}return e[0]}},[i,l]=g.useState(a()),d=o!==void 0?e.find(u=>r(u)===o):i,c=u=>{o===void 0&&l(u)};return g.useEffect(()=>{if(o!==void 0)return;const u=a(),p=i&&e.some(h=>r(h)===r(i));u&&(!p||t!==void 0&&i&&r(i)!==t)?l(u):!u&&i&&l(void 0)},[e,t]),{activeTab:d,setActiveTab:c}},Xh=(e,t,o)=>{const[r,a]=g.useState(e||null);return{activeValue:t!==void 0?t:r,setActiveValue:d=>{t===void 0&&a(d),o&&o(d)}}},Kh=({tab:e,isActive:t,onClick:o,iconPosition:r="left",tabStyles:a,textStyles:i})=>{const l={display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",cursor:"pointer",borderBottom:"2px solid",borderBottomColor:t?"theme-primary":"transparent",backgroundColor:"transparent",color:t?"theme-primary":"color-gray-600",fontWeight:t?"600":"500",marginBottom:"-1px",transition:"all 0.2s ease",on:{hover:{color:"theme-primary",borderBottomColor:t?"theme-primary":"color-gray-300"}}},d=()=>{switch(r){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},c=()=>["top","bottom"].includes(r)?"4px":"8px",u=e.icon&&g.isValidElement(e.icon)?g.cloneElement(e.icon,{strokeWidth:t?2.5:2}):e.icon;return n.jsxs(s.Element,{as:"div",role:"tab","aria-selected":t,tabIndex:t?0:-1,...l,...a,flexDirection:d(),gap:c(),onClick:o,"data-state":t?"active":"inactive",children:[u&&n.jsx(s.Element,{children:u},t?"active-icon":"inactive-icon"),n.jsxs(s.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[n.jsx(s.Text,{...i,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),n.jsx(s.Text,{...i,fontWeight:t?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})},Qh=({tabs:e=[],activeTab:t,handleTabClick:o,views:r={},renderTab:a,renderContent:i,iconPosition:l="left"})=>t?n.jsxs(s.Vertical,{width:"100%",height:"100%",...r.container,children:[n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...r.headerTabs,children:e.map(d=>{const c=(d.value!==void 0?d.value:d.title)===(t.value!==void 0?t.value:t.title),u=()=>o(d);return a?a(d,c,u):n.jsx(Kh,{tab:d,isActive:c,onClick:u,iconPosition:l,tabStyles:{...r.tab,...c?r.activeTab:{}},textStyles:{...r.title,...c?r.activeText:{}}},d.title)})}),n.jsx(s.View,{width:"100%",height:"100%",...r.content,children:i?i(t):t.content})]}):null,Ja=g.createContext(null),Za=()=>{const e=g.useContext(Ja);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},Jh=({children:e,views:t})=>n.jsx(s.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...t==null?void 0:t.container,children:e}),Zh=({value:e,children:t,disabled:o=!1,views:r})=>{const{activeValue:a,setActiveValue:i}=Za(),l=a===e,d=()=>{o||i(e)};return n.jsx(s.View,{cursor:o?"not-allowed":"pointer",opacity:o?.6:1,padding:"12px 16px",borderBottom:"2px solid",borderBottomColor:l?"theme-primary":"transparent",color:l?"theme-primary":"color-gray-600",fontWeight:l?"600":"400",transition:"all 0.2s ease",_hover:o?{}:{color:"theme-primary"},onClick:d,...r==null?void 0:r.trigger,...l?r==null?void 0:r.activeState:{},children:t})},em=({value:e,children:t,views:o})=>{const{activeValue:r}=Za();return r!==e?null:n.jsx(s.View,{width:"100%",padding:"24px",...o==null?void 0:o.content,children:t})},tm=({tabs:e,views:t,defaultValue:o,onTabChange:r,renderTab:a,renderContent:i,iconPosition:l="left",value:d,onValueChange:c,children:u})=>{const p=Xh(o,d,c),h=Yh(e||[],o,d);if(u)return n.jsx(Ja.Provider,{value:p,children:u});if(e){const m=x=>{const f=b=>b.value!==void 0?b.value:b.title;(!h.activeTab||f(h.activeTab)!==f(x))&&(h.setActiveTab(x),r&&r(x))};return n.jsx(Qh,{tabs:e,views:t,activeTab:h.activeTab,handleTabClick:m,renderTab:a,renderContent:i,iconPosition:l})}return null},om=g.memo(tm),go=om;go.List=Jh;go.Trigger=Zh;go.Content=em;const rm=e=>{const{children:t,_isInView:o=!1,alternateHighlightText:r=[],alternateAnimation:a=!1,alternateDuration:i=3e3,highlightText:l,highlightTypewriter:d=!1,highlightSlide:c=!1,highlightSlideDuration:u=500,highlightSlideStagger:p=50,highlightSlideSequential:h=!0}=e,[m,x]=g.useState(t),[f,b]=g.useState(l);return g.useEffect(()=>{if(!a||r.length===0||!o||typeof t!="string"||typeof l!="string")return x(t),b(l),()=>{};const y=t,k=l;let j=0;const S=w=>{const I=r[w],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(M,"gi"),E=y.replace(R,I);x(E),b(I)};S(j);const C=setInterval(()=>{j=(j+1)%r.length,S(j)},i);return()=>clearInterval(C)},[a,r,i,l,t,o]),{finalDisplayedText:m,activeHighlightTarget:f,highlightTypewriter:d,highlightSlide:c,highlightSlideDuration:u,highlightSlideStagger:p,highlightSlideSequential:h}},nm={xs:24,sm:36,md:48,lg:64,xl:72},am={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,t)=>({background:`linear-gradient(135deg, ${e}, ${t||e})`,backgroundClip:"text",WebkitBackgroundClip:"text !important",WebkitTextFillColor:"transparent",color:"transparent",display:"inline-block",textShadow:"none"}),outline:e=>({WebkitTextStroke:`1px ${e}`,WebkitTextFillColor:"transparent !important",color:"transparent",textShadow:"none"}),glow:e=>({color:e,textShadow:`0 0 10px ${e}80, 0 0 20px ${e}40, 0 0 30px ${e}20`}),solid:e=>({color:e}),default:()=>({})},im=({text:e,typingSpeed:t=50,pauseTime:o=500,onComplete:r,showCursor:a=!0,cursorColor:i="currentColor",textStyle:l,textComponent:d,as:c,...u})=>{const p=d||s.Text,h=Array.isArray(e)?e:[e],[m,x]=g.useState(h.map(()=>"")),[f,b]=g.useState(!1),[y,k]=g.useState(0),[j,S]=g.useState(0);g.useEffect(()=>{x(h.map(()=>"")),b(!1),k(0),S(0)},[e]),g.useEffect(()=>{if(f){r&&r();return}const w=h[y];if(j>=w.length){if(y>=h.length-1){b(!0);return}const M=setTimeout(()=>{k(R=>R+1),S(0)},o);return()=>clearTimeout(M)}const I=setTimeout(()=>{x(M=>{const R=[...M];return R[y]=w.substring(0,j+1),R}),S(M=>M+1)},t);return()=>clearTimeout(I)},[h,y,j,f,r,o,t]);const C=w=>{if(!w||typeof w!="string")return w;const I=w.split("|");return I.length===1?w:I.map((M,R)=>n.jsxs(g.Fragment,{children:[M,R<I.length-1&&n.jsx("br",{})]},R))};return n.jsx(n.Fragment,{children:m.map((w,I)=>n.jsxs(g.Fragment,{children:[C(w),a&&I===y&&!f&&n.jsx(p,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:i,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...l})]},I))})},lm=({text:e,duration:t=500,direction:o="up",stagger:r=50,sequential:a=!1,textStyle:i,as:l,wordProps:d,textComponent:c,...u})=>{const[p,h]=g.useState(e),[m,x]=g.useState("entering"),[f,b]=g.useState(0),y=c||s.Text,k=g.useRef(null),j=g.useRef(null);g.useEffect(()=>{e===p&&m==="visible"||e!==p&&(m==="entering"||m==="visible"?(k.current=e,x("exiting")):m==="exiting"&&(k.current=e))},[e,p,m]);const{lines:S,totalWordCount:C}=g.useMemo(()=>{const W=p.split("|").map(L=>L.trim().split(/\s+/).filter(H=>H.length>0)),P=W.reduce((L,H)=>L+H.length,0);return{lines:W,totalWordCount:P}},[p]),w=g.useMemo(()=>a?C*(t+r):(C-1)*r+t,[C,t,r,a]),I=g.useMemo(()=>a?C*(t+r):(C-1)*r+t,[C,t,r,a]);g.useEffect(()=>(j.current&&clearTimeout(j.current),m==="entering"?j.current=setTimeout(()=>{x("visible")},w+50):m==="exiting"&&(j.current=setTimeout(()=>{k.current!==null&&(h(k.current),k.current=null),b(V=>V+1),x("entering")},I+50)),()=>{j.current&&clearTimeout(j.current)}),[m,w,I]);const{style:M,...R}=d||{},E=o==="up",_=V=>a?V*(t+r):V*r,T=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...i}),[i]),$=g.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),D=g.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let z=0;return n.jsx(s.Element,{as:"span",style:T,...u,children:n.jsx("span",{style:$,children:S.map((V,W)=>n.jsx("span",{style:D,children:V.map((P,L)=>{const H=z++,B=_(H),F=L===V.length-1;let A;const O=`${t}ms`,Y=`${B}ms`;m==="entering"?A=E?s.Animation.slideInUp({duration:O,delay:Y,timingFunction:"ease-out",fillMode:"both"}):s.Animation.slideInDown({duration:O,delay:Y,timingFunction:"ease-out",fillMode:"both"}):m==="exiting"&&(A=E?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:O,delay:Y,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:O,delay:Y,timingFunction:"ease-in",fillMode:"both"});const X={...M,display:"inline-block",marginRight:F?0:"0.25em",transform:m==="visible"?"translateY(0)":void 0,opacity:m==="visible"?1:void 0};return n.jsx(y,{as:"span",animate:A,...R,...X,children:P},`${f}-${W}-${L}`)})},`line-${W}`))})})};function qr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const wo=e=>{if(!e||typeof e!="string")return e;const t=e.split("|");return t.length===1?e:t.map((o,r)=>n.jsxs(g.Fragment,{children:[o,r<t.length-1&&n.jsx("br",{})]},r))},cm=({children:e,highlightText:t,highlightStyle:o="solid",highlightColor:r="theme-primary",highlightSecondaryColor:a,size:i="lg",views:l,highlightAnimate:d,animate:c,animationLoop:u=1,highlightAnimationLoop:p=1,highlightTypewriter:h=!1,highlightTypewriterDuration:m=3e3,highlightSlide:x=!1,highlightSlideDuration:f=500,highlightSlideStagger:b=50,highlightSlideSequential:y=!0,themeMode:k,...j})=>{const{ref:S,inView:C}=s.useInView(),{finalDisplayedText:w,activeHighlightTarget:I,highlightTypewriter:M,highlightSlide:R,highlightSlideDuration:E,highlightSlideStagger:_,highlightSlideSequential:T}=rm({children:e,highlightText:t,_isInView:C,highlightTypewriter:h,highlightSlide:x,highlightSlideDuration:f,highlightSlideStagger:b,highlightSlideSequential:y,...j}),$=nm[i],D=am[o](r,a),z=(B,F)=>B&&(Array.isArray(B)?B.map(A=>({...A,iterationCount:F.toString()})):{...B,iterationCount:F.toString()}),V=z(c,u),W=z(d,p),P=typeof w=="string"?w:typeof e=="string"?e:"",L={ref:S,animate:C?V:void 0,as:"h1",fontSize:$},H=B=>!C&&(M||R)?n.jsx("span",{style:{opacity:0},children:B}):M?n.jsx(im,{text:B,typingSpeed:Math.max(30,m/(B.length*10)),cursorColor:"currentColor",...D}):R?n.jsx(lm,{text:B,duration:E,stagger:_,sequential:T,direction:"up",fontSize:$,wordProps:D}):wo(B);if(typeof P=="string"&&I){const B=Array.isArray(I)?new RegExp(`(${I.map(Y=>qr(String(Y))).join("|")})`,"gi"):new RegExp(`(${qr(String(I))})`,"gi"),F=[];let A=0,O;for(;O=B.exec(P);)O.index>A&&F.push(P.substring(A,O.index)),F.push({highlight:!0,text:O[0]}),A=O.index+O[0].length;return A<P.length&&F.push(P.substring(A)),n.jsx(s.Element,{...L,...l==null?void 0:l.container,...j,children:F.map((Y,X)=>typeof Y=="string"?n.jsx(s.Text,{as:"span",display:"inline",...l==null?void 0:l.text,children:wo(Y)},`text-${X}`):n.jsx(s.Text,{as:"span",display:"inline",animate:C?W:void 0,...R?{}:D,...l==null?void 0:l.highlight,children:H(Y.text)},`highlight-${X}`))})}return o&&!I?n.jsx(s.Element,{...L,...j,...l==null?void 0:l.container,children:n.jsx(s.Text,{as:"span",display:"inline",animate:C?W:void 0,...R?{}:D,...l==null?void 0:l.highlight,children:H(P)})}):n.jsx(s.Text,{...L,...j,...l==null?void 0:l.container,...l==null?void 0:l.text,children:wo(P)})},sm=e=>n.jsx(cm,{...e}),dm=sm,um=({items:e,shape:t,variant:o,onToggleChange:r})=>{const{activeToggles:a,setActiveToggles:i}=za();return n.jsx(Va,{items:e,shape:t,variant:o,activeToggles:a,setActiveToggles:i,onToggleChange:r})},pm=um,gm=({items:e,onChange:t})=>{const[o,r]=g.useState(e),[a,i]=g.useState(null),[l,d]=g.useState(null),c=g.useRef({x:0,y:0}),u=g.useRef([]),p=g.useCallback((x,f)=>{x.preventDefault(),document.body.style.cursor="grabbing";const b="touches"in x?x.touches[0].clientX:x.clientX,y="touches"in x?x.touches[0].clientY:x.clientY;c.current={x:b,y},d(f),i(o[f])},[o]),h=g.useCallback(x=>{if(l===null)return;const f="touches"in x?x.touches[0].clientX:x.clientX,b="touches"in x?x.touches[0].clientY:x.clientY,y=u.current[l];if(!y)return;const k=f-c.current.x,j=b-c.current.y;y.style.transform=`translate(${k}px, ${j}px)`,y.style.zIndex="1000";const S=u.current.findIndex((C,w)=>{if(!C||w===l)return!1;const I=C.getBoundingClientRect();return b>=I.top&&b<=I.bottom});if(S!==-1&&S!==l){const C=[...o],[w]=C.splice(l,1);C.splice(S,0,w),r(C),d(S),t==null||t(C),c.current={x:f,y:b}}},[l,o,t]),m=g.useCallback(()=>{document.body.style.cursor="",u.current.forEach(x=>{x&&(x.style.transform="",x.style.zIndex="")}),d(null),i(null)},[l]);return g.useEffect(()=>(l!==null&&(window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),window.addEventListener("mouseup",m),window.addEventListener("touchend",m)),()=>{window.removeEventListener("mousemove",h),window.removeEventListener("touchmove",h),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m)}),[l,h,m]),{items:o,draggedItem:a,draggedIndex:l,itemRefs:u,handleDragStart:p}},hm=({items:e,renderItem:t,containerProps:o,itemProps:r,draggedIndex:a,itemRefs:i,handleDragStart:l,views:d,themeMode:c})=>n.jsx(s.View,{overflow:"hidden",position:"relative",...o,...d==null?void 0:d.container,children:e.map((u,p)=>n.jsx(s.View,{ref:h=>i.current[p]=h,onMouseDown:h=>l(h,p),onTouchStart:h=>l(h,p),position:"relative",cursor:"grab",transition:"transform 0.2s",...r,...d==null?void 0:d.item,children:t?t(u,p):u},p))}),ei=e=>{const{items:t,draggedIndex:o,itemRefs:r,handleDragStart:a}=gm(e);return n.jsx(hm,{...e,items:t,draggedIndex:o,itemRefs:r,handleDragStart:a})},mm=ei,fm=({onFileSelect:e,onMultipleFileSelect:t,validateFile:o,accept:r,multiple:a,disabled:i,previewUrl:l})=>{const[d,c]=g.useState(!1),[u,p]=g.useState(null),h=g.useRef(null),m=l!==void 0?l:u;g.useEffect(()=>()=>{u&&URL.revokeObjectURL(u)},[u]);const x=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!0)},[i]),f=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!1)},[i]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),!i&&c(!0)},[i]),y=g.useCallback(C=>{if(!C||C.length===0)return;const w=Array.from(C);if(!a&&w.length>0){const I=w[0];if(I.type.startsWith("image/")){const M=URL.createObjectURL(I);p(R=>(R&&URL.revokeObjectURL(R),M))}else p(null)}a?t&&t(w):w.length>0&&e&&e(w[0])},[a,t,e]),k=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),c(!1),!i&&C.dataTransfer.files&&C.dataTransfer.files.length>0&&(y(C.dataTransfer.files),C.dataTransfer.clearData())},[i,y]),j=g.useCallback(()=>{var C;i||(C=h.current)==null||C.click()},[i]),S=g.useCallback(C=>{y(C.target.files),C.target.value&&(C.target.value="")},[y]);return{isDragActive:d,handleDragEnter:x,handleDragLeave:f,handleDragOver:b,handleDrop:k,handleClick:j,handleFileChange:S,inputRef:h,preview:m}},xm={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",padding:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:"12px",zIndex:10,_hover:{backgroundColor:"rgba(0, 0, 0, 0.7)"}},ti=({files:e,sandboxId:t,onRemove:o,layout:r="inline",maxHeight:a="120px",showPreviews:i=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(c=>c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/(1024*1024)).toFixed(1)} MB`,[]);return n.jsx(s.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:a,overflowY:"auto",...l==null?void 0:l.container,children:e.map((c,u)=>{const p=URL.createObjectURL(c)||(c==null?void 0:c.path)||(c==null?void 0:c.url)||"",h=c.type.startsWith("image/"),m=c.type.startsWith("video/"),x=c.type.startsWith("audio/");return n.jsx(s.Vertical,{alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",animate:{from:{opacity:0,scale:.9},to:{opacity:1,scale:1}},animationDuration:.2,...l==null?void 0:l.item,children:i&&n.jsxs(be,{children:[n.jsxs(be.Trigger,{children:[h&&n.jsx(s.Image,{src:p,alt:c.name,width:"60px",height:"60px",objectFit:"cover"}),m&&n.jsx(s.View,{as:"video",src:p,alt:c.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(Zt,{widthHeight:24,color:"color-black"})}),!h&&!m&&!x&&n.jsx(s.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:n.jsx(xt,{widthHeight:24,color:"color-black"})}),o&&n.jsx(s.Button,{...xm,onClick:f=>{f.stopPropagation(),o(u)},"aria-label":`Remove ${c.name}`,children:"×"})]}),n.jsxs(be.Content,{children:[h&&n.jsx(s.Image,{src:p,alt:c.name,maxWidth:"100%"}),m&&n.jsx(s.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),x&&n.jsx(s.View,{as:"audio",src:p,controls:!0,width:"100%"}),n.jsxs(s.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[c.name," (",d(c.size),")"]})]})]})},u)})})},bm=({children:e,text:t="Drop files here or click to upload",textProps:o,containerProps:r,disabled:a,accept:i,multiple:l,isDragActive:d,handleDragEnter:c,handleDragLeave:u,handleDragOver:p,handleDrop:h,handleClick:m,handleFileChange:x,inputRef:f,preview:b,imageProps:y,selectedFiles:k,onRemove:j})=>n.jsxs(s.Center,{width:"100%",minHeight:"200px",height:k&&k.length>0?"auto":"200px",borderWidth:2,borderStyle:"dashed",borderColor:d?"primary":"rgba(0,0,0,0.1)",borderRadius:12,backgroundColor:d?"rgba(0,0,0,0.02)":"transparent",flexDirection:"column",cursor:a?"not-allowed":"pointer",opacity:a?.6:1,onClick:m,onDragEnter:c,onDragLeave:u,onDragOver:p,onDrop:h,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...r,children:[n.jsx("input",{type:"file",ref:f,onChange:x,accept:i,multiple:l,style:{display:"none"},disabled:a}),b&&!l?n.jsxs(s.View,{width:"100%",height:"200px",position:"relative",children:[n.jsx(s.Image,{src:b,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...y}),n.jsx(s.Center,{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:0,_hover:{opacity:1},transition:"opacity 0.2s",children:n.jsx(s.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||n.jsxs(s.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[n.jsx(Xo,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),n.jsx(s.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...o,children:t})]}),l&&k&&k.length>0&&n.jsx(s.View,{marginTop:16,width:"100%",children:n.jsx(ti,{files:k,onRemove:j||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),ym=e=>{const t=fm(e);return n.jsx(bm,{...e,...t})},km=(e=!1)=>{const[t,o]=g.useState(e),[r,a]=g.useState(null);return g.useEffect(()=>{const i=c=>{!c.composedPath().some(h=>(h==null?void 0:h.id)==="dropdown-menu"||(h==null?void 0:h.id)==="dropdown-trigger")&&t&&(o(!1),a(null))},l=()=>{t&&(o(!1),a(null))},d=c=>{c.key==="Escape"&&t&&(o(!1),a(null))};return document.addEventListener("mousedown",i),window.addEventListener("resize",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("resize",l),document.removeEventListener("keydown",d)}},[t]),{isOpen:t,setIsOpen:o,activeSubmenuId:r,setActiveSubmenuId:a}},Cm={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},jm={default:{backgroundColor:"color-white",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Sm={hover:{backgroundColor:"color-gray-100"}},oi=g.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),wm=({children:e,value:t})=>n.jsx(oi.Provider,{value:t,children:e}),gr=()=>{const e=g.useContext(oi);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},ri=({children:e,views:t,...o})=>{const{isOpen:r,setIsOpen:a,triggerRef:i}=gr(),l=d=>{d.stopPropagation(),a(!r)};return n.jsx(s.View,{ref:i,id:"dropdown-trigger",onClick:l,cursor:"pointer",position:"relative",display:"inline-block",...t==null?void 0:t.container,...o,children:e})},hr=({items:e,side:t="bottom",align:o="start",views:r,...a})=>{const{isOpen:i,variant:l,triggerRef:d}=gr(),c=g.useRef(null),{ref:u,relation:p}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[h,m]=g.useState({x:0,y:0,placement:t});if(g.useEffect(()=>{d.current&&u&&(u.current=d.current)},[d,u,i]),g.useEffect(()=>{if(i&&c.current&&d.current){const b=d.current.getBoundingClientRect();let y=t;p&&(t==="bottom"&&p.space.vertical==="top"?y="top":t==="top"&&p.space.vertical==="bottom"?y="bottom":t==="right"&&p.space.horizontal==="left"?y="left":t==="left"&&p.space.horizontal==="right"&&(y="right"));let k=0,j=0;switch(y){case"bottom":k=o==="start"?b.left:o==="end"?b.right-180:b.left+b.width/2-90,j=b.bottom+8;break;case"top":k=o==="start"?b.left:o==="end"?b.right-180:b.left+b.width/2-90,j=b.top-8;break;case"right":k=b.right+8,j=o==="start"?b.top:o==="end"?b.bottom-100:b.top+b.height/2-50;break;case"left":k=b.left-8,j=o==="start"?b.top:o==="end"?b.bottom-100:b.top+b.height/2-50;break}m({x:k,y:j,placement:y})}},[i,t,o,d,p]),!i)return null;const f=(()=>{const b={position:"fixed",left:h.x,top:h.y,zIndex:1e3};switch(h.placement){case"top":return{...b,transform:"translateY(-100%)"};case"left":return{...b,transform:"translateX(-100%)"};case"bottom":case"right":default:return b}})();return n.jsx(s.View,{ref:c,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:f,...jm[l],...r==null?void 0:r.menu,...a,children:e.map((b,y)=>b.divider?n.jsx(ai,{views:r},`divider-${y}`):n.jsx(ni,{item:b,views:r},b.id))})},ni=({item:e,views:t,...o})=>{const{activeSubmenuId:r,setActiveSubmenuId:a,size:i}=gr(),[l,d]=g.useState(!1),c=e.items&&e.items.length>0,u=r===e.id,p=g.useRef(null),h=()=>{d(!0),c&&a(e.id)},m=()=>{d(!1)},x=f=>{f.stopPropagation(),!e.disabled&&!c&&e.onClick&&e.onClick()};return n.jsxs(s.View,{ref:p,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Cm[i],_hover:e.disabled?{}:Sm.hover,backgroundColor:l&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:h,onMouseLeave:m,onClick:x,...t==null?void 0:t.item,...o,children:[e.icon&&n.jsx(s.View,{marginRight:8,...t==null?void 0:t.icon,children:e.icon}),n.jsx(s.View,{flexGrow:1,children:e.label}),c&&n.jsx(s.View,{marginLeft:8,...t==null?void 0:t.submenuIndicator,children:n.jsx(ie,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&c&&n.jsx(hr,{items:e.items||[],side:"right",align:"start",views:t})]})},ai=({views:e,...t})=>n.jsx(s.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...t}),Im=({trigger:e,items:t,side:o="bottom",align:r="start",views:a,themeMode:i,...l})=>n.jsxs(s.View,{position:"relative",display:"inline-block",...a==null?void 0:a.container,...l,children:[n.jsx(ri,{views:a,children:e}),n.jsx(hr,{items:t,side:o,align:r,views:a})]}),Tm=({trigger:e,items:t,size:o="md",variant:r="default",side:a="bottom",align:i="start",defaultOpen:l=!1,views:d,...c})=>{const{isOpen:u,setIsOpen:p,activeSubmenuId:h,setActiveSubmenuId:m}=km(l),x=g.useRef(null);return n.jsx(wm,{value:{isOpen:u,setIsOpen:p,activeSubmenuId:h,setActiveSubmenuId:m,size:o,variant:r,triggerRef:x},children:n.jsx(Im,{trigger:e,items:t,side:a,align:i,views:d,...c})})},Tt=Tm;Tt.Trigger=ri;Tt.Content=hr;Tt.Item=ni;Tt.Divider=ai;const Mm=e=>{const{value:t,defaultValue:o="",onChange:r,onChangeComplete:a,isOpen:i,onOpen:l,onClose:d,closeOnSelect:c=!0,maxRecentColors:u=8,showRecentColors:p=!0}=e,[h,m]=g.useState(i??!1),[x,f]=g.useState(t??o),[b,y]=g.useState(""),[k,j]=g.useState([]),S=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{t!==void 0&&f(t)},[t]),g.useEffect(()=>{i!==void 0&&m(i)},[i]),g.useEffect(()=>{if(p){const T=localStorage.getItem("colorPicker-recentColors");if(T)try{j(JSON.parse(T))}catch{}}},[p]),g.useEffect(()=>{const T=$=>{h&&S.current&&C.current&&!S.current.contains($.target)&&!C.current.contains($.target)&&_()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[h]);const w=g.useCallback(T=>{p&&j($=>{const D=$.filter(V=>V!==T),z=[T,...D].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(z)),z})},[p,u]),I=g.useCallback(()=>{const T=!h;m(T),T?l==null||l():d==null||d()},[h,l,d]),M=g.useCallback(T=>{f(T),w(T),r==null||r(T),a==null||a(T),c&&(m(!1),d==null||d())},[r,a,c,d,w]),R=g.useCallback(T=>{y(T)},[]),E=g.useCallback(()=>{b&&(M(b),y(""))},[b,M]),_=g.useCallback(()=>{m(!1),d==null||d()},[d]);return{isOpen:h,selectedColor:x,recentColors:k,customColor:b,handleToggle:I,handleColorSelect:M,handleCustomColorChange:R,handleCustomColorSubmit:E,handleClose:_,triggerRef:S,dropdownRef:C}},Ue={container:{position:"relative",display:"inline-block",width:"100%"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",transition:"all 0.2s ease"},dropdown:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,backgroundColor:"color-white",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0 8px 16px rgba(0,0,0,0.1)",padding:"16px",minWidth:"280px"},colorGrid:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"8px",marginBottom:"16px"},customInput:{marginBottom:"12px"},recentColors:{borderTop:"1px solid color-gray-200",paddingTop:"12px"}},Rm={xs:{height:"28px",fontSize:"12px",padding:"4px 8px"},sm:{height:"32px",fontSize:"14px",padding:"6px 10px"},md:{height:"40px",fontSize:"16px",padding:"8px 12px"},lg:{height:"48px",fontSize:"18px",padding:"10px 16px"},xl:{height:"56px",fontSize:"20px",padding:"12px 20px"}},zm={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Em={default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Vm=[{name:"Blue 500",value:"color-blue-500",category:"primary"},{name:"Purple 500",value:"color-purple-500",category:"primary"},{name:"Pink 500",value:"color-pink-500",category:"primary"},{name:"Red 500",value:"color-red-500",category:"primary"},{name:"Orange 500",value:"color-orange-500",category:"primary"},{name:"Yellow 500",value:"color-yellow-500",category:"primary"},{name:"Green 500",value:"color-green-500",category:"primary"},{name:"Teal 500",value:"color-teal-500",category:"primary"},{name:"Blue 300",value:"color-blue-300",category:"light"},{name:"Purple 300",value:"color-purple-300",category:"light"},{name:"Pink 300",value:"color-pink-300",category:"light"},{name:"Red 300",value:"color-red-300",category:"light"},{name:"Orange 300",value:"color-orange-300",category:"light"},{name:"Yellow 300",value:"color-yellow-300",category:"light"},{name:"Green 300",value:"color-green-300",category:"light"},{name:"Teal 300",value:"color-teal-300",category:"light"},{name:"Blue 700",value:"color-blue-700",category:"dark"},{name:"Purple 700",value:"color-purple-700",category:"dark"},{name:"Pink 700",value:"color-pink-700",category:"dark"},{name:"Red 700",value:"color-red-700",category:"dark"},{name:"Orange 700",value:"color-orange-700",category:"dark"},{name:"Yellow 700",value:"color-yellow-700",category:"dark"},{name:"Green 700",value:"color-green-700",category:"dark"},{name:"Teal 700",value:"color-teal-700",category:"dark"},{name:"Gray 100",value:"color-gray-100",category:"neutral"},{name:"Gray 300",value:"color-gray-300",category:"neutral"},{name:"Gray 500",value:"color-gray-500",category:"neutral"},{name:"Gray 700",value:"color-gray-700",category:"neutral"},{name:"Gray 900",value:"color-gray-900",category:"neutral"},{name:"Black",value:"color-black",category:"neutral"},{name:"White",value:"color-white",category:"neutral"}],Pm=({id:e,name:t,label:o,placeholder:r="Select a color",helperText:a,views:i={},size:l="md",shape:d="default",variant:c="default",error:u=!1,isDisabled:p=!1,isReadOnly:h=!1,predefinedColors:m=Vm,showCustomInput:x=!0,showRecentColors:f=!0,isOpen:b,selectedColor:y,recentColors:k,customColor:j,handleToggle:S,handleColorSelect:C,handleCustomColorChange:w,handleCustomColorSubmit:I,triggerRef:M,dropdownRef:R,onChange:E,..._})=>{const{getColor:T}=s.useTheme(),$={...Ue.container,...i==null?void 0:i.container},D={...Ue.trigger,...Rm[l],...zm[d],...Em[c],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...i==null?void 0:i.trigger},z={...Ue.dropdown,...i==null?void 0:i.dropdown},V={...Ue.colorGrid,...i==null?void 0:i.colorGrid},W={...Ue.recentColors,...i==null?void 0:i.recentColors},P=y||"color-gray-200";return n.jsxs(s.View,{...$,..._,children:[o&&n.jsx(s.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...i==null?void 0:i.label,children:o}),n.jsxs(s.View,{ref:M,onClick:p||h?void 0:S,...D,children:[n.jsxs(s.Horizontal,{alignItems:"center",gap:8,children:[n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:P,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),n.jsx(s.Text,{color:y?"color-gray-800":"color-gray-500",fontSize:"inherit",children:y||r})]}),!h&&!p&&n.jsx(ie,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&n.jsxs(s.View,{ref:R,...z,children:[n.jsx(s.View,{...V,children:m.map((L,H)=>n.jsx(s.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:L.value,borderWidth:"2px",borderStyle:"solid",borderColor:y===L.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>C(L.value),title:L.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...i==null?void 0:i.colorSwatch},H))}),x&&n.jsxs(s.View,{...Ue.customInput,...i==null?void 0:i.customInput,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[n.jsx("input",{type:"color",value:j||"#000000",onChange:L=>{const H=L.target.value;w(H),C(H)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),n.jsx(wt,{placeholder:"Enter hex color (e.g., #ff0000)",value:j,onChange:L=>w(L.target.value),onKeyPress:L=>{L.key==="Enter"&&I()},size:"sm",right:j&&n.jsx(s.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:j,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:I})})]}),f&&k.length>0&&n.jsxs(s.View,{...W,children:[n.jsx(s.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),n.jsx(s.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((L,H)=>n.jsx(s.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:L,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>C(L),title:L,_hover:{transform:"scale(1.1)"}},H))})]})]}),a&&n.jsx(s.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...i==null?void 0:i.helperText,children:a})]})},Wm=e=>{const t=Mm(e);return n.jsx(Pm,{...t,...e})},_m=Wm,$m=e=>{const t=_a(e);return n.jsx($a,{...t,...e})},Lm=$m,Dm=e=>{const t=Pa(e);return n.jsx(Wa,{...t,...e})},Hm=Dm,Bm=(e=null,t=null)=>{const[o,r]=g.useState(e),[a,i]=g.useState(t),l=c=>a===c,d=c=>{i(u=>u===c?null:c)};return g.useEffect(()=>{const c=p=>{!p.composedPath().some(x=>(x==null?void 0:x.id)==="menubar-content"||(x==null?void 0:x.id)==="menubar-trigger")&&a!==null&&i(null)},u=p=>{p.key==="Escape"&&a!==null&&i(null)};return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u)}},[a]),{activeMenuId:o,setActiveMenuId:r,openMenuId:a,setOpenMenuId:i,isMenuOpen:l,toggleMenu:d}},ii={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},Am={default:{backgroundColor:"transparent",color:"color-gray-800"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800"},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800"}},Fm={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Ft={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},li=g.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),ho=()=>g.useContext(li),Om=({value:e,children:t})=>n.jsx(li.Provider,{value:e,children:t}),ci=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",views:a,...i})=>{const l=t==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(l,{role:"menubar","aria-orientation":t,...Fm[t],...Am[r],...a==null?void 0:a.container,...i,children:e})},si=({children:e,id:t,disabled:o=!1,views:r})=>{const{orientation:a}=ho(),i=a==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(i,{role:"none",position:"relative",opacity:o?.5:1,pointerEvents:o?"none":"auto",...r==null?void 0:r.menu,children:g.Children.map(e,l=>g.isValidElement(l)?g.cloneElement(l,{...l.props,menuId:t}):l)})},di=({children:e,menuId:t,disabled:o=!1,views:r})=>{const{activeMenuId:a,setActiveMenuId:i,toggleMenu:l,isMenuOpen:d,size:c,triggerRefs:u}=ho(),p=g.useRef(null),h=a===t,m=d(t);g.useEffect(()=>(p.current&&t&&(u.current[t]=p.current),()=>{t&&delete u.current[t]}),[t,u]);const x=()=>{o||(i(t),l(t))};return n.jsx(s.View,{ref:p,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":m,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ii[c],...h?Ft.active:{},...o?Ft.disabled:{},_hover:o?{}:Ft.hover,onClick:x,...r==null?void 0:r.trigger,children:e})},ui=({children:e,menuId:t,views:o})=>{const{isMenuOpen:r,orientation:a,triggerRefs:i}=ho(),l=g.useRef(null),[d,c]=g.useState({x:0,y:0,placement:a==="horizontal"?"bottom":"right"}),u=r(t);if(g.useEffect(()=>{if(u&&l.current&&t&&i.current[t]){const h=l.current.getBoundingClientRect(),m=i.current[t].getBoundingClientRect(),x=Math.max(h.width||200,200),f=Math.max(h.height||150,150),b=window.innerWidth,y=window.innerHeight,k={top:m.top,right:b-m.right,bottom:y-m.bottom,left:m.left},j=a==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:m.left,y:m.top-f-8},{placement:"right",space:k.right,fits:k.right>=x+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:m.left-x-8,y:m.top}]:[{placement:"right",space:k.right,fits:k.right>=x+8,x:m.right+8,y:m.top},{placement:"left",space:k.left,fits:k.left>=x+8,x:m.left-x-8,y:m.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=f+8,x:m.left,y:m.bottom+8},{placement:"top",space:k.top,fits:k.top>=f+8,x:m.left,y:m.top-f-8}],S=j.find(M=>M.fits);if(S){c({x:S.x,y:S.y,placement:S.placement});return}const C=j.reduce((M,R)=>R.space>M.space?R:M);let w=C.x,I=C.y;w+x>b&&(w=b-x-8),w<8&&(w=8),I+f>y&&(I=y-f-8),I<8&&(I=8),c({x:w,y:I,placement:C.placement})}},[u,a,t,i]),!u)return null;const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return n.jsx(s.View,{ref:l,id:"menubar-content",role:"menu",minWidth:"200px",backgroundColor:"color-white",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:p,...o==null?void 0:o.content,children:e})},pi=({children:e,icon:t,disabled:o=!1,onClick:r,views:a})=>{const{size:i}=ho(),l=()=>{o||!r||r()};return n.jsxs(s.View,{role:"menuitem",cursor:o?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:o?.5:1,...ii[i],_hover:o?{}:Ft.hover,onClick:l,...a==null?void 0:a.item,children:[t&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:t}),e]})},gi=({views:e})=>n.jsx(s.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),vm=({items:e,orientation:t,size:o,variant:r,views:a,themeMode:i})=>n.jsx(ci,{orientation:t,size:o,variant:r,views:a,children:e.map(l=>n.jsxs(si,{id:l.id,disabled:l.disabled,views:a,children:[n.jsxs(di,{menuId:l.id,views:a,children:[l.icon&&n.jsx(s.View,{marginRight:8,...a==null?void 0:a.icon,children:l.icon}),l.label]}),l.items&&l.items.length>0&&n.jsx(ui,{menuId:l.id,views:a,children:l.items.map((d,c)=>d.separator?n.jsx(gi,{views:a},`separator-${c}`):n.jsx(pi,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:a,children:d.label},d.id))})]},l.id))}),Nm=({items:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultActiveMenuId:a=null,defaultOpenMenuId:i=null,views:l,...d})=>{const{activeMenuId:c,setActiveMenuId:u,openMenuId:p,setOpenMenuId:h,isMenuOpen:m,toggleMenu:x}=Bm(a,i),f=g.useRef({});return n.jsx(Om,{value:{activeMenuId:c,setActiveMenuId:u,openMenuId:p,setOpenMenuId:h,isMenuOpen:m,toggleMenu:x,orientation:t,size:o,variant:r,triggerRefs:f},children:n.jsx(vm,{items:e,orientation:t,size:o,variant:r,views:l,...d})})},Ae=Nm;Ae.Root=ci;Ae.Menu=si;Ae.Trigger=di;Ae.Content=ui;Ae.Item=pi;Ae.Separator=gi;const Um=(e,t,o)=>{const[r,a]=g.useState([]);return g.useEffect(()=>{a((()=>{const l=[];if(t<=o)for(let d=1;d<=t;d++)l.push(d);else{l.push(1);let d=Math.max(2,e-Math.floor((o-2)/2)),c=Math.min(t-1,d+o-3);c>=t-1&&(c=t-1,d=Math.max(2,c-(o-3))),d>2&&l.push("...");for(let u=d;u<=c;u++)l.push(u);c<t-1&&l.push("..."),l.push(t)}return l})())},[e,t,o]),{visiblePageNumbers:r}},qe={sm:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px",media:{mobile:{fontSize:"11px",padding:"3px 6px",minWidth:"24px",height:"24px"}}},md:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px",media:{mobile:{fontSize:"12px",padding:"4px 8px",minWidth:"28px",height:"28px"}}},lg:{fontSize:"16px",padding:"8px 16px",minWidth:"44px",height:"44px",media:{mobile:{fontSize:"14px",padding:"6px 12px",minWidth:"36px",height:"36px"}}}},pt={default:{backgroundColor:"transparent",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",_hover:{backgroundColor:"color-gray-200"}},outline:{backgroundColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",_hover:{backgroundColor:"color-gray-100"}}},gt={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},qm={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},_t={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Gm=({currentPage:e,totalPages:t,onPageChange:o,pageSize:r=10,pageSizeOptions:a=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:i,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:c=5,showFirstLastButtons:u=!1,size:p="md",variant:h="default",shape:m="rounded",visiblePageNumbers:x,views:f,...b})=>{const y=S=>{S<1||S>t||S===e||o(S)},k=S=>{i&&i(Number(S.target.value))},j=(S,C)=>{if(S==="...")return n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",...qe[p],...f==null?void 0:f.ellipsis,children:"..."},`ellipsis-${C}`);const w=S===e;return n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer",...qe[p],...pt[h],...gt[m],...w?qm:{},onClick:()=>y(S),"aria-label":`Page ${S}`,"aria-current":w?"page":void 0,...w?f==null?void 0:f.activePageButton:f==null?void 0:f.pageButton,children:S},`page-${S}`)};return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,...f==null?void 0:f.container,...b,children:[u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...pt[h],...gt[m],...e===1?_t:{},onClick:()=>y(1),"aria-label":"First page",disabled:e===1,...f==null?void 0:f.navigationButton,children:[n.jsx(ie,{orientation:"left",widthHeight:16}),n.jsx(ie,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...pt[h],...gt[m],...e===1?_t:{},onClick:()=>y(e-1),"aria-label":"Previous page",disabled:e===1,...f==null?void 0:f.navigationButton,children:n.jsx(ie,{orientation:"left",widthHeight:16})}),x.map((S,C)=>j(S,C)),n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===t?"not-allowed":"pointer",...qe[p],...pt[h],...gt[m],...e===t?_t:{},onClick:()=>y(e+1),"aria-label":"Next page",disabled:e===t,...f==null?void 0:f.navigationButton,children:n.jsx(ie,{orientation:"right",widthHeight:16})}),u&&n.jsxs(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===t?"not-allowed":"pointer",...qe[p],...pt[h],...gt[m],...e===t?_t:{},onClick:()=>y(t),"aria-label":"Last page",disabled:e===t,...f==null?void 0:f.navigationButton,children:[n.jsx(ie,{orientation:"right",widthHeight:16}),n.jsx(ie,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&n.jsxs(s.Text,{marginLeft:16,color:"color-gray-600",...f==null?void 0:f.pageInfo,children:["Page ",e," of ",t]}),l&&i&&n.jsx(s.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:r,onChange:k,...f==null?void 0:f.pageSizeSelector,children:a.map(S=>n.jsx("option",{value:S.value,children:S.label},S.value))})]})},Ym=({currentPage:e,totalPages:t,onPageChange:o,pageSize:r=10,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:c=5,showFirstLastButtons:u=!1,size:p="md",variant:h="default",shape:m="rounded",views:x,...f})=>{const{visiblePageNumbers:b}=Um(e,t,c);return n.jsx(Gm,{currentPage:e,totalPages:t,onPageChange:o,pageSize:r,pageSizeOptions:a,onPageSizeChange:i,showPageSizeSelector:l,showPageInfo:d,maxPageButtons:c,showFirstLastButtons:u,size:p,variant:h,shape:m,visiblePageNumbers:b,views:x,...f})},Xm=Ym,Km=({shape:e="linear",value:t=0,max:o=100,color:r="theme-primary",backgroundColor:a="color-gray-200",height:i,size:l,radius:d=4,strokeWidth:c=10,showLabel:u=!1,labelColor:p="theme-text-primary",animated:h=!0,animationDuration:m="0.5s",views:x,themeMode:f,...b})=>{const{getColor:y,themeMode:k}=s.useTheme(),j=f||k,C=Math.min(o,Math.max(0,t))/o*100,w=y(a,{themeMode:j}),I=y(r,{themeMode:j});if(e==="circle"){const R=l||(typeof i=="number"?i:100),E=(R-c)/2,_=2*Math.PI*E,T=_-C/100*_;return n.jsxs(s.View,{width:R,height:R,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...x==null?void 0:x.container,...b,children:[n.jsxs("svg",{width:R,height:R,viewBox:`0 0 ${R} ${R}`,style:{transform:"rotate(-90deg)"},children:[n.jsx("circle",{cx:R/2,cy:R/2,r:E,stroke:w,strokeWidth:c,fill:"transparent",...x==null?void 0:x.track}),n.jsx("circle",{cx:R/2,cy:R/2,r:E,stroke:I,strokeWidth:c,strokeDasharray:_,strokeDashoffset:T,strokeLinecap:"round",fill:"transparent",style:{transition:h?`stroke-dashoffset ${m} ease-in-out`:"none"},...x==null?void 0:x.indicator})]}),u&&n.jsx(s.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:n.jsxs(s.Text,{color:p,fontSize:`${R*.2}px`,fontWeight:"bold",...x==null?void 0:x.text,children:[Math.round(C),"%"]})})]})}const M=i||8;return n.jsx(s.View,{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":o,width:"100%",height:M,backgroundColor:w,borderRadius:d,overflow:"hidden",...x==null?void 0:x.container,...b,children:n.jsx(s.View,{width:`${C}%`,height:"100%",backgroundColor:I,borderRadius:d,style:{transition:h?`width ${m} ease-in-out`:"none"},...x==null?void 0:x.bar})})},Qm=e=>n.jsx(Km,{...e}),Jm=Qm,Zm=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),ef=Zm(),tf={thin:"1px",medium:"2px",thick:"4px"},ht={container:{transition:"opacity 0.15s ease"},label:{fontSize:"14px",fontWeight:"500",color:"color-gray-600",paddingHorizontal:"8px",backgroundColor:"color-white",transition:"color 0.15s ease"}},of=({orientation:e="horizontal",variant:t="solid",thickness:o="thin",color:r,spacing:a="0px",label:i,decorative:l=!1,views:d,themeMode:c,...u})=>{const{themeMode:p}=s.useTheme(),h=r||"color-gray-200",m=ef[t],x=tf[o],f=l?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return i&&e==="horizontal"?n.jsxs(s.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:a,...f,...u,children:[n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:x,borderTopStyle:m,borderTopColor:h,...ht.container,...d==null?void 0:d.container}),n.jsx(s.Text,{...ht.label,...d==null?void 0:d.label,children:i}),n.jsx(s.View,{height:"0px",flexGrow:1,borderTopWidth:x,borderTopStyle:m,borderTopColor:h,...ht.container,...d==null?void 0:d.container})]}):e==="horizontal"?n.jsx(s.View,{height:"0px",width:"100%",borderTopWidth:x,borderTopStyle:m,borderTopColor:h,padding:a,...ht.container,...f,...d==null?void 0:d.container,...u}):n.jsx(s.View,{width:"0px",height:"100%",borderLeftWidth:x,borderLeftStyle:m,borderLeftColor:h,padding:a,...ht.container,...f,...d==null?void 0:d.container,...u})},hi=e=>n.jsx(of,{...e}),rf=hi,nf=hi,af={xs:12,sm:14,md:16,lg:18,xl:20},lf=({isSupported:e,isSharing:t,onShare:o,label:r,children:a,icon:i,size:l,isDisabled:d,isLoading:c,iconPosition:u,disableWhenUnsupported:p=!0,...h})=>{const m=l??"md",x=i??n.jsx(an,{widthHeight:af[m],strokeWidth:1.5,filled:!1}),f=!!d||!e&&p,b=!!c||t;return n.jsx(Le,{...h,size:m,icon:x,iconPosition:u??"left",isDisabled:f,isLoading:b,onClick:o,children:a??r??"Share"})},Gr=()=>typeof navigator>"u"?void 0:navigator,cf=(e,t)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(t)}catch{return!1}return!0},sf=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},df=e=>{const{shareData:t,onClick:o,onUnsupported:r,onShareStart:a,onShareSuccess:i,onShareCancel:l,onShareError:d}=e,[c,u]=g.useState(!1),p=g.useMemo(()=>cf(Gr(),t),[t]),h=g.useCallback((...m)=>{o==null||o(...m);const x=Gr();if(!x||typeof x.share!="function"){r==null||r();return}if(!c){if(typeof x.canShare=="function")try{if(!x.canShare(t)){r==null||r();return}}catch(f){d==null||d(f);return}u(!0),a==null||a();try{x.share(t).then(()=>{i==null||i()}).catch(f=>{if(sf(f)==="AbortError"){l==null||l();return}d==null||d(f)}).finally(()=>{u(!1)})}catch(f){u(!1),d==null||d(f)}}},[c,o,l,d,a,i,r,t]);return{isSupported:p,isSharing:c,handleShare:h}},uf=e=>{const{isSupported:t,isSharing:o,handleShare:r}=df(e),{shareData:a,onShareStart:i,onShareSuccess:l,onShareCancel:d,onShareError:c,onUnsupported:u,onClick:p,...h}=e;return n.jsx(lf,{...h,isSupported:t,isSharing:o,onShare:r})},pf=uf,gf=({label:e,status:t="default",views:o,themeMode:r,...a})=>{const{themeMode:i}=s.useTheme(),l=hn();return n.jsxs(s.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...o==null?void 0:o.container,...a,children:[n.jsx(s.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...l[t].indicator,...o==null?void 0:o.indicator}),e&&n.jsx(s.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...l[t].label,...o==null?void 0:o.label,children:e})]})},hf=e=>n.jsx(gf,{...e}),mf=(e=!0,t,o,r)=>{const{on:a}=s.useResponsive(),i=a("mobile"),[l,d]=g.useState(t!==void 0?t:e);return g.useEffect(()=>{t!==void 0&&d(t)},[t]),{isExpanded:l,toggleExpanded:()=>{const h=!l;d(h),o&&o(h)},expand:()=>{l||(d(!0),o&&o(!0))},collapse:()=>{l&&(d(!1),o&&o(!1))},isMobile:i}},ff={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},xf=e=>({default:{backgroundColor:"color-white",color:"color-gray-800",transition:"all 0.2s ease"},filled:{backgroundColor:"color-gray-100",color:"color-gray-800",transition:"all 0.2s ease"},outline:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",color:"color-gray-800",transition:"all 0.2s ease"},subtle:{backgroundColor:"color-gray-50",color:"color-gray-800",transition:"all 0.2s ease"},elevated:{backgroundColor:"color-white",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",color:"color-gray-800",transition:"all 0.2s ease"}}),bf=xf(),yf={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},kf={none:{},low:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"},medium:{boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)"},high:{boxShadow:"0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"}},Cf={fast:"width 0.2s ease, transform 0.2s ease",normal:"width 0.3s ease, transform 0.3s ease",slow:"width 0.5s ease, transform 0.5s ease",bounce:"width 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55)"},mi=g.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),mo=()=>g.useContext(mi),jf=({value:e,children:t})=>n.jsx(mi.Provider,{value:e,children:t}),Sf=({children:e,showToggleButton:t=!0,views:o,...r})=>{const{isExpanded:a,toggleExpanded:i,position:l}=mo();return n.jsx(s.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...o==null?void 0:o.header,...r,children:a?n.jsxs(s.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,t&&n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...o==null?void 0:o.toggleButton,children:n.jsx(ie,{orientation:l==="left"?"left":"right",widthHeight:16,...o==null?void 0:o.toggleButtonIcon})})]}):n.jsx(s.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:t&&n.jsx(s.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},onClick:i,"aria-label":a?"Collapse sidebar":"Expand sidebar",...o==null?void 0:o.toggleButton,children:n.jsx(ie,{orientation:l==="left"?"right":"left",widthHeight:16,...o==null?void 0:o.toggleButtonIcon})})})})},wf=({children:e,views:t,...o})=>{const{isExpanded:r}=mo();return n.jsx(s.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:r?"16px":"8px",...t==null?void 0:t.content,...o,children:e})},If=({children:e,views:t,...o})=>{const{isExpanded:r}=mo();return n.jsx(s.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...t==null?void 0:t.footer,...o,children:r?e:null})},Tf=({children:e,position:t="left",size:o="md",variant:r="default",fixed:a=!1,hasBackdrop:i=!0,expandedWidth:l,collapsedWidth:d,breakpointBehavior:c="overlay",elevation:u="none",transitionPreset:p="normal",ariaLabel:h="Sidebar navigation",isExpanded:m,isMobile:x,collapse:f,views:b,themeMode:y,...k})=>{const j=ff[o],S=m?l||j.expandedWidth:d||j.collapsedWidth,C=!x||x&&c!=="hide",w=a||x&&c==="overlay"?"fixed":"relative",I=i&&x&&m&&c==="overlay";return n.jsxs(n.Fragment,{children:[I&&n.jsx(s.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:f,...b==null?void 0:b.backdrop}),C&&n.jsx(s.Vertical,{position:w,top:0,height:"100vh",width:S,zIndex:999,transition:Cf[p],transform:x&&c==="overlay"&&!m?`translateX(${t==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":h,...bf[r],...yf[t],...kf[u],...b==null?void 0:b.container,...k,children:g.Children.map(e,M=>M)})]})},Mf=({children:e,position:t="left",size:o="md",variant:r="default",defaultExpanded:a=!0,expanded:i,onExpandedChange:l,fixed:d=!1,hasBackdrop:c=!0,showToggleButton:u=!0,expandedWidth:p,collapsedWidth:h,breakpoint:m=768,breakpointBehavior:x="overlay",views:f,...b})=>{const{isExpanded:y,toggleExpanded:k,expand:j,collapse:S,isMobile:C}=mf(a,i,l);return n.jsx(jf,{value:{isExpanded:y,toggleExpanded:k,expand:j,collapse:S,position:t,size:o,variant:r,views:f},children:n.jsx(Tf,{position:t,size:o,variant:r,fixed:d,hasBackdrop:c,showToggleButton:u,expandedWidth:p,collapsedWidth:h,breakpoint:m,breakpointBehavior:x,isExpanded:y,isMobile:C,toggleExpanded:k,expand:j,collapse:S,views:f,...b,children:e})})},Mt=Mf;Mt.Header=Sf;Mt.Content=wf;Mt.Footer=If;Mt.useContext=mo;const Rf=()=>({getItem:e=>{try{return localStorage.getItem(`resizable-${e}`)}catch(t){return console.warn("Failed to access localStorage:",t),null}},setItem:(e,t)=>{try{localStorage.setItem(`resizable-${e}`,t)}catch(o){console.warn("Failed to write to localStorage:",o)}}}),zf=(e,t,o,r=50,a=1/0,i=!1,l,d,c=10)=>{const[u,p]=g.useState(!1),[h,m]=g.useState([]),x=g.useRef(null),f=g.useRef(null),b=g.useRef(0),y=g.useRef([]),k=g.useRef(d||(typeof window<"u"?Rf():null)),j=g.useCallback(()=>x.current?e==="horizontal"?x.current.offsetWidth:x.current.offsetHeight:0,[e]),S=g.useCallback(()=>{if(!l||!k.current)return null;const V=k.current.getItem(l);if(!V)return null;try{const W=JSON.parse(V);return Array.isArray(W.sizes)?W.sizes:null}catch(W){return console.warn("Failed to parse saved panel sizes:",W),null}},[l]),C=g.useCallback(()=>{if(!l||!k.current||h.length===0)return;const V=h.map(W=>({id:W.id,size:W.size,collapsed:W.collapsed||!1}));k.current.setItem(l,JSON.stringify({sizes:V}))},[l,h]),w=g.useCallback((V,W,P,L,H)=>{m(B=>B.some(F=>F.id===V)?B:[...B,{id:V,size:W,minSize:P??r,maxSize:L??a,collapsible:H??i,collapsed:!1}])},[r,a,i]),I=g.useCallback(V=>{m(W=>W.filter(P=>P.id!==V))},[]),M=g.useCallback(V=>{const W=h.find(P=>P.id===V);return W?W.size:0},[h]),R=g.useCallback((V,W)=>{m(P=>P.map(L=>L.id===V?{...L,size:W}:L))},[]),E=g.useCallback(V=>{const W=h.find(P=>P.id===V);return W?!!W.collapsed:!1},[h]),_=g.useCallback(V=>{m(W=>{const P=W.findIndex(F=>F.id===V);if(P===-1)return W;const L=W[P];if(!L.collapsible)return W;const H={...L,collapsed:!L.collapsed},B=[...W];return B[P]=H,B})},[]),T=g.useCallback((V,W)=>{f.current=V,b.current=W,y.current=h.map(P=>P.size),p(!0)},[h]),$=g.useCallback(V=>{if(!u||!f.current)return;const W=f.current,P=V-b.current;let L=-1;const H=W.match(/\d+$/);if(H&&(L=parseInt(H[0],10)-1),L===-1&&h.length>=2&&(L=0),L<0||L>=h.length-1)return;const B=h[L],F=h[L+1];if(B.collapsed||F.collapsed)return;let A=y.current[L]+P,O=y.current[L+1]-P;A=Math.max(B.minSize??r,Math.min(B.maxSize??a,A)),O=Math.max(F.minSize??r,Math.min(F.maxSize??a,O)),m(Y=>Y.map((X,U)=>U===L?{...X,size:A}:U===L+1?{...X,size:O}:X))},[u,h,e,r,a]),D=g.useCallback(()=>{u&&o&&o(h.map(V=>V.size)),f.current=null,p(!1),l&&C()},[u,h,o,l,C]),z=g.useCallback(V=>{if(!u||!f.current)return;const W=f.current;let P=-1;const L=W.match(/\d+$/);if(L&&(P=parseInt(L[0],10)-1),P===-1&&h.length>=2&&(P=0),P<0||P>=h.length-1)return;let H=0;e==="horizontal"?(V.key==="ArrowLeft"&&(H=-c),V.key==="ArrowRight"&&(H=c),V.key==="Home"&&(H=-100),V.key==="End"&&(H=100)):(V.key==="ArrowUp"&&(H=-c),V.key==="ArrowDown"&&(H=c),V.key==="Home"&&(H=-100),V.key==="End"&&(H=100)),H!==0&&(V.preventDefault(),$(b.current+H)),V.key==="Escape"&&(m(B=>B.map((F,A)=>({...F,size:y.current[A]}))),D())},[u,h,e,$,D,c]);return g.useEffect(()=>{const V=L=>{if(!u)return;const H=e==="horizontal"?L.clientX:L.clientY;$(H)},W=L=>{if(!u||L.touches.length===0)return;const H=L.touches[0],B=e==="horizontal"?H.clientX:H.clientY;$(B)},P=()=>{u&&D()};return u&&(document.addEventListener("mousemove",V),document.addEventListener("touchmove",W),document.addEventListener("mouseup",P),document.addEventListener("touchend",P),document.addEventListener("keydown",z),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("touchmove",W),document.removeEventListener("mouseup",P),document.removeEventListener("touchend",P),document.removeEventListener("keydown",z),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,$,D,z]),g.useEffect(()=>{if(h.length!==0){if(l){const V=S();if(V){m(W=>W.map(P=>{const L=V.find(H=>H.id===P.id);return L?{...P,size:L.size,collapsed:L.collapsed||!1}:P}));return}}if(!t){const W=j()/h.length;m(P=>P.map(L=>({...L,size:W})))}}},[h.length,t,j,l,S]),g.useEffect(()=>{if(!t||t.length===0||h.length===0)return;const V=j(),W=t.map(P=>typeof P=="string"&&P.endsWith("%")?parseFloat(P)/100*V:typeof P=="number"?P:parseFloat(P));m(P=>P.map((L,H)=>({...L,size:H<W.length?W[H]:L.size})))},[t,h.length,j]),g.useEffect(()=>{h.length>0&&l&&!u&&C()},[h,l,u,C]),{isResizing:u,setIsResizing:p,containerRef:x,panels:h,registerPanel:w,unregisterPanel:I,getPanelSize:M,setPanelSize:R,isPanelCollapsed:E,togglePanelCollapse:_,startResize:T,onResize:$,endResize:D}},Ef={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Vf=(e,t)=>({sm:{width:t==="horizontal"?"4px":"100%",height:t==="vertical"?"4px":"100%"},md:{width:t==="horizontal"?"6px":"100%",height:t==="vertical"?"6px":"100%"},lg:{width:t==="horizontal"?"8px":"100%",height:t==="vertical"?"8px":"100%"}})[e],Pf=e=>({default:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}},subtle:{backgroundColor:"transparent",_hover:{backgroundColor:"color-gray-100"},_active:{backgroundColor:"color-gray-200"}},prominent:{backgroundColor:"color-gray-100",_hover:{backgroundColor:"color-gray-200"},_active:{backgroundColor:"color-gray-300"}}}),Wf=Pf(),$t={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},fi=g.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),xi=()=>g.useContext(fi),_f=({value:e,children:t})=>n.jsx(fi.Provider,{value:e,children:t}),$f=({children:e,id:t,defaultSize:o,minSize:r,maxSize:a,collapsible:i,defaultCollapsed:l,onCollapseChange:d,views:c,...u})=>{const{orientation:p,registerPanel:h,unregisterPanel:m,getPanelSize:x,isPanelCollapsed:f,togglePanelCollapse:b}=xi(),y=typeof o=="string"&&o.endsWith("%")?0:typeof o=="number"?o:0;g.useEffect(()=>(h(t,y,r,a,i),()=>m(t)),[t,y,r,a,i,h,m]);const k=x(t),j=f(t);return g.useEffect(()=>{d&&j!==void 0&&d(j)},[j,d]),g.useEffect(()=>{i&&l&&!j&&b(t)},[t,i,l,j,b]),j?n.jsx(s.View,{flex:"0 0 auto",width:p==="horizontal"?"10px":"100%",height:p==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>b(t),"aria-label":`Expand panel ${t}`,role:"button",tabIndex:0,...c==null?void 0:c.collapsedPanel,...u}):n.jsx(s.View,{flex:k>0?"0 0 auto":"1",width:p==="horizontal"?`${k}px`:"100%",height:p==="vertical"?`${k}px`:"100%",overflow:"auto",...c==null?void 0:c.panel,...u,children:e})},Lf=({id:e,position:t="both",disabled:o=!1,withVisualIndicator:r=!0,withCollapseButton:a=!1,collapseTarget:i,views:l,...d})=>{const{orientation:c,size:u,variant:p,startResize:h,isPanelCollapsed:m,togglePanelCollapse:x}=xi(),b=(()=>{if(i)return i;const w=e.match(/\d+$/);if(!w)return"";const I=parseInt(w[0],10);return isNaN(I)?"":`panel${I}`})(),y=m(b),k=w=>{if(o)return;w.preventDefault();const I=c==="horizontal"?w.clientX:w.clientY;h(e,I)},j=w=>{if(o||w.touches.length===0)return;w.preventDefault();const I=w.touches[0],M=c==="horizontal"?I.clientX:I.clientY;h(e,M)},S=w=>{o||(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),h(e,0))},C=w=>{w.stopPropagation(),b&&x(b)};return n.jsxs(s.View,{role:"separator","aria-orientation":c,"aria-valuemin":0,"aria-valuemax":100,tabIndex:o?-1:0,cursor:c==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...Vf(u,c),...Wf[p],onMouseDown:k,onTouchStart:j,onKeyDown:S,opacity:o?.5:1,pointerEvents:o?"none":"auto",...l==null?void 0:l.handle,...d,children:[r&&n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",width:c==="horizontal"?"100%":"auto",height:c==="vertical"?"100%":"auto",pointerEvents:"none",...l==null?void 0:l.handleIcon,children:c==="horizontal"?n.jsxs(s.Horizontal,{gap:1,children:[n.jsx(s.View,{...$t.horizontal}),n.jsx(s.View,{...$t.horizontal})]}):n.jsxs(s.Vertical,{gap:1,children:[n.jsx(s.View,{...$t.vertical}),n.jsx(s.View,{...$t.vertical})]})}),a&&b&&n.jsx(s.View,{position:"absolute",top:c==="horizontal"?"-20px":"50%",left:c==="horizontal"?"50%":"-20px",transform:c==="horizontal"?"translateX(-50%)":"translateY(-50%)",width:"16px",height:"16px",borderRadius:"full",backgroundColor:"color-gray-100",border:"1px solid",borderColor:"color-gray-300",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:1,onClick:C,"aria-label":y?`Expand panel ${b}`:`Collapse panel ${b}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...l==null?void 0:l.collapseIcon,children:n.jsx(s.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:y?n.jsxs(s.Horizontal,{children:[n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),n.jsx(s.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):n.jsx(s.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},Df=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultSizes:a,minSize:i,maxSize:l,collapsible:d=!1,containerRef:c,autoSaveId:u,views:p,...h})=>{const m=t==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(m,{ref:c,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Ef[t],...p==null?void 0:p.container,...h,children:e})},Hf=({children:e,orientation:t="horizontal",size:o="md",variant:r="default",defaultSizes:a,onSizesChange:i,minSize:l=50,maxSize:d,collapsible:c=!1,autoSaveId:u,storage:p,keyboardResizeBy:h=10,views:m,...x})=>{const{isResizing:f,setIsResizing:b,containerRef:y,registerPanel:k,unregisterPanel:j,getPanelSize:S,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:R,endResize:E}=zf(t,a,i,l,d,c,u,p,h);return n.jsx(_f,{value:{orientation:t,size:o,variant:r,isResizing:f,setIsResizing:b,registerPanel:k,unregisterPanel:j,getPanelSize:S,setPanelSize:C,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:R,endResize:E},children:n.jsx(Df,{orientation:t,size:o,variant:r,defaultSizes:a,minSize:l,maxSize:d,collapsible:c,autoSaveId:u,keyboardResizeBy:h,containerRef:y,views:m,...x,children:e})})},mr=Hf;mr.Panel=$f;mr.Handle=Lf;const Lt={info:{container:{backgroundColor:"color-blue-50",border:"color-blue-300"},content:{color:"color-blue-700"},icon:{color:"color-blue-500"}},success:{container:{backgroundColor:"color-green-50",border:"color-green-300"},content:{color:"color-green-700"},icon:{color:"color-green-500"}},warning:{container:{backgroundColor:"color-orange-50",border:"color-orange-300"},content:{color:"color-orange-700"},icon:{color:"color-orange-500"}},error:{container:{backgroundColor:"color-red-50",border:"color-red-300"},content:{color:"color-red-700"},icon:{color:"color-red-500"}}},Bf={top:{top:"16px",left:"50%",transform:"translateX(-50%)"},"top-right":{top:"16px",right:"16px"},"top-left":{top:"16px",left:"16px"},bottom:{bottom:"16px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"}},Af=()=>Math.random().toString(36).substring(2,9);let Ge=new Map;const Rt=Bo.create(e=>({toasts:[],add:(t,o,r,a={})=>{const i=a.id||Af(),l={id:i,variant:t,title:o,description:r,createdAt:Date.now(),isVisible:!0,...a};if(e(d=>({toasts:[...d.toasts,l]})),a.duration!==0){const d=a.duration||5e3,c=setTimeout(()=>{Rt.getState().remove(i)},d);Ge.set(i,c)}return i},remove:t=>{e(o=>({toasts:o.toasts.map(r=>r.id===t?{...r,isVisible:!1}:r)})),Ge.has(t)&&(clearTimeout(Ge.get(t)),Ge.delete(t)),setTimeout(()=>{e(o=>({toasts:o.toasts.filter(r=>r.id!==t)}))},300)},removeAll:()=>{Ge.forEach(clearTimeout),Ge.clear(),e(t=>({toasts:t.toasts.map(o=>({...o,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Fe=(e,t,o,r)=>Rt.getState().add(e,t,o,r),bi=(e,t,o)=>Fe("info",e,t,o),yi=(e,t,o)=>Fe("success",e,t,o),ki=(e,t,o)=>Fe("warning",e,t,o),Ci=(e,t,o)=>Fe("error",e,t,o),ji=e=>{Rt.getState().remove(e)},Si=()=>{Rt.getState().removeAll()},wi=({variant:e,title:t,description:o,onClose:r,isClosable:a=!0,action:i,actionText:l,showIcon:d=!0,theme:c,views:u,render:p,icon:h,id:m,isVisible:x=!0,themeMode:f})=>{const b=c??Lt,y=()=>{var C,w;if(h!==void 0)return h;const S=e?(w=(C=Lt[e])==null?void 0:C.icon)==null?void 0:w.color:Lt.info.icon.color;switch(e){case"info":return n.jsx(ze,{widthHeight:20,color:S});case"success":return n.jsx(Fo,{widthHeight:20,color:S});case"warning":return n.jsx(ze,{widthHeight:20,color:S,orientation:"down"});case"error":return n.jsx(eo,{widthHeight:20,color:S});default:return n.jsx(ze,{widthHeight:20,color:Lt.info.icon.color})}};if(p)return n.jsx(n.Fragment,{children:p({id:m||"",onClose:r})});const k=e==="error"?"alert":"status",j=e==="error"||e==="warning"?"assertive":"polite";return n.jsxs(s.Horizontal,{role:k,"aria-live":j,"aria-atomic":"true","data-state":x?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:b[e].container.backgroundColor,borderColor:b[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:x?1:0,transform:x?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[d&&n.jsx(s.View,{marginTop:"2px",...u==null?void 0:u.icon,children:y()}),n.jsxs(s.Vertical,{gap:4,flex:"1",children:[n.jsx(s.Text,{size:"md",fontWeight:"600",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.title,children:t}),o&&n.jsx(s.Text,{size:"sm",color:b[e].content.color,fontWeight:"400",backgroundColor:b[e].container.backgroundColor,...u==null?void 0:u.description,children:o}),i&&l&&n.jsx(s.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:b[e].content.color,backgroundColor:b[e].container.backgroundColor,onClick:S=>{S.stopPropagation(),i()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:l})]}),a&&n.jsx(s.View,{as:"button","aria-label":"Close toast",backgroundColor:"transparent",border:"none",cursor:"pointer",padding:"4px",marginLeft:"8px",marginTop:"-4px",marginRight:"-8px",borderRadius:"4px",onClick:S=>{S.stopPropagation(),r()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:n.jsx(ye,{widthHeight:16,color:b[e].content.color})})]})},Ff=({position:e="top-right",gap:t=8,limit:o=5,containerStyle:r})=>{const{toasts:a,remove:i}=Rt(),d=g.useMemo(()=>{const c={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return a.forEach(u=>{const p=u.position||e;c[p].push(u)}),Object.keys(c).forEach(u=>{c[u]=c[u].slice(-o)}),c},[a,e,o])[e];return n.jsx(s.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${t}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...Bf[e],style:r,children:d.map(c=>n.jsx(s.View,{pointerEvents:"auto",animation:e.includes("right")?"slideInRight 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("left")?"slideInLeft 0.3s ease-out, fadeIn 0.3s ease-out":e.includes("top")?"slideInDown 0.3s ease-out, fadeIn 0.3s ease-out":"slideInUp 0.3s ease-out, fadeIn 0.3s ease-out",children:n.jsx(wi,{id:c.id,variant:c.variant,title:c.title,description:c.description,onClose:()=>i(c.id),isClosable:c.isClosable,action:c.action,actionText:c.actionText,showIcon:c.showIcon,views:c.views,render:c.render,icon:c.icon,isVisible:c.isVisible})},c.id))})},Of=()=>({toast:(e,t,o,r)=>Fe(e,t,o,r),info:(e,t,o)=>bi(e,t,o),success:(e,t,o)=>yi(e,t,o),warning:(e,t,o)=>ki(e,t,o),error:(e,t,o)=>Ci(e,t,o),remove:e=>ji(e),removeAll:()=>Si()}),vf=e=>n.jsx(wi,{...e}),Nf=Object.assign(vf,{Container:e=>n.jsx(Ff,{...e}),show:Fe,info:bi,success:yi,warning:ki,error:Ci,remove:ji,removeAll:Si}),Uf=Of,Yr=(e,t)=>{var l,d;if(!e)return!0;const o=e.toLowerCase(),r=t.name.toLowerCase().includes(o),a=((l=t.description)==null?void 0:l.toLowerCase().includes(o))||!1,i=((d=t.keywords)==null?void 0:d.some(c=>c.toLowerCase().includes(o)))||!1;return r||a||i},qf=({open:e,onOpenChange:t,groups:o=[],commands:r=[],filter:a})=>{const[i,l]=g.useState(""),[d,c]=g.useState(0),u=g.useRef(null),p=g.useMemo(()=>a||Yr,[a]),h=g.useMemo(()=>[...o.flatMap(y=>y.commands),...r],[o,r]),m=g.useMemo(()=>i.trim()?h.filter(b=>p(i,b)):h,[h,i,p]),x=g.useMemo(()=>{if(!i)return o;const b=a||Yr;return o.map(y=>({...y,commands:y.commands.filter(k=>b(i,k))})).filter(y=>y.commands.length)},[o,i,a]);g.useEffect(()=>{c(0)},[m.length]);const f=g.useCallback(b=>{if(e)switch(b.key){case"ArrowDown":b.preventDefault(),c(y=>y<m.length-1?y+1:y);break;case"ArrowUp":b.preventDefault(),c(y=>y>0?y-1:y);break;case"Enter":b.preventDefault(),m[d]&&(m[d].onSelect(),t(!1),l(""));break;case"Escape":b.preventDefault(),t(!1),l("");break}},[e,m,d,t]);return g.useEffect(()=>(document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}),[f]),g.useEffect(()=>{if(u.current&&e){const b=u.current.querySelector(`[data-index="${d}"]`);b&&b.scrollIntoView({block:"nearest"})}},[d,e]),g.useEffect(()=>{e?c(0):l("")},[e]),{search:i,setSearch:l,selectedIndex:d,setSelectedIndex:c,filteredCommands:m,filteredGroups:x,listRef:u}},Gf={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},Yf=e=>({default:{backgroundColor:"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},filled:{backgroundColor:"color-gray-50",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"},outline:{backgroundColor:"color-white",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)"}}),Xf=Yf(),Kf={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},Qf={overflow:"auto",padding:"8px 0"},Jf={marginBottom:"8px"},Zf={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},e0={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},t0={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},o0={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},r0={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},n0={display:"flex",flexDirection:"column",flex:1},a0={fontSize:"14px",fontWeight:"medium"},i0={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},l0={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},c0={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},s0={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},d0=g.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),u0=({value:e,children:t})=>n.jsx(d0.Provider,{value:e,children:t}),Ii=({value:e,onValueChange:t,placeholder:o="Type a command or search...",views:r,...a})=>{const i=g.useRef(null);return g.useEffect(()=>{i.current&&i.current.focus()},[]),n.jsxs(s.View,{...Kf,...r==null?void 0:r.container,...a,children:[n.jsx(vt,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),n.jsx(s.View,{as:"input",type:"text",value:e,onChange:l=>t(l.target.value),placeholder:o,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:i,...r==null?void 0:r.input})]})},p0=({children:e,views:t,...o})=>n.jsx(s.View,{...Qf,...t==null?void 0:t.container,...o,children:e}),Ti=({heading:e,children:t,views:o,...r})=>n.jsxs(s.View,{...Jf,...o==null?void 0:o.container,...r,children:[n.jsx(s.Text,{...Zf,...o==null?void 0:o.heading,children:e}),t]}),Ho=({item:e,selected:t=!1,onSelect:o,views:r,...a})=>{const i=()=>{!e.disabled&&o&&o()};return n.jsxs(s.Horizontal,{...e0,...t?t0:{},...e.disabled?o0:{},onClick:i,...r==null?void 0:r.container,...a,children:[e.icon&&n.jsx(s.View,{...r0,...r==null?void 0:r.icon,children:e.icon}),n.jsxs(s.Vertical,{...n0,...r==null?void 0:r.content,children:[n.jsx(s.Text,{...a0,...r==null?void 0:r.name,children:e.name}),e.description&&n.jsx(s.Text,{...i0,...r==null?void 0:r.description,children:e.description})]}),e.shortcut&&n.jsx(s.Text,{...l0,...r==null?void 0:r.shortcut,children:e.shortcut})]})},Mi=({children:e="No results found.",views:t,...o})=>n.jsx(s.View,{...c0,...t==null?void 0:t.container,...o,children:e}),g0=({open:e,onOpenChange:t,groups:o=[],commands:r=[],placeholder:a,size:i="md",variant:l="default",emptyState:d,footer:c,search:u,setSearch:p,selectedIndex:h,setSelectedIndex:m,filteredCommands:x,filteredGroups:f,listRef:b,views:y,filter:k,...j})=>{if(!e)return null;const S=g.useCallback(R=>{R.disabled||(R.onSelect(),t(!1),p(""))},[t,p]),C=g.useCallback(R=>R.target===R.currentTarget&&t(!1),[t]),w=g.useMemo(()=>({search:u,setSearch:p,selectedIndex:h,setSelectedIndex:m,filteredCommands:x,onSelect:S}),[u,h,x,S,p,m]),I=o.length>0,M=x.length===0;return n.jsx(s.View,{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:9999,onClick:C,...j,children:n.jsx(u0,{value:w,children:n.jsxs(s.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...Gf[i],...Xf[l],...y==null?void 0:y.container,onClick:R=>R.stopPropagation(),children:[n.jsx(Ii,{value:u,onValueChange:p,placeholder:a,views:y==null?void 0:y.searchInput}),n.jsx(s.View,{ref:b,flex:1,overflow:"auto",...y==null?void 0:y.list,children:M?d||n.jsx(Mi,{views:y==null?void 0:y.empty}):I?f.map(R=>n.jsx(Ti,{heading:R.name,views:y==null?void 0:y.groupHeading,children:R.commands.map(E=>{const _=x.findIndex(T=>T.id===E.id);return n.jsx(Ho,{item:E,selected:_===h,onSelect:()=>S(E),"data-index":_,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},E.id)})},R.id)):x.map((R,E)=>n.jsx(Ho,{item:R,selected:E===h,onSelect:()=>S(R),"data-index":E,views:{container:y==null?void 0:y.item,icon:y==null?void 0:y.icon,content:y==null?void 0:y.content,name:y==null?void 0:y.name,description:y==null?void 0:y.description,shortcut:y==null?void 0:y.shortcut}},R.id))}),c&&n.jsx(s.View,{...s0,...y==null?void 0:y.footer,children:c})]})})})},h0=({open:e,onOpenChange:t,groups:o=[],commands:r=[],placeholder:a,size:i="md",variant:l="default",filter:d,emptyState:c,footer:u,views:p,...h})=>{const{search:m,setSearch:x,selectedIndex:f,setSelectedIndex:b,filteredCommands:y,filteredGroups:k,listRef:j}=qf({open:e,onOpenChange:t,groups:o,commands:r,filter:d});return n.jsx(g0,{open:e,onOpenChange:t,groups:o,commands:r,placeholder:a,size:i,variant:l,emptyState:c,footer:u,search:m,setSearch:x,selectedIndex:f,setSelectedIndex:b,filteredCommands:y,filteredGroups:k,listRef:j,views:p,...h})},it=h0;it.Input=Ii;it.List=p0;it.Group=Ti;it.Item=Ho;it.Empty=Mi;const Xr=()=>Math.random().toString(36).substring(2,11),m0=({defaultOpen:e=!1,openDelay:t=200,closeDelay:o=200,isDisabled:r=!1}={})=>{const[a,i]=g.useState(e),l=g.useRef(null),d=g.useRef(null),c=g.useRef(null),u=g.useRef(null),p=g.useRef(`tooltip-trigger-${Xr()}`).current,h=g.useRef(`tooltip-content-${Xr()}`).current,m=g.useCallback(()=>{r||(u.current&&(clearTimeout(u.current),u.current=null),!a&&!c.current&&(c.current=setTimeout(()=>{i(!0),c.current=null},t)))},[a,t,r]),x=g.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),a&&!u.current&&(u.current=setTimeout(()=>{i(!1),u.current=null},o))},[a,o]),f=g.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return g.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),g.useEffect(()=>{const b=y=>{y.key==="Escape"&&a&&i(!1)};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[a]),{isOpen:a,openTooltip:m,closeTooltip:x,cancelCloseTimer:f,triggerRef:l,contentRef:d,triggerId:p,contentId:h}},f0={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},x0=e=>({default:{backgroundColor:"color-gray-900",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",transition:"opacity 0.15s ease"},light:{backgroundColor:"color-white",color:"color-gray-800",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.04)",transition:"opacity 0.15s ease"},dark:{backgroundColor:"color-gray-950",color:"color-white",borderRadius:"6px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.2), 0px 2px 4px rgba(0, 0, 0, 0.12)",transition:"opacity 0.15s ease"}}),b0=x0(),y0=e=>{const t={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...t,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...t,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...t,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...t,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return t}},Ri=g.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),fr=()=>g.useContext(Ri),k0=({value:e,children:t})=>n.jsx(Ri.Provider,{value:e,children:t}),zi=({children:e,views:t,asChild:o=!1,...r})=>{const{openTooltip:a,closeTooltip:i,triggerRef:l,contentId:d,triggerId:c}=fr(),x={ref:l,onMouseEnter:()=>a(),onMouseLeave:()=>i(),onFocus:()=>a(),onBlur:()=>i(),id:c,"aria-describedby":d,...t==null?void 0:t.container,...r};return o&&g.isValidElement(e)?g.cloneElement(e,x):n.jsx(s.View,{display:"inline-block",...x,children:e})},C0=({children:e,views:t,...o})=>{const{isOpen:r,contentRef:a,contentId:i,triggerId:l}=fr();return r?n.jsx(s.View,{ref:a,id:i,role:"tooltip","aria-labelledby":l,...t==null?void 0:t.container,...o,children:e}):null},j0=({content:e,children:t,position:o="top",align:r="center",size:a="md",variant:i="default",showArrow:l=!0,views:d,themeMode:c,...u})=>{const{isOpen:p,triggerRef:h,contentRef:m,contentId:x,triggerId:f}=fr(),{ref:b,relation:y}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,j]=g.useState({x:0,y:0,placement:o});g.useEffect(()=>{h!=null&&h.current&&b&&(b.current=h.current)},[h,b,p]),g.useEffect(()=>{if(p&&(m!=null&&m.current)&&(h!=null&&h.current)){const I=h.current.getBoundingClientRect();let M=o;y&&(o==="top"&&y.space.vertical==="bottom"?M="bottom":o==="bottom"&&y.space.vertical==="top"?M="top":o==="right"&&y.space.horizontal==="left"?M="left":o==="left"&&y.space.horizontal==="right"&&(M="right"));let R=0,E=0;switch(M){case"top":R=r==="start"?I.left:r==="end"?I.right-120:I.left+I.width/2-60,E=I.top-8;break;case"bottom":R=r==="start"?I.left:r==="end"?I.right-120:I.left+I.width/2-60,E=I.bottom+8;break;case"right":R=I.right+8,E=r==="start"?I.top:r==="end"?I.bottom-32:I.top+I.height/2-16;break;case"left":R=I.left-8,E=r==="start"?I.top:r==="end"?I.bottom-32:I.top+I.height/2-16;break}j({x:R,y:E,placement:M})}},[p,o,r,h,m,y]);const S=l?y0(k.placement):{},w=(()=>{const I={position:"fixed",left:k.x,top:k.y,zIndex:1e3};switch(k.placement){case"top":return{...I,transform:"translateY(-100%)"};case"left":return{...I,transform:"translateX(-100%)"};case"bottom":case"right":default:return I}})();return n.jsxs(s.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...u,children:[n.jsx(zi,{children:t}),p&&n.jsxs(s.View,{ref:m,id:x,role:"tooltip","aria-labelledby":f,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:w,...f0[a],...b0[i],...d==null?void 0:d.content,children:[typeof e=="string"?n.jsx(s.Text,{...d==null?void 0:d.text,children:e}):e,l&&n.jsx(s.View,{...S,...d==null?void 0:d.arrow})]})]})},S0=({content:e,children:t,position:o="top",align:r="center",size:a="md",variant:i="default",openDelay:l=200,closeDelay:d=200,showArrow:c=!0,defaultOpen:u=!1,isDisabled:p=!1,views:h,...m})=>{const x=m0({defaultOpen:u,openDelay:l,closeDelay:d,isDisabled:p});return n.jsx(k0,{value:x,children:n.jsx(j0,{content:e,position:o,align:r,size:a,variant:i,showArrow:c,views:h,...m,children:t})})},xr=S0;xr.Trigger=zi;xr.Content=C0;const Ei=g.forwardRef((e,t)=>{const o=ya(e);return n.jsx(Sa,{...e,...o})});Ei.displayName="ChatInput";const w0={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},Kr={container:{position:"relative",display:"flex",flexDirection:"column",height:"100vh",alignItems:"center",justifyContent:"center"},gradient:{position:"absolute",inset:"-10px",opacity:.5,pointerEvents:"none",filter:"blur(10px)",backgroundSize:"300% 200%",backgroundPosition:"50% 50%, 50% 50%"}},Io={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},image:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"scroll"},content:{position:"relative",width:"100%",height:"100%",zIndex:2}},To={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},video:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"},content:{position:"relative",zIndex:2}},Qr={"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-top-right":"to top right","to-top-left":"to top left","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left"},Dt={center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-right":"top right","top-left":"top left","bottom-right":"bottom right","bottom-left":"bottom left"},I0={linear:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],radial:[{color:"color-blue-500",position:"0%"},{color:"color-purple-500",position:"100%"}],conic:[{color:"color-red-500",position:"0deg"},{color:"color-yellow-500",position:"90deg"},{color:"color-green-500",position:"180deg"},{color:"color-blue-500",position:"270deg"},{color:"color-red-500",position:"360deg"}]},T0=(e,t,o,r,a)=>{const i=t.map(l=>`${l.color} ${l.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${o&&Qr[o]?Qr[o]:o||"to right"}, ${i})`;case"radial":const d=a&&Dt[a]?Dt[a]:a||"center";return`radial-gradient(${r||"circle"} at ${d}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&Dt[a]?Dt[a]:a||"center"}, ${i})`;default:return`linear-gradient(to right, ${i})`}},M0={linear:{backgroundSize:"200% 200%",transition:"background-position 3s ease-in-out",animate:{from:{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},to:{backgroundPosition:"0% 50%"}}},radial:{backgroundSize:"100% 100%",transition:"all 3s ease-in-out",animate:{from:{backgroundPosition:"center",backgroundSize:"100% 100%"},"50%":{backgroundSize:"120% 120%"},to:{backgroundPosition:"center",backgroundSize:"100% 100%"}}},conic:{transition:"transform 3s linear",animate:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}},Jr={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},R0=({type:e="linear",direction:t="to-right",shape:o="circle",position:r="center",from:a,to:i,colors:l,animate:d=!1,animationDuration:c=3,children:u,views:p,themeMode:h,...m})=>{const x=g.useMemo(()=>l&&l.length>0?l:a&&i?[{color:a,position:"0%"},{color:i,position:"100%"}]:I0[e],[l,a,i,e]),f=g.useMemo(()=>{const y=x.map(k=>({...k,color:k.color}));return T0(e,y,t,o,r)},[e,x,t,o,r]),b=g.useMemo(()=>{if(!d)return{};const y=M0[e];return{...y,transition:y.transition.replace("3s",`${c}s`),animationDuration:`${c}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,c,e]);return n.jsx(s.View,{background:f,...Jr.container,...b,...p==null?void 0:p.container,...m,children:u&&n.jsx(s.View,{...Jr.content,...p==null?void 0:p.content,children:u})})},z0=e=>n.jsx(R0,{...e}),E0=g.createContext({}),V0=({children:e,showRadialGradient:t=!0,views:o,themeMode:r,...a})=>{const i={white:"rgba(255,255,255,1)",transparent:"rgba(255,255,255,0)"},l=["rgb(59, 130, 246)","rgb(196, 181, 253)","rgb(147, 197, 253)","rgb(221, 214, 254)","rgb(96, 165, 250)"],d={...Kr.gradient,backgroundImage:`
56
56
  repeating-linear-gradient(100deg, ${l.join(", ")}),
57
57
  repeating-linear-gradient(100deg, ${i.white} 0%, ${i.white} 7%, ${i.transparent} 10%, ${i.transparent} 12%, ${i.white} 16%)
58
- `,animation:"aurora 4s ease infinite",...t?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return n.jsxs(s.View,{...Xr.container,...o==null?void 0:o.container,...a,children:[n.jsx(s.View,{style:d}),e,n.jsx("style",{children:`
58
+ `,animation:"aurora 4s ease infinite",...t?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return n.jsxs(s.View,{...Kr.container,...o==null?void 0:o.container,...a,children:[n.jsx(s.View,{style:d}),e,n.jsx("style",{children:`
59
59
  @keyframes aurora {
60
60
  0% { background-position: 0% 50%; }
61
61
  50% { background-position: 100% 50%; }
62
62
  100% { background-position: 0% 50%; }
63
63
  }
64
- `})]})},L0=({number:e=20,children:t,...o})=>{const r=Array.from({length:e},(a,i)=>i);return n.jsxs(s.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...o,children:[r.map(a=>{const i=a*37%200-100+"px",l=.2+a*13%6*.1+"s",d=(1+a*7%9)/2+"s",c=300+a*17%100+"px";return n.jsx(s.View,{position:"absolute",top:"0px",left:i,width:"2px",height:"2px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)",transform:"rotate(215deg)",zIndex:0,animate:{from:{transform:"translateX(-100%) translateY(-100%)"},to:{transform:`translateX(${c}) translateY(${c})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:l},children:n.jsx(s.View,{position:"absolute",top:"-1px",left:"-1px",width:"1px",height:"1px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 10px 0 1px rgba(255, 255, 255, 0.1)"})},a)}),t&&n.jsx(s.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:t})]})},Jr=["rgb(186, 230, 253)","rgb(249, 168, 212)","rgb(134, 239, 172)","rgb(253, 224, 71)","rgb(252, 165, 165)","rgb(216, 180, 254)","rgb(147, 197, 253)","rgb(165, 180, 252)","rgb(196, 181, 253)"],D0=()=>Jr[Math.floor(Math.random()*Jr.length)],H0=({rows:e=15,cols:t=10,squareSize:o=40,...r})=>{const a=Array(e).fill(1),i=Array(t).fill(1);return n.jsx(s.View,{padding:16,width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-50",zIndex:0,transform:"skewX(-48deg) skewY(14deg) scale(0.675) rotate(0deg) translateZ(0)",...r,children:a.map((l,d)=>n.jsx(s.Horizontal,{gap:0,children:i.map((c,u)=>n.jsx(s.View,{height:o/3,width:o,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:D0(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${d}`))})},B0=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],A0=({count:e=50,colors:t=B0,speed:o="medium",shapes:r=["circle"],...a})=>{const i=Array.from({length:e},(u,p)=>p),l=()=>{switch(o){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>r[Math.floor(Math.random()*r.length)],c=()=>t[Math.floor(Math.random()*t.length)];return n.jsx(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:i.map(u=>{const p=Math.random()*8+4,m=Math.random()*400,h=Math.random()*300,x=Math.random()*400,f=Math.random()*300,b=(Math.random()*10+5)/l(),y=Math.random()*5,k=d(),j=c(),S={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return n.jsx(s.View,{position:"absolute",width:p,height:p,backgroundColor:j,opacity:.7,style:{left:m,top:h,...S[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${x-m}px, ${f-h}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${b}s`,delay:`${y}s`}},u)})})},F0=({gridSize:e=30,lineColor:t="rgba(59, 130, 246, 0.3)",pulseColor:o="rgba(59, 130, 246, 0.8)",animationSpeed:r="medium",...a})=>{const i=()=>{switch(r){case"slow":return 4;case"fast":return 1;default:return 2}},l=Math.floor(400/e),d=Math.floor(300/e),c=l*d,u=Array.from({length:c},(p,m)=>m);return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:[Array.from({length:l+1},(p,m)=>n.jsx(s.View,{position:"absolute",left:m*e,top:0,width:1,height:"100%",backgroundColor:t},`v-line-${m}`)),Array.from({length:d+1},(p,m)=>n.jsx(s.View,{position:"absolute",left:0,top:m*e,width:"100%",height:1,backgroundColor:t},`h-line-${m}`)),u.map(p=>{const m=p%l,h=Math.floor(p/l),x=(m+h)*.1;return n.jsx(s.View,{position:"absolute",left:m*e+1,top:h*e+1,width:e-2,height:e-2,backgroundColor:"transparent",animate:{from:{backgroundColor:"transparent"},to:{backgroundColor:o},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${i()}s`,delay:`${x}s`}},p)})]})},O0=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],v0=({rippleCount:e=5,colors:t=O0,maxSize:o=200,frequency:r=3,...a})=>{const i=Array.from({length:e},(l,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:t[d%t.length],delay:d*(r/e),duration:3+Math.random()*2}));return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...a,children:[i.map(l=>n.jsx(s.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:l.x-10,top:l.y-10,border:`2px solid ${l.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${o/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration}s`,delay:`${l.delay}s`}},l.id)),i.map(l=>n.jsx(s.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:l.x-5,top:l.y-5,backgroundColor:l.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${o/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration*1.2}s`,delay:`${l.delay+.5}s`}},`secondary-${l.id}`))]})},N0=({children:e,src:t,backgroundSize:o="cover",backgroundPosition:r="center",backgroundRepeat:a="no-repeat",backgroundAttachment:i="scroll",imageOpacity:l=1,overlay:d=null,blendMode:c="normal",views:u,themeMode:p,...m})=>{const h={...Io.image,backgroundImage:`url(${t})`,backgroundSize:o,backgroundPosition:r,backgroundRepeat:a,backgroundAttachment:i,opacity:l};return n.jsxs(s.View,{...Io.container,...u==null?void 0:u.container,...m,children:[n.jsx(s.View,{style:h,...u==null?void 0:u.image}),d,e&&n.jsx(s.View,{...Io.content,...u==null?void 0:u.content,children:e})]})},U0=({children:e,src:t,autoPlay:o=!0,loop:r=!0,muted:a=!0,playsInline:i=!0,overlay:l=null,blendMode:d="normal",views:c,themeMode:u,...p})=>n.jsxs(s.View,{...To.container,...c==null?void 0:c.container,...p,children:[n.jsx(s.View,{as:"video",src:t,autoPlay:o,loop:r,muted:a,playsInline:i,style:To.video,...c==null?void 0:c.video}),l,e&&n.jsx(s.View,{...To.content,...c==null?void 0:c.content,children:e})]}),q0=({children:e,...t})=>n.jsx(_0,{...t,children:e}),G0=({contentPosition:e,backgroundColor:t="color-black-900",...o})=>{const a=(()=>{let i=`${t}-100`,l=`${t}-900`,d=`${t}-600`,c=`${t}-400`;switch(t.indexOf("-")===-1&&(i=`color-mix(in srgb, ${t} 10%, transparent)`,l=`color-mix(in srgb, ${t} 90%, transparent)`,d=`color-mix(in srgb, ${t} 70%, transparent)`,c=`color-mix(in srgb, ${t} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${i} 0%, ${i} 100%), linear-gradient(to right, ${l} 0%, ${d} 65%, ${i} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${i} 0%, ${i} 100%), linear-gradient(to left, ${l} 0%, ${d} 65%, ${i} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${i} 0%, ${i} 100%), linear-gradient(to bottom, ${l} 0%, ${d} 60%, ${i} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${i} 0%, ${i} 100%), linear-gradient(to top, ${l} 0%, ${d} 60%, ${i} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${l} 0%, ${i} 100%)`;default:return c}})();return n.jsx(s.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:a,pointerEvents:"none",zIndex:1,...o})},Y0=({children:e,views:t,...o})=>n.jsx(W0.Provider,{value:{},children:n.jsx(s.View,{...R0.container,...t==null?void 0:t.container,...o,children:e})}),Ei=g.forwardRef(({children:e,designProps:t,shape:o="rounded",decorationRotation:r=5,decorationScale:a=1,decorationOpacity:i=.8,views:l,...d},c)=>{const p=(y=>{switch(y){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(o),m=Math.abs(r)*(Math.PI/180),h=Math.sin(m)*100,x=(a-1)*100/2,f=Math.ceil(h+x),b=d.backgroundColor??"theme-primary";return n.jsx(s.View,{...d,ref:c,backgroundColor:"transparent",position:"relative",overflow:"visible",...l==null?void 0:l.container,children:n.jsxs(s.View,{padding:d.padding??`${96+f}px ${f}px`,position:"relative",overflow:"visible",children:[n.jsx(s.View,{position:"absolute",top:f,left:f,right:f,bottom:f,backgroundColor:b,borderRadius:p,opacity:i/1.5,transform:`scale(${a})`,pointerEvents:"none",zIndex:1,...l==null?void 0:l.back}),n.jsx(s.View,{position:"absolute",top:f,left:f,right:f,bottom:f,transform:`rotate(${r}deg) scale(${a})`,opacity:i/1.2,backgroundColor:b,borderRadius:p,pointerEvents:"none",zIndex:2,...l==null?void 0:l.front}),n.jsx(s.View,{margin:"0 auto",position:"relative",zIndex:3,...l==null?void 0:l.content,children:e})]})})});Ei.displayName="Background.Layout";const le=Y0;le.Aurora=$0;le.Meteors=L0;le.Wall=H0;le.Particles=A0;le.Grid=F0;le.Ripples=v0;le.Image=N0;le.Video=U0;le.Gradient=q0;le.Overlay=G0;le.Layout=Ei;const Vi=g.forwardRef((e,t)=>n.jsx(le,{...e,ref:t}));Vi.displayName="Background";const Pi=Object.assign(Vi,{Layout:le.Layout,Aurora:le.Aurora,Meteors:le.Meteors,Wall:le.Wall,Particles:le.Particles,Grid:le.Grid,Ripples:le.Ripples,Image:le.Image,Video:le.Video,Gradient:le.Gradient,Overlay:le.Overlay});Pi.displayName="Background";function X0(e){const{inputValue:t,onInputChange:o,onSubmit:r,messages:a=[]}=e,[i,l]=g.useState(""),d=g.useRef(null),c=g.useRef(null),u=t!==void 0,p=t!==void 0?t:i,m=g.useCallback(x=>{u?o==null||o(x):l(x)},[u,o]),h=g.useCallback(x=>{x&&x.preventDefault();const f=p.trim();f&&r&&(r(f),u||l(""),d.current&&(d.current.style.height="auto"))},[p,r,u]);return g.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[a.length]),{internalInputValue:p,handleInputChange:m,handleSubmit:h,inputRef:d,messagesRef:c}}const K0={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},Q0={default:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"16px"},glassy:{backgroundColor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(12px)",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},minimal:{backgroundColor:"transparent",border:"none"}},J0={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},Z0={backgroundColor:"rgba(37, 99, 235, 0.9)",color:"#ffffff",alignSelf:"flex-end",borderBottomRightRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},ex={backgroundColor:"rgba(244, 244, 245, 0.6)",color:"#18181b",alignSelf:"flex-start",borderBottomLeftRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},tx={position:"relative",backgroundColor:"rgba(244, 244, 245, 0.05)",backdropFilter:"blur(12px)",borderRadius:"16px",border:"1px solid rgba(0, 0, 0, 0.1)",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"8px 12px",display:"flex",alignItems:"flex-end",gap:"8px",transition:"all 0.2s ease"},we={container:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden"},messagesContainer:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px",padding:"16px"},inputContainer:tx,bubble:{maxWidth:"80%",position:"relative",wordWrap:"break-word",animation:"chatBubbleAppear 0.3s ease-out"},timestamp:{position:"absolute",top:"-24px",fontSize:"12px",color:"rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(255, 255, 255, 0.9)",padding:"2px 8px",borderRadius:"9999px",opacity:0,transition:"opacity 0.15s ease-out",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},input:{flex:1,border:"none",outline:"none",backgroundColor:"transparent",resize:"none",fontFamily:"inherit",fontSize:"14px",minHeight:"24px",maxHeight:"120px"},sendButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},attachmentButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",transition:"background-color 0.2s ease",flexShrink:0}},ox=({messages:e=[],inputPlaceholder:t="Type a message...",disableInput:o=!1,variant:r="default",size:a="md",showTimestamps:i=!0,enableAttachments:l=!1,enableContextPicker:d=!1,selectedContextElements:c=[],onContextPickerClick:u,onRemoveContextElement:p,isLoading:m=!1,loadingText:h="Loading...",styles:x={},maxHeight:f="600px",internalInputValue:b,handleInputChange:y,handleSubmit:k,inputRef:j,messagesRef:S,...C})=>{var z;const w={...we.container,...Q0[r],...x.container},I={...we.messagesContainer,maxHeight:f,...x.messagesContainer},M={...we.inputContainer,...x.inputContainer},R={...we.input,...K0[a],...x.input},E=g.useCallback(V=>{y(V.target.value),V.target.style.height="auto",V.target.style.height=`${V.target.scrollHeight}px`},[y]),W=g.useCallback(V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),k())},[k]),T=b.trim().length>0,{onSubmit:$,...D}=C;return n.jsxs(s.View,{...w,...D,children:[n.jsxs(s.View,{ref:S,...I,children:[e.length===0?n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:n.jsx(s.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(V=>n.jsx(rx,{message:V,size:a,showTimestamp:i,styles:{bubble:x.bubble,userBubble:x.userBubble,assistantBubble:x.assistantBubble,timestamp:x.timestamp,reasoningContainer:x.reasoningContainer,reasoningContent:x.reasoningContent,errorMessage:x.errorMessage,systemMessage:x.systemMessage,toolMessage:x.toolMessage}},V.id)),m&&n.jsxs(s.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...x.loadingIndicator,children:[n.jsx(Uo,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",fontSize:"14px",children:h})]})]}),n.jsxs(s.View,{children:[c.length>0&&n.jsx(s.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...x.contextChipsContainer,children:c.map(V=>n.jsxs(s.Horizontal,{backgroundColor:"rgba(37, 99, 235, 0.1)",border:"1px solid rgba(37, 99, 235, 0.2)",borderRadius:"6px",padding:"4px 8px",alignItems:"center",gap:6,children:[n.jsx(s.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:V.name}),n.jsx(s.View,{as:"button",type:"button",onClick:()=>p==null?void 0:p(V.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:n.jsx(xe,{widthHeight:12,color:"color-blue-700"})})]},V.id))}),n.jsxs(s.View,{as:"form",onSubmit:k,...M,children:[l&&n.jsx(s.View,{as:"button",type:"button",...we.attachmentButton,...x.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:n.jsx(bt,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"textarea",ref:j,value:b,onChange:E,onKeyDown:W,placeholder:t,disabled:o||m,...R,style:{...R,opacity:o||m?.5:1}}),n.jsxs(s.Vertical,{gap:4,alignItems:"center",children:[d&&n.jsx(s.View,{as:"button",type:"button",onClick:u,...we.attachmentButton,...x.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(z=x.contextPickerButton)==null?void 0:z._hover},title:"Select element from page",children:n.jsx(cn,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"button",type:"submit",disabled:!T||o||m,...we.sendButton,backgroundColor:T?"theme-primary":"color-gray-300",_hover:{backgroundColor:T?"color-blue-600":"color-gray-300"},...x.sendButton,style:{cursor:T?"pointer":"not-allowed",opacity:!T||o||m?.6:1},children:n.jsx(No,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},rx=({message:e,size:t,showTimestamp:o,styles:r})=>{const[a,i]=g.useState(!1),[l,d]=g.useState(!1),c=e.role==="user",u=e.messageType==="system",p=e.messageType==="error",m=e.messageType==="tool";if(u)return n.jsx(s.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...r.systemMessage,children:n.jsxs(s.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[n.jsx(Re,{widthHeight:12,color:"color-gray-600"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(m)return n.jsx(s.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...r.toolMessage,children:n.jsxs(s.Horizontal,{gap:8,alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",padding:"8px",borderRadius:"8px",width:"100%",border:"1px solid rgba(0,0,0,0.05)",children:[n.jsx(rn,{widthHeight:14,color:"color-gray-600"}),n.jsxs(s.Vertical,{gap:2,children:[n.jsx(s.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const h={...we.bubble,...J0[t],...c?Z0:ex,...p?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...r.bubble,...c?r.userBubble:r.assistantBubble,...p?r.errorMessage:{}},x={...we.timestamp,[c?"right":"left"]:"8px",opacity:a?1:0,...r.timestamp};return n.jsx(s.View,{position:"relative",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),display:"flex",justifyContent:c?"flex-end":"flex-start",children:n.jsxs(s.View,{...h,children:[o&&n.jsx(s.View,{...x,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p&&n.jsxs(s.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[n.jsx(ro,{widthHeight:14,color:"#b91c1c"}),n.jsx(s.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&n.jsxs(s.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...r.reasoningContainer,children:[n.jsxs(s.Horizontal,{as:"button",onClick:()=>d(!l),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[n.jsx(s.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),n.jsx(ie,{orientation:l?"down":"right",widthHeight:10,color:"color-gray-500"})]}),l&&n.jsx(s.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...r.reasoningContent,children:n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),n.jsx(s.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&n.jsx(s.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(f=>n.jsxs(s.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[n.jsx(bt,{widthHeight:14}),n.jsx(s.Text,{children:f.name})]},f.id))}),e.contextElements&&e.contextElements.length>0&&n.jsxs(s.Vertical,{gap:4,marginTop:"8px",children:[n.jsx(s.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(f=>n.jsx(s.Horizontal,{gap:6,padding:"4px 8px",backgroundColor:"rgba(37, 99, 235, 0.1)",borderRadius:"6px",fontSize:"11px",border:"1px solid rgba(37, 99, 235, 0.2)",children:n.jsx(s.Text,{color:"color-blue-700",fontWeight:"500",children:f.name})},f.id))]})]})})},br=e=>{const t=X0(e);return n.jsx(ox,{...e,...t})};br.displayName="ChatWidget";const _i=br;function nx({onSelect:e,onCancel:t,active:o}){const[r,a]=g.useState(null);g.useRef(null);const i=g.useCallback(c=>{var x;if(!o)return;const u=document.elementFromPoint(c.clientX,c.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){a(null);return}const p=u.getBoundingClientRect();let m=u.tagName.toLowerCase();if(u.id)m+=`#${u.id}`;else if(u.className&&typeof u.className=="string"){const f=u.className.split(" ")[0];f&&(m+=`.${f}`)}const h=(x=u.innerText)==null?void 0:x.slice(0,20);h&&(m+=` ("${h}...")`),a({id:u.id||`el-${Date.now()}`,name:m,tagName:u.tagName.toLowerCase(),rect:p})},[o]),l=g.useCallback(c=>{!o||c.target.closest('[data-chatwidget-ignore="true"]')||(c.preventDefault(),c.stopPropagation(),r&&e(r))},[o,r,e]),d=g.useCallback(c=>{o&&c.key==="Escape"&&t()},[o,t]);return g.useEffect(()=>(o?(document.addEventListener("mousemove",i),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(a(null),document.removeEventListener("mousemove",i),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[o,i,l,d]),{highlightedElement:r}}function ax({element:e}){return e?n.jsx("div",{id:"chatwidget-overlay",style:{position:"fixed",top:e.rect.top,left:e.rect.left,width:e.rect.width,height:e.rect.height,border:"2px solid #2563eb",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",zIndex:99999,transition:"all 0.1s ease-out",borderRadius:"4px"},children:n.jsx("div",{style:{position:"absolute",top:"-24px",left:"0",backgroundColor:"#2563eb",color:"white",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:"bold",whiteSpace:"nowrap"},children:e.name})}):null}const ix=({initialMessages:e=[],onSendMessage:t,bubbleSize:o="md"})=>{const[r,a]=g.useState(!1),[i,l]=g.useState(!1),[d,c]=g.useState(e),[u,p]=g.useState([]),{highlightedElement:m}=nx({active:i,onSelect:y=>{p(k=>[...k,y]),l(!1),a(!0)},onCancel:()=>{l(!1),a(!0)}}),h=()=>a(!r),x=()=>{l(!0),a(!1)},f=y=>{p(k=>k.filter(j=>j.id!==y))},b=y=>{const k={id:Date.now().toString(),role:"user",content:y,timestamp:new Date,contextElements:[...u]};c(j=>[...j,k]),t==null||t(y,u),p([]),setTimeout(()=>{var w;const j=Math.random()>.7,S=Math.random()>.4,C={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:j?"I will highlight the selected element.":`I received your message regarding: ${((w=k.contextElements)==null?void 0:w.map(I=>I.name).join(", "))||"general context"}. How can I assist you further?`,messageType:j?"tool":"text",reasoning:S?"Analyzing the user input and context... The user seems to be asking about specific elements. I should tailor my response to the selected context.":void 0};c(I=>[...I,C]),j&&setTimeout(()=>{c(I=>[...I,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return n.jsxs(s.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[n.jsx(ax,{element:m}),i&&n.jsx(s.View,{position:"fixed",top:24,left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"24px",zIndex:1e4,boxShadow:"0 4px 6px rgba(0,0,0,0.1)",children:n.jsx(s.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),r&&n.jsxs(s.View,{position:"absolute",bottom:60,right:0,width:"400px",height:"600px",marginBottom:"16px",backgroundColor:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(20px)",borderRadius:"24px",border:"1px solid rgba(255, 255, 255, 0.4)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",animation:"slideUp 0.3s ease-out",style:{animation:"fadeIn 0.2s ease-out",transformOrigin:"bottom right"},children:[n.jsxs(s.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),n.jsx(s.View,{as:"button",onClick:()=>a(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:n.jsx(xe,{widthHeight:16,color:"color-gray-500"})})]}),n.jsx(_i,{messages:d,onSubmit:b,size:o,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:x,onRemoveContextElement:f,styles:{container:{height:"calc(100% - 60px)",backgroundColor:"transparent"},inputContainer:{backgroundColor:"white",margin:"0 16px 16px 16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}}})]}),!i&&n.jsx(s.View,{as:"button",onClick:h,width:"56px",height:"56px",borderRadius:"50%",backgroundColor:"theme-primary",border:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",_hover:{transform:"scale(1.05)"},_active:{transform:"scale(0.95)"},"data-chatwidget-ignore":"true",children:r?n.jsx(xe,{widthHeight:24,color:"white"}):n.jsx(ln,{widthHeight:24,color:"white"})})]})};exports.Accordion=Jt;exports.Alert=pc;exports.ArrowIcon=rc;exports.AspectRatio=hc;exports.AttachmentGroup=ei;exports.AttachmentIcon=bt;exports.AttachmentPreview=Tm;exports.AudioIcon=Zt;exports.AudioInput=Ic;exports.AudioWaveform=Ko;exports.Avatar=Ec;exports.BackIcon=Ml;exports.Background=Pi;exports.Badge=Lc;exports.BatteryIcon=ul;exports.BluetoothIcon=Zl;exports.BoldArrowIcon=oc;exports.BookmarkIcon=pl;exports.Button=Le;exports.CalendarIcon=vl;exports.CameraIcon=Jl;exports.Card=so;exports.Carousel=et;exports.Chart=xd;exports.ChartIcon=wl;exports.ChatInput=zi;exports.ChatWidget=_i;exports.ChatWidgetComponent=br;exports.ChatWidgetWidget=ix;exports.CheckIcon=Tl;exports.Checkbox=su;exports.ChevronIcon=ie;exports.ClockIcon=Nl;exports.CloseEyeIcon=qo;exports.CloseIcon=xe;exports.CloudIcon=gl;exports.ColorInput=hu;exports.ColorPicker=Hh;exports.ComboBox=Fp;exports.Command=at;exports.ContextMenu=tt;exports.CookieConsent=jd;exports.CopyIcon=ml;exports.CountryPicker=ju;exports.CreditCardIcon=Bl;exports.CropIcon=ic;exports.DatePicker=Pp;exports.DeleteIcon=hl;exports.Divider=sf;exports.DocumentIcon=Sl;exports.DownloadIcon=bl;exports.DragAndDrop=yh;exports.DragAndDropComponent=Za;exports.DragHandleIcon=Qi;exports.DragHandleLinesIcon=cc;exports.Drawer=rt;exports.DropZone=Sh;exports.DropdownMenu=Tt;exports.DustBinIcon=eo;exports.EditIcon=fl;exports.EmojiPicker=Ah;exports.ErrorIcon=ro;exports.ExternalLinkIcon=an;exports.FacebookIcon=al;exports.FileIcon=xt;exports.FileImage=Ed;exports.FileSVG=zd;exports.FilterIcon=Ol;exports.FolderIcon=Ki;exports.FormikChatInput=jg;exports.FormikCheckbox=eg;exports.FormikColorInput=wg;exports.FormikComboBox=Og;exports.FormikCountryPicker=Rg;exports.FormikDatePicker=Tg;exports.FormikEmojiPicker=Im;exports.FormikForm=Qp;exports.FormikIconPicker=bm;exports.FormikOTPInput=Kg;exports.FormikPassword=Ag;exports.FormikRadio=cg;exports.FormikSelect=Eg;exports.FormikSelector=Zg;exports.FormikSlider=Yg;exports.FormikSwitch=Pg;exports.FormikTagInput=Wg;exports.FormikTextArea=Lg;exports.FormikTextField=Hg;exports.FormikToggle=dm;exports.FormikToggleGroup=gm;exports.FormikUploader=Ia;exports.GiftIcon=Pl;exports.HeartIcon=cl;exports.HelpIcon=Xi;exports.HomeIcon=xl;exports.HoverCard=fe;exports.Icon=Ot;exports.IconPicker=Oh;exports.ImageIcon=Zi;exports.InfoIcon=Re;exports.InstagramIcon=rl;exports.LayoutIcon=Dl;exports.LikeIcon=Ql;exports.Link=Tn;exports.LinkIcon=Ll;exports.LinkedinIcon=il;exports.Loader=ft;exports.LoadingSpinnerIcon=Uo;exports.LockIcon=kl;exports.LogoutIcon=Wl;exports.MagicWandIcon=Xl;exports.MapPinIcon=Ul;exports.MediaPreview=zm;exports.MenuIcon=ql;exports.Menubar=Ae;exports.MessageLayout=yc;exports.MessageView=un;exports.MicrophoneIcon=vo;exports.MinusIcon=tn;exports.Modal=Be;exports.MoonIcon=Il;exports.MoreIcon=Al;exports.MousePointerIcon=cn;exports.NavigationMenu=nt;exports.NotificationIcon=jl;exports.OTPInput=Xp;exports.OpenEyeIcon=Go;exports.Pagination=Zh;exports.PanelIcon=ln;exports.Password=Wp;exports.PauseIcon=on;exports.PlayIcon=Fo;exports.PlusIcon=yl;exports.PowerOffIcon=$l;exports.PrintIcon=Yl;exports.ProfileIcon=Cl;exports.ProgressBar=of;exports.RefreshIcon=Gl;exports.Resizable=hr;exports.RotateIcon=Vl;exports.SaveIcon=dl;exports.SearchIcon=vt;exports.Select=Gd;exports.Selector=tu;exports.SendIcon=No;exports.Separator=cf;exports.SettingsIcon=rn;exports.ShapeIcon=El;exports.ShareButton=ff;exports.ShareIcon=nn;exports.ShieldIcon=_l;exports.Sidebar=Mt;exports.Slider=Rm;exports.SliderIcon=ac;exports.SpinnerIcon=nc;exports.StarIcon=sl;exports.StatusIndicator=bf;exports.StopIcon=to;exports.SuccessIcon=Yo;exports.Switch=Zd;exports.Table=Se;exports.Tabs=go;exports.TagInput=Np;exports.TextArea=ru;exports.TextField=wt;exports.TextIcon=zl;exports.ThreadsIcon=ll;exports.TickIcon=oo;exports.Title=mh;exports.Toast=Yf;exports.Toggle=za;exports.ToggleGroup=fh;exports.Tooltip=xr;exports.TrashIcon=Fl;exports.TwitchIcon=ol;exports.TwitterIcon=el;exports.UnLikeIcon=Kl;exports.UnlockIcon=ec;exports.UploadIcon=Xo;exports.Uploader=ao;exports.UserIcon=Yi;exports.VideoIcon=Ji;exports.WarningIcon=Oo;exports.WifiIcon=tc;exports.XIcon=tl;exports.YoutubeIcon=nl;exports.ZapIcon=Hl;exports.ZoomInIcon=lc;exports.ZoomOutIcon=Rl;exports.hideMessage=dn;exports.hideModal=dr;exports.showMessage=sn;exports.showModal=Em;exports.showToast=Fe;exports.useMessageStore=no;exports.useModalStore=ze;exports.useToast=Xf;
64
+ `})]})},P0=({number:e=20,children:t,...o})=>{const r=Array.from({length:e},(a,i)=>i);return n.jsxs(s.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...o,children:[r.map(a=>{const i=a*37%200-100+"px",l=.2+a*13%6*.1+"s",d=(1+a*7%9)/2+"s",c=300+a*17%100+"px";return n.jsx(s.View,{position:"absolute",top:"0px",left:i,width:"2px",height:"2px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)",transform:"rotate(215deg)",zIndex:0,animate:{from:{transform:"translateX(-100%) translateY(-100%)"},to:{transform:`translateX(${c}) translateY(${c})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:l},children:n.jsx(s.View,{position:"absolute",top:"-1px",left:"-1px",width:"1px",height:"1px",borderRadius:"9999px",backgroundColor:"white",boxShadow:"0 10px 0 1px rgba(255, 255, 255, 0.1)"})},a)}),t&&n.jsx(s.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:t})]})},Zr=["rgb(186, 230, 253)","rgb(249, 168, 212)","rgb(134, 239, 172)","rgb(253, 224, 71)","rgb(252, 165, 165)","rgb(216, 180, 254)","rgb(147, 197, 253)","rgb(165, 180, 252)","rgb(196, 181, 253)"],W0=()=>Zr[Math.floor(Math.random()*Zr.length)],_0=({rows:e=15,cols:t=10,squareSize:o=40,...r})=>{const a=Array(e).fill(1),i=Array(t).fill(1);return n.jsx(s.View,{padding:16,width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-50",zIndex:0,transform:"skewX(-48deg) skewY(14deg) scale(0.675) rotate(0deg) translateZ(0)",...r,children:a.map((l,d)=>n.jsx(s.Horizontal,{gap:0,children:i.map((c,u)=>n.jsx(s.View,{height:o/3,width:o,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:W0(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${d}`))})},$0=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],L0=({count:e=50,colors:t=$0,speed:o="medium",shapes:r=["circle"],...a})=>{const i=Array.from({length:e},(u,p)=>p),l=()=>{switch(o){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>r[Math.floor(Math.random()*r.length)],c=()=>t[Math.floor(Math.random()*t.length)];return n.jsx(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:i.map(u=>{const p=Math.random()*8+4,h=Math.random()*400,m=Math.random()*300,x=Math.random()*400,f=Math.random()*300,b=(Math.random()*10+5)/l(),y=Math.random()*5,k=d(),j=c(),S={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return n.jsx(s.View,{position:"absolute",width:p,height:p,backgroundColor:j,opacity:.7,style:{left:h,top:m,...S[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${x-h}px, ${f-m}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${b}s`,delay:`${y}s`}},u)})})},D0=({gridSize:e=30,lineColor:t="rgba(59, 130, 246, 0.3)",pulseColor:o="rgba(59, 130, 246, 0.8)",animationSpeed:r="medium",...a})=>{const i=()=>{switch(r){case"slow":return 4;case"fast":return 1;default:return 2}},l=Math.floor(400/e),d=Math.floor(300/e),c=l*d,u=Array.from({length:c},(p,h)=>h);return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...a,children:[Array.from({length:l+1},(p,h)=>n.jsx(s.View,{position:"absolute",left:h*e,top:0,width:1,height:"100%",backgroundColor:t},`v-line-${h}`)),Array.from({length:d+1},(p,h)=>n.jsx(s.View,{position:"absolute",left:0,top:h*e,width:"100%",height:1,backgroundColor:t},`h-line-${h}`)),u.map(p=>{const h=p%l,m=Math.floor(p/l),x=(h+m)*.1;return n.jsx(s.View,{position:"absolute",left:h*e+1,top:m*e+1,width:e-2,height:e-2,backgroundColor:"transparent",animate:{from:{backgroundColor:"transparent"},to:{backgroundColor:o},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${i()}s`,delay:`${x}s`}},p)})]})},H0=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],B0=({rippleCount:e=5,colors:t=H0,maxSize:o=200,frequency:r=3,...a})=>{const i=Array.from({length:e},(l,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:t[d%t.length],delay:d*(r/e),duration:3+Math.random()*2}));return n.jsxs(s.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...a,children:[i.map(l=>n.jsx(s.View,{position:"absolute",width:20,height:20,borderRadius:"50%",style:{left:l.x-10,top:l.y-10,border:`2px solid ${l.color}`,backgroundColor:"transparent"},animate:{from:{transform:"scale(0)",opacity:1},to:{transform:`scale(${o/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration}s`,delay:`${l.delay}s`}},l.id)),i.map(l=>n.jsx(s.View,{position:"absolute",width:10,height:10,borderRadius:"50%",style:{left:l.x-5,top:l.y-5,backgroundColor:l.color},animate:{from:{transform:"scale(1)",opacity:.8},to:{transform:`scale(${o/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration*1.2}s`,delay:`${l.delay+.5}s`}},`secondary-${l.id}`))]})},A0=({children:e,src:t,backgroundSize:o="cover",backgroundPosition:r="center",backgroundRepeat:a="no-repeat",backgroundAttachment:i="scroll",imageOpacity:l=1,overlay:d=null,blendMode:c="normal",views:u,themeMode:p,...h})=>{const m={...Io.image,backgroundImage:`url(${t})`,backgroundSize:o,backgroundPosition:r,backgroundRepeat:a,backgroundAttachment:i,opacity:l};return n.jsxs(s.View,{...Io.container,...u==null?void 0:u.container,...h,children:[n.jsx(s.View,{style:m,...u==null?void 0:u.image}),d,e&&n.jsx(s.View,{...Io.content,...u==null?void 0:u.content,children:e})]})},F0=({children:e,src:t,autoPlay:o=!0,loop:r=!0,muted:a=!0,playsInline:i=!0,overlay:l=null,blendMode:d="normal",views:c,themeMode:u,...p})=>n.jsxs(s.View,{...To.container,...c==null?void 0:c.container,...p,children:[n.jsx(s.View,{as:"video",src:t,autoPlay:o,loop:r,muted:a,playsInline:i,style:To.video,...c==null?void 0:c.video}),l,e&&n.jsx(s.View,{...To.content,...c==null?void 0:c.content,children:e})]}),O0=({children:e,...t})=>n.jsx(z0,{...t,children:e}),v0=({contentPosition:e,backgroundColor:t="color-black-900",...o})=>{const a=(()=>{let i=`${t}-100`,l=`${t}-900`,d=`${t}-600`,c=`${t}-400`;switch(t.indexOf("-")===-1&&(i=`color-mix(in srgb, ${t} 10%, transparent)`,l=`color-mix(in srgb, ${t} 90%, transparent)`,d=`color-mix(in srgb, ${t} 70%, transparent)`,c=`color-mix(in srgb, ${t} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${i} 0%, ${i} 100%), linear-gradient(to right, ${l} 0%, ${d} 65%, ${i} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${i} 0%, ${i} 100%), linear-gradient(to left, ${l} 0%, ${d} 65%, ${i} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${i} 0%, ${i} 100%), linear-gradient(to bottom, ${l} 0%, ${d} 60%, ${i} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${i} 0%, ${i} 100%), linear-gradient(to top, ${l} 0%, ${d} 60%, ${i} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${l} 0%, ${i} 100%)`;default:return c}})();return n.jsx(s.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:a,pointerEvents:"none",zIndex:1,...o})},N0=({children:e,views:t,...o})=>n.jsx(E0.Provider,{value:{},children:n.jsx(s.View,{...w0.container,...t==null?void 0:t.container,...o,children:e})}),Vi=g.forwardRef(({children:e,designProps:t,shape:o="rounded",decorationRotation:r=5,decorationScale:a=1,decorationOpacity:i=.8,views:l,...d},c)=>{const p=(y=>{switch(y){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(o),h=Math.abs(r)*(Math.PI/180),m=Math.sin(h)*100,x=(a-1)*100/2,f=Math.ceil(m+x),b=d.backgroundColor??"theme-primary";return n.jsx(s.View,{...d,ref:c,backgroundColor:"transparent",position:"relative",overflow:"visible",...l==null?void 0:l.container,children:n.jsxs(s.View,{padding:d.padding??`${96+f}px ${f}px`,position:"relative",overflow:"visible",children:[n.jsx(s.View,{position:"absolute",top:f,left:f,right:f,bottom:f,backgroundColor:b,borderRadius:p,opacity:i/1.5,transform:`scale(${a})`,pointerEvents:"none",zIndex:1,...l==null?void 0:l.back}),n.jsx(s.View,{position:"absolute",top:f,left:f,right:f,bottom:f,transform:`rotate(${r}deg) scale(${a})`,opacity:i/1.2,backgroundColor:b,borderRadius:p,pointerEvents:"none",zIndex:2,...l==null?void 0:l.front}),n.jsx(s.View,{margin:"0 auto",position:"relative",zIndex:3,...l==null?void 0:l.content,children:e})]})})});Vi.displayName="Background.Layout";const le=N0;le.Aurora=V0;le.Meteors=P0;le.Wall=_0;le.Particles=L0;le.Grid=D0;le.Ripples=B0;le.Image=A0;le.Video=F0;le.Gradient=O0;le.Overlay=v0;le.Layout=Vi;const Pi=g.forwardRef((e,t)=>n.jsx(le,{...e,ref:t}));Pi.displayName="Background";const Wi=Object.assign(Pi,{Layout:le.Layout,Aurora:le.Aurora,Meteors:le.Meteors,Wall:le.Wall,Particles:le.Particles,Grid:le.Grid,Ripples:le.Ripples,Image:le.Image,Video:le.Video,Gradient:le.Gradient,Overlay:le.Overlay});Wi.displayName="Background";function U0(e){const{inputValue:t,onInputChange:o,onSubmit:r,messages:a=[]}=e,[i,l]=g.useState(""),d=g.useRef(null),c=g.useRef(null),u=t!==void 0,p=t!==void 0?t:i,h=g.useCallback(x=>{u?o==null||o(x):l(x)},[u,o]),m=g.useCallback(x=>{x&&x.preventDefault();const f=p.trim();f&&r&&(r(f),u||l(""),d.current&&(d.current.style.height="auto"))},[p,r,u]);return g.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[a.length]),{internalInputValue:p,handleInputChange:h,handleSubmit:m,inputRef:d,messagesRef:c}}const q0={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},G0={default:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"16px"},glassy:{backgroundColor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(12px)",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},minimal:{backgroundColor:"transparent",border:"none"}},Y0={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},X0={backgroundColor:"rgba(37, 99, 235, 0.9)",color:"#ffffff",alignSelf:"flex-end",borderBottomRightRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},K0={backgroundColor:"rgba(244, 244, 245, 0.6)",color:"#18181b",alignSelf:"flex-start",borderBottomLeftRadius:"4px",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Q0={position:"relative",backgroundColor:"rgba(244, 244, 245, 0.05)",backdropFilter:"blur(12px)",borderRadius:"16px",border:"1px solid rgba(0, 0, 0, 0.1)",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",padding:"8px 12px",display:"flex",alignItems:"flex-end",gap:"8px",transition:"all 0.2s ease"},we={container:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"hidden"},messagesContainer:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px",padding:"16px"},inputContainer:Q0,bubble:{maxWidth:"80%",position:"relative",wordWrap:"break-word",animation:"chatBubbleAppear 0.3s ease-out"},timestamp:{position:"absolute",top:"-24px",fontSize:"12px",color:"rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(255, 255, 255, 0.9)",padding:"2px 8px",borderRadius:"9999px",opacity:0,transition:"opacity 0.15s ease-out",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},input:{flex:1,border:"none",outline:"none",backgroundColor:"transparent",resize:"none",fontFamily:"inherit",fontSize:"14px",minHeight:"24px",maxHeight:"120px"},sendButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",flexShrink:0},attachmentButton:{width:"32px",height:"32px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",transition:"background-color 0.2s ease",flexShrink:0}},J0=({messages:e=[],inputPlaceholder:t="Type a message...",disableInput:o=!1,variant:r="default",size:a="md",showTimestamps:i=!0,enableAttachments:l=!1,enableContextPicker:d=!1,selectedContextElements:c=[],onContextPickerClick:u,onRemoveContextElement:p,isLoading:h=!1,loadingText:m="Loading...",styles:x={},maxHeight:f="600px",internalInputValue:b,handleInputChange:y,handleSubmit:k,inputRef:j,messagesRef:S,...C})=>{var z;const w={...we.container,...G0[r],...x.container},I={...we.messagesContainer,maxHeight:f,...x.messagesContainer},M={...we.inputContainer,...x.inputContainer},R={...we.input,...q0[a],...x.input},E=g.useCallback(V=>{y(V.target.value),V.target.style.height="auto",V.target.style.height=`${V.target.scrollHeight}px`},[y]),_=g.useCallback(V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),k())},[k]),T=b.trim().length>0,{onSubmit:$,...D}=C;return n.jsxs(s.View,{...w,...D,children:[n.jsxs(s.View,{ref:S,...I,children:[e.length===0?n.jsx(s.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:n.jsx(s.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(V=>n.jsx(Z0,{message:V,size:a,showTimestamp:i,styles:{bubble:x.bubble,userBubble:x.userBubble,assistantBubble:x.assistantBubble,timestamp:x.timestamp,reasoningContainer:x.reasoningContainer,reasoningContent:x.reasoningContent,errorMessage:x.errorMessage,systemMessage:x.systemMessage,toolMessage:x.toolMessage}},V.id)),h&&n.jsxs(s.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...x.loadingIndicator,children:[n.jsx(Uo,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),n.jsx(s.Text,{color:"color-gray-500",fontSize:"14px",children:m})]})]}),n.jsxs(s.View,{children:[c.length>0&&n.jsx(s.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...x.contextChipsContainer,children:c.map(V=>n.jsxs(s.Horizontal,{backgroundColor:"rgba(37, 99, 235, 0.1)",border:"1px solid rgba(37, 99, 235, 0.2)",borderRadius:"6px",padding:"4px 8px",alignItems:"center",gap:6,children:[n.jsx(s.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:V.name}),n.jsx(s.View,{as:"button",type:"button",onClick:()=>p==null?void 0:p(V.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:n.jsx(ye,{widthHeight:12,color:"color-blue-700"})})]},V.id))}),n.jsxs(s.View,{as:"form",onSubmit:k,...M,children:[l&&n.jsx(s.View,{as:"button",type:"button",...we.attachmentButton,...x.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:n.jsx(bt,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"textarea",ref:j,value:b,onChange:E,onKeyDown:_,placeholder:t,disabled:o||h,...R,style:{...R,opacity:o||h?.5:1}}),n.jsxs(s.Vertical,{gap:4,alignItems:"center",children:[d&&n.jsx(s.View,{as:"button",type:"button",onClick:u,...we.attachmentButton,...x.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(z=x.contextPickerButton)==null?void 0:z._hover},title:"Select element from page",children:n.jsx(sn,{widthHeight:16,color:"color-gray-600"})}),n.jsx(s.View,{as:"button",type:"submit",disabled:!T||o||h,...we.sendButton,backgroundColor:T?"theme-primary":"color-gray-300",_hover:{backgroundColor:T?"color-blue-600":"color-gray-300"},...x.sendButton,style:{cursor:T?"pointer":"not-allowed",opacity:!T||o||h?.6:1},children:n.jsx(No,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},Z0=({message:e,size:t,showTimestamp:o,styles:r})=>{const[a,i]=g.useState(!1),[l,d]=g.useState(!1),c=e.role==="user",u=e.messageType==="system",p=e.messageType==="error",h=e.messageType==="tool";if(u)return n.jsx(s.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...r.systemMessage,children:n.jsxs(s.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[n.jsx(ze,{widthHeight:12,color:"color-gray-600"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(h)return n.jsx(s.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...r.toolMessage,children:n.jsxs(s.Horizontal,{gap:8,alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",padding:"8px",borderRadius:"8px",width:"100%",border:"1px solid rgba(0,0,0,0.05)",children:[n.jsx(nn,{widthHeight:14,color:"color-gray-600"}),n.jsxs(s.Vertical,{gap:2,children:[n.jsx(s.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const m={...we.bubble,...Y0[t],...c?X0:K0,...p?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...r.bubble,...c?r.userBubble:r.assistantBubble,...p?r.errorMessage:{}},x={...we.timestamp,[c?"right":"left"]:"8px",opacity:a?1:0,...r.timestamp};return n.jsx(s.View,{position:"relative",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),display:"flex",justifyContent:c?"flex-end":"flex-start",children:n.jsxs(s.View,{...m,children:[o&&n.jsx(s.View,{...x,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p&&n.jsxs(s.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[n.jsx(ro,{widthHeight:14,color:"#b91c1c"}),n.jsx(s.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&n.jsxs(s.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...r.reasoningContainer,children:[n.jsxs(s.Horizontal,{as:"button",onClick:()=>d(!l),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[n.jsx(s.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),n.jsx(ie,{orientation:l?"down":"right",widthHeight:10,color:"color-gray-500"})]}),l&&n.jsx(s.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...r.reasoningContent,children:n.jsx(s.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),n.jsx(s.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&n.jsx(s.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(f=>n.jsxs(s.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[n.jsx(bt,{widthHeight:14}),n.jsx(s.Text,{children:f.name})]},f.id))}),e.contextElements&&e.contextElements.length>0&&n.jsxs(s.Vertical,{gap:4,marginTop:"8px",children:[n.jsx(s.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(f=>n.jsx(s.Horizontal,{gap:6,padding:"4px 8px",backgroundColor:"rgba(37, 99, 235, 0.1)",borderRadius:"6px",fontSize:"11px",border:"1px solid rgba(37, 99, 235, 0.2)",children:n.jsx(s.Text,{color:"color-blue-700",fontWeight:"500",children:f.name})},f.id))]})]})})},br=e=>{const t=U0(e);return n.jsx(J0,{...e,...t})};br.displayName="ChatWidget";const _i=br;function ex({onSelect:e,onCancel:t,active:o}){const[r,a]=g.useState(null);g.useRef(null);const i=g.useCallback(c=>{var x;if(!o)return;const u=document.elementFromPoint(c.clientX,c.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){a(null);return}const p=u.getBoundingClientRect();let h=u.tagName.toLowerCase();if(u.id)h+=`#${u.id}`;else if(u.className&&typeof u.className=="string"){const f=u.className.split(" ")[0];f&&(h+=`.${f}`)}const m=(x=u.innerText)==null?void 0:x.slice(0,20);m&&(h+=` ("${m}...")`),a({id:u.id||`el-${Date.now()}`,name:h,tagName:u.tagName.toLowerCase(),rect:p})},[o]),l=g.useCallback(c=>{!o||c.target.closest('[data-chatwidget-ignore="true"]')||(c.preventDefault(),c.stopPropagation(),r&&e(r))},[o,r,e]),d=g.useCallback(c=>{o&&c.key==="Escape"&&t()},[o,t]);return g.useEffect(()=>(o?(document.addEventListener("mousemove",i),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(a(null),document.removeEventListener("mousemove",i),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[o,i,l,d]),{highlightedElement:r}}function tx({element:e}){return e?n.jsx("div",{id:"chatwidget-overlay",style:{position:"fixed",top:e.rect.top,left:e.rect.left,width:e.rect.width,height:e.rect.height,border:"2px solid #2563eb",backgroundColor:"rgba(37, 99, 235, 0.1)",pointerEvents:"none",zIndex:99999,transition:"all 0.1s ease-out",borderRadius:"4px"},children:n.jsx("div",{style:{position:"absolute",top:"-24px",left:"0",backgroundColor:"#2563eb",color:"white",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:"bold",whiteSpace:"nowrap"},children:e.name})}):null}const ox=({initialMessages:e=[],onSendMessage:t,bubbleSize:o="md"})=>{const[r,a]=g.useState(!1),[i,l]=g.useState(!1),[d,c]=g.useState(e),[u,p]=g.useState([]),{highlightedElement:h}=ex({active:i,onSelect:y=>{p(k=>[...k,y]),l(!1),a(!0)},onCancel:()=>{l(!1),a(!0)}}),m=()=>a(!r),x=()=>{l(!0),a(!1)},f=y=>{p(k=>k.filter(j=>j.id!==y))},b=y=>{const k={id:Date.now().toString(),role:"user",content:y,timestamp:new Date,contextElements:[...u]};c(j=>[...j,k]),t==null||t(y,u),p([]),setTimeout(()=>{var w;const j=Math.random()>.7,S=Math.random()>.4,C={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:j?"I will highlight the selected element.":`I received your message regarding: ${((w=k.contextElements)==null?void 0:w.map(I=>I.name).join(", "))||"general context"}. How can I assist you further?`,messageType:j?"tool":"text",reasoning:S?"Analyzing the user input and context... The user seems to be asking about specific elements. I should tailor my response to the selected context.":void 0};c(I=>[...I,C]),j&&setTimeout(()=>{c(I=>[...I,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return n.jsxs(s.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[n.jsx(tx,{element:h}),i&&n.jsx(s.View,{position:"fixed",top:24,left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"24px",zIndex:1e4,boxShadow:"0 4px 6px rgba(0,0,0,0.1)",children:n.jsx(s.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),r&&n.jsxs(s.View,{position:"absolute",bottom:60,right:0,width:"400px",height:"600px",marginBottom:"16px",backgroundColor:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(20px)",borderRadius:"24px",border:"1px solid rgba(255, 255, 255, 0.4)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",animation:"slideUp 0.3s ease-out",style:{animation:"fadeIn 0.2s ease-out",transformOrigin:"bottom right"},children:[n.jsxs(s.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[n.jsx(s.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),n.jsx(s.View,{as:"button",onClick:()=>a(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:n.jsx(ye,{widthHeight:16,color:"color-gray-500"})})]}),n.jsx(_i,{messages:d,onSubmit:b,size:o,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:x,onRemoveContextElement:f,styles:{container:{height:"calc(100% - 60px)",backgroundColor:"transparent"},inputContainer:{backgroundColor:"white",margin:"0 16px 16px 16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"}}})]}),!i&&n.jsx(s.View,{as:"button",onClick:m,width:"56px",height:"56px",borderRadius:"50%",backgroundColor:"theme-primary",border:"none",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",_hover:{transform:"scale(1.05)"},_active:{transform:"scale(0.95)"},"data-chatwidget-ignore":"true",children:r?n.jsx(ye,{widthHeight:24,color:"white"}):n.jsx(cn,{widthHeight:24,color:"white"})})]})};exports.Accordion=Jt;exports.Alert=gc;exports.ArrowIcon=nc;exports.AspectRatio=fc;exports.AttachmentGroup=ti;exports.AttachmentIcon=bt;exports.AttachmentPreview=jh;exports.AudioIcon=Zt;exports.AudioInput=Tc;exports.AudioWaveform=Ko;exports.Avatar=Vc;exports.BackIcon=Rl;exports.Background=Wi;exports.Badge=Dc;exports.BatteryIcon=pl;exports.BluetoothIcon=ec;exports.BoldArrowIcon=rc;exports.BookmarkIcon=gl;exports.Button=Le;exports.CalendarIcon=Nl;exports.CameraIcon=Zl;exports.Card=so;exports.Carousel=tt;exports.Chart=kd;exports.ChartIcon=Il;exports.ChatInput=Ei;exports.ChatWidget=_i;exports.ChatWidgetComponent=br;exports.ChatWidgetWidget=ox;exports.CheckIcon=Ml;exports.Checkbox=pu;exports.ChevronIcon=ie;exports.ClockIcon=Ul;exports.CloseEyeIcon=qo;exports.CloseIcon=ye;exports.CloudIcon=hl;exports.ColorInput=bu;exports.ColorPicker=_m;exports.ComboBox=Np;exports.Command=it;exports.ContextMenu=ot;exports.CookieConsent=Id;exports.CopyIcon=ml;exports.CountryPicker=Iu;exports.CreditCardIcon=Al;exports.CropIcon=lc;exports.DatePicker=$p;exports.DeleteIcon=fl;exports.Divider=nf;exports.DocumentIcon=wl;exports.DownloadIcon=yl;exports.DragAndDrop=mm;exports.DragAndDropComponent=ei;exports.DragHandleIcon=Ji;exports.DragHandleLinesIcon=sc;exports.Drawer=nt;exports.DropZone=ym;exports.DropdownMenu=Tt;exports.DustBinIcon=eo;exports.EditIcon=xl;exports.EmojiPicker=Lm;exports.ErrorIcon=ro;exports.ExternalLinkIcon=ln;exports.FacebookIcon=il;exports.FileIcon=xt;exports.FileImage=Wd;exports.FileSVG=Pd;exports.FilterIcon=vl;exports.FolderIcon=Qi;exports.FormikChatInput=Ig;exports.FormikCheckbox=rg;exports.FormikColorInput=Mg;exports.FormikComboBox=Ug;exports.FormikCountryPicker=Vg;exports.FormikDatePicker=zg;exports.FormikEmojiPicker=Ch;exports.FormikForm=eg;exports.FormikIconPicker=hh;exports.FormikOTPInput=Zg;exports.FormikPassword=vg;exports.FormikRadio=ug;exports.FormikSelect=Wg;exports.FormikSelector=oh;exports.FormikSlider=Qg;exports.FormikSwitch=$g;exports.FormikTagInput=Dg;exports.FormikTextArea=Bg;exports.FormikTextField=Fg;exports.FormikToggle=ih;exports.FormikToggleGroup=sh;exports.FormikUploader=Ta;exports.GiftIcon=Wl;exports.HeartIcon=sl;exports.HelpIcon=Ki;exports.HomeIcon=bl;exports.HoverCard=be;exports.Icon=Ot;exports.IconPicker=Hm;exports.ImageIcon=el;exports.InfoIcon=ze;exports.InstagramIcon=nl;exports.LayoutIcon=Hl;exports.LikeIcon=Jl;exports.Link=Mn;exports.LinkIcon=Dl;exports.LinkedinIcon=ll;exports.Loader=ft;exports.LoadingSpinnerIcon=Uo;exports.LockIcon=Cl;exports.LogoutIcon=$l;exports.MagicWandIcon=Kl;exports.MapPinIcon=ql;exports.MediaPreview=Ih;exports.MenuIcon=Gl;exports.Menubar=Ae;exports.MessageLayout=kc;exports.MessageView=pn;exports.MicrophoneIcon=vo;exports.MinusIcon=on;exports.Modal=Be;exports.MoonIcon=Tl;exports.MoreIcon=Fl;exports.MousePointerIcon=sn;exports.NavigationMenu=at;exports.NotificationIcon=Sl;exports.OTPInput=Jp;exports.OpenEyeIcon=Go;exports.Pagination=Xm;exports.PanelIcon=cn;exports.Password=Dp;exports.PauseIcon=rn;exports.PlayIcon=Fo;exports.PlusIcon=kl;exports.PowerOffIcon=Ll;exports.PrintIcon=Xl;exports.ProfileIcon=jl;exports.ProgressBar=Jm;exports.RefreshIcon=Yl;exports.Resizable=mr;exports.RotateIcon=Pl;exports.SaveIcon=ul;exports.SearchIcon=vt;exports.Select=Kd;exports.Selector=nu;exports.SendIcon=No;exports.Separator=rf;exports.SettingsIcon=nn;exports.ShapeIcon=Vl;exports.ShareButton=pf;exports.ShareIcon=an;exports.ShieldIcon=_l;exports.Sidebar=Mt;exports.Slider=wh;exports.SliderIcon=ic;exports.SpinnerIcon=ac;exports.StarIcon=dl;exports.StatusIndicator=hf;exports.StopIcon=to;exports.SuccessIcon=Yo;exports.Switch=ou;exports.Table=Se;exports.Tabs=go;exports.TagInput=Gp;exports.TextArea=iu;exports.TextField=wt;exports.TextIcon=El;exports.ThreadsIcon=cl;exports.TickIcon=oo;exports.Title=dm;exports.Toast=Nf;exports.Toggle=Ea;exports.ToggleGroup=pm;exports.Tooltip=xr;exports.TrashIcon=Ol;exports.TwitchIcon=rl;exports.TwitterIcon=tl;exports.UnLikeIcon=Ql;exports.UnlockIcon=tc;exports.UploadIcon=Xo;exports.Uploader=ao;exports.UserIcon=Xi;exports.VideoIcon=Zi;exports.WarningIcon=Oo;exports.WifiIcon=oc;exports.XIcon=ol;exports.YoutubeIcon=al;exports.ZapIcon=Bl;exports.ZoomInIcon=cc;exports.ZoomOutIcon=zl;exports.hideMessage=un;exports.hideModal=dr;exports.showMessage=dn;exports.showModal=Th;exports.showToast=Fe;exports.useMessageStore=no;exports.useModalStore=Ee;exports.useToast=Uf;
65
65
  //# sourceMappingURL=web.cjs.js.map