@app-studio/web 0.9.90 → 0.9.91
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 +10 -37
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +7418 -8103
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +10 -37
- package/dist/web.umd.js.map +1 -1
- package/package.json +2 -1
package/dist/web.cjs.js
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),s=require("app-studio"),kr=require("lucide-react/dynamicIconImports"),Ao=require("zustand"),Hi=require("react-dom"),ke=require("formik");function Bi(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=Bi(g),Fo=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Di=({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(()=>Fo("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"}}},tn=g.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Oi=({children:e,value:t})=>n.jsx(tn.Provider,{value:t,children:e}),on=()=>{const e=g.useContext(tn);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}=on(),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}=on(),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=Di({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 xo=({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,fallback:d,...c})=>{const u=i||t;if(!e)return n.jsx(xo,{widthHeight:t,color:o,...c,children:l});const p=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(p in kr))return n.jsx(xo,{widthHeight:u,color:o,...c,children:d||l});const h=g.lazy(kr[p]),m=Yi(r,o,a);return n.jsx(xo,{widthHeight:u,color:o,...c,children:n.jsx(g.Suspense,{fallback:d||null,children:n.jsx(h,{size:u,...m})})})},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}),rn=v("minus",{filled:!1}),ze=v("info",{filled:!1}),Oo=v("play",{filled:!1}),nn=v("pause",{filled:!1}),sl=v("heart",{filled:!1}),dl=v("star",{filled:!1}),ul=v("save",{filled:!1}),vo=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}),No=v("mic",{filled:!1}),to=v("square",{filled:!1}),Uo=v("send",{filled:!1}),qo=v("loader",{filled:!1}),bt=v("paperclip",{filled:!1}),vt=v("search",{filled:!1}),bl=v("home",{filled:!1}),an=v("settings",{filled:!1}),yl=v("download",{filled:!1}),ln=v("share",{filled:!1}),oo=v("check",{filled:!1}),kl=v("plus",{filled:!1}),Go=v("eye-off",{filled:!1}),Yo=v("eye",{filled:!1}),Cl=v("lock",{filled:!1}),jl=v("user",{filled:!1}),cn=v("external-link",{filled:!1}),Xo=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}),sn=v("panel-left",{filled:!1}),Ko=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}),Hl=v("link",{filled:!1}),Bl=v("layout",{filled:!1}),Dl=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}),dn=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(Xo,{...m});case"error":return n.jsx(ro,{...m});case"warning":default:return n.jsx(vo,{...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))}),Qo=({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=Ao.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})})),un=(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)},pn=()=>{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"}}},gn=({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(Xo,{widthHeight:24,color:f,...p==null?void 0:p.icon}),warning:n.jsx(vo,{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(gn,{variant:i,subtitle:l,show:r,title:a,theme:t,isClosable:d,views:c,action:u,actionText:p,showIcon:h,timeout:m,hide:()=>pn()}),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=>{un("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:H=({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(Ko,{widthHeight:32,...C})),!t&&!p&&a&&E({text:a,textProps:w}),t&&H({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(Oo,{widthHeight:16,color:"currentColor",filled:!1}):n.jsx(nn,{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(Qo,{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(No,{widthHeight:16,color:"currentColor",filled:!1})})]}),m&&!t&&n.jsx("audio",{controls:!0,src:m})]})}function hn(){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 H=$.createMediaStreamSource(E),z=$.createAnalyser();z.fftSize=256,z.smoothingTimeConstant=.8,H.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}=hn();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},bo={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={...bo.image,...(r==null?void 0:r.image)||{}};return n.jsxs(s.Center,{role:"avatar",width:c,height:c,...bo.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,...bo.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"}}),mn=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=mn(),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})]})},Hc=e=>n.jsx(Lc,{...e}),Bc=()=>{const[e,t]=g.useState(!1);return{isHovered:e,setIsHovered:t}};/**
|
|
2
|
-
* @remix-run/router v1.23.2
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Remix Software Inc.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/function Ro(){return Ro=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},Ro.apply(this,arguments)}var Cr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cr||(Cr={}));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 zo(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 fn(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 jr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jr||(jr={}));function Sr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[o,r]=Dc(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 Dc(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"?fn(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=wr(o.substring(1),"/"):i=wr(o,t)}else i=t;return{pathname:i,search:Nc(r),hash:Uc(a)}}function wr(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 yo(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 xn(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 bn(e,t,o,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=fn(e):(a=Ro({},e),se(!a.pathname||!a.pathname.includes("?"),yo("?","pathname","search",a)),se(!a.pathname||!a.pathname.includes("#"),yo("#","pathname","hash",a)),se(!a.search||!a.search.includes("#"),yo("#","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 Jo=e=>e.join("/").replace(/\/\/+/g,"/"),Nc=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Uc=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yn=["post","put","patch","delete"];new Set(yn);const qc=["get",...yn];new Set(qc);/**
|
|
11
|
-
* React Router v6.30.3
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Remix Software Inc.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/function Eo(){return Eo=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},Eo.apply(this,arguments)}const io=Q.createContext(null);process.env.NODE_ENV!=="production"&&(io.displayName="DataRouter");const kn=Q.createContext(null);process.env.NODE_ENV!=="production"&&(kn.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 Zo=Q.createContext(null);process.env.NODE_ENV!=="production"&&(Zo.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;er()||(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:Jo([r,l])),a.createHref({pathname:c,search:d,hash:i})}function er(){return Q.useContext(Zo)!=null}function yt(){return er()||(process.env.NODE_ENV!=="production"?se(!1,"useLocation() may be used only in the context of a <Router> component."):se(!1)),Q.useContext(Zo).location}const Cn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jn(e){Q.useContext(Ie).static||Q.useLayoutEffect(e)}function Kc(){let{isDataRoute:e}=Q.useContext(et);return e?ts():Qc()}function Qc(){er()||(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(xn(a,o.v7_relativeSplatPath)),d=Q.useRef(!1);return jn(()=>{d.current=!0}),Q.useCallback(function(u,p){if(p===void 0&&(p={}),process.env.NODE_ENV!=="production"&&Ze(d.current,Cn),!d.current)return;if(typeof u=="number"){r.go(u);return}let h=bn(u,JSON.parse(l),i,p.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Jo([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(xn(a,r.v7_relativeSplatPath));return Q.useMemo(()=>bn(e,JSON.parse(l),i,o==="path"),[e,l,i,o])}var Sn=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Sn||{}),tr=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}(tr||{});function wn(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,wn(e)):se(!1)),t}function Zc(e){let t=Q.useContext(et);return t||(process.env.NODE_ENV!=="production"?se(!1,wn(e)):se(!1)),t}function In(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 In(tr.UseRouteId)}function ts(){let{router:e}=Jc(Sn.UseNavigateStable),t=In(tr.UseNavigateStable),o=Q.useRef(!1);return jn(()=>{o.current=!0}),Q.useCallback(function(a,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&Ze(o.current,Cn),o.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Eo({fromRouteId:t},i)))},[e,t])}new Promise(()=>{});/**
|
|
20
|
-
* React Router DOM v6.30.3
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Remix Software Inc.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
26
|
-
*
|
|
27
|
-
* @license MIT
|
|
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 or(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 Bt="get",Dt="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 ko(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 "'+Dt+'"')),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")||Bt,a=ko(e.getAttribute("enctype"))||Dt,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")||Bt,a=ko(e.getAttribute("formenctype"))||ko(d.getAttribute("enctype"))||Dt,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=Bt,r=null,a=Dt,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 Tn=Q.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Tn.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,rr=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=or(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"&&(rr.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=or(t,us),m=kt(c,{relative:h.relative}),x=yt(),f=Q.useContext(kn),{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(rr,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=Bt,action:c,onSubmit:u,relative:p,preventScrollReset:h,viewTransition:m}=e,x=or(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 Ir;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ir||(Ir={}));function ys(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Mn(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:zo(u)===zo(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}=Mn(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:Jo([r,l.pathname])),zo(l)}function Ts(e,t){t===void 0&&(t={});let o=Q.useContext(Tn);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}=Mn(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 Sr(a.pathname,l)!=null||Sr(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(rr,{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(cn,{widthHeight:Ms[o]})]})})},zs=e=>{const t=Bc();return n.jsx(Rs,{...t,...e})},Rn=zs,nr={xs:14,sm:18,md:22,lg:26,xl:30},ar={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:nr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},ar[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:nr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},ar[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:nr[e],[u,p]=g.useState(0);return g.useEffect(()=>{const h=setInterval(()=>{p(m=>m+45)},ar[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"}),zn={xs:ct("xs"),sm:ct("sm"),md:ct("md"),lg:ct("lg"),xl:ct("xl")},mt={square:0,rounded:8,pill:999},En={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"}}},Hs=({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=zn[i],h=d?En[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})]})},Bs=e=>{const t=mt[e];return typeof t=="number"?t:typeof t=="string"&&parseInt(t,10)||0},Ds=({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=Bs(c),_=o?n.jsx(Rn,{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(Ds,{asComponent:o?"div":"button",isWrapped:!0,borderRadius:Math.max(0,E-3),width:"100%",height:"100%",...T})})}if(t==="animatedStroke"){const H=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:H,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%)`,B=`linear-gradient(270deg, ${z} 50%, transparent 50%)`,D=`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:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),c=require("app-studio"),vt=require("lucide-react/dynamicIconImports"),kt=require("zustand"),va=require("react-router-dom"),Xa=require("react-dom"),be=require("formik"),jt=(e="id")=>`${e}-${Math.random().toString(36).substring(2,9)}`,Ka=({type:e="single",value:o,defaultValue:t,onValueChange:n,collapsible:i=!1})=>{const a=o!==void 0,l=o??t,d=()=>e==="multiple"?Array.isArray(l)?l:l?[l]:[]:Array.isArray(l)?l[0]:l,[s,u]=g.useState(d()),p=g.useMemo(()=>jt("accordion"),[]),m=a?o:s,h=g.useMemo(()=>m===void 0?[]:Array.isArray(m)?m:[m],[m]);g.useEffect(()=>{a&&(e==="multiple"&&!Array.isArray(o)?(console.warn('Accordion with type="multiple" received non-array value:',o),u(o?[String(o)]:[])):e==="single"&&Array.isArray(o)?(console.warn('Accordion with type="single" received array value:',o),u(o.length>0?o[0]:void 0)):u(o))},[o,a,e]);const f=g.useCallback(y=>{let b;if(e==="single")m===y&&i?b=void 0:m!==y?b=y:b=m;else{const k=Array.isArray(m)?m:[];k.includes(y)?b=k.filter(C=>C!==y):b=[...k,y],Array.isArray(b)&&b.length===0&&(b=[])}a||u(b),n&&n(b)},[e,m,i,a,n]),x=g.useCallback(y=>h.includes(y),[h]);return{expandedItems:h,toggleItem:f,isItemExpanded:x,type:e,collapsible:i,baseId:p}},Qa={square:{borderRadius:0},rounded:{borderRadius:8}},Za={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"}}},wr=g.createContext({expandedItems:[],toggleItem:()=>{},isItemExpanded:()=>!1,type:"single",collapsible:!1,baseId:""}),Ja=({children:e,value:o})=>r.jsx(wr.Provider,{value:o,children:e}),Ir=()=>{const e=g.useContext(wr);if(!e)throw new Error("useAccordionContext must be used within an AccordionProvider");return e},ei=({value:e,children:o,isDisabled:t=!1,views:n,...i})=>{const{isItemExpanded:a,baseId:l}=Ir(),d=a(e),s=`${l}-trigger-${e}`,u=`${l}-content-${e}`;return r.jsx(c.View,{borderWidth:1,borderStyle:"solid",borderColor:"color-gray-200",marginBottom:8,overflow:"hidden",opacity:t?.5:1,pointerEvents:t?"none":"auto","data-state":d?"open":"closed","data-disabled":t?"":void 0,...n==null?void 0:n.item,...i,children:g.Children.map(o,p=>g.isValidElement(p)?g.cloneElement(p,{...p.props,value:e,isExpanded:d,isDisabled:t,triggerId:s,contentId:u}):p)})},oi=({children:e,value:o,isExpanded:t,isDisabled:n,triggerId:i,contentId:a,views:l,asChild:d=!1,...s})=>{const{toggleItem:u}=Ir(),m={id:i,"aria-expanded":t,"aria-controls":a,"aria-disabled":n,"data-state":t?"open":"closed","data-disabled":n?"":void 0,onClick:()=>{o&&!n&&u(o)},padding:16,cursor:n?"not-allowed":"pointer",alignItems:"center",justifyContent:"space-between",backgroundColor:"color-white",width:"100%",...l==null?void 0:l.container,...s};if(d&&g.isValidElement(e)){const h=g.Children.only(e);return g.cloneElement(h,{...m,...h.props})}return r.jsxs(c.Horizontal,{...m,children:[e,r.jsx(c.View,{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)",...l==null?void 0:l.icon,children:r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z",fill:"currentColor"})})})]})},ti=({children:e,isExpanded:o,isDisabled:t,triggerId:n,contentId:i,views:a,...l})=>o?r.jsx(c.View,{id:i,role:"region","aria-labelledby":n,padding:16,backgroundColor:"color-white",maxHeight:o?"1000px":"0",transition:"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out",opacity:1,overflow:"hidden","data-state":o?"open":"closed","data-disabled":t?"":void 0,...a==null?void 0:a.container,...l,children:e}):null,ri=({children:e,shape:o="rounded",variant:t="default",views:n,baseId:i,type:a,collapsible:l,themeMode:d,...s})=>r.jsx(c.Vertical,{width:"100%","data-orientation":"vertical",...Qa[o],...Za[t],...n==null?void 0:n.container,...s,children:e}),ni=({children:e,type:o="single",value:t,defaultValue:n,onValueChange:i,collapsible:a=!1,shape:l="rounded",variant:d="default",views:s,...u})=>{const p=Array.isArray(n)?n:n?[n]:void 0,m=Ka({type:o,value:t,defaultValue:n??p,onValueChange:i,collapsible:a});return r.jsx(Ja,{value:{expandedItems:m.expandedItems,toggleItem:m.toggleItem,isItemExpanded:m.isItemExpanded,type:m.type,collapsible:m.collapsible,baseId:m.baseId},children:r.jsx(ri,{shape:l,variant:d,views:s,baseId:m.baseId,type:m.type,collapsible:m.collapsible,...u,children:e})})},Do=ni;Do.Item=ei;Do.Trigger=oi;Do.Content=ti;const tt=({widthHeight:e,color:o="currentColor",transform:t,orientation:n="up",children:i,...a})=>r.jsx(c.Center,{widthHeight:e,lineHeight:e,color:o,display:"flex",transform:t||(n==="left"?"rotate(-90deg)":n==="right"?"rotate(90deg)":n==="up"?"rotate(0deg)":n==="down"?"rotate(180deg)":"none"),...a,children:i}),ai=(e,o,t)=>{const{getColor:n}=c.useTheme(),i=n(o);return{fill:e?i:"none",stroke:i,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}},Eo=({name:e="circle",widthHeight:o=24,color:t="currentColor",filled:n=!1,strokeWidth:i=1,size:a,children:l,fallback:d,...s})=>{const u=a||o;if(!e)return r.jsx(tt,{widthHeight:o,color:t,...s,children:l});const p=e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(!(p in vt))return r.jsx(tt,{widthHeight:u,color:t,...s,children:d||l});const m=g.lazy(vt[p]),h=ai(n,t,i);return r.jsx(tt,{widthHeight:u,color:t,...s,children:r.jsx(g.Suspense,{fallback:d||null,children:r.jsx(m,{size:u,...h})})})},q=(e,o={})=>{const t=n=>r.jsx(Eo,{name:e,...o,...n});return t.displayName=`${e}Icon`,t},ii=q("user",{filled:!1}),li=q("circle-help",{filled:!1}),ci=q("folder",{filled:!1}),ae=q("chevron-up",{filled:!1}),si=q("grip-vertical",{filled:!1}),uo=q("file",{filled:!1}),di=q("video",{filled:!1}),ui=q("image",{filled:!1}),Fo=q("volume",{filled:!1}),gi=q("twitter",{filled:!1}),pi=q("x",{filled:!1}),mi=q("twitch",{filled:!1}),xe=q("x",{filled:!1,strokeWidth:2}),hi=q("instagram",{filled:!1}),fi=q("youtube",{filled:!1}),xi=q("facebook",{filled:!1}),bi=q("linkedin",{filled:!1}),yi=q("at-sign",{filled:!1}),Tr=q("minus",{filled:!1}),Te=q("info",{filled:!1}),Ct=q("play",{filled:!1}),Mr=q("pause",{filled:!1}),ki=q("heart",{filled:!1}),ji=q("star",{filled:!1}),Ci=q("save",{filled:!1}),St=q("triangle-alert",{filled:!1}),Si=q("battery",{filled:!1}),wi=q("bookmark",{filled:!1}),Ii=q("cloud",{filled:!1}),Ti=q("copy",{filled:!1}),Oo=q("trash",{filled:!1}),Mi=Oo,zi=q("edit",{filled:!1}),wt=q("mic",{filled:!1}),qo=q("square",{filled:!1}),It=q("send",{filled:!1}),Tt=q("loader",{filled:!1}),go=q("paperclip",{filled:!1}),Po=q("search",{filled:!1}),Ri=q("home",{filled:!1}),zr=q("settings",{filled:!1}),Vi=q("download",{filled:!1}),Rr=q("share",{filled:!1}),No=q("check",{filled:!1}),Ei=q("plus",{filled:!1}),Mt=q("eye-off",{filled:!1}),zt=q("eye",{filled:!1}),Pi=q("lock",{filled:!1}),Wi=q("user",{filled:!1}),Vr=q("external-link",{filled:!1}),Rt=q("check-circle",{filled:!1}),Uo=q("alert-circle",{filled:!1}),_i=q("bell",{filled:!1}),$i=q("file-text",{filled:!1}),Hi=q("bar-chart",{filled:!1}),Bi=q("moon",{filled:!1}),Er=q("panel-left",{filled:!1}),Vt=q("upload",{filled:!1}),Li=No,Ai=e=>r.jsx(ae,{orientation:"left",...e}),Di=q("zoom-out",{filled:!1}),Fi=q("type",{filled:!1}),Oi=q("shapes",{filled:!1}),qi=q("rotate-cw",{filled:!1}),Ni=q("gift",{filled:!1}),Ui=q("shield",{filled:!1}),Gi=q("log-out",{filled:!1}),Yi=q("power",{filled:!1}),vi=q("link",{filled:!1}),Xi=q("layout",{filled:!1}),Ki=q("zap",{filled:!1}),Qi=q("credit-card",{filled:!1}),Zi=q("more-horizontal",{filled:!1}),Ji=Oo,el=q("filter",{filled:!1}),ol=q("calendar",{filled:!1}),tl=q("clock",{filled:!1}),rl=q("map-pin",{filled:!1}),nl=q("menu",{filled:!1}),al=q("refresh-cw",{filled:!1}),il=q("printer",{filled:!1}),ll=q("wand",{filled:!1}),cl=q("thumbs-down",{filled:!1}),sl=q("thumbs-up",{filled:!1}),dl=q("camera",{filled:!1}),ul=q("bluetooth",{filled:!1}),gl=q("unlock",{filled:!1}),pl=q("wifi",{filled:!1}),ml=q("arrow-right",{filled:!1}),hl=q("arrow-up",{filled:!1}),fl=q("loader",{filled:!1}),xl=q("sliders-horizontal",{filled:!1}),bl=q("crop",{filled:!1}),yl=q("zoom-in",{filled:!1}),kl=q("grip-horizontal",{filled:!1}),Pr=q("mouse-pointer-2",{filled:!1}),jl=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"}}}),Cl=({icon:e,title:o="",views:t,description:n="",variant:i="default",themeMode:a,children:l,...d})=>{const{themeMode:s}=c.useTheme(),u=jl(),p=()=>{var f;if(e)return e;const h={size:20,color:((f=t==null?void 0:t.icon)==null?void 0:f.color)??u[i].icon.color};switch(i){case"info":return r.jsx(Te,{...h});case"success":return r.jsx(Rt,{...h});case"error":return r.jsx(Uo,{...h});case"warning":default:return r.jsx(St,{...h})}};return r.jsxs(c.Horizontal,{gap:12,padding:"16px",flexWrap:"nowrap",alignItems:"flex-start",borderRadius:"8px",borderWidth:"1px",borderStyle:"solid",borderColor:u[i].container.borderColor,backgroundColor:u[i].container.backgroundColor,boxShadow:u[i].container.boxShadow,transition:"all 0.2s ease",...t==null?void 0:t.container,...d,children:[r.jsx(c.View,{alignSelf:"flex-start",marginTop:"2px",...t==null?void 0:t.icon,children:p()}),r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsx(c.Text,{fontSize:"16px",fontWeight:"600",lineHeight:"24px",color:u[i].content.color,backgroundColor:u[i].container.backgroundColor,...t==null?void 0:t.title,children:o}),r.jsx(c.Text,{fontSize:"14px",fontWeight:"400",lineHeight:"20px",color:u[i].content.color,backgroundColor:u[i].container.backgroundColor,...t==null?void 0:t.description,children:n||l})]})]})},Sl=e=>r.jsx(Cl,{...e}),wl=Sl,Il=({ratio:e=16/9,children:o,views:t,...n})=>r.jsx(c.Center,{width:"100%",position:"relative",overflow:"hidden",paddingTop:`${1/e*100}%`,borderRadius:8,...n,...t==null?void 0:t.center,children:r.jsx(c.View,{position:"absolute",top:0,right:0,bottom:0,left:0,...t==null?void 0:t.view,children:o})}),Tl=({ratio:e,children:o,...t})=>r.jsx(Il,{ratio:e,...t,children:o}),Ml=Tl;function zl(e,o,t){return Math.min(Math.max(e,o),t)}const Rl=({bars:e,isPaused:o,...t})=>r.jsx(c.Horizontal,{alignItems:"center",minWidth:100,gap:1,height:32,maxWidth:200,width:"100%",marginTop:4,...t,children:e.map((i,a)=>r.jsx(c.View,{width:2,backgroundColor:o?"color-gray-200":i>=0?"color-gray-900":"color-gray-500",style:{height:`${zl(i*300,2,32)}px`}},a))}),Et=({analyserNode:e,isPaused:o,...t})=>{const n=g.useRef(null),i=60,a=32,[l,d]=g.useState([]);return g.useEffect(()=>{if(!e){d(Array(i).fill(-1));return}const s=e.frequencyBinCount,u=new Uint8Array(s),p=()=>{e.getByteTimeDomainData(u);let m=0;for(let f=0;f<s;f++){const x=(u[f]-128)/128;m+=x*x}const h=Math.sqrt(m/s);g.startTransition(()=>{d(f=>{const y=[...f,h].slice(-i);return y.length<i?[...Array(i-y.length).fill(-1),...y]:y})})};return n.current=setInterval(p,a),()=>{n.current&&clearInterval(n.current)}},[e]),r.jsx(Rl,{bars:l,isPaused:o,...t})},Go=kt.create(e=>({visible:!1,title:"",subtitle:"",variant:"info",isClosable:!1,views:{},action:()=>{},actionText:"",showIcon:!1,timeout:3e3,show:(o,t="",n="",i,a,l,d,s,u)=>e({visible:!0,variant:o,title:t,subtitle:n,isClosable:i,views:a,action:l,actionText:d,showIcon:s,timeout:u}),hide:()=>e({visible:!1})})),Wr=(e,o,t,n)=>{Go.getState().show(e,o,t,n==null?void 0:n.isClosable,n==null?void 0:n.views,n==null?void 0:n.action,n==null?void 0:n.actionText,n==null?void 0:n.showIcon,n==null?void 0:n.timeout)},_r=()=>{Go.getState().hide()},Vl={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"}}},$r=({variant:e,hide:o,title:t,subtitle:n,theme:i,action:a,actionText:l,showIcon:d=!1,isClosable:s=!1,timeout:u=3e3,views:p})=>{var k,C;g.useEffect(()=>{if(u&&!s){const S=setTimeout(()=>{o()},u);return()=>{clearTimeout(S)}}},[]);const m=i??Vl,h=!!(a&&l),f={borderWidth:1,borderStyle:"solid",borderRadius:8,borderColor:`${m[e].container.border}`},x={info:"#3b82f6",success:"#4ade80",warning:"#f97316",error:"#ef4444"}[e],y={info:r.jsx(Te,{widthHeight:24,color:x,...p==null?void 0:p.icon}),success:r.jsx(Rt,{widthHeight:24,color:x,...p==null?void 0:p.icon}),warning:r.jsx(St,{widthHeight:24,color:x,...p==null?void 0:p.icon}),error:r.jsx(Uo,{widthHeight:24,color:x,...p==null?void 0:p.icon})}[e],b=d&&y;return r.jsxs(c.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:s?()=>{}:()=>{o()},...f,...p==null?void 0:p.container,children:[b&&y,r.jsxs(c.Vertical,{gap:8,width:"100%",children:[r.jsx(c.Text,{size:"md",weight:"semiBold",...p==null?void 0:p.title,children:t}),n&&r.jsx(c.Text,{size:"sm",...p==null?void 0:p.subtitle,children:n})]}),h&&r.jsx(c.Text,{marginRight:10,onClick:a,padding:"6px 10px",whiteSpace:"nowrap",...f,...p==null?void 0:p.actionText,children:l}),s&&r.jsx(c.View,{position:"absolute",zIndex:1e4,right:8,top:6,onClick:()=>{o()},...(k=p==null?void 0:p.closingIcon)==null?void 0:k.container,children:r.jsx(xe,{widthHeight:18,color:x,...(C=p==null?void 0:p.closingIcon)==null?void 0:C.icon})})]})},El=({container:e,theme:o,position:t="topRight"})=>{const{visible:n,title:i,variant:a,subtitle:l,isClosable:d,views:s,action:u,actionText:p,showIcon:m,timeout:h}=Go(),f={topLeft:{top:6,left:8},topRight:{top:6,right:8},bottomLeft:{bottom:8,left:6},bottomRight:{bottom:8,right:6}}[t],x=()=>r.jsx($r,{variant:a,subtitle:l,show:n,title:i,theme:o,isClosable:d,views:s,action:u,actionText:p,showIcon:m,timeout:h,hide:()=>_r()}),y=e?g.cloneElement(e,{},x()):r.jsx(c.View,{position:"absolute",zIndex:1e4,...f,children:x()});return n?y:null},Pl=(e,o)=>{const t=document.createElement("video");t.preload="metadata",t.onloadedmetadata=()=>{t.currentTime=1},t.oncanplay=()=>{const n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight;const i=n.getContext("2d");if(i){i.drawImage(t,0,0,n.width,n.height);const a=n.toDataURL("image/jpeg");o(a)}URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(e)},Wl=({maxSize:e=100*1024*1024,onFileSelect:o,onMultipleFileSelect:t,validateFile:n,thumbnail:i,multiple:a=!1,onError:l=d=>{Wr("error","Error",d)}})=>{const d=g.useRef(null),s=g.useRef(null),[u,p]=g.useState(null),[m,h]=g.useState([]),[f,x]=g.useState(null),[y,b]=g.useState(null),[k,C]=g.useState(i||null),S=g.useCallback(w=>{const I=w.target.files;if(x(null),!I||I.length===0){l("No file selected"),x("No file selected");return}if(a){const M=Array.from(I),z=[];for(const V of M){if(V.size>e){l(`File ${V.name} exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File ${V.name} exceeds ${Math.round(e/(1024*1024))}MB.`);continue}if(n){const $=n(V);if($){l(`${V.name}: ${$}`),x(`${V.name}: ${$}`);continue}}z.push(V)}z.length>0&&(h(z),t&&t(z))}else{const M=I[0];if(M.size>e){l(`File exceeds ${Math.round(e/(1024*1024))}MB.`),x(`File exceeds ${Math.round(e/(1024*1024))}MB.`);return}if(n){const z=n(M);if(z){l(z),x(z);return}}b(URL.createObjectURL(M)),M.type.startsWith("video/")&&Pl(M,C),o&&(p(M),o(M))}},[e,o,t,n,a]),j=()=>{var w;return(w=d.current)==null?void 0:w.click()};return g.useEffect(()=>()=>{y&&URL.revokeObjectURL(y),k&&URL.revokeObjectURL(k)},[y,k]),{previewUrl:y,thumbnailUrl:k,errorMessage:f,fileInputRef:d,videoRef:s,selectedFile:u,selectedFiles:m,handleFileChange:S,handleClick:j}},_l=({accept:e,isLoading:o=!1,progress:t=0,icon:n,text:i,previewUrl:a,thumbnailUrl:l,errorMessage:d,fileInputRef:s,videoRef:u,selectedFile:p,selectedFiles:m,handleFileChange:h,handleClick:f,multiple:x=!1,containerProps:y,errorMessageProps:b,progressProps:k,videoProps:C,imageProps:S,iconProps:j,textProps:w,fileType:I,previewUrl:M,renderError:z=({errorMessage:E,errorMessageProps:W,themeMode:P})=>r.jsx(c.Text,{color:"red",fontSize:12,marginTop:8,...W,...R==null?void 0:R.text,children:E}),renderText:V=({text:E,textProps:W})=>r.jsx(c.Text,{marginTop:8,...W,...R==null?void 0:R.text,children:E}),renderFile:$=({selectedFile:E,textProps:W})=>E?r.jsxs(c.Center,{marginTop:8,gap:10,flexDirection:"column",...R==null?void 0:R.container,children:[r.jsx(c.Text,{maxLines:2,...W,...R==null?void 0:R.text,children:E.name}),r.jsxs(c.Text,{...W,...R==null?void 0:R.text,children:["(",Math.round(E.size/1024)," KB)"]})]}):null,renderVideo:T=({selectedFile:E,videoRef:W,videoProps:P})=>r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...R==null?void 0:R.view,children:r.jsx(c.View,{as:"video",width:"100%",height:"100%",src:E?URL.createObjectURL(E):void 0,style:{objectFit:"cover"},ref:W,...P,...R==null?void 0:R.view})}),renderImage:_=({previewUrl:E,imageProps:W})=>(console.log("Rendering image with URL:",E),r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...R==null?void 0:R.view,children:r.jsx(c.Image,{src:E,alt:"Preview",width:"100%",height:"100%",objectFit:"cover",style:{maxHeight:"100%",maxWidth:"100%"},...W,...R==null?void 0:R.image})})),renderProgress:B=({progress:E,progressProps:W})=>r.jsxs(c.Horizontal,{gap:8,alignItems:"center",...W,...R==null?void 0:R.horizontal,children:[r.jsx(c.View,{height:4,backgroundColor:"rgba(0,0,0,0.1)",width:"100%",borderRadius:2,...R==null?void 0:R.view,children:r.jsx(c.View,{height:4,width:`${E}%`,borderRadius:2,backgroundColor:"color-dark-50",...R==null?void 0:R.view})}),r.jsxs(c.Text,{fontSize:12,...R==null?void 0:R.text,children:[E,"%"]})]}),views:R={}})=>{const E=M||a;return r.jsxs(c.Center,{onClick:f,cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,padding:16,flexDirection:"column",overflow:"hidden",position:"relative",height:p&&t===100?"200px":"auto",...y,...R==null?void 0:R.container,children:[t===100&&I==="image"&&E&&_({previewUrl:E,imageProps:S}),t===100&&I==="video"&&l&&T({selectedFile:p,thumbnailUrl:l,videoRef:u,videoProps:C,imageProps:S}),t===100&&I==="file"&&p&&$({selectedFile:p,textProps:w}),t<100&&(n||r.jsx(Vt,{widthHeight:32,...j})),!o&&!p&&i&&V({text:i,textProps:w}),o&&B({progress:t,progressProps:k}),!o&&d&&z({errorMessage:d,errorMessageProps:b}),r.jsx(c.View,{as:"input",type:"file",ref:s,onChange:h,accept:e,multiple:x,style:{display:"none"},...R==null?void 0:R.view})]})},Yo=({accept:e="*/*",icon:o,text:t,maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,isLoading:d=!1,progress:s=0,fileType:u,multiple:p=!1,...m})=>{const{previewUrl:h,thumbnailUrl:f,errorMessage:x,videoRef:y,fileInputRef:b,selectedFile:k,selectedFiles:C,handleFileChange:S,handleClick:j}=Wl({maxSize:n,onFileSelect:i,onMultipleFileSelect:a,validateFile:l,multiple:p}),I=(()=>{if(u)return u;if(k)return k.type.startsWith("image/")?"image":k.type.startsWith("video/")?"video":"file"})();return r.jsx(_l,{handleClick:j,accept:e,isLoading:d,progress:s,icon:o,text:t,maxSize:n,onFileSelect:i,validateFile:l,errorMessage:x,handleFileChange:S,selectedFile:k,selectedFiles:C,videoRef:y,fileInputRef:b,previewUrl:h,thumbnailUrl:f,fileType:I,multiple:p,...m})};function $l({onAudio:e,recording:o,paused:t,audioBlob:n,analyserNode:i,startRecording:a,stopRecording:l,pauseRecording:d,resumeRecording:s,resetRecording:u,handleFileChange:p,...m}){const[h,f]=g.useState(null);return g.useEffect(()=>{if(n){const x=URL.createObjectURL(n);return f(x),()=>{URL.revokeObjectURL(x)}}return f(null),()=>{}},[n]),r.jsxs(c.View,{gap:"8px",...m,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",margin:10,children:[r.jsx(Yo,{accept:"audio/*",icon:r.jsx(go,{widthHeight:16}),maxSize:100*1024*1024,onFileSelect:x=>e(x),fileType:"file",multiple:!1,renderError:({errorMessage:x})=>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:x=>x.size>100*1024*1024?"File size exceeds 100MB limit":x.type.startsWith("audio/")?null:"Only audio files are allowed"}),o?r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[r.jsx(c.View,{as:"button",type:"button",onClick:t?s: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:t?r.jsx(Ct,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(Mr,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.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:r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1})}),r.jsx(c.View,{minWidth:90,children:o&&r.jsx(Et,{analyserNode:i,isPaused:t})})]}):r.jsx(c.View,{as:"button",type:"button",onClick:a,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:r.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]}),h&&!o&&r.jsx("audio",{controls:!0,src:h})]})}function Hr(){const[e,o]=g.useState(!1),[t,n]=g.useState(!1),[i,a]=g.useState(0),[l,d]=g.useState(null),[s,u]=g.useState(null),[p,m]=g.useState(null),h=g.useRef(null),f=g.useRef(null),x=g.useRef(null),y=g.useRef(null),b=g.useRef([]),k=g.useRef(null),C=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),y.current&&(y.current.getTracks().forEach(V=>V.stop()),y.current=null),f.current&&(f.current.close(),f.current=null),x.current&&(x.current.disconnect(),x.current=null),u(null),k.current&&(clearInterval(k.current),k.current=null)},[]),j=g.useCallback(async()=>{S(),d(null),a(0),b.current=[];try{const V=await navigator.mediaDevices.getUserMedia({audio:!0});y.current=V;const $=MediaRecorder.isTypeSupported(C)?C:void 0,T=new MediaRecorder(V,$?{mimeType:$}:void 0);h.current=T;const _=new(window.AudioContext||window.webkitAudioContext);f.current=_;const B=_.createMediaStreamSource(V),R=_.createAnalyser();R.fftSize=256,R.smoothingTimeConstant=.8,B.connect(R),x.current=R,u(R),T.ondataavailable=E=>{E.data.size>0&&b.current.push(E.data)},T.onstop=()=>{const E=new Blob(b.current,{type:T.mimeType||C});m(E),S()},T.start(),o(!0),n(!1),k.current=setInterval(()=>{a(E=>E+1)},1e3)}catch{d("Microphone access denied or unavailable."),S()}},[S]),w=g.useCallback(()=>{h.current&&h.current.state!=="inactive"&&h.current.stop(),o(!1),n(!1),k.current&&(clearInterval(k.current),k.current=null)},[]),I=g.useCallback(()=>{h.current&&h.current.state==="recording"&&(h.current.pause(),n(!0),k.current&&(clearInterval(k.current),k.current=null))},[]),M=g.useCallback(()=>{h.current&&h.current.state==="paused"&&(h.current.resume(),n(!1),k.current||(k.current=setInterval(()=>{a(V=>V+1)},1e3)))},[]),z=g.useCallback(()=>{S(),o(!1),n(!1),m(null),a(0),d(null),b.current=[]},[S]);return g.useEffect(()=>()=>S(),[S]),{recording:e,paused:t,audioBlob:p,analyserNode:s,duration:i,error:l,startRecording:j,stopRecording:w,pauseRecording:I,resumeRecording:M,resetRecording:z}}function Hl(e){const{onAudio:o}=e,{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:u,resetRecording:p}=Hr();return g.useEffect(()=>{if(i&&o){const h=new File([i],"recording.webm",{type:i.type||"audio/webm;codecs=opus"});o(h)}},[i,o]),{recording:t,paused:n,audioBlob:i,analyserNode:a,startRecording:l,stopRecording:d,pauseRecording:s,resumeRecording:u,resetRecording:p,handleFileChange:h=>{var x;const f=(x=h.target.files)==null?void 0:x[0];f&&o&&o(f)}}}function Bl(e){const o=Hl(e);return r.jsx($l,{...e,...o})}const Ll=()=>{const[e,o]=g.useState(!1);return{imageError:e,setImageError:o}},Al={xs:24,sm:32,md:48,lg:64,xl:80},rt={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"}},Dl=({src:e,size:o="md",fallback:t="IM",views:n,imageError:i,setImageError:a,onClick:l=()=>{},children:d})=>{const s=Al[o],u={...rt.image,...(n==null?void 0:n.image)||{}};return r.jsxs(c.Center,{role:"avatar",width:s,height:s,...rt.container,borderColor:i?"color-gray-400":"transparent",onClick:l,...n==null?void 0:n.container,children:[!i&&e?r.jsx(c.Image,{alt:"IM",src:e,style:u,width:s,height:s,onError:()=>a(!0)}):r.jsx(c.Text,{size:o,...rt.fallback,...n==null?void 0:n.fallback,children:t}),d]})},Fl=({src:e,size:o,views:t,fallback:n,onClick:i,children:a})=>{const{imageError:l,setImageError:d}=Ll();return r.jsx(Dl,{src:e,size:o,views:t,fallback:n,imageError:l,setImageError:d,onClick:i,children:a})},Ol=Fl,ql={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"}},Nl={square:0,rounded:"8px",pill:"9999px"},Ul={"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"}},Gl=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"}}),Br=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"}}}),Yl=({content:e,children:o,icon:t,pastil:n,position:i,shape:a="pill",variant:l="filled",size:d="md",views:s,themeMode:u,...p})=>{const{themeMode:m}=c.useTheme(),h=Gl()[l],f=Br(),x={width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",borderRadius:Nl[a],...ql[d],...h,...i?Ul[i]:{},...s==null?void 0:s.container};let y="currentColor";return typeof n=="string"?n in f?y=f[n].indicator.backgroundColor:y=n:n===!0&&(y="color-green-500",l==="filled"&&(y="color-white")),r.jsxs(c.Center,{role:"badge",...x,...p,children:[t&&r.jsx(c.View,{role:"badge-icon",...s==null?void 0:s.icon,children:t}),n&&r.jsx(c.View,{role:"badge-pastil",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:y,...s==null?void 0:s.pastil}),(e||o)&&r.jsx(c.Text,{role:"badgeText",fontWeight:"500",textAlign:"center",...s==null?void 0:s.text,color:x.color,children:o||e})]})},vl=e=>r.jsx(Yl,{...e}),Xl=()=>{const[e,o]=g.useState(!1);return{isHovered:e,setIsHovered:o}},Kl={xs:12,sm:14,md:16,lg:18,xl:20},Ql=({children:e,to:o="/",iconSize:t="sm",underline:n="default",isHovered:i=!1,isExternal:a=!1,views:l={icon:{},text:{}},setIsHovered:d=()=>{},...s})=>{const u=()=>{n==="hover"&&d(!0)},p=()=>{n==="hover"&&d(!1)},m=()=>n==="underline"||n==="hover"&&i?"underline":"none";return r.jsx(va.Link,{to:o,target:a?"_blank":"_self",style:{textDecoration:"inherit",color:"inherit"},children:r.jsxs(c.Horizontal,{onMouseEnter:u,onMouseLeave:p,gap:3,alignItems:"center",flexWrap:"nowrap",textDecoration:m(),...l.text,...s,children:[e,a&&r.jsx(Vr,{widthHeight:Kl[t]})]})})},Zl=e=>{const o=Xl();return r.jsx(Ql,{...o,...e})},Lr=Zl,Pt={xs:14,sm:18,md:22,lg:26,xl:30},Wt={fast:50,normal:100,slow:300},Jl=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${s}px`,height:`${s}px`,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:`rotate(${u}deg)`},...i,children:[r.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),r.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("g",{id:"SVGRepo_iconCarrier",children:r.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})})]})},ec=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${u}deg)`},...i,children:[r.jsx("circle",{cx:"10",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"25",cy:"25",r:"4",fill:d}),r.jsx("circle",{cx:"40",cy:"25",r:"4",fill:d})]})},oc=({size:e="md",speed:o="normal",color:t="theme-loading",themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=a(t,{themeMode:n||l}),s=typeof e=="number"?e:Pt[e],[u,p]=g.useState(0);return g.useEffect(()=>{const m=setInterval(()=>{p(h=>h+45)},Wt[o]);return()=>clearInterval(m)},[o]),r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:`${s}px`,height:`${s}px`,style:{transform:`rotate(${u}deg)`},...i,children:r.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:d,strokeWidth:"5",strokeDasharray:"1,10"})})},tc=({size:e,children:o,textColor:t,loaderColor:n,type:i="default",speed:a="normal",textPosition:l="right",views:d,...s})=>{const{getColor:u}=c.useTheme();n=u(n||s.color||"theme-loading"),t=u(t||s.color||"theme-loading");const p={size:e,speed:a,color:n},m={default:r.jsx(Jl,{...p}),dotted:r.jsx(ec,{...p}),quarter:r.jsx(oc,{...p})};return r.jsxs(c.Center,{gap:10,flexDirection:l==="top"||l==="bottom"?"column":"row",...s,...d==null?void 0:d.container,children:[(l==="left"||l==="top")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o}),m[i],(l==="right"||l==="bottom")&&o&&r.jsx(c.View,{color:t,...d==null?void 0:d.text,children:o})]})},rc=e=>r.jsx(tc,{...e}),so=rc,nc={xs:10,sm:12,md:14,lg:16,xl:20},eo={xs:12,sm:16,md:20,lg:24,xl:28},oo=e=>({minHeight:eo[e]*2,paddingHorizontal:eo[e]/2,fontSize:nc[e],fontWeight:500,lineHeight:eo[e],letterSpacing:"-0.01em",paddingInline:eo[e],paddingBlock:eo[e]/2,outlineWidth:"medium"}),Ar={xs:oo("xs"),sm:oo("sm"),md:oo("md"),lg:oo("lg"),xl:oo("xl")},co={square:0,rounded:8,pill:999},Dr={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}},ac=(e,o,t=!1)=>{const n=t?o:e,i=t?e:o,a=t?o:e;return{filled:{backgroundColor:n,color:i,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 ${n}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},empty:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},outline:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease"},ghost:{backgroundColor:"transparent",color:a,borderWidth:1,borderStyle:"solid",borderColor:"transparent",_hover:{borderWidth:1,borderStyle:"solid",borderColor:a,color:a,opacity:.9},_active:{opacity:.95},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"background-color 0.2s ease, opacity 0.2s ease"},link:{backgroundColor:"transparent",color:a,borderWidth:0,borderStyle:"none",borderColor:"transparent",textDecoration:"underline",textUnderlineOffset:"2px",textDecorationThickness:"1px",textDecorationColor:a,_hover:{opacity:.8},_active:{opacity:.9},_focusVisible:{outline:"none",boxShadow:`0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px ${a}`},transition:"opacity 0.2s ease"},subtle:{backgroundColor:t?`color-mix(in srgb, ${a} 20%, transparent)`:`color-mix(in srgb, ${a} 5%, transparent)`,color:a,borderWidth:1,borderStyle:"solid",borderColor:a,_hover:{backgroundColor:t?`color-mix(in srgb, ${a} 40%, transparent)`:`color-mix(in srgb, ${a} 15%, transparent)`},_active:{backgroundColor:t?"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 ${a}`},transition:"all 0.2s ease"}}},ic=({children:e,icon:o,isLoading:t,iconPosition:n="left",loaderPosition:i="left",size:a="md",resolvedTextColor:l,isIconRounded:d,views:s})=>{const u=["left","right"].includes(n)?c.Horizontal:c.Vertical,p=Ar[a],m=d?Dr[a]:{};return r.jsxs(u,{gap:8,alignItems:"center",justifyContent:"center",...p,...m,...s==null?void 0:s.content,children:[t&&i==="left"&&r.jsx(so,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader}),o&&["left","top"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),e,o&&["right","bottom"].includes(n)&&!t&&r.jsx(c.View,{color:l,...s==null?void 0:s.icon,children:o}),t&&i==="right"&&r.jsx(so,{size:a==="xs"||a==="sm"?"sm":"md",color:l,...s==null?void 0:s.loader})]})},lc=e=>{const o=co[e];return typeof o=="number"?o:typeof o=="string"&&parseInt(o,10)||0},cc=({asComponent:e,isDisabled:o,isLoading:t,isWrapped:n=!1,borderRadius:i,width:a,height:l,baseStyles:d,sizeStyles:s,iconPad:u,mainTone:p,resolvedTextColor:m,children:h,borderWidth:f=0,...x})=>r.jsx(c.Element,{as:e,disabled:!!(o||t),display:n?"flex":"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:i,width:a,height:l,...d,...s,...u,backgroundColor:(d==null?void 0:d.backgroundColor)||(n?p:void 0),color:m,borderWidth:n?0:void 0,cursor:o?"default":"pointer",...x,children:h}),sc=({shape:e,isDisabled:o,onClick:t,shadow:n,borderWidth:i,isAuto:a,isFilled:l,views:d,children:s,...u})=>r.jsx(c.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[e],cursor:o?"default":"pointer",onClick:t,boxShadow:n,padding:i,width:a?"fit-content":l?"100%":void 0,...d==null?void 0:d.container,...u,children:s}),dc=({variant:e,animation:o,to:t,isDisabled:n,isLoading:i,isAuto:a,isFilled:l,isExternal:d,shape:s="rounded",shadow:u,onClick:p,views:m,baseStyles:h,sizeStyles:f,iconPad:x,resolvedTextColor:y,content:b,size:k,mainTone:C,borderMovingDuration:S=2,borderMovingGradientColors:j=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:w="#705CFF",animatedStrokeTextColor:I="#333333",getColor:M=V=>V,...z})=>{var _;const V=lc(s),$=t?r.jsx(Lr,{to:t,isExternal:d,color:"currentColor",textDecoration:"inherit",_hover:{color:"currentColor"},...m==null?void 0:m.link,children:b}):b,T={isDisabled:n,isLoading:i,baseStyles:h,sizeStyles:f,iconPad:x,resolvedTextColor:y,mainTone:C,children:$};if(o==="borderMoving"&&j){const R={from:{backgroundPosition:"0% 50%"},to:{backgroundPosition:"200% 50%"},duration:`${S}s`,timingFunction:"linear",iterationCount:"infinite"};return r.jsx(sc,{shape:s,isDisabled:n,onClick:p,shadow:u,borderWidth:3,isAuto:a,isFilled:l,views:m,background:`linear-gradient(90deg, ${j[0]}, ${j[1]}, ${j[2]}, ${j[0]})`,backgroundSize:"200% 100%",animate:R,...z,children:r.jsx(cc,{asComponent:t?"div":"button",isWrapped:!0,borderRadius:Math.max(0,V-3),width:"100%",height:"100%",...T})})}if(o==="animatedStroke"){const B=M(w),R=M(I),E=1e3,W={from:{strokeWidth:"8px",strokeDasharray:`0 ${E}`,strokeDashoffset:-Math.round(E*.63)},to:{strokeWidth:"3px",strokeDasharray:`${E}`,strokeDashoffset:0},duration:"0.9s",timingFunction:"ease-in",fillMode:"forwards"},P=["group",(_=m==null?void 0:m.container)==null?void 0:_.className,z==null?void 0:z.className].filter(Boolean).join(" ");return r.jsxs(c.Element,{as:t?"div":"button",type:t?void 0:"button",disabled:!!(!t&&(n||i)),onClick:p,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"all 0.2s ease",cursor:n?"default":"pointer",color:R,backgroundColor:"transparent",borderWidth:0,...m==null?void 0:m.container,...z,className:P,children:[r.jsx(c.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:r.jsx(c.View,{as:"rect",x:"0",y:"0",height:"100%",width:"100%",rx:V,ry:V,fill:"transparent",stroke:B,strokeWidth:"8px",strokeDasharray:`0 ${E}`,strokeDashoffset:-Math.round(E*.63),pathLength:E,on:{groupHover:{animate:W}}})}),r.jsx(c.View,{position:"relative",zIndex:0,children:$})]})}if(o==="borderReveal"){const R=(j==null?void 0:j[0])||C||"#000000",W=S*.75/4,P=`linear-gradient(90deg, ${R} 50%, transparent 50%)`,H=`linear-gradient(180deg, ${R} 50%, transparent 50%)`,L=`linear-gradient(270deg, ${R} 50%, transparent 50%)`,A=`linear-gradient(0deg, ${R} 50%, transparent 50%)`,F="100% 0, 100% 100%, 0 100%, 0 0",D="0 0, 100% 0, 100% 100%, 0 100%",O=`0s, ${W}s, ${W*2}s, ${W*2}s`,v=`${W*2}s, ${W*2}s, ${W}s, 0s`,X=4;return r.jsx(c.Element,{as:"div",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:co[s],cursor:n?"default":"pointer",onClick:p,boxShadow:u,padding:3,background:`
|
|
29
2
|
${P} no-repeat,
|
|
3
|
+
${H} no-repeat,
|
|
30
4
|
${L} no-repeat,
|
|
31
|
-
${
|
|
32
|
-
${D} no-repeat
|
|
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],B=(L==null?void 0:L.color)??W,D=n.jsx(Hs,{icon:b,isLoading:m,iconPosition:r,loaderPosition:a,size:t,resolvedTextColor:B,isIconRounded:x,views:w,children:y}),F=zn[t],A=x?En[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:B,content:D,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"}}},Vn=g.createContext({}),ir=()=>g.useContext(Vn),Vo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ir(),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})},Po=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ir(),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})},Wo=({children:e,views:t,style:o,themeMode:r,...a})=>{var u;const i=s.useTheme(),{styles:l}=ir(),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===Vo||I.type===Po||I.type===Wo)),{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(Vn.Provider,{value:f,children:n.jsx(s.View,{...S,children:b?r:n.jsxs(s.Vertical,{width:"100%",children:[a&&n.jsx(Vo,{children:a}),n.jsx(Po,{children:r}),i&&n.jsx(Wo,{children:i})]})})})},Ys=e=>n.jsx(Gs,{...e}),so=Ys;so.Header=Vo;so.Content=Po;so.Footer=Wo;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(()=>Fo("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 H=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},[]),B=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]),D=l||b>0,F=l||b<p-1;return{activeIndex:b,totalSlides:p,goToSlide:_,nextSlide:T,prevSlide:$,canGoNext:F,canGoPrevious:D,handleMouseEnter:H,handleMouseLeave:z,handleDragStart:V,handleDragMove:W,handleDragEnd:P,registerSlide:L,unregisterSlide:B,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}}),Pn=g.createContext(null),uo=()=>{const e=g.useContext(Pn);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},Wn=({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}),_n=({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})})},Ln=({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})},Hn=({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:H,handleDragStart:z,handleDragMove:V,handleDragEnd:W}=I,P=()=>{if(!a)return null;const D=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:D}),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((D,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(D=>g.isValidElement(D)&&(D.type===Hn||D.type===Ln||D.type===_n||D.type===$n)),[e])?n.jsx(Pn.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:H,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((D,F)=>n.jsx(Wn,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:D},F))}),P(),L()]})},Zs=e=>n.jsx(Js,{...e}),tt=Zs;tt.Slide=Wn;tt.Content=Hn;tt.Item=Ln;tt.Previous=_n;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"},Bn={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}},lr={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={...lr},ud={...lr,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},pd={...lr,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,...Bn,...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],H=e.series.reduce((L,B)=>{const D=B.data[R];return L+(typeof D=="number"?D:0)},0),z=H>0?(M/H*100).toFixed(1):null,V=w.color?u(w.color):"black",W=L=>{const B=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:H.toLocaleString()})]})]})]});l(L.clientX,L.clientY,B)},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,...Bn,...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 B=L.data[I];return P+(typeof B=="number"?B:0)},0),T=_>0?(w/_*100).toFixed(1):null,$=I>0&&typeof j.data[I-1]=="number"?j.data[I-1]:null,H=typeof $=="number"?w-$:null,z=typeof H=="number"?`${H>=0?"+":""}${H.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,H=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,B=E>Math.PI?1:0;let D;a?D=[`M ${T} ${$}`,`A ${f} ${f} 0 ${B} 1 ${H} ${z}`,`L ${P} ${L}`,`A ${k} ${k} 0 ${B} 0 ${V} ${W}`,"Z"].join(" "):D=[`M ${b} ${y}`,`L ${T} ${$}`,`A ${f} ${f} 0 ${B} 1 ${H} ${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:D,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 H=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"?H=E.clientX-100:H=E.clientX+10,h.space.vertical==="top"?z=E.clientY-30:z=E.clientY+10}l(H,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:H,showTooltip:z,hideTooltip:V,getChartDimensions:W}=gd({data:t,dataPoints:o,animated:c,animationDuration:u,showTooltips:d}),P=H(),{width:L,height:B}=W(),D=m||L,F=x||(p?L/h:B),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:D,height:F,animationProgress:_,showGrid:l,onBarClick:y,showTooltip:z,hideTooltip:V,views:f});case"line":case"area":return n.jsx(md,{data:P,width:D,height:F,animationProgress:_,showGrid:l,onPointClick:y,showTooltip:z,hideTooltip:V,views:f});case"pie":case"donut":return n.jsx(fd,{dataPoints:P,width:D,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(()=>Fo("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}},Tr={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"}},Mr={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:()=>{}}),Rd=({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},An=({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})},cr=({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(On,{views:i},`divider-${w}`):n.jsx(Fn,{item:C,views:i},C.id)),t]})},Fn=({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,...Tr[c],_hover:k?{}:Mr.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(cr,{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,...Tr[c],_hover:r?{}:Mr.hover,...a==null?void 0:a.item,...i,children:t})},On=({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(An,{disableNativeContextMenu:a,views:i,...d,children:e}),n.jsx(cr,{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=An;ot.Content=cr;ot.Item=Fn;ot.Divider=On;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}),vn=({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}},Nn=({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?Hi.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}),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(_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})]}));Te.displayName="FieldContainer";const Un={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Rr={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},qn={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,...Un[i],...qn[l],...x==null?void 0:x.container,...f,children:o})},sr=({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}},Hd=({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})},Bd=e=>n.jsx(Hd,{...e}),jt=Bd,Be=({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:Rr[t],lineHeight:Rr[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}),Gn={xs:12,sm:14,md:16,lg:20,xl:24},Dd={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"}},zr={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",...Dd,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:Gn[t],onClick:a,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},Yn=({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:H}=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),B=A=>{document.dispatchEvent(new Event("closeAllSelects")),A&&A.stopPropagation&&A.stopPropagation();const O=!l;C(O),M(!O)},D=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||B(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(Be,{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(sr,{children:!m&&!h&&n.jsx(s.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?zr.closed:zr.open,children:n.jsx(ie,{color:"inherit",widthHeight:Gn[b],style:j.icon,orientation:"down"})})}),!l&&x.length>0&&n.jsx(Nn,{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:D,highlightedIndex:E,setHighlightedIndex:R,selectedValue:r})})})]})})},Xd=e=>{const t={...e,options:e.options||[]},o=vn(t);return n.jsx(Yn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},Kd=Xd,Xn=({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}}},Er={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}),Kn=({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",...Er.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)",...Er.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=Xn(e);return n.jsx(Kn,{...t,...e})},ou=tu,Qn=({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}},Jn=({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=Qn(t);return n.jsx(Jn,{...o,...t,onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(r)}})},nu=ru,Zn=({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}},ea=({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:{}},...H})=>{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=D=>{w(D),_(!1)},B=D=>{typeof D=="string"?(E(D),I&&I(D)):(E(D.target.value),I&&I(D.target.value))};return n.jsx(Te,{helperText:d,error:r,views:$,...H,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(Be,{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:D=>B(D),...V,style:{resize:y||b?"none":"vertical"},...$==null?void 0:$.textarea})]})})})},au=e=>{const t=Zn(e);return n.jsx(ea,{...t,...e})},iu=au,dr=({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:H=()=>{},themeMode:z,...V})=>{const{getColor:W,themeMode:P}=s.useTheme(),L=W("color-blueGray-700",{themeMode:z||P}),B=!!(k&&o),D={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=>{H&&H(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&&(H({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:B,onMouseEnter:A,onMouseLeave:A,children:[l,n.jsxs(rt,{children:[B&&n.jsx(Be,{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",...D,...V,onChange:Y,value:a})]}),w&&a&&!C&&!S&&n.jsx(sr,{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=dr(e);return n.jsx(St,{...t,...e})},wt=cu,ta=({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"}},Vr={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"}},Co={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"}}},oa=({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?Co.error[E]:x?Co.disabled[E]:m?Co.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(rn,{widthHeight:Vr[u],color:"white",transition:"all 0.2s ease"}):(a||h)&&(t??n.jsx(oo,{widthHeight:Vr[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=ta(e);return n.jsx(oa,{...t,...e})},pu=uu,ra=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(D=>D!==W),B=[W,...L].slice(0,c);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(B))}catch(D){console.warn("Failed to save recent colors to localStorage:",D)}return B})},[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)},[]),H=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:H,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"}],na=({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:H,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},B={...st.dropdown,...i==null?void 0:i.dropdown},D={...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:H,...B,children:[n.jsx(s.View,{...D,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=ra(e);return n.jsx(na,{...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"}],aa=({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}},Pr={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))})},ia=({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:H}=s.useTheme(),z=$("color-blueGray-700",{themeMode:_||H}),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)},B=A=>{S(A),M(!1)},D=!!(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:D,_hover:!h&&!d?{borderColor:"theme-primary"}:void 0,children:[n.jsxs(rt,{children:[D&&n.jsx(Be,{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:B,onFocus:V,...F,...T,value:r,onChange:L})]}),n.jsx(sr,{children:l?n.jsx(ie,{orientation:"down",widthHeight:Pr[b],color:z,style:E.icon}):n.jsx(ie,{orientation:"up",widthHeight:Pr[b],color:z,style:E.icon})})]}),!l&&n.jsx(Su,{size:b,views:E,options:f,callback:W})]})},wu=e=>{const t=aa(e);return n.jsx(ia,{...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 He(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=He(t);return new Date(o+r)}function zu(e,t){he(2,arguments);var o=He(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 la(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=la(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=He((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 ca(e,t){var o,r,a,i,l,d,c,u;he(1,arguments);var p=je(e),h=p.getUTCFullYear(),m=po(),x=He((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=He((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=ca(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 Hu=6048e5;function Bu(e,t){he(1,arguments);var o=je(e),r=Qt(o,t).getTime()-Lu(o,t).getTime();return Math.round(r/Hu)+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"},Du={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=ca(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=la(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=Bu(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 _r(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 _r(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"+Wr(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"+Wr(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 Wr(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 _r(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"})}},sa=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}}",sa(i,o))},Fu={p:sa,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 Lr(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 jo(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:jo({formats:Xu,defaultWidth:"full"}),time:jo({formats:Ku,defaultWidth:"full"}),dateTime:jo({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=He((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=He((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 H=Fu[$];return H(T,S.formatLong)}return T}).join("").match(Tp).map(function(T){if(T==="''")return"'";var $=T[0];if($==="'")return Pp(T);var H=Du[$];if(H)return qu(T)&&Lr(T,t,String(e)),Uu(T)&&Lr(T,t,String(e)),H(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 da=()=>{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}),ua=({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(Be,{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=da();return n.jsx(ua,{...t,...e})},$p=_p,pa=e=>{const t=dr(e),[o,r]=g.useState(!1);return{isVisible:o,setIsVisible:r,...e,...t}},Lp=({visibleIcon:e=n.jsx(Yo,{widthHeight:14}),hiddenIcon:t=n.jsx(Go,{widthHeight:14}),...o})=>{const{isVisible:r,setIsVisible:a,...i}=pa(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})})},Hp=Lp,ga=(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}},Bp={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)"},Hr={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)"}},Dp={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"},Br={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"},ha=({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),[$,H]=g.useState(!1),z=()=>{var O;const B=$?Hr.enter:Hr.initial;if(!M.current)return{};const D=M.current.getBoundingClientRect(),F={position:"fixed",left:D.left,width:D.width,zIndex:1e4,...B};return((O=R==null?void 0:R.space)==null?void 0:O.vertical)==="top"?{...F,bottom:window.innerHeight-D.top+6}:{...F,top:D.bottom+6}};g.useEffect(()=>{if(S){const B=setTimeout(()=>H(!0),10);return()=>clearTimeout(B)}H(!1)},[S]),g.useEffect(()=>{const B=D=>{!D.composedPath().some(O=>(O==null?void 0:O.id)==="combobox-dropdown")&&M.current&&!M.current.contains(D.target)&&C(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const V=B=>{if(y(B),B==="")k(t);else{const D=t.filter(F=>F.label.toLowerCase().includes(B.toLowerCase()));k(D)}f(0)},W=B=>{if(w){const D=h.some(A=>A.value===B.value);let F;D?F=h.filter(A=>A.value!==B.value):F=[...h,B],m(F),r==null||r(F)}else u(B),r==null||r(B),C(!1)},P=(B,D)=>{B.stopPropagation();const F=h.filter(A=>A.value!==D.value);m(F),r==null||r(F)},L=B=>w?h.some(D=>D.value===B.value):B.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(B=>n.jsxs(s.Horizontal,{...Op,_hover:{backgroundColor:"color-gray-200"},children:[B.icon&&n.jsx(s.View,{flexShrink:0,children:B.icon}),n.jsx(s.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:B.label}),n.jsx(ye,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:D=>P(D,B)})]},B.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?Br.open:Br.closed,children:n.jsx(ie,{widthHeight:16,orientation:"down",color:S?"color-gray-700":"color-gray-400"})})]})]})}),S&&n.jsx(Nn,{children:n.jsxs(s.View,{ref:E,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...Bp,style:z(),...j==null?void 0:j.dropdown,children:[a&&n.jsx(s.View,{...Dp,children:n.jsx(St,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:b,onChange:B=>V(B),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((B,D)=>{const F=L(B),A=D===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(D),onClick:()=>W(B),...j==null?void 0:j.item,children:[n.jsxs(s.Horizontal,{gap:8,alignItems:"center",children:[B.icon&&n.jsx(s.View,{flexShrink:0,children:B.icon}),n.jsx(s.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:B.label})]}),F&&o&&n.jsx(oo,{widthHeight:16,color:"theme-primary"})]},B.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=ga(o,r,a);return n.jsx(ha,{id:e,name:t,items:o,...l,...i})},Np=vp,ma=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((H,z)=>({id:`tag-${z}-${Date.now()}`,value:H})):b;g.useEffect(()=>{t&&Array.isArray(t)&&y(t.map((H,z)=>({id:`tag-${z}-${Date.now()}`,value:H})))},[t]);const I=g.useCallback(H=>{const z=H.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(H=>{if(h||m)return;const z=H.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(H=>{if(h||m)return;const z=w[H];if(!z)return;const V=w.filter((P,L)=>L!==H),W=V.map(P=>P.value);t||y(V),r==null||r(W),i==null||i(z.value,H)},[w,r,i,h,m,t]),E=g.useCallback(H=>{if(h||m)return;const z=H.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(H=>{if(h||m)return;const{key:z}=H;if(p.includes("enter")&&z==="Enter"){H.preventDefault(),x.trim()&&M(x);return}if(p.includes("tab")&&z==="Tab"&&x.trim()){H.preventDefault(),M(x);return}if(p.includes("space")&&z===" "&&x.trim()){H.preventDefault(),M(x);return}if(z==="Backspace"&&!x&&w.length>0){H.preventDefault(),R(w.length-1);return}},[M,R,x,w,p,h,m]),T=g.useCallback(()=>{var H;j(!0),(H=e.onFocus)==null||H.call(e)},[e.onFocus]),$=g.useCallback(()=>{var H;j(!1),x.trim()&&M(x),(H=e.onBlur)==null||H.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"})})]})},fa=({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:$,...H})=>{const{getColor:z,themeMode:V}=s.useTheme(),W=!!(o&&(S||d.length>0||l)),P=w&&d.length>=w,L={...Un[x],...qn[f],...h==null?void 0:h.inputContainer},B={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,...H,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(Be,{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((D,F)=>n.jsx(Up,{tag:D.value,onRemove:()=>_==null?void 0:_(F),isRemovable:j,size:m,views:h,isDisabled:b,isReadOnly:y},D.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",...B}),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=ma(e),{tags:o,...r}=e;return n.jsx(fa,{...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 xa=({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),H=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]),B=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]),D=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;H.current.value!==U.value&&H.current.onChange&&H.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 Li=Z[0]===Z[1]&&Z[0]<N;ce==="backward"&&!Li&&(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:B,handleBlur:D,handleKeyDown:F,handleKeyPress:A,handlePaste:O}},Xp=g.createContext({slots:[],isFocused:!1,isHovering:!1}),Kp=`
|
|
5
|
+
${A} no-repeat
|
|
6
|
+
`,backgroundSize:`200% ${X}px, ${X}px 200%, 200% ${X}px, ${X}px 200%`,backgroundPosition:F,transitionProperty:"background-position",transitionDuration:`${W}s`,transitionTimingFunction:"linear",transitionDelay:v,_hover:{backgroundPosition:D,transitionDelay:O},width:a?"fit-content":l?"100%":void 0,...m==null?void 0:m.container,...z,children:r.jsx(c.View,{as:t?"div":"button",disabled:!!(n||i),display:"flex",alignItems:"center",justifyContent:"center",borderRadius:Math.max(0,V-3),width:"100%",height:"100%",...h,...f,...x,backgroundColor:(h==null?void 0:h.backgroundColor)||C,color:y,borderWidth:0,cursor:n?"default":"pointer",children:$})})}return r.jsx(c.Element,{as:e==="link"&&t?"div":"button",type:e==="link"&&t?void 0:"button",disabled:!!(n||i),...f,...x,display:"inline-flex",alignItems:"center",justifyContent:"center",width:a?"fit-content":l?"100%":void 0,borderRadius:co[s],boxShadow:u,transition:"all 0.2s ease",cursor:n?"default":"pointer",onClick:p,...h,...m==null?void 0:m.container,...z,children:$})},uc=({variant:e="filled",size:o="md",shape:t="rounded",iconPosition:n="left",loaderPosition:i="left",backgroundColor:a,color:l,textColor:d,reversed:s=!1,isAuto:u=!0,isFilled:p,isDisabled:m,isLoading:h,isIconRounded:f,isHovered:x,icon:y,children:b,to:k,isExternal:C,shadow:S,onClick:j,views:w={},borderMovingDuration:I=2,borderMovingGradientColors:M=["#705CFF","#FF5C97","#FFC75C"],animatedStrokeAccentColor:z="#705CFF",animatedStrokeTextColor:V="#333333",...$})=>{const{getColorHex:T}=c.useTheme();let R=T(m?"theme-disabled":h?"theme-loading":a??l??"theme-button-background");(R==="theme-button-background"||R==="theme-loading")&&(R=T(h?"color-dark-500":"theme-primary"));let W=T(d??"theme-button-text");W==="theme-button-text"&&(W=T("color-white"));const H=g.useMemo(()=>ac(R,W,s),[R,W,s])[e],L=(H==null?void 0:H.color)??W,A=r.jsx(ic,{icon:y,isLoading:h,iconPosition:n,loaderPosition:i,size:o,resolvedTextColor:L,isIconRounded:f,views:w,children:b}),F=Ar[o],D=f?Dr[o]:{};return r.jsx(dc,{variant:e,animation:$.animation,to:k,isDisabled:m,isLoading:h,isAuto:u,isFilled:p,isExternal:C,shape:t,shadow:S,onClick:j,views:w,baseStyles:H,sizeStyles:F,iconPad:D,resolvedTextColor:L,content:A,size:o,mainTone:R,borderMovingDuration:I,borderMovingGradientColors:M,animatedStrokeAccentColor:z,animatedStrokeTextColor:V,getColor:T,...$})},gc=e=>{const[o,t]=c.useHover();return r.jsx(uc,{ref:o,isHovered:t,...e})},We=gc,pc={sm:{padding:"12px"},md:{padding:"16px"},lg:{padding:"24px"}},mc={square:0,rounded:"8px",pill:"24px"},hc=e=>{const o=e==="dark";return{default:{backgroundColor:o?"color-gray-900":"color-white",border:"none",transition:"background-color 0.2s ease, box-shadow 0.2s ease"},outlined:{backgroundColor:o?"color-gray-900":"color-white",borderWidth:"1px",borderStyle:"solid",borderColor:o?"color-gray-700":"color-gray-200",transition:"border-color 0.2s ease, box-shadow 0.2s ease",_hover:{borderColor:o?"color-gray-600":"color-gray-300",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"}},elevated:{backgroundColor:o?"color-gray-900":"color-white",boxShadow:o?"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:o?"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)"}}}},vo=e=>{const o=e.themeMode==="dark";return{container:{backgroundColor:o?"color-gray-900":"color-white",color:o?"color-white":"color-black",borderRadius:"8px",overflow:"hidden",transition:"all 0.2s ease"},header:{padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:o?"color-gray-800":"color-gray-100",color:"theme-primary"},content:{padding:"16px",color:o?"color-gray-300":"color-gray-600"},footer:{padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:o?"color-gray-800":"color-gray-100"}}},Fr=g.createContext({}),_t=()=>g.useContext(Fr),ut=({children:e,views:o,style:t,themeMode:n,...i})=>{var u;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).header,s={...d,...l==null?void 0:l.header,...i,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.header)==null?void 0:u.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},gt=({children:e,views:o,style:t,themeMode:n,...i})=>{var u;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).content,s={...d,...l==null?void 0:l.content,...i,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.content)==null?void 0:u.style,...t}};return r.jsx(c.Vertical,{gap:12,...s,children:e})},pt=({children:e,views:o,style:t,themeMode:n,...i})=>{var u;const a=c.useTheme(),{styles:l}=_t(),d=vo(a).footer,s={...d,...l==null?void 0:l.footer,...i,style:{...d==null?void 0:d.style,...(u=l==null?void 0:l.footer)==null?void 0:u.style,...t}};return r.jsx(c.Vertical,{gap:8,...s,children:e})},fc=({variant:e="default",size:o="md",shape:t="rounded",children:n,header:i,footer:a,isFullWidth:l=!1,views:d,style:s,themeMode:u,...p})=>{var j,w;const m=c.useTheme(),h=vo(m),f=((j=pc[o])==null?void 0:j.padding)||"16px",x=g.useMemo(()=>({styles:{container:{...h.container,borderRadius:mc[t],...d==null?void 0:d.container},header:{...h.header,padding:f,...d==null?void 0:d.header},content:{...h.content,padding:f,...d==null?void 0:d.content},footer:{...h.footer,padding:f,...d==null?void 0:d.footer}}}),[h,d,f,t]),y=g.Children.toArray(n).some(I=>g.isValidElement(I)&&(I.type===ut||I.type===gt||I.type===pt)),{themeMode:b}=m,C=hc(u||b)[e],S={width:l?"100%":"auto",overflow:"hidden",...C,...x.styles.container,...p,style:{...(w=x.styles.container)==null?void 0:w.style,...s}};return r.jsx(Fr.Provider,{value:x,children:r.jsx(c.View,{...S,children:y?n:r.jsxs(c.Vertical,{width:"100%",children:[i&&r.jsx(ut,{children:i}),r.jsx(gt,{children:n}),a&&r.jsx(pt,{children:a})]})})})},xc=e=>r.jsx(fc,{...e}),Xo=xc;Xo.Header=ut;Xo.Content=gt;Xo.Footer=pt;const bc=({defaultActiveIndex:e=0,activeIndex:o,onChange:t,autoPlay:n=!1,autoPlayInterval:i=3e3,pauseOnHover:a=!0,infinite:l=!0,totalSlides:d,stepIndices:s})=>{const u=g.useRef(d||0),[p,m]=g.useState(d||0),h=g.useRef(new Set),f=g.useRef(0),x=g.useMemo(()=>jt("carousel-content"),[]),[y,b]=g.useState(o!==void 0?o:e),[k,C]=g.useState(!1),[S,j]=g.useState(!1),[w,I]=g.useState(0),[M,z]=g.useState(0),V=g.useRef(null);g.useEffect(()=>{o!==void 0&&b(o)},[o]);const $=g.useCallback(D=>{let O=D;l?D<0?O=p-1:D>=p&&(O=0):O=Math.max(0,Math.min(D,p-1)),s&&s.length>0&&(s.includes(O)||(O=s.reduce((X,U)=>Math.abs(U-O)<Math.abs(X-O)?U:X))),o===void 0&&b(O),t&&t(O)},[o,l,t,p]),T=g.useCallback(()=>{$(y+1)},[y,$]),_=g.useCallback(()=>{$(y-1)},[y,$]);g.useEffect(()=>(n&&!k&&!S&&(V.current=setInterval(()=>{T()},i)),()=>{V.current&&clearInterval(V.current)}),[n,i,k,S,T,a]);const B=g.useCallback(()=>{a&&C(!0)},[a]),R=g.useCallback(()=>{C(!1)},[]),E=g.useCallback(D=>{j(!0),"touches"in D?(I(D.touches[0].clientX),z(D.touches[0].clientY)):(I(D.clientX),z(D.clientY))},[]),W=g.useCallback(D=>{if(!S)return;let O,v;"touches"in D?(O=D.touches[0].clientX,v=D.touches[0].clientY):(O=D.clientX,v=D.clientY);const X=O-w,U=v-M;Math.abs(X)>Math.abs(U)&&Math.abs(X)>50&&(X>0?_():T(),j(!1))},[S,w,M,T,_]),P=g.useCallback(()=>{j(!1)},[]),H=g.useCallback(()=>{const D=f.current++;h.current.add(D);const O=h.current.size;return u.current=O,m(O),D},[]),L=g.useCallback(D=>{h.current.delete(D);const O=h.current.size;if(u.current=O,m(O),O>0&&y>=O){const v=Math.max(0,O-1);o===void 0&&b(v),t&&t(v)}},[y,o,t]),A=l||y>0,F=l||y<p-1;return{activeIndex:y,totalSlides:p,goToSlide:$,nextSlide:T,prevSlide:_,canGoNext:F,canGoPrevious:A,handleMouseEnter:B,handleMouseLeave:R,handleDragStart:E,handleDragMove:W,handleDragEnd:P,registerSlide:H,unregisterSlide:L,contentId:x,infinite:l}},yc={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"}},kc={dot:{backgroundColor:"theme-primary"},line:{backgroundColor:"theme-primary"},number:{backgroundColor:"theme-primary",color:"color-white"}},Wo={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"}},po=()=>({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,...Wo},nextButton:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",zIndex:10,...Wo}}),Or=g.createContext(null),Ko=()=>{const e=g.useContext(Or);if(!e)throw new Error("Carousel compound components must be used within <Carousel>");return e},qr=({children:e,isActive:o,views:t,...n})=>r.jsx(c.View,{flexShrink:0,width:"100%",height:"100%",display:o?"block":"none",...t,...n,children:e}),Nr=({views:e,children:o,...t})=>{const{goToPrevious:n,canGoPrevious:i,styles:a}=Ko(),d={...po().prevButton,...a==null?void 0:a.prevButton,...e==null?void 0:e.prevButton};return r.jsx(We,{"aria-label":"Previous slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"left",widthHeight:16})})},Ur=({views:e,children:o,...t})=>{const{goToNext:n,canGoNext:i,styles:a}=Ko(),d={...po().nextButton,...a==null?void 0:a.nextButton,...e==null?void 0:e.nextButton};return r.jsx(We,{"aria-label":"Next slide",onClick:()=>n(),isDisabled:!i,...d,...t,children:o??r.jsx(ae,{orientation:"right",widthHeight:16})})},Gr=({children:e,views:o,...t})=>{const{registerSlide:n,unregisterSlide:i,styles:a}=Ko(),l=g.useRef(null);g.useEffect(()=>{const u=n();return l.current=u,()=>{l.current!==null&&i(l.current)}},[n,i]);const s={...po().item,...a==null?void 0:a.item,...o==null?void 0:o.item};return r.jsx(c.View,{role:"group","aria-roledescription":"slide",...s,...t,children:e})},Yr=({children:e,views:o,style:t,...n})=>{const{currentIndex:i,styles:a,contentId:l}=Ko(),d=po(),s={...d.content,...a==null?void 0:a.content,...o==null?void 0:o.content},u={...d.innerContainer,...a==null?void 0:a.innerContainer,...o==null?void 0:o.innerContainer},p=`-${i*100}%`;return r.jsx(c.View,{...s,...n,style:{...s==null?void 0:s.style,...t},id:l,"aria-live":"polite",children:r.jsx(c.View,{...u,style:{...u==null?void 0:u.style,transform:`translateX(${p})`},children:e})})},jc=({children:e,defaultActiveIndex:o=0,activeIndex:t,onChange:n,showNavigation:i=!0,navigationPosition:a="inside",prevButton:l,nextButton:d,showIndicators:s=!0,indicatorPosition:u="bottom",indicatorVariant:p="dot",autoPlay:m=!1,autoPlayInterval:h=3e3,pauseOnHover:f=!0,infinite:x=!0,direction:y="horizontal",transitionDuration:b=300,views:k,stepIndices:C,themeMode:S,...j})=>{const w=g.useMemo(()=>g.Children.toArray(e),[e]),I=bc({defaultActiveIndex:o,activeIndex:t,onChange:n,autoPlay:m,autoPlayInterval:h,pauseOnHover:f,infinite:x,totalSlides:w.length}),{activeIndex:M,totalSlides:z,goToSlide:V,nextSlide:$,prevSlide:T,handleMouseEnter:_,handleMouseLeave:B,handleDragStart:R,handleDragMove:E,handleDragEnd:W}=I,P=()=>{if(!i)return null;const A=l||r.jsx(c.View,{as:"button","aria-label":"Previous slide",...Wo,...k==null?void 0:k.prevButton,children:"❮"}),F=d||r.jsx(c.View,{as:"button","aria-label":"Next slide",...Wo,...k==null?void 0:k.nextButton,children:"❯"});return r.jsxs(r.Fragment,{children:[r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",left:a==="inside"?"10px":"-40px",onClick:T,cursor:!x&&M===0?"not-allowed":"pointer",opacity:!x&&M===0?.5:1,children:A}),r.jsx(c.View,{position:"absolute",top:"50%",transform:"translateY(-50%)",right:a==="inside"?"10px":"-40px",onClick:$,cursor:!x&&M===w.length-1?"not-allowed":"pointer",opacity:!x&&M===w.length-1?.5:1,children:F})]})},H=()=>s?r.jsx(c.Horizontal,{position:"absolute",left:"0",right:"0",justifyContent:"center",...u==="top"?{top:"10px"}:{bottom:"10px"},...k==null?void 0:k.indicators,children:w.map((A,F)=>r.jsx(c.View,{onClick:()=>V(F),cursor:"pointer",...yc[p],...F===M?{...kc[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(A=>g.isValidElement(A)&&(A.type===Yr||A.type===Gr||A.type===Nr||A.type===Ur)),[e])?r.jsx(Or.Provider,{value:{currentIndex:M,totalSlides:z,goToSlide:V,goToNext:$,goToPrevious:T,canGoNext:I.canGoNext,canGoPrevious:I.canGoPrevious,registerSlide:I.registerSlide,unregisterSlide:I.unregisterSlide,styles:{...po(),...k},contentId:I.contentId,infinite:x},children:r.jsx(c.View,{role:"region","aria-roledescription":"carousel","aria-label":"Carousel",position:"relative",width:"100%",height:"100%",overflow:"hidden",...k==null?void 0:k.container,...j,children:e})}):r.jsxs(c.View,{position:"relative",width:"100%",height:"100%",overflow:"hidden",onMouseEnter:_,onMouseLeave:B,onTouchStart:R,onTouchMove:E,onTouchEnd:W,onMouseDown:R,onMouseMove:E,onMouseUp:W,...k==null?void 0:k.container,...j,children:[r.jsx(c.View,{width:"100%",height:"100%",position:"relative",...k==null?void 0:k.slideWrapper,children:w.map((A,F)=>r.jsx(qr,{isActive:F===M,index:F,views:k==null?void 0:k.slide,children:A},F))}),P(),H()]})},Cc=e=>r.jsx(jc,{...e}),ve=Cc;ve.Slide=qr;ve.Content=Yr;ve.Item=Gr;ve.Previous=Nr;ve.Next=Ur;const ye={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"},Sc=[ye.blue,ye.green,ye.purple,ye.orange,ye.red,ye.teal,ye.pink,ye.indigo,ye.yellow,ye.cyan],Ue=Sc,wc={width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},Ic={fontSize:"18px",fontWeight:"bold",marginBottom:"16px",textAlign:"center"},Tc={display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:"16px"},Mc={display:"flex",alignItems:"center",marginRight:"16px",marginBottom:"8px"},zc={width:"12px",height:"12px",borderRadius:"2px",marginRight:"6px"},Rc={fontSize:"14px"},vr={stroke:"color-gray-200",strokeWidth:"1px"},_o={stroke:"color-gray-300",strokeWidth:"1px"},$o={fontSize:"12px",fill:"color-gray-600"},Vc={rx:"2px",ry:"2px",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},Ec={strokeWidth:"2px",fill:"none"},Pc={r:"4px",strokeWidth:"2px",stroke:"white",cursor:"pointer",transition:"r 0.2s ease"},Co={strokeWidth:"1px",stroke:"white",cursor:"pointer",transition:"opacity 0.2s ease",_hover:{opacity:.8}},$t={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"},Wc={...$t},_c={...$t,backgroundColor:"rgba(255, 235, 238, 0.9)",color:"color-red-700"},$c={...$t,backgroundColor:"rgba(245, 245, 245, 0.8)",color:"color-gray-600"},Hc=({data:e,dataPoints:o,animated:t=!0,animationDuration:n=500,showTooltips:i=!0})=>{const[a,l]=g.useState(t?0:1),[d,s]=g.useState({visible:!1,x:0,y:0,content:null}),u=g.useRef(null),p=g.useRef(null);g.useEffect(()=>{if(!t){l(1);return}const y=Date.now(),b=()=>{const k=Date.now()-y,C=Math.min(k/n,1);l(C),C<1&&(u.current=requestAnimationFrame(b))};return u.current=requestAnimationFrame(b),()=>{u.current&&cancelAnimationFrame(u.current)}},[t,n]);const m=g.useCallback(()=>e?{...e,series:e.series.map((y,b)=>({...y,color:y.color||Ue[b%Ue.length]}))}:o?o.map((y,b)=>({...y,color:y.color||Ue[b%Ue.length]})):null,[e,o]),h=g.useCallback((y,b,k)=>{i&&s({visible:!0,x:y,y:b,content:k})},[i]),f=g.useCallback(()=>{s(y=>({...y,visible:!1}))},[]),x=g.useCallback(()=>{if(!p.current)return{width:0,height:0};const{width:y,height:b}=p.current.getBoundingClientRect();return{width:y,height:b}},[]);return{animationProgress:a,tooltip:d,containerRef:p,processedData:m,showTooltip:h,hideTooltip:f,getChartDimensions:x}},Bc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onBarClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:u}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=g.useMemo(()=>{let w=0;return e.series.forEach(I=>{I.data.forEach(M=>{w=Math.max(w,M)})}),w},[e]),x=e.labels.length,y=e.series.length,b=m/x,k=b*.8/y,C=b*.2/(y+1),S=f||10,j=g.useMemo(()=>{const I=[];for(let M=0;M<=5;M++){const z=S/5*M;I.push(z)}return I},[f]);return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((w,I)=>{const M=p.left+(I+.5)*b,z=t-p.bottom+20;return r.jsx("text",{x:M,y:z,textAnchor:"middle",...$o,...s==null?void 0:s.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}`)}),j.map((w,I)=>{const M=t-p.bottom-w/S*h;return r.jsxs(g.Fragment,{children:[r.jsx("text",{x:p.left-10,y:M,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.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)}),i&&r.jsx("line",{x1:p.left,y1:M,x2:o-p.right,y2:M,...vr,...s==null?void 0:s.grid})]},`y-tick-${I}`)}),e.series.map((w,I)=>r.jsx(g.Fragment,{children:w.data.map((M,z)=>{const V=M/S*h*n,$=p.left+z*b+C*(I+1)+k*I,T=t-p.bottom-V,_=e.labels[z],B=e.series.reduce((H,L)=>{const A=L.data[z];return H+(typeof A=="number"?A:0)},0),R=B>0?(M/B*100).toFixed(1):null,E=w.color?u(w.color):"black",W=H=>{const L=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"180px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:w.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:E})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:_}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:M.toLocaleString()})]}),R!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${R}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:B.toLocaleString()})]})]})]});l(H.clientX,H.clientY,L)},P=()=>{a&&a(w.name,z)};return r.jsx("rect",{x:$,y:T,width:k,height:V,fill:E,onMouseEnter:W,onMouseLeave:d,onClick:P,...Vc,...s==null?void 0:s.bar},`bar-${I}-${z}`)})},`series-${I}`))]})},Lc=({data:e,width:o,height:t,animationProgress:n,showGrid:i=!0,onPointClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:u}=c.useTheme(),p={top:20,right:20,bottom:40,left:50},m=o-p.left-p.right,h=t-p.top-p.bottom,f=g.useMemo(()=>{let C=0;return e.series.forEach(S=>{S.data.forEach(j=>{C=Math.max(C,j)})}),C},[e]),x=f||10,y=g.useMemo(()=>{const S=[];for(let j=0;j<=5;j++){const w=x/5*j;S.push(w)}return S},[f]),b=C=>`M ${C.map((j,w)=>{const I=p.left+w/(e.labels.length-1)*m,M=t-p.bottom-j/x*h*n;return`${I},${M}`}).join(" L ")}`,k=C=>{const S=p.left,j=p.left+m,w=t-p.bottom,I=C.map((M,z)=>{const V=p.left+z/(e.labels.length-1)*m,$=t-p.bottom-M/x*h*n;return`${V},${$}`});return`M ${S},${w} L ${I.join(" L ")} L ${j},${w} Z`};return r.jsxs("svg",{width:o,height:t,children:[r.jsx("line",{x1:p.left,y1:t-p.bottom,x2:o-p.right,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),r.jsx("line",{x1:p.left,y1:p.top,x2:p.left,y2:t-p.bottom,..._o,...s==null?void 0:s.axis}),e.labels.map((C,S)=>{const j=p.left+S/(e.labels.length-1)*m,w=t-p.bottom+20;return r.jsx("text",{x:j,y:w,textAnchor:"middle",...$o,...s==null?void 0:s.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:C},`x-label-${S}`)}),y.map((C,S)=>{const j=t-p.bottom-C/x*h;return r.jsxs(g.Fragment,{children:[r.jsx("text",{x:p.left-10,y:j,textAnchor:"end",dominantBaseline:"middle",...$o,...s==null?void 0:s.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:C.toFixed(0)}),i&&r.jsx("line",{x1:p.left,y1:j,x2:o-p.right,y2:j,...vr,...s==null?void 0:s.grid})]},`y-tick-${S}`)}),e.series.map((C,S)=>{const j=C.color?u(C.color):"black";return r.jsxs(g.Fragment,{children:[r.jsx("path",{d:k(C.data),fill:j,opacity:.1,...s==null?void 0:s.area}),r.jsx("path",{d:b(C.data),stroke:j,...Ec,...s==null?void 0:s.line}),C.data.map((w,I)=>{const M=p.left+I/(e.labels.length-1)*m,z=t-p.bottom-w/x*h*n,V=e.labels[I],$=e.series.reduce((P,H)=>{const L=H.data[I];return P+(typeof L=="number"?L:0)},0),T=$>0?(w/$*100).toFixed(1):null,_=I>0&&typeof C.data[I-1]=="number"?C.data[I-1]:null,B=typeof _=="number"?w-_:null,R=typeof B=="number"?`${B>=0?"+":""}${B.toLocaleString()}`:null,E=P=>{const H=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:C.name}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j})]}),r.jsx(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:V}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:w.toLocaleString()})]}),R!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Change"}),r.jsx(c.Text,{fontWeight:"medium",children:R})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T}%`})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Category total"}),r.jsx(c.Text,{fontWeight:"medium",children:$.toLocaleString()})]})]})]});l(P.clientX,P.clientY,H)},W=()=>{a&&a(C.name,I)};return r.jsx("circle",{cx:M,cy:z,fill:j,onMouseEnter:E,onMouseLeave:d,onClick:W,...Pc,...s==null?void 0:s.point},`point-${S}-${I}`)})]},`series-${S}`)})]})},Ac=({dataPoints:e,width:o,height:t,animationProgress:n,isDonut:i=!1,onSliceClick:a,showTooltip:l,hideTooltip:d,views:s})=>{const{getColor:u}=c.useTheme(),{ref:p,relation:m}=c.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 x=Math.min(o,t)/2*.8,y=o/2,b=t/2,k=i?x*.6:0,C=g.useMemo(()=>e.reduce((j,w)=>j+w.value,0),[e]),S=g.useMemo(()=>{if(C===0)return[{path:i?[`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,`M ${y} ${b-k}`,`A ${k} ${k} 0 1 0 ${y} ${b+k}`,`A ${k} ${k} 0 1 0 ${y} ${b-k}`,"Z"].join(" "):[`M ${y} ${b}`,`M ${y} ${b-x}`,`A ${x} ${x} 0 1 1 ${y} ${b+x}`,`A ${x} ${x} 0 1 1 ${y} ${b-x}`,"Z"].join(" "),color:"#E2E8F0",label:"Total",value:0,percentage:"0%",labelX:y,labelY:b,startAngle:0,endAngle:Math.PI*2,index:-1}];const j=[];let w=-Math.PI/2;for(let I=0;I<e.length;I++){const z=e[I].value/C,V=z*2*Math.PI*n,$=w+V,T=y+Math.cos(w)*x,_=b+Math.sin(w)*x,B=y+Math.cos($)*x,R=b+Math.sin($)*x,E=y+Math.cos(w)*k,W=b+Math.sin(w)*k,P=y+Math.cos($)*k,H=b+Math.sin($)*k,L=V>Math.PI?1:0;let A;i?A=[`M ${T} ${_}`,`A ${x} ${x} 0 ${L} 1 ${B} ${R}`,`L ${P} ${H}`,`A ${k} ${k} 0 ${L} 0 ${E} ${W}`,"Z"].join(" "):A=[`M ${y} ${b}`,`L ${T} ${_}`,`A ${x} ${x} 0 ${L} 1 ${B} ${R}`,"Z"].join(" ");const F=w+V/2,D=x*.7,O=y+Math.cos(F)*D,v=b+Math.sin(F)*D,X=`${(z*100).toFixed(1)}%`,U=e[I].color||Ue[I%Ue.length],K=u(U);j.push({path:A,color:K,label:e[I].label,value:e[I].value,percentage:X,labelX:O,labelY:v,startAngle:w,endAngle:$,index:I}),w=$}return j},[e,C,x,y,b,k,n,i]);return r.jsxs("svg",{ref:h,width:o,height:t,style:{overflow:"visible"},children:[i&&r.jsx("circle",{cx:y,cy:b,r:k,fill:"white",pointerEvents:"none"}),S.map((j,w)=>{const I=V=>{const $=C>0?j.value/C*100:0,T=C>0?Math.max(0,100-$):null,_=r.jsxs(c.View,{display:"flex",flexDirection:"column",minWidth:"200px",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"semibold",children:j.label}),r.jsx(c.View,{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:j.color})]}),r.jsxs(c.Text,{marginTop:"4px",color:"color-gray-500",fontSize:"12px",children:["Slice ",j.index+1," of ",e.length]}),r.jsxs(c.View,{marginTop:"8px",display:"flex",flexDirection:"column",children:[r.jsxs(c.View,{display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Value"}),r.jsx(c.Text,{fontWeight:"medium",children:j.value.toLocaleString()})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Share"}),r.jsx(c.Text,{fontWeight:"medium",children:j.percentage})]}),r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Total"}),r.jsx(c.Text,{fontWeight:"medium",children:C.toLocaleString()})]}),T!==null&&r.jsxs(c.View,{marginTop:"4px",display:"flex",justifyContent:"space-between",children:[r.jsx(c.Text,{color:"color-gray-500",children:"Remaining"}),r.jsx(c.Text,{fontWeight:"medium",children:`${T.toFixed(1)}%`})]})]})]});let B=V.clientX,R=V.clientY;if(m&&h.current){const E=h.current.getBoundingClientRect();V.clientX-E.left,V.clientY-E.top,m.space.horizontal==="left"?B=V.clientX-100:B=V.clientX+10,m.space.vertical==="top"?R=V.clientY-30:R=V.clientY+10}l(B,R,_)},M=()=>{j.index!==-1&&a&&a(e[j.index],j.index)},z=j.index===-1;return r.jsxs("g",{children:[r.jsx("path",{d:j.path,fill:j.color,onMouseEnter:z?void 0:I,onMouseLeave:z?void 0:d,onClick:M,...Co,style:{...Co==null?void 0:Co.style,cursor:z?"default":"pointer"},...s==null?void 0:s.pie}),!z&&j.endAngle-j.startAngle>.2&&r.jsx("text",{x:j.labelX,y:j.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:j.percentage})]},`slice-${w}`)})]})},Dc=({visible:e,x:o,y:t,content:n,maxDistance:i=100,views:a})=>{const l=g.useRef(null),[d,s]=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,f=10,x=15;let y=o-x,b=t-x;const k=o-y,C=t-b;k>i&&(y=o-i),C>i&&(b=t-i),y+m>window.innerWidth-f&&(y=window.innerWidth-m-f,o-y>i&&(y=o-i)),y<f&&(y=f),b+h>window.innerHeight-f&&(b=window.innerHeight-h-f,t-b>i&&(b=t-i)),b<f&&(b=f),s({left:y,top:b})},[e,o,t,i]),e?r.jsx(c.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,...a==null?void 0:a.tooltip,children:n}):null},Fc=({type:e,data:o,dataPoints:t,title:n,showLegend:i=!0,legendPosition:a="bottom",showGrid:l=!0,showTooltips:d=!0,animated:s=!0,animationDuration:u=500,responsive:p=!0,aspectRatio:m=16/9,width:h=200,height:f=200,views:x,onDataPointClick:y,onSeriesClick:b,isLoading:k=!1,error:C,noData:S,loadingIndicator:j,errorIndicator:w,noDataIndicator:I,"aria-label":M,themeMode:z,...V})=>{const{animationProgress:$,tooltip:T,containerRef:_,processedData:B,showTooltip:R,hideTooltip:E,getChartDimensions:W}=Hc({data:o,dataPoints:t,animated:s,animationDuration:u,showTooltips:d}),P=B(),{width:H,height:L}=W(),A=h||H,F=f||(p?H/m:L),D=()=>{if(!i||!P)return null;let re=[];return e==="pie"||e==="donut"?Array.isArray(P)&&(re=P):P&&P.series&&(re=P.series),!re||re.length===0?null:r.jsx(c.Horizontal,{flexWrap:"wrap",justifyContent:"center",marginTop:a==="bottom"?"16px":0,marginBottom:a==="top"?"16px":0,...Tc,...x==null?void 0:x.legend,children:re.map((ne,oe)=>r.jsxs(c.View,{...Mc,...x==null?void 0:x.legendItem,children:[r.jsx(c.View,{backgroundColor:ne.color,...zc}),r.jsx(c.Text,{...Rc,children:ne.name||ne.label})]},`legend-${oe}`))})},O=()=>{if(!P)return null;switch(e){case"bar":return r.jsx(Bc,{data:P,width:A,height:F,animationProgress:$,showGrid:l,onBarClick:b,showTooltip:R,hideTooltip:E,views:x});case"line":case"area":return r.jsx(Lc,{data:P,width:A,height:F,animationProgress:$,showGrid:l,onPointClick:b,showTooltip:R,hideTooltip:E,views:x});case"pie":case"donut":return r.jsx(Ac,{dataPoints:P,width:A,height:F,animationProgress:$,isDonut:e==="donut",onSliceClick:y,showTooltip:R,hideTooltip:E,views:x});default:return null}},v=()=>k?r.jsx(c.View,{...Wc,...x==null?void 0:x.loadingOverlay,children:j||r.jsx(c.Center,{children:r.jsx(so,{size:"lg"})})}):null,X=()=>C?r.jsx(c.View,{..._c,...x==null?void 0:x.errorOverlay,children:w||r.jsx(c.Text,{fontWeight:"medium",children:typeof C=="string"?C:"An error occurred"})}):null,U=()=>S?r.jsx(c.View,{...$c,...x==null?void 0:x.noDataOverlay,children:I||r.jsx(c.Text,{children:typeof S=="string"?S:"No data available"})}):null,K=M??(typeof n=="string"?n:"Chart"),J=!C&&!k&&!S;return r.jsxs(c.View,{ref:_,role:"region","aria-label":K,"aria-busy":k,...wc,...x==null?void 0:x.container,...V,children:[n&&r.jsx(c.Text,{...Ic,children:n}),J&&a==="top"&&D(),r.jsxs(c.View,{flex:1,width:"100%",position:"relative",...x==null?void 0:x.chart,children:[J&&O(),v(),X(),U()]}),J&&a==="bottom"&&D(),r.jsx(Dc,{visible:d&&T.visible,x:T.x,y:T.y,content:T.content,maxDistance:100,views:x})]})},Oc=e=>r.jsx(Fc,{...e}),qc=Oc,Nc=(e=365)=>{const[o,t]=g.useState(!1),[n,i]=g.useState(null),a="app-studio-cookie-consent";g.useEffect(()=>{const u=localStorage.getItem(a);i(u!==null?u==="true":!1)},[]);const l=u=>{localStorage.setItem(a,String(u));const p=new Date;p.setDate(p.getDate()+e),localStorage.setItem(`${a}-expires`,p.toISOString()),i(u)};return{isHovered:o,setIsHovered:t,hasConsent:n,acceptCookies:()=>{l(!0)},resetConsent:()=>{localStorage.removeItem(a),localStorage.removeItem(`${a}-expires`),i(!1)}}},Uc=e=>{const o=e==="dark";return{default:{container:{backgroundColor:o?"#1f2937":"#ffffff",borderColor:o?"#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:o?"#e5e7eb":"#1f2937"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#e5e7eb":"#4b5563",borderColor:o?"#4b5563":"#d1d5db",hoverBackgroundColor:o?"#374151":"#f3f4f6"}},info:{container:{backgroundColor:o?"#1e3a8a":"#eff6ff",borderColor:o?"#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:o?"#bfdbfe":"#1e40af"},acceptButton:{backgroundColor:"#3b82f6",color:"#ffffff",hoverBackgroundColor:"#2563eb"},customizeButton:{backgroundColor:"transparent",color:o?"#bfdbfe":"#1e40af",borderColor:o?"#3b82f6":"#93c5fd",hoverBackgroundColor:o?"#1e40af":"#dbeafe"}},primary:{container:{backgroundColor:o?"#0c4a6e":"#f0f9ff",borderColor:o?"#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:o?"#bae6fd":"#0369a1"},acceptButton:{backgroundColor:"#0ea5e9",color:"#ffffff",hoverBackgroundColor:"#0284c7"},customizeButton:{backgroundColor:"transparent",color:o?"#bae6fd":"#0369a1",borderColor:o?"#0ea5e9":"#7dd3fc",hoverBackgroundColor:o?"#0369a1":"#e0f2fe"}}}},Gc=({title:e="Nous utilisons des cookies",description:o="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:t="Accepter",customizeButtonText:n="Personnaliser",position:i="bottom",variant:a="default",onAccept:l,onCustomize:d,views:s,showCustomizeButton:u=!0,cookieExpiration:p=365,themeMode:m,...h})=>{const{themeMode:f}=c.useTheme(),x=m||f||"light",{hasConsent:y,acceptCookies:b}=Nc(p),C=Uc(x)[a];if(y)return null;const S=()=>{b(),l&&l()},j=()=>{d&&d()};return r.jsx(c.View,{position:"fixed",left:16,right:16,zIndex:1e3,padding:16,borderWidth:"1px",borderStyle:"solid",borderRadius:8,maxWidth:"800px",marginX:"auto",...i==="bottom"?{bottom:16}:{top:16},...C.container,...s==null?void 0:s.container,...h,children:r.jsxs(c.Vertical,{gap:12,maxWidth:1200,marginX:"auto",children:[e&&r.jsx(c.Text,{fontWeight:"bold",fontSize:18,color:"color-black",...s==null?void 0:s.title,children:e}),o&&r.jsx(c.Text,{fontSize:14,color:"color-black",...s==null?void 0:s.description,children:o}),r.jsxs(c.Horizontal,{gap:12,justifyContent:"flex-end",marginTop:8,...s==null?void 0:s.buttonGroup,children:[u&&r.jsx(We,{variant:"outline",onClick:j,size:"sm",...s==null?void 0:s.customizeButton,children:n}),r.jsx(We,{variant:"primary",onClick:S,size:"sm",...s==null?void 0:s.acceptButton,children:t})]})]})})},Yc=e=>r.jsx(Gc,{...e}),vc=Yc,Xc=e=>{const{size:o,variant:t,onOpenChange:n}=e||{},[i,a]=g.useState(!1),[l,d]=g.useState({x:0,y:0}),[s,u]=g.useState(null),p=g.useRef(null),m=g.useRef(null),h=g.useMemo(()=>jt("contextmenu-content"),[]),f=g.useCallback(y=>{d({x:y.clientX,y:y.clientY}),a(!0),n==null||n(!0)},[n]),x=g.useCallback(()=>{a(!1),u(null),n==null||n(!1)},[n]);return g.useEffect(()=>{const y=C=>{m.current&&!m.current.contains(C.target)&&x()},b=()=>{i&&x()},k=C=>{C.key==="Escape"&&i&&x()};return document.addEventListener("mousedown",y),window.addEventListener("resize",b),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),window.removeEventListener("resize",b),document.removeEventListener("keydown",k)}},[i,x]),{isOpen:i,setIsOpen:a,position:l,setPosition:d,activeSubmenuId:s,setActiveSubmenuId:u,size:o,variant:t,triggerRef:p,contentRef:m,contentId:h,openMenu:f,closeMenu:x}},Xt={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Kc={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"}},Kt={hover:{backgroundColor:"color-gray-100"}},Xr=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:()=>{}}),Qc=({children:e,value:o})=>r.jsx(Xr.Provider,{value:o,children:e}),Ho=()=>{const e=g.useContext(Xr);if(!e)throw new Error("useContextMenuContext must be used within a ContextMenuProvider");return e},Kr=({children:e,disableNativeContextMenu:o=!0,asChild:t=!1,isDisabled:n=!1,views:i,...a})=>{const{triggerRef:l,contentId:d,openMenu:s}=Ho(),p={ref:l,onContextMenu:m=>{if(!n)if(o&&m.preventDefault(),s)s(m);else{const{setIsOpen:h,setPosition:f}=Ho();f({x:m.clientX,y:m.clientY}),h(!0)}},"aria-controls":d,"aria-haspopup":"menu","data-disabled":n?"":void 0,...t&&g.isValidElement(e)&&e.props.isDisabled===void 0&&{isDisabled:n},...i==null?void 0:i.container,...a};if(t&&g.isValidElement(e)){const m=g.Children.only(e);return g.cloneElement(m,{...p,...m.props})}return r.jsx(c.View,{...p,children:e})},Ht=({items:e,children:o,position:t,side:n="right",align:i="start",views:a,style:l,...d})=>{const{isOpen:s,position:u,contentRef:p,contentId:m,variant:h}=Ho(),f=g.useRef(null),x=p||f,{ref:y,relation:b}=c.useElementPosition({}),[k,C]=g.useState({x:0,y:0});if(g.useEffect(()=>{if(s&&x.current){const j=t||u,w=x.current.offsetWidth,I=x.current.offsetHeight,M=window.innerWidth,z=window.innerHeight;let V=j.x,$=j.y;b&&(b.space.horizontal==="left"?V=j.x-w:V=j.x,b.space.vertical==="top"?$=j.y-I:$=j.y),V+w>M&&(V=M-w-8),V<8&&(V=8),$+I>z&&($=z-I-8),$<8&&($=8),C({x:V,y:$})}},[s,u,t,n,i,x,b]),!s)return null;const S={position:"fixed",top:`${k.y}px`,left:`${k.x}px`,zIndex:1e3,transformOrigin:"top left"};return r.jsxs(c.View,{id:m||"context-menu",ref:x,role:"menu",tabIndex:-1,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:{...S,...l},...Kc[h],...a==null?void 0:a.menu,...a==null?void 0:a.content,...d,children:[e&&e.map((j,w)=>j.divider?r.jsx(Zr,{views:a},`divider-${w}`):r.jsx(Qr,{item:j,views:a},j.id)),o]})},Qr=({item:e,children:o,onSelect:t,isDisabled:n=!1,views:i,...a})=>{const{activeSubmenuId:l,setActiveSubmenuId:d,size:s,closeMenu:u}=Ho();if(e){const[m,h]=g.useState(!1),f=e.items&&e.items.length>0,x=l===e.id,[y,b]=g.useState({x:0,y:0}),k=e.disabled||n,C=()=>{h(!0),f&&d(e.id)},S=()=>{h(!1)},j=()=>{k||!f&&e.onClick&&(e.onClick(),u&&u())},{ref:w,relation:I}=c.useElementPosition({});return g.useEffect(()=>{if(x&&w.current){const M=w.current.getBoundingClientRect(),z=window.innerWidth,V=200;let $=!1;if(I)$=I.space.horizontal==="left";else{const T=z-M.right,_=M.left;$=T<V&&_>T}b({x:$?M.left-V:M.right,y:M.top})}},[x,e.items,I]),r.jsxs(c.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,...Xt[s],_hover:k?{}:Kt.hover,backgroundColor:m&&!k?"color-gray-100":"transparent",onMouseEnter:C,onMouseLeave:S,onClick:j,...i==null?void 0:i.item,...a,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),f&&r.jsx(c.View,{marginLeft:8,...i==null?void 0:i.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),x&&f&&r.jsx(Ht,{items:e.items||[],position:y,side:"right",align:"start",views:i})]})}const p=m=>{n||(t==null||t(m),u&&u())};return r.jsx(c.View,{role:"menuitem",onClick:p,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,"aria-disabled":n,"data-disabled":n?"":void 0,...Xt[s],_hover:n?{}:Kt.hover,...i==null?void 0:i.item,...a,children:o})},Zr=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.divider,...o}),Zc=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",role:"separator","aria-orientation":"horizontal",...e==null?void 0:e.separator,...o}),Jc=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,views:a,themeMode:l,...d})=>!o||o.length===0?r.jsx(r.Fragment,{children:e}):r.jsxs(r.Fragment,{children:[r.jsx(Kr,{disableNativeContextMenu:i,views:a,...d,children:e}),r.jsx(Ht,{items:o,views:a})]}),es=({children:e,items:o,size:t="md",variant:n="default",disableNativeContextMenu:i=!0,onOpenChange:a,views:l,...d})=>{const s=Xc({size:t,variant:n,onOpenChange:a}),{isOpen:u,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,triggerRef:y,contentRef:b,contentId:k,openMenu:C,closeMenu:S}=s;return r.jsx(Qc,{value:{isOpen:u,setIsOpen:p,position:m,setPosition:h,activeSubmenuId:f,setActiveSubmenuId:x,size:t,variant:n,triggerRef:y,contentRef:b,contentId:k,openMenu:C,closeMenu:S,styles:l},children:r.jsx(Jc,{items:o,size:t,variant:n,disableNativeContextMenu:i,views:l,...d,children:e})})},Xe=es;Xe.Trigger=Kr;Xe.Content=Ht;Xe.Item=Qr;Xe.Divider=Zr;Xe.Separator=Zc;const os=({src:e,color:o,views:t,themeMode:n,...i})=>{const{getColor:a,themeMode:l}=c.useTheme(),d=o?{fill:a(o,{themeMode:l}),stroke:a(o,{themeMode:l})}:{};return r.jsx(c.Center,{...i,...t==null?void 0:t.container,children:r.jsx(c.Image,{...d,content:'url("'+e+'")',width:"100%",height:"100%",...t==null?void 0:t.image})})},ts=({path:e,...o})=>r.jsx(c.Image,{src:e,...o}),Jr=({placeholder:e,isMulti:o,options:t,id:n=`select-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=g.useState(!1),[d,s]=g.useState(!1),[u,p]=g.useState(i),[m,h]=g.useState(0),[f,x]=g.useState(!0);return{id:n,value:u,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},en=({children:e,containerId:o="portal-root"})=>{const[t,n]=g.useState(null);return g.useEffect(()=>{let i=document.getElementById(o),a=!1;return i||(a=!0,i=document.createElement("div"),i.setAttribute("id",o),document.body.appendChild(i)),n(i),()=>{a&&i&&i.parentNode&&i.childNodes.length===0&&i.parentNode.removeChild(i)}},[o]),t?Xa.createPortal(e,t):null},mt=({children:e,views:o={helperText:{}},...t})=>r.jsx(c.Text,{size:"xs",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"all 0.2s ease",...o.helperText,...t,children:e}),Se=g.forwardRef(({children:e,helperText:o,error:t=!1,views:n,...i},a)=>r.jsxs(c.Vertical,{ref:a,gap:8,position:"relative",width:"100%",marginVertical:4,...i,...n==null?void 0:n.container,children:[e,!t&&o&&r.jsx(mt,{marginTop:4,...n==null?void 0:n.helperText,children:o}),t&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,fontWeight:"500",color:"color-red-500",transition:"all 0.2s ease",...n==null?void 0:n.error,children:t})]}));Se.displayName="FieldContainer";const on={default:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},square:{borderRadius:0},rounded:{borderRadius:"8px",media:{mobile:{borderRadius:"6px"}}},pill:{borderRadius:"9999px"}},Qt={xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},tn={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"}}},rs={paddingTop:"16px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"12px",paddingBottom:"6px",paddingLeft:"12px",paddingRight:"12px"}}},ns={paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",media:{mobile:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"12px",paddingRight:"12px"}}},ze=({label:e,shadow:o,children:t,value:n,size:i="md",shape:a="default",variant:l="default",error:d=!1,showLabel:s=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,views:f={pickerBox:{}},...x})=>{const b=d?"color-red-500":(p||u)&&!m?"theme-primary":"color-gray-300";return r.jsx(c.Horizontal,{gap:8,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",marginBottom:2,borderStyle:"solid",borderColor:b,backgroundColor:"color-white",fontSize:c.Typography.fontSizes[i],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",...s?rs:ns,...o,...on[a],...tn[l],...f==null?void 0:f.container,...x,children:t})},Bt=({children:e,...o})=>r.jsx(c.Center,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",...o,children:e}),as={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}},is=({children:e,heading:o,isItalic:t=!1,isUnderlined:n=!1,isStriked:i=!1,weight:a="normal",size:l="sm",dropDown:d,...s})=>{const u=o?as[o]:{};return r.jsx(c.Element,{as:"label",width:"100%",fontSize:l,fontStyle:t?"italic":"normal",fontWeight:c.Typography.fontWeights[a],textDecoration:i?"line-through":n?"underline":"none",...u,...s,children:e})},ls=e=>r.jsx(is,{...e}),mo=ls,$e=({children:e,size:o="md",error:t=!1,color:n="theme-primary",views:i={label:{}},helperText:a,...l})=>r.jsx(mo,{top:0,zIndex:-10,position:"absolute",fontSize:Qt[o],lineHeight:Qt[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"color-red-500":n,transition:"color 200ms ease-out",...i.label,...l,children:e}),Ke=({children:e,...o})=>r.jsx(c.Vertical,{width:"100%",maxWidth:"100%",position:"relative",...o,children:e}),rn={xs:12,sm:14,md:16,lg:20,xl:24},cs={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)"},ss={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)"}},ds={padding:"10px 12px",cursor:"pointer",borderRadius:"6px",margin:"2px 4px",transition:"background-color 0.15s ease"},So={default:{backgroundColor:"transparent"},highlighted:{backgroundColor:"color-gray-100"},selected:{backgroundColor:"color-gray-100"},selectedHighlighted:{backgroundColor:"color-gray-200"}},Zt={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)"}},us={padding:"4px 8px",borderRadius:"6px",backgroundColor:"color-gray-100",fontSize:"13px",fontWeight:"500",color:"color-gray-700",transition:"background-color 0.15s ease"},gs={scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.15) transparent"},ps=({isHovered:e,setIsHovered:o,option:t,size:n="md",callback:i=()=>{},style:a,isSelected:l=!1,...d})=>{const s=(m,h)=>{m.stopPropagation(),m.preventDefault(),typeof i=="function"&&i(h)},u=()=>o(!e),p=()=>l&&e?So.selectedHighlighted:l?So.selected:e?So.highlighted:So.default;return r.jsxs(c.Element,{as:"li",display:"flex",alignItems:"center",justifyContent:"space-between",listStyleType:"none",...ds,...p(),onMouseEnter:u,onMouseLeave:u,onClick:m=>s(m,t.value),...d,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[n],fontWeight:l?"500":"400",lineHeight:"1.4",color:l?"color-gray-900":"color-gray-700",...a,children:t.label}),l&&r.jsx(c.Element,{as:"span",color:"theme-primary",fontSize:"14px",marginLeft:8,display:"flex",alignItems:"center",children:"✓"})]})},ms=({size:e="md",views:o={field:{},text:{}},value:t,isDisabled:n,placeholder:i,removeOption:a=()=>{},options:l})=>{const d={margin:0,width:"95%",height:"100%",border:"none",paddingVertical:4,paddingHorizontal:0,fontSize:c.Typography.fontSizes[e],fontWeight:"400",lineHeight:"1.5",letterSpacing:"-0.01em",backgroundColor:"transparent",color:n?"color-gray-400":"color-gray-900",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",...o.field,...o.text},s=l.length>0&&l.find(u=>u.value===t);return r.jsx(c.Text,{...d,children:(t===""||Array.isArray(t)&&t.length===0)&&i?i:r.jsx(r.Fragment,{children:typeof t=="string"?(s&&s.label)??t:Array.isArray(t)&&t.length>0?r.jsx(c.Horizontal,{gap:6,children:t.map(u=>r.jsx(xs,{option:u,removeOption:a},u))}):r.jsx("span",{children:t})})})},hs=({id:e,name:o,value:t,onChange:n,isMulti:i=!1,isDisabled:a=!1,isReadOnly:l=!1,options:d=[],...s})=>{const u=p=>{n&&n(p)};return r.jsx(c.Element,{id:e,name:o,as:"select",opacity:0,width:0,height:0,position:"absolute",value:t,disabled:a,readOnly:l,onChange:u,multiple:i,...s,children:d.length>0&&d.map(p=>r.jsx("option",{value:p.value,children:p.label},p.value))})},fs=({size:e,views:o={},options:t,callback:n=()=>{},highlightedIndex:i,setHighlightedIndex:a,selectedValue:l})=>{const d=u=>n(u),s=u=>Array.isArray(l)?l.includes(u):l===u;return r.jsx(c.Element,{as:"ul",role:"listbox",display:"flex",flexDirection:"column",margin:0,padding:"4px",...cs,style:gs,...o==null?void 0:o.dropDown,children:t&&t.length>0&&t.map((u,p)=>r.jsx(ps,{size:e,style:o.text,option:u,callback:d,isSelected:s(u.value),isHovered:p===i,setIsHovered:()=>{},onMouseEnter:()=>a(p)},u.value))})},xs=({option:e,size:o="md",removeOption:t=()=>{},...n})=>{const i=()=>t(e);return r.jsxs(c.Horizontal,{gap:6,alignItems:"center",onClick:a=>a.stopPropagation(),...us,_hover:{backgroundColor:"color-gray-200"},...n,children:[r.jsx(c.Text,{fontSize:c.Typography.fontSizes[o],fontWeight:"500",color:"color-gray-700",children:e}),r.jsx(xe,{role:"close-button",color:"color-gray-500",widthHeight:rn[o],onClick:i,cursor:"pointer",transition:"color 0.15s ease",_hover:{color:"color-gray-700"}})]})},nn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isMulti:s=!1,isFocused:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,options:f=[],shadow:x={},size:y="md",shape:b="default",variant:k="default",views:C={text:{},icon:{},dropDown:{},selectBox:{},label:{},helperText:{}},onChange:S=()=>{},setHide:j=()=>{},setValue:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setHighlightedIndex:z,highlightedIndex:V,...$})=>{const{ref:T,relation:_,updateRelation:B}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),R=g.useRef(null),E=()=>{var X;if(!T.current)return{};const D=T.current.getBoundingClientRect(),O={position:"fixed",left:D.left,width:D.width,zIndex:1e4};return((X=_==null?void 0:_.space)==null?void 0:X.vertical)==="top"?{...O,bottom:window.innerHeight-D.top+8}:{...O,top:D.bottom+8}};g.useEffect(()=>{const D=()=>j(!0);return document.addEventListener("closeAllSelects",D),()=>document.removeEventListener("closeAllSelects",D)},[j]),g.useEffect(()=>{const D=O=>{!O.target.closest(`#${e}`)&&!l&&j(!0)};return document.addEventListener("click",D),()=>{document.removeEventListener("click",D)}},[e,l,j]);const W=!!(u&&t),P=()=>I(!p),H=()=>M(!0),L=D=>{document.dispatchEvent(new Event("closeAllSelects")),D&&D.stopPropagation&&D.stopPropagation();const O=!l;j(O),M(!O)},A=g.useCallback(D=>{if(j(!0),document.dispatchEvent(new Event("closeAllSelects")),s&&Array.isArray(n)){if(!n.includes(D)){const O=[...n,D];w(O),S&&S(D)}}else w(D),S&&S(D);M(!0)},[s,n,j,w,S,M]),F=D=>{if(Array.isArray(n)&&n.includes(D)){const O=n.filter(v=>v!==D);w(O.length===0?[]:O)}};return r.jsx(Se,{ref:T,position:"relative",width:"100%",display:"inline-block",id:e,role:"SelectBox",helperText:a,error:d,views:C,onClick:D=>{D.stopPropagation(),m||h||L(D)},children:r.jsxs(ze,{label:t,size:y,error:d,shape:b,views:C,shadow:x,variant:k,value:n,color:"theme-primary",isHovered:p,isDisabled:m,isReadOnly:h,isFocused:u,showLabel:W,onMouseEnter:P,onMouseLeave:P,position:"relative",children:[r.jsxs(Ke,{children:[W&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:d,...C,children:t}),r.jsx(hs,{id:e,name:o,options:f,onChange:S,value:n,isDisabled:m,isReadOnly:h,isMulti:s,onFocus:H,...$}),r.jsx(ms,{options:f,size:y,views:C,value:n,isDisabled:m,placeholder:i,removeOption:F})]}),r.jsx(Bt,{children:!h&&!m&&r.jsx(c.Element,{display:"flex",alignItems:"center",justifyContent:"center",style:l?Zt.closed:Zt.open,children:r.jsx(ae,{color:"inherit",widthHeight:rn[y],style:C.icon,orientation:"down"})})}),!l&&f.length>0&&r.jsx(en,{children:r.jsx(c.Element,{ref:R,onClick:D=>D.stopPropagation(),style:{...E(),...ss.enter},children:r.jsx(fs,{size:y,views:C,options:f,callback:A,highlightedIndex:V,setHighlightedIndex:z,selectedValue:n})})})]})})},bs=e=>{const o={...e,options:e.options||[]},t=Jr(o);return r.jsx(nn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},ys=bs,an=({isDisabled:e,isChecked:o})=>{const[t,n]=g.useState(!1),[i,a]=g.useState(o||!1),[l,d]=g.useState(o||!1);return g.useEffect(()=>{o!==void 0&&(a(o),d(o))},[o]),{isHovered:t,setIsHovered:n,on:i,setOn:a,value:l,setValue:d}},ks={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"}},js={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"}},Cs={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}},Ee={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}}},Jt={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)"}},Ss=e=>r.jsx(c.Input,{type:"checkbox",...e}),ln=({id:e,name:o,label:t,inActiveChild:n,isChecked:i,activeChild:a,labelPosition:l="right",shadow:d={},size:s="sm",value:u=!1,isHovered:p=!1,isDisabled:m=!1,isReadOnly:h=!1,on:f,setOn:x,onChange:y,setValue:b=()=>{},setIsHovered:k=()=>{},helperText:C,views:S={slider:{},circle:{},label:{}},...j})=>{const w=V=>{if(!h&&!m){const $=V.target.checked;b($),x($),y&&y($)}},I=()=>k(!0),M=()=>k(!1),z={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 r.jsxs(mo,{htmlFor:e,onMouseEnter:I,onMouseLeave:M,...z.container,...j,children:[r.jsx(Ss,{id:e,name:o,opacity:0,width:0,height:0,checked:u,onChange:w,disabled:m,readOnly:h,...j}),l==="left"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t}),r.jsxs(c.View,{display:"flex",alignItems:"center",justifyContent:u?a?"space-between":"flex-end":n?"space-between":"flex-start",marginBottom:4,borderRadius:"9999px",backgroundColor:m?Ee.default.disabled:u?p?Ee.states.hover.active:Ee.default.active:p?Ee.states.hover.inactive:Ee.default.inactive,opacity:!m&&u&&p?Ee.states.hover.activeOpacity:1,cursor:"pointer",...Jt.slider,...d,...Cs[s],...js[s],...S.slider,children:[a&&u&&r.jsx(c.View,{marginLeft:8,marginRight:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:a}),r.jsx(c.View,{borderRadius:"50%",backgroundColor:Ee.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)",...Jt.knob,zIndex:1,...ks[s],...S.circle}),n&&!u&&r.jsx(c.View,{marginRight:8,marginLeft:4,transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",children:n})]}),l==="right"&&t&&r.jsx(c.Text,{fontWeight:"500",color:m?"color-gray-400":"color-gray-700",transition:"all 0.2s ease",children:t})]})},ws=e=>{const o=an(e);return r.jsx(ln,{...o,...e})},Is=ws,cn=({placeholder:e,isMulti:o,options:t,id:n=`selector-${Math.random().toString(36).substr(2,9)}`})=>{const i=e?o?[]:"":Array.isArray(t)&&t.length>0?t[0].value:o?[]:"",[a,l]=g.useState(!1),[d,s]=g.useState(!1),[u,p]=g.useState(i),[m,h]=g.useState(0),[f,x]=g.useState(!0);return{id:n,value:u,setValue:p,hide:f,setHide:x,isHovered:a,setIsHovered:l,isFocused:d,setIsFocused:s,highlightedIndex:m,setHighlightedIndex:h}},sn=({id:e,name:o,label:t,value:n,size:i,views:a={},options:l=[],onChange:d=()=>{},setValue:s=()=>{},...u})=>{const{getColor:p}=c.useTheme(),m=g.useCallback(h=>{s(h.value),d&&d(h.value)},[s,d]);return r.jsxs(Se,{id:e,width:"100%",views:a,children:[t&&r.jsxs(c.Horizontal,{fontSize:"10px",letterSpacing:"wider",color:"color-black-500",fontWeight:"bold",marginBottom:12,alignItems:"center",gap:6,style:{textTransform:"uppercase"},children:[r.jsx(Te,{widthHeight:14})," ",r.jsx(c.Text,{children:t})]}),r.jsx(c.Horizontal,{gap:0,children:l.map((h,f,x)=>{const y=n===h.value;let b=p("color-gray-200"),k=p("color-gray-500"),C="transparent";if(y){if(h.color)h.color,b=p(h.color),k=p(h.color),C="rgba(0,0,0,0.05)";else{const S=p("theme-primary");b=S,k=S,C="color-gray-50"}h.color?(b=p(h.color),k=p(h.color),C="transparent"):(b=p("theme-primary"),k=p("theme-primary"),C="transparent")}return r.jsx(We,{onClick:()=>m(h),flex:1,...i?{size:i}:{paddingVertical:6,fontSize:"12px"},fontWeight:y?"bold":"normal",style:{borderTop:`1px solid ${y?b:p("color-gray-200")}`,borderBottom:`1px solid ${y?b:p("color-gray-200")}`,borderLeft:`1px solid ${y?b:p("color-gray-200")}`,borderRight:f===x.length-1||y?`1px solid ${y?b:p("color-gray-200")}`:"none",backgroundColor:C,color:k,borderRadius:f===0?"6px 0 0 6px":f===x.length-1?"0 6px 6px 0":"0",zIndex:y?1:0,boxShadow:"none"},...a.item,children:h.label},h.value)})}),r.jsx("input",{type:"hidden",id:e,name:o,value:Array.isArray(n)?n.join(","):n,onChange:()=>{}})]})},Ts=e=>{const o={...e,options:e.options||[]},t=cn(o);return r.jsx(sn,{...t,...o,onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n)}})},Ms=Ts,dn=({label:e,placeholder:o,value:t})=>{const[n,i]=g.useState(e??o),[a,l]=g.useState(!1),[d,s]=g.useState(t||""),[u,p]=g.useState(!1);return g.useMemo(()=>{i(u&&!d?o??"":e??o)},[d,u,e,o]),{hint:n,setHint:i,isHovered:a,setIsHovered:l,value:d,setValue:s,isFocused:u,setIsFocused:p}},un=({id:e,name:o,hint:t,error:n,value:i,label:a,shadow:l,helperText:d,placeholder:s,size:u="sm",shape:p="default",variant:m="default",isHovered:h=!1,isFocused:f=!1,isEditable:x=!1,isReadOnly:y=!1,isDisabled:b=!1,isAutoFocus:k=!1,isMultiline:C=!1,maxRows:S=3,maxCols:j=30,onBlur:w=()=>{},onChange:I,onFocus:M,setHint:z=()=>{},setValue:V=()=>{},setIsFocused:$=()=>{},setIsHovered:T=()=>{},views:_={label:{},helperText:{}},...B})=>{const R=!!(f&&a),E={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",minHeight:"5em",maxHeight:"calc(100vh - 100px)",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[u],lineHeight:`${Math.round(c.Typography.fontSizes[u]*1.5)}px`,letterSpacing:"-0.01em",fontWeight:400,backgroundColor:"transparent",color:b?"color-gray-400":"color-gray-900",cursor:b?"not-allowed":"text",opacity:b?.7:1,transition:"color 200ms ease-out, opacity 200ms ease-out",..._.field},W=()=>T(!h),P=()=>{$(!0),M&&M()},H=A=>{w(A),$(!1)},L=A=>{typeof A=="string"?(V(A),I&&I(A)):(V(A.target.value),I&&I(A.target.value))};return r.jsx(Se,{helperText:d,error:n,views:_,...B,children:r.jsx(ze,{label:a,size:u,error:n,shape:p,views:_,shadow:l,variant:m,value:i,color:"theme-primary",isHovered:h,isDisabled:b,isReadOnly:y,isFocused:f,showLabel:R,onMouseEnter:W,onMouseLeave:W,..._==null?void 0:_.content,children:r.jsxs(Ke,{..._==null?void 0:_.warper,children:[R&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:n,..._==null?void 0:_.label,children:a}),r.jsx(c.Element,{as:"textarea",id:e,name:o,rows:S,cols:j,value:i,readOnly:y,disabled:b,autoFocus:k,editable:`${!!x.toString()}`,placeholder:t,onBlur:H,onFocus:P,multiline:`${!!C.toString()}`,onChange:A=>L(A),...E,style:{resize:b||y?"none":"vertical"},..._==null?void 0:_.textarea})]})})})},zs=e=>{const o=dn(e);return r.jsx(un,{...o,...e})},Rs=zs,Lt=({label:e,placeholder:o,value:t})=>{const[n,i]=g.useState(e??o),[a,l]=g.useState(!1),[d,s]=g.useState(!1),[u,p]=g.useState(t);return g.useMemo(()=>{i(a&&!u?o??"":e??o)},[u,a,e,o]),{hint:n,setHint:i,isFocused:a,setIsFocused:l,isHovered:d,setIsHovered:s,setValue:p,value:u}},Vs=e=>r.jsx(c.Input,{type:"text",...e}),ho=({id:e,name:o,label:t,hint:n,value:i,onChange:a,left:l,right:d,helperText:s,placeholder:u,onChangeText:p,shadow:m={},views:h={container:{},field:{},label:{},helperText:{},text:{}},size:f="md",shape:x="default",variant:y="default",error:b=!1,isFocused:k=!1,isHovered:C=!1,isDisabled:S=!1,isReadOnly:j=!1,isClearable:w=!0,isAutoFocus:I=!1,setHint:M=()=>{},setIsFocused:z=()=>{},setIsHovered:V=()=>{},setValue:$=()=>{},onClick:T=()=>{},onFocus:_,onBlur:B=()=>{},themeMode:R,...E})=>{const{getColor:W,themeMode:P}=c.useTheme(),H=W("color-blueGray-700",{themeMode:R||P}),L=!!(k&&t),A={margin:0,paddingVertical:4,paddingHorizontal:0,width:"100%",height:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[f],lineHeight:`${Math.round(c.Typography.fontSizes[f]*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=()=>{z(!0),_&&_()},D=()=>V(!C),O=U=>{B&&B(U),z(!1)},v=U=>{typeof U=="string"?($(U),p&&p(U),a&&a(U)):($(U.target.value),p&&p(U.target.value),a&&a(U.target.value))},X=()=>{$(""),a&&(B({target:{name:o}}),p&&p(""),a&&a("")),typeof document>"u"&&p&&p("")};return r.jsx(Se,{helperText:s,error:b,views:h,children:r.jsxs(ze,{label:t,size:f,error:b,shape:x,views:h,shadow:m,variant:y,value:i,color:"theme-primary",isHovered:C,isDisabled:S,isReadOnly:j,isFocused:k,showLabel:L,onMouseEnter:D,onMouseLeave:D,children:[l,r.jsxs(Ke,{children:[L&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:b,...h,children:t}),r.jsx(Vs,{id:e,name:o,readOnly:j,disabled:S,autoFocus:I,placeholder:n,onFocus:F,onBlur:O,autoComplete:"off",...A,...E,onChange:v,value:i})]}),w&&i&&!j&&!S&&r.jsx(Bt,{children:r.jsx(xe,{size:20,color:H,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]})})},Es=e=>{const o=Lt(e);return r.jsx(ho,{...o,...e})},fo=Es,gn=({defaultIsSelected:e=!1})=>{const[o,t]=g.useState(!1),[n,i]=g.useState(e);return{isHovered:o,setIsHovered:t,isSelected:n,setIsSelected:i}},Ps={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},Ws={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"}},nt={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"}}},pn=({id:e,icon:o,name:t,label:n,isChecked:i,onChange:a,onValueChange:l,shadow:d={},labelPosition:s="right",size:u="md",error:p=!1,isSelected:m=!1,isHovered:h=!1,isDisabled:f=!1,isReadOnly:x=!1,isIndeterminate:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:C=()=>{},views:S={checkbox:{},label:{}},infoText:j,helperText:w,...I})=>{const M=()=>C(!h),z=()=>{!x&&!f&&(k&&k(!m),a&&a(!i),l&&l(!i))},V=y?"indeterminate":i||m?"selected":"unselected",$=p?nt.error[V]:f?nt.disabled[V]:h?nt.hover[V]:{},T={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:p?"color-red-600":f?"color-gray-400":"color-gray-700",cursor:f?"not-allowed":x?"default":"pointer",opacity:f?.6:1,transition:"all 0.2s ease",...S.label},checkbox:{...Ws[V],...$,borderRadius:"4px",...Ps[u],transition:"all 0.2s ease",...d,...S.checkbox}};return r.jsxs(mo,{htmlFor:e,as:"div",onClick:z,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[u],...T.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",s==="left"&&n&&r.jsx(c.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:n}),r.jsx(c.Center,{...T.checkbox,children:y?r.jsx(Tr,{widthHeight:er[u],color:"white",transition:"all 0.2s ease"}):(i||m)&&(o??r.jsx(No,{widthHeight:er[u],color:"white",transition:"all 0.2s ease"}))}),s==="right"&&n&&r.jsx(c.Text,{size:u,fontWeight:"500",...S==null?void 0:S.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:s==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15",...S==null?void 0:S.infoText,children:j})]}),p&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:p})]})},_s=e=>{const o=gn(e);return r.jsx(pn,{...o,...e})},$s=_s,mn=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,onOpen:a,onClose:l,closeOnSelect:d=!0,maxRecentColors:s=8,showRecentColors:u=!0,isAutoFocus:p=!1}=e,[m,h]=g.useState(!1),[f,x]=g.useState(o??t),[y,b]=g.useState(""),[k,C]=g.useState([]),[S,j]=g.useState(!1),[w,I]=g.useState(!1),M=g.useRef(null),z=g.useRef(null);g.useEffect(()=>{o!==void 0&&x(o)},[o]),g.useEffect(()=>{if(u)try{const W=localStorage.getItem("colorInput-recentColors");W&&C(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=>{m&&M.current&&z.current&&!M.current.contains(P.target)&&!z.current.contains(P.target)&&R()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[m]);const V=g.useCallback(W=>{u&&C(P=>{const H=P.filter(A=>A!==W),L=[W,...H].slice(0,s);try{localStorage.setItem("colorInput-recentColors",JSON.stringify(L))}catch(A){console.warn("Failed to save recent colors to localStorage:",A)}return L})},[u,s]),$=g.useCallback(()=>{const W=!m;h(W),W?a==null||a():l==null||l()},[m,a,l]),T=g.useCallback(W=>{x(W),V(W),n==null||n(W),i==null||i(W),d&&(h(!1),l==null||l())},[n,i,d,l,V]),_=g.useCallback(W=>{b(W)},[]),B=g.useCallback(()=>{y&&(T(y),b(""))},[y,T]),R=g.useCallback(()=>{h(!1),l==null||l()},[l]),E=g.useCallback(W=>{x(W),n==null||n(W)},[n]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,isFocused:S,isHovered:w,handleToggle:$,handleColorSelect:T,handleCustomColorChange:_,handleCustomColorSubmit:B,handleClose:R,setIsFocused:j,setIsHovered:I,setValue:E,triggerRef:M,dropdownRef:z}},to={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"}},Hs={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"}},Bs={default:{borderRadius:"6px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Ls={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"}},As=[{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"}],hn=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",shadow:u,error:p=!1,isDisabled:m=!1,isReadOnly:h=!1,isFocused:f=!1,isHovered:x=!1,predefinedColors:y=As,showCustomInput:b=!0,showRecentColors:k=!0,isOpen:C=!1,selectedColor:S="",recentColors:j=[],customColor:w="",handleToggle:I=()=>{},handleColorSelect:M=()=>{},handleCustomColorChange:z=()=>{},handleCustomColorSubmit:V=()=>{},setIsFocused:$=()=>{},setIsHovered:T=()=>{},triggerRef:_,dropdownRef:B,onChange:R,...E})=>{const{getColor:W}=c.useTheme(),P={...to.container,...a==null?void 0:a.container},H={...to.trigger,...Hs[l],...Bs[d],...Ls[s],...p&&{borderColor:"color-red-500"},...m&&{opacity:.6,cursor:"not-allowed"},...f&&{borderColor:"color-blue-500",boxShadow:"0 0 0 3px rgba(59, 130, 246, 0.1)"},...x&&!m&&{borderColor:"color-gray-400"},...a==null?void 0:a.trigger,...u&&u},L={...to.dropdown,...a==null?void 0:a.dropdown},A={...to.colorGrid,...a==null?void 0:a.colorGrid},F={...to.recentColors,...a==null?void 0:a.recentColors},D=S||"color-gray-200";return r.jsxs(c.View,{...P,...E,children:[t&&r.jsx(mo,{htmlFor:e,size:l,isDisabled:m,error:p,views:a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:_,onClick:m||h?void 0:I,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),onFocus:()=>$(!0),onBlur:()=>$(!1),tabIndex:m?-1:0,role:"button","aria-expanded":C,"aria-haspopup":"listbox","aria-label":t||n,width:"fit-content",gap:8,...H,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:D,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),!h&&!m&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:C?"up":"down"})]}),C&&r.jsxs(c.View,{ref:B,...L,children:[r.jsx(c.View,{...A,children:y.map((O,v)=>r.jsx(c.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"},...a==null?void 0:a.colorSwatch},v))}),k&&j.length>0&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:4,flexWrap:"wrap",...F,children:j.map((O,v)=>r.jsx(c.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"}},v))})]}),b&&r.jsxs(c.Vertical,{gap:8,marginTop:"16px",children:[r.jsx(c.Text,{fontSize:"12px",fontWeight:"500",color:"color-gray-600",children:"Custom Color"}),r.jsxs(c.Horizontal,{gap:8,children:[r.jsx(fo,{value:w,onChange:O=>z(O.target.value),placeholder:"#000000 or rgb(0,0,0)",size:"sm",style:{flex:1},views:a==null?void 0:a.customInput}),r.jsx(c.View,{padding:"8px 12px",backgroundColor:"color-blue-500",borderRadius:"4px",cursor:"pointer",onClick:V,_hover:{backgroundColor:"color-blue-600"},children:r.jsx(c.Text,{color:"color-white",fontSize:"12px",fontWeight:"500",children:"Add"})})]})]})]}),i&&r.jsx(c.Text,{fontSize:"12px",color:p?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i}),p&&typeof p=="string"&&r.jsx(c.Text,{fontSize:"12px",color:"color-red-500",marginTop:"4px",...a==null?void 0:a.error,children:p})]})},Ds=e=>{const o=mn(e);return r.jsx(hn,{...o,...e})},Fs=Ds,ht=[{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"}],fn=({placeholder:e})=>{const[o,t]=g.useState(ht),[n,i]=g.useState(e??ht[0].name),[a,l]=g.useState(!0),[d,s]=g.useState(!1),[u,p]=g.useState(!1);return{hide:a,setHide:l,newOptions:o,setNewOptions:t,isHovered:u,setIsHovered:p,isFocused:d,setIsFocused:s,value:n,setValue:i}},or={xs:8,sm:10,md:12,lg:14,xl:16},Os=({size:e,...o})=>r.jsx(c.Element,{as:"ul",...o}),qs=e=>r.jsx(c.Input,{type:"country",...e}),Ns=({size:e,...o})=>r.jsx(c.Element,{as:"li",...o}),Us=({option:e,size:o="md",callback:t=()=>{},views:n={text:{}}})=>{const i=a=>{a&&a.stopPropagation&&a.stopPropagation(),t(e)};return r.jsx(Ns,{margin:0,role:"DropDownItem",listStyleType:"none",fontWeight:"normal",paddingVertical:6,paddingHorizontal:12,onClick:i,fontSize:c.Typography.fontSizes[o],_hover:{opacity:.8},...n.text,children:e})},Gs=({size:e,views:o={dropDown:{}},options:t=[],callback:n=()=>{}})=>{const i=a=>n(a);return r.jsx(Os,{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",...o.dropDown,children:t.map(a=>r.jsx(Us,{size:e,option:a.name,callback:i,...o.text},a.code))})},xn=({id:e,name:o,label:t,value:n,placeholder:i,helperText:a,hide:l=!1,error:d=!1,isHovered:s=!1,isFocused:u=!1,isAutoFocus:p=!1,isDisabled:m=!1,isReadOnly:h=!1,shadow:f={},newOptions:x=[],size:y="md",variant:b="default",shape:k="default",onChange:C,onBlur:S=()=>{},setHide:j=()=>{},setNewOptions:w=()=>{},setIsHovered:I=()=>{},setIsFocused:M=()=>{},setValue:z=()=>{},views:V={text:{},icon:{},label:{},dropDown:{},helperText:{}},themeMode:$,...T})=>{const{getColor:_,themeMode:B}=c.useTheme(),R=_("color-blueGray-700",{themeMode:$||B}),E=()=>M(!0),W=D=>{j(!l),z(D),C&&C(D)},P=()=>{!m&&!h&&j(!l)},H=D=>{const O=D.target.value,v=ht.filter(X=>X.name.toLowerCase().startsWith(O.toLowerCase()));l&&j(!1),w(v),C&&C(O)},L=D=>{S(D),M(!1)},A=!!(t&&(u||n)),F={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none"}},fontSize:c.Typography.fontSizes[y],backgroundColor:"transparent",color:m?"color-trueGray-600":"color-blueGray-700",cursor:m?"not-allowed":h?"auto":"pointer",...V.field};return r.jsxs(Se,{helperText:a,error:d,views:V,onClick:P,children:[r.jsxs(ze,{label:t,size:y,error:d,shape:k,views:V,shadow:f,variant:b,value:n,color:"theme-primary",isDisabled:m,isReadOnly:h,isFocused:u,showLabel:A,_hover:!m&&!d?{borderColor:"theme-primary"}:void 0,children:[r.jsxs(Ke,{children:[A&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:d,...V,children:t}),r.jsx(qs,{id:e,name:o,placeholder:i,readOnly:h,disabled:m,autoFocus:p,onBlur:L,onFocus:E,...F,...T,value:n,onChange:H})]}),r.jsx(Bt,{children:l?r.jsx(ae,{orientation:"down",widthHeight:or[y],color:R,style:V.icon}):r.jsx(ae,{orientation:"up",widthHeight:or[y],color:R,style:V.icon})})]}),!l&&r.jsx(Gs,{size:y,views:V,options:x,callback:W})]})},Ys=e=>{const o=fn(e);return r.jsx(xn,{...o,...e})},vs=Ys;function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Bo(e)}function ge(e,o){if(o.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+o.length+" present")}function Xs(e){return ge(1,arguments),e instanceof Date||Bo(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ke(e){ge(1,arguments);var o=Object.prototype.toString.call(e);return e instanceof Date||Bo(e)==="object"&&o==="[object Date]"?new Date(e.getTime()):typeof e=="number"||o==="[object Number]"?new Date(e):((typeof e=="string"||o==="[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 Ks(e){if(ge(1,arguments),!Xs(e)&&typeof e!="number")return!1;var o=ke(e);return!isNaN(Number(o))}function _e(e){if(e===null||e===!0||e===!1)return NaN;var o=Number(e);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function Qs(e,o){ge(2,arguments);var t=ke(e).getTime(),n=_e(o);return new Date(t+n)}function Zs(e,o){ge(2,arguments);var t=_e(o);return Qs(e,-t)}var Js=864e5;function ed(e){ge(1,arguments);var o=ke(e),t=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var n=o.getTime(),i=t-n;return Math.floor(i/Js)+1}function Lo(e){ge(1,arguments);var o=1,t=ke(e),n=t.getUTCDay(),i=(n<o?7:0)+n-o;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function bn(e){ge(1,arguments);var o=ke(e),t=o.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Lo(n),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var l=Lo(a);return o.getTime()>=i.getTime()?t+1:o.getTime()>=l.getTime()?t:t-1}function od(e){ge(1,arguments);var o=bn(e),t=new Date(0);t.setUTCFullYear(o,0,4),t.setUTCHours(0,0,0,0);var n=Lo(t);return n}var td=6048e5;function rd(e){ge(1,arguments);var o=ke(e),t=Lo(o).getTime()-od(o).getTime();return Math.round(t/td)+1}var nd={};function Qo(){return nd}function Ao(e,o){var t,n,i,a,l,d,s,u;ge(1,arguments);var p=Qo(),m=_e((t=(n=(i=(a=o==null?void 0:o.weekStartsOn)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&i!==void 0?i:p.weekStartsOn)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&t!==void 0?t:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=ke(e),f=h.getUTCDay(),x=(f<m?7:0)+f-m;return h.setUTCDate(h.getUTCDate()-x),h.setUTCHours(0,0,0,0),h}function yn(e,o){var t,n,i,a,l,d,s,u;ge(1,arguments);var p=ke(e),m=p.getUTCFullYear(),h=Qo(),f=_e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:h.firstWeekContainsDate)!==null&&n!==void 0?n:(s=h.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,f),x.setUTCHours(0,0,0,0);var y=Ao(x,o),b=new Date(0);b.setUTCFullYear(m,0,f),b.setUTCHours(0,0,0,0);var k=Ao(b,o);return p.getTime()>=y.getTime()?m+1:p.getTime()>=k.getTime()?m:m-1}function ad(e,o){var t,n,i,a,l,d,s,u;ge(1,arguments);var p=Qo(),m=_e((t=(n=(i=(a=o==null?void 0:o.firstWeekContainsDate)!==null&&a!==void 0?a:o==null||(l=o.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&n!==void 0?n:(s=p.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=yn(e,o),f=new Date(0);f.setUTCFullYear(h,0,m),f.setUTCHours(0,0,0,0);var x=Ao(f,o);return x}var id=6048e5;function ld(e,o){ge(1,arguments);var t=ke(e),n=Ao(t,o).getTime()-ad(t,o).getTime();return Math.round(n/id)+1}function ee(e,o){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length<o;)n="0"+n;return t+n}var we={y:function(o,t){var n=o.getUTCFullYear(),i=n>0?n:1-n;return ee(t==="yy"?i%100:i,t.length)},M:function(o,t){var n=o.getUTCMonth();return t==="M"?String(n+1):ee(n+1,2)},d:function(o,t){return ee(o.getUTCDate(),t.length)},a:function(o,t){var n=o.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(o,t){return ee(o.getUTCHours()%12||12,t.length)},H:function(o,t){return ee(o.getUTCHours(),t.length)},m:function(o,t){return ee(o.getUTCMinutes(),t.length)},s:function(o,t){return ee(o.getUTCSeconds(),t.length)},S:function(o,t){var n=t.length,i=o.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return ee(a,t.length)}},Ae={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cd={G:function(o,t,n){var i=o.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(o,t,n){if(t==="yo"){var i=o.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return we.y(o,t)},Y:function(o,t,n,i){var a=yn(o,i),l=a>0?a:1-a;if(t==="YY"){var d=l%100;return ee(d,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):ee(l,t.length)},R:function(o,t){var n=bn(o);return ee(n,t.length)},u:function(o,t){var n=o.getUTCFullYear();return ee(n,t.length)},Q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ee(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,n){var i=Math.ceil((o.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ee(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,n){var i=o.getUTCMonth();switch(t){case"M":case"MM":return we.M(o,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,n){var i=o.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return ee(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,n,i){var a=ld(o,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):ee(a,t.length)},I:function(o,t,n){var i=rd(o);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ee(i,t.length)},d:function(o,t,n){return t==="do"?n.ordinalNumber(o.getUTCDate(),{unit:"date"}):we.d(o,t)},D:function(o,t,n){var i=ed(o);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ee(i,t.length)},E:function(o,t,n){var i=o.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return ee(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(o,t,n,i){var a=o.getUTCDay(),l=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return ee(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(o,t,n){var i=o.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return ee(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,n){var i=o.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(o,t,n){var i=o.getUTCHours(),a;switch(i===12?a=Ae.noon:i===0?a=Ae.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(o,t,n){var i=o.getUTCHours(),a;switch(i>=17?a=Ae.evening:i>=12?a=Ae.afternoon:i>=4?a=Ae.morning:a=Ae.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(o,t,n){if(t==="ho"){var i=o.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return we.h(o,t)},H:function(o,t,n){return t==="Ho"?n.ordinalNumber(o.getUTCHours(),{unit:"hour"}):we.H(o,t)},K:function(o,t,n){var i=o.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ee(i,t.length)},k:function(o,t,n){var i=o.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ee(i,t.length)},m:function(o,t,n){return t==="mo"?n.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):we.m(o,t)},s:function(o,t,n){return t==="so"?n.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):we.s(o,t)},S:function(o,t){return we.S(o,t)},X:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();if(l===0)return"Z";switch(t){case"X":return rr(l);case"XXXX":case"XX":return Pe(l);case"XXXXX":case"XXX":default:return Pe(l,":")}},x:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"x":return rr(l);case"xxxx":case"xx":return Pe(l);case"xxxxx":case"xxx":default:return Pe(l,":")}},O:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+tr(l,":");case"OOOO":default:return"GMT"+Pe(l,":")}},z:function(o,t,n,i){var a=i._originalDate||o,l=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+tr(l,":");case"zzzz":default:return"GMT"+Pe(l,":")}},t:function(o,t,n,i){var a=i._originalDate||o,l=Math.floor(a.getTime()/1e3);return ee(l,t.length)},T:function(o,t,n,i){var a=i._originalDate||o,l=a.getTime();return ee(l,t.length)}};function tr(e,o){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var l=o;return t+String(i)+l+ee(a,2)}function rr(e,o){if(e%60===0){var t=e>0?"-":"+";return t+ee(Math.abs(e)/60,2)}return Pe(e,o)}function Pe(e,o){var t=o||"",n=e>0?"-":"+",i=Math.abs(e),a=ee(Math.floor(i/60),2),l=ee(i%60,2);return n+a+t+l}var nr=function(o,t){switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kn=function(o,t){switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},sd=function(o,t){var n=o.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return nr(o,t);var l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",nr(i,t)).replace("{{time}}",kn(a,t))},dd={p:kn,P:sd};function ud(e){var o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),e.getTime()-o.getTime()}var gd=["D","DD"],pd=["YY","YYYY"];function md(e){return gd.indexOf(e)!==-1}function hd(e){return pd.indexOf(e)!==-1}function ar(e,o,t){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(t,"`; 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(o,"`) for formatting years to the input `").concat(t,"`; 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(o,"`) for formatting days of the month to the input `").concat(t,"`; 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(o,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var fd={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"}},xd=function(o,t,n){var i,a=fd[o];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function at(e){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=o.width?String(o.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var bd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jd={date:at({formats:bd,defaultWidth:"full"}),time:at({formats:yd,defaultWidth:"full"}),dateTime:at({formats:kd,defaultWidth:"full"})},Cd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sd=function(o,t,n,i){return Cd[o]};function ro(e){return function(o,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=e.formattingValues[l]||e.formattingValues[a]}else{var d=e.defaultWidth,s=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[s]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(o):o;return i[u]}}var wd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Id={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Td={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"]},Md={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"]},zd={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"}},Rd={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"}},Vd=function(o,t){var n=Number(o),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ed={ordinalNumber:Vd,era:ro({values:wd,defaultWidth:"wide"}),quarter:ro({values:Id,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:ro({values:Td,defaultWidth:"wide"}),day:ro({values:Md,defaultWidth:"wide"}),dayPeriod:ro({values:zd,defaultWidth:"wide",formattingValues:Rd,defaultFormattingWidth:"wide"})};function no(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=o.match(i);if(!a)return null;var l=a[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(d)?Wd(d,function(m){return m.test(l)}):Pd(d,function(m){return m.test(l)}),u;u=e.valueCallback?e.valueCallback(s):s,u=t.valueCallback?t.valueCallback(u):u;var p=o.slice(l.length);return{value:u,rest:p}}}function Pd(e,o){for(var t in e)if(e.hasOwnProperty(t)&&o(e[t]))return t}function Wd(e,o){for(var t=0;t<e.length;t++)if(o(e[t]))return t}function _d(e){return function(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.match(e.matchPattern);if(!n)return null;var i=n[0],a=o.match(e.parsePattern);if(!a)return null;var l=e.valueCallback?e.valueCallback(a[0]):a[0];l=t.valueCallback?t.valueCallback(l):l;var d=o.slice(i.length);return{value:l,rest:d}}}var $d=/^(\d+)(th|st|nd|rd)?/i,Hd=/\d+/i,Bd={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},Ld={any:[/^b/i,/^(a|c)/i]},Ad={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Dd={any:[/1/i,/2/i,/3/i,/4/i]},Fd={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},Od={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]},qd={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},Nd={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]},Ud={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},Gd={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}},Yd={ordinalNumber:_d({matchPattern:$d,parsePattern:Hd,valueCallback:function(o){return parseInt(o,10)}}),era:no({matchPatterns:Bd,defaultMatchWidth:"wide",parsePatterns:Ld,defaultParseWidth:"any"}),quarter:no({matchPatterns:Ad,defaultMatchWidth:"wide",parsePatterns:Dd,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:no({matchPatterns:Fd,defaultMatchWidth:"wide",parsePatterns:Od,defaultParseWidth:"any"}),day:no({matchPatterns:qd,defaultMatchWidth:"wide",parsePatterns:Nd,defaultParseWidth:"any"}),dayPeriod:no({matchPatterns:Ud,defaultMatchWidth:"any",parsePatterns:Gd,defaultParseWidth:"any"})},vd={code:"en-US",formatDistance:xd,formatLong:jd,formatRelative:Sd,localize:Ed,match:Yd,options:{weekStartsOn:0,firstWeekContainsDate:1}},Xd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qd=/^'([^]*?)'?$/,Zd=/''/g,Jd=/[a-zA-Z]/;function eu(e,o,t){var n,i,a,l,d,s,u,p,m,h,f,x,y,b;ge(2,arguments);var k=String(o),C=Qo(),S=(n=(i=void 0)!==null&&i!==void 0?i:C.locale)!==null&&n!==void 0?n:vd,j=_e((a=(l=(d=(s=void 0)!==null&&s!==void 0?s:void 0)!==null&&d!==void 0?d:C.firstWeekContainsDate)!==null&&l!==void 0?l:(u=C.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=_e((m=(h=(f=(x=void 0)!==null&&x!==void 0?x:void 0)!==null&&f!==void 0?f:C.weekStartsOn)!==null&&h!==void 0?h:(y=C.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.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=ke(e);if(!Ks(I))throw new RangeError("Invalid time value");var M=ud(I),z=Zs(I,M),V={firstWeekContainsDate:j,weekStartsOn:w,locale:S,_originalDate:I},$=k.match(Kd).map(function(T){var _=T[0];if(_==="p"||_==="P"){var B=dd[_];return B(T,S.formatLong)}return T}).join("").match(Xd).map(function(T){if(T==="''")return"'";var _=T[0];if(_==="'")return ou(T);var B=cd[_];if(B)return hd(T)&&ar(T,o,String(e)),md(T)&&ar(T,o,String(e)),B(z,T,S.localize,V);if(_.match(Jd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return T}).join("");return $}function ou(e){var o=e.match(Qd);return o?o[1].replace(Zd,"'"):e}const jn=()=>{const[e,o]=g.useState(!1),[t,n]=g.useState(!1),[i,a]=g.useState(eu(new Date,"yyyy-MM-dd"));return{date:i,setDate:a,isHovered:e,setIsHovered:o,isFocused:t,setIsFocused:n}},tu=e=>r.jsx(c.Input,{type:"date",...e}),Cn=({id:e,icon:o,name:t,label:n,date:i,children:a,helperText:l,shadow:d={},size:s="md",variant:u="default",shape:p="default",views:m={container:{},label:{},helperText:{},text:{},field:{}},error:h=!1,isHovered:f=!1,isFocused:x=!1,isDisabled:y=!1,isReadOnly:b=!1,setDate:k=()=>{},setIsFocused:C=()=>{},setIsHovered:S=()=>{},onChange:j,onChangeText:w,...I})=>{const M=!!(x&&n),z=()=>S(!f),V=()=>C(!0),$=_=>{typeof _=="string"?(k(_),w&&w(_)):(k(_.target.value),j&&j(_.target.value))},T={margin:0,paddingVertical:8,paddingHorizontal:0,width:"100%",heigth:"100%",border:"none",on:{focus:{outline:"none",backgroundColor:"transparent"}},fontSize:c.Typography.fontSizes[s],backgroundColor:"transparent",color:y?"color-trueGray-600":"color-blueGray-700",cursor:y?"not-allowed":b?"auto":"pointer",...m.field};return r.jsx(Se,{helperText:l,error:h,views:m,children:r.jsx(ze,{label:n,size:s,error:h,shape:p,views:m,shadow:d,color:"theme-primary",variant:u,value:i,isHovered:f,isDisabled:y,isReadOnly:b,isFocused:x,showLabel:M,onMouseEnter:z,onMouseLeave:z,children:r.jsxs(Ke,{children:[M&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:h,...m,children:n}),r.jsx(tu,{id:e,name:t,onFocus:V,disabled:y,readOnly:b,...T,...I,...w&&{onChangeText:$},onChange:$})]})})})},ru=e=>{const o=jn();return r.jsx(Cn,{...o,...e})},nu=ru,Sn=e=>{const o=Lt(e),[t,n]=g.useState(!1);return{isVisible:t,setIsVisible:n,...e,...o}},au=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const{isVisible:n,setIsVisible:i,...a}=Sn(t);return r.jsx(ho,{...a,type:n?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||i(!n)},children:n?e:o})})},iu=au,wn=(e,o,t)=>{const[n,i]=g.useState(e),[a,l]=g.useState(o?{value:o,label:o}:e[0]),[d,s]=g.useState([]),[u,p]=g.useState(0),[m,h]=g.useState(t??""),[f,x]=g.useState(!1);return{filteredItems:n,setFilteredItems:i,selectedItem:a,setSelectedItem:l,selectedItems:d,setSelectedItems:s,highlightedIndex:u,setHighlightedIndex:p,searchQuery:m,setSearchQuery:h,isDropdownVisible:f,setIsDropdownVisible:x}},lu={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)"},ir={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)"}},cu={padding:"8px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-100",backgroundColor:"color-gray-50",borderTopLeftRadius:"10px",borderTopRightRadius:"10px"},su={padding:"8px 10px",cursor:"pointer",borderRadius:"6px",margin:"1px 4px",transition:"background-color 0.15s ease"},du={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)"}},uu={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"},In=({placeholder:e,items:o,showTick:t=!0,onSelect:n,searchEnabled:i=!0,left:a,right:l,label:d,filteredItems:s,setSelectedItem:u,selectedItem:p,selectedItems:m,setSelectedItems:h,highlightedIndex:f,setHighlightedIndex:x,searchQuery:y,setSearchQuery:b,setFilteredItems:k,views:C,isDropdownVisible:S,setIsDropdownVisible:j,isMulti:w=!1,...I})=>{const{ref:M,relation:z}=c.useElementPosition({trackChanges:!0,trackOnScroll:!0,trackOnResize:!0,throttleMs:10}),V=g.useRef(null),[$,T]=g.useState(!1),[_,B]=g.useState(!1),R=()=>{var O;const L=_?ir.enter:ir.initial;if(!M.current)return{};const A=M.current.getBoundingClientRect(),F={position:"fixed",left:A.left,width:A.width,zIndex:1e4,...L};return((O=z==null?void 0:z.space)==null?void 0:O.vertical)==="top"?{...F,bottom:window.innerHeight-A.top+6}:{...F,top:A.bottom+6}};g.useEffect(()=>{if(S){const L=setTimeout(()=>B(!0),10);return()=>clearTimeout(L)}B(!1)},[S]),g.useEffect(()=>{const L=A=>{!A.composedPath().some(O=>(O==null?void 0:O.id)==="combobox-dropdown")&&M.current&&!M.current.contains(A.target)&&j(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);const E=L=>{if(b(L),L==="")k(o);else{const A=o.filter(F=>F.label.toLowerCase().includes(L.toLowerCase()));k(A)}x(0)},W=L=>{if(w){const A=m.some(D=>D.value===L.value);let F;A?F=m.filter(D=>D.value!==L.value):F=[...m,L],h(F),n==null||n(F)}else u(L),n==null||n(L),j(!1)},P=(L,A)=>{L.stopPropagation();const F=m.filter(D=>D.value!==A.value);h(F),n==null||n(F)},H=L=>w?m.some(A=>A.value===L.value):L.value===p.value;return r.jsxs(c.Horizontal,{role:"combobox",flexWrap:"nowrap",gap:15,alignItems:"center",width:"100%",...I,children:[d&&r.jsx(c.Text,{views:C==null?void 0:C.label,htmlFor:I.id,children:d}),r.jsxs(c.View,{position:"relative",width:"100%",children:[r.jsx("div",{ref:M,onClick:()=>j(!S),style:{width:"100%"},children:r.jsxs(ze,{isHovered:$,isFocused:S,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),cursor:"pointer",views:{container:C==null?void 0:C.container},children:[r.jsxs(c.Horizontal,{gap:10,alignItems:"center",width:"100%",flexWrap:w?"wrap":"nowrap",...C==null?void 0:C.labelContainer,children:[a,w?m.length>0?r.jsx(c.Horizontal,{gap:6,flexWrap:"wrap",alignItems:"center",children:m.map(L=>r.jsxs(c.Horizontal,{...uu,_hover:{backgroundColor:"color-gray-200"},children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:"color-gray-700",weight:"medium",children:L.label}),r.jsx(xe,{widthHeight:12,color:"color-gray-500",cursor:"pointer",onClick:A=>P(A,L)})]},L.value))}):r.jsx(c.Text,{weight:"medium",flexGrow:1,color:"color-gray-500",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...C==null?void 0:C.label,children:e}):r.jsxs(r.Fragment,{children:[p.icon&&p.label!==e&&r.jsx(c.View,{children:p.icon}),r.jsx(c.Text,{weight:"medium",flexGrow:1,color:p.label===e?"color-gray-500":"color-gray-800",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},...C==null?void 0:C.label,children:p.label})]})]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[l,r.jsx(c.View,{style:S?lr.open:lr.closed,children:r.jsx(ae,{widthHeight:16,orientation:"down",color:S?"color-gray-700":"color-gray-400"})})]})]})}),S&&r.jsx(en,{children:r.jsxs(c.View,{ref:V,id:"combobox-dropdown",role:"listbox","aria-labelledby":I.id,...lu,style:R(),...C==null?void 0:C.dropdown,children:[i&&r.jsx(c.View,{...cu,children:r.jsx(ho,{id:`${I.id}-search`,name:`${I.name}-search`,width:"100%",type:"search",autoFocus:!0,value:y,onChange:L=>E(L),hint:e||"Search...",isClearable:!1,left:r.jsx(Po,{widthHeight:14,color:"color-gray-400"}),views:{container:{width:"100%",padding:"0",backgroundColor:"transparent",borderColor:"color-gray-200",...C==null?void 0:C.text},field:{fontSize:"13px"}}})}),s.length>0&&r.jsx(c.View,{margin:0,padding:"4px",children:s.map((L,A)=>{const F=H(L),D=A===f;return r.jsxs(c.Horizontal,{role:"option","aria-selected":F,justifyContent:"space-between",alignItems:"center",...su,backgroundColor:F&&D?"rgba(59, 130, 246, 0.12)":F?"rgba(59, 130, 246, 0.08)":D?"color-gray-100":"transparent",onMouseEnter:()=>x(A),onClick:()=>W(L),...C==null?void 0:C.item,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[L.icon&&r.jsx(c.View,{flexShrink:0,children:L.icon}),r.jsx(c.Text,{size:"sm",color:F?"theme-primary":"color-gray-800",weight:F?"medium":"normal",children:L.label})]}),F&&t&&r.jsx(No,{widthHeight:16,color:"theme-primary"})]},L.value)})}),s.length===0&&r.jsxs(c.Vertical,{...du,children:[r.jsx(Po,{widthHeight:24,color:"color-gray-300"}),r.jsx(c.Text,{color:"color-gray-500",size:"sm",align:"center",children:"No results found"}),r.jsx(c.Text,{color:"color-gray-400",size:"xs",align:"center",children:"Try a different search term"})]})]})})]})]})},gu=({id:e,name:o,items:t,placeholder:n,searchPlaceholder:i,...a})=>{const l=wn(t,n,i);return r.jsx(In,{id:e,name:o,items:t,...l,...a})},pu=gu,Tn=e=>{const{tags:o,defaultTags:t=[],onTagsChange:n,onTagAdd:i,onTagRemove:a,maxTags:l,minTagLength:d=1,maxTagLength:s=50,allowDuplicates:u=!1,separators:p=["enter","comma"],isDisabled:m=!1,isReadOnly:h=!1}=e,[f,x]=g.useState(""),[y,b]=g.useState(()=>(o||t||[]).map((R,E)=>({id:`tag-${E}-${Date.now()}`,value:R}))),[k,C]=g.useState(!1),[S,j]=g.useState(!1),w=o&&Array.isArray(o)?o.map((B,R)=>({id:`tag-${R}-${Date.now()}`,value:B})):y;g.useEffect(()=>{o&&Array.isArray(o)&&b(o.map((B,R)=>({id:`tag-${R}-${Date.now()}`,value:B})))},[o]);const I=g.useCallback(B=>{const R=B.trim();return!(R.length<d||R.length>s||!u&&w.map(W=>W.value.toLowerCase()).includes(R.toLowerCase())||l&&w.length>=l)},[w,d,s,u,l]),M=g.useCallback(B=>{if(m||h)return;const R=B.trim();if(!R||!I(R))return;const E={id:`tag-${Date.now()}-${Math.random()}`,value:R},W=[...w,E],P=W.map(H=>H.value);o||b(W),n==null||n(P),i==null||i(R),x("")},[w,I,n,i,m,h,o]),z=g.useCallback(B=>{if(m||h)return;const R=w[B];if(!R)return;const E=w.filter((P,H)=>H!==B),W=E.map(P=>P.value);o||b(E),n==null||n(W),a==null||a(R.value,B)},[w,n,a,m,h,o]),V=g.useCallback(B=>{if(m||h)return;const R=B.target.value;if(p.includes("comma")&&R.includes(",")){const E=R.split(","),W=E[0],P=E.slice(1).join(",");W.trim()&&M(W),x(P);return}x(R)},[M,p,m,h]),$=g.useCallback(B=>{if(m||h)return;const{key:R}=B;if(p.includes("enter")&&R==="Enter"){B.preventDefault(),f.trim()&&M(f);return}if(p.includes("tab")&&R==="Tab"&&f.trim()){B.preventDefault(),M(f);return}if(p.includes("space")&&R===" "&&f.trim()){B.preventDefault(),M(f);return}if(R==="Backspace"&&!f&&w.length>0){B.preventDefault(),z(w.length-1);return}},[M,z,f,w,p,m,h]),T=g.useCallback(()=>{var B;C(!0),(B=e.onFocus)==null||B.call(e)},[e.onFocus]),_=g.useCallback(()=>{var B;C(!1),f.trim()&&M(f),(B=e.onBlur)==null||B.call(e)},[M,f,e.onBlur]);return{inputValue:f,setInputValue:x,tags:w,setTags:b,isFocused:k,setIsFocused:C,isHovered:S,setIsHovered:j,addTag:M,removeTag:z,handleInputChange:V,handleKeyDown:$,handleFocus:T,handleBlur:_,validateTag:I}},mu=({tag:e,onRemove:o,isRemovable:t,size:n,views:i,isDisabled:a,isReadOnly:l})=>{const[d,s]=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}}[n]||{padding:"6px 14px",fontSize:"14px",iconSize:14};return r.jsxs(c.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:a?.6:1,_hover:!a&&!l?{backgroundColor:"color-gray-100-200",borderColor:"color-gray-200",boxShadow:"0 4px 6px rgba(0,0,0,0.05)",transform:"translateY(-1px)"}:{},...i==null?void 0:i.tag,children:[r.jsx(c.Text,{fontSize:u.fontSize,color:a?"color-gray-100":"theme-primary",whiteSpace:"nowrap",...i==null?void 0:i.tagText,children:e}),t&&!a&&!l&&r.jsx(c.View,{cursor:"pointer",padding:"2px",borderRadius:"50%",transition:"all 0.2s ease",backgroundColor:d?"color-red-100":"transparent",opacity:d?1:.7,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onClick:p=>{p.stopPropagation(),o()},_hover:{backgroundColor:"color-red-50"},...i==null?void 0:i.tagRemove,children:r.jsx(xe,{widthHeight:u.iconSize,color:d?"color-red-500":"color-gray-400"})})]})},Mn=({id:e,name:o,label:t,placeholder:n="Type and press Enter to add tags...",helperText:i,error:a=!1,inputValue:l="",tags:d=[],left:s,right:u,shadow:p={},views:m={},size:h="md",shape:f="default",variant:x="default",isDisabled:y=!1,isReadOnly:b=!1,isAutoFocus:k=!1,isRemovable:C=!0,isFocused:S=!1,isHovered:j=!1,maxTags:w,handleInputChange:I,handleKeyDown:M,handleFocus:z,handleBlur:V,removeTag:$,setIsHovered:T,onClick:_,...B})=>{const{getColor:R,themeMode:E}=c.useTheme(),W=!!(t&&(S||d.length>0||l)),P=w&&d.length>=w,H={...on[f],...tn[x],...m==null?void 0:m.inputContainer},L={border:"none",outline:"none",backgroundColor:"transparent",fontSize:c.Typography.fontSizes[h],color:y?"color-gray-400":"color-gray-800",flex:1,minWidth:"120px",...m==null?void 0:m.input};return r.jsx(Se,{error:!!a,helperText:typeof a=="string"?a:i,views:m,...B,children:r.jsxs(ze,{label:t,shadow:p,value:d.length>0||l?"has-content":"",size:h,shape:f,variant:x,error:!!a,showLabel:W,isFocused:S,isHovered:j,isDisabled:y,isReadOnly:b,views:m,onClick:_,onMouseEnter:()=>T==null?void 0:T(!0),onMouseLeave:()=>T==null?void 0:T(!1),...H,children:[s,r.jsxs(Ke,{children:[t&&r.jsx($e,{size:h,error:!!a,views:m,children:t}),r.jsxs(c.Horizontal,{alignItems:"center",gap:8,flexWrap:"wrap",width:"100%",minHeight:c.Typography.fontSizes[h],padding:"8px 0",...m==null?void 0:m.tagsContainer,children:[d.map((A,F)=>r.jsx(mu,{tag:A.value,onRemove:()=>$==null?void 0:$(F),isRemovable:C,size:h,views:m,isDisabled:y,isReadOnly:b},A.id)),!P&&r.jsx(c.Input,{id:e,name:o,type:"text",value:l,placeholder:d.length===0?n:"",disabled:y,readOnly:b,autoFocus:k,onChange:I,onKeyDown:M,onFocus:z,onBlur:V,autoComplete:"off",...L}),P&&r.jsxs(c.Text,{fontSize:c.Typography.fontSizes[h],color:"color-gray-500",fontStyle:"italic",...m==null?void 0:m.placeholder,children:["Maximum ",w," tags reached"]})]})]}),u]})})},hu=e=>{const o=Tn(e),{tags:t,...n}=e;return r.jsx(Mn,{...o,...n})},fu=hu;function xu(e){const o=setTimeout(e,0),t=setTimeout(e,10),n=setTimeout(e,50);return[o,t,n]}const zn=({value:e,defaultValue:o="",length:t=6,onChange:n,onChangeText:i,onComplete:a,onKeyDown:l,onKeyPress:d,onBlur:s,onFocus:u,isReadOnly:p,isDisabled:m,pattern:h,stepValues:f,pasteTransformer:x})=>{var v,X;const y=e!==void 0,b=y?e:o,[k,C]=g.useState((b==null?void 0:b.slice(0,t))||""),[S,j]=g.useState(!1),[w,I]=g.useState(!1),[M,z]=g.useState(null),[V,$]=g.useState(null),T=g.useRef(null),_=g.useRef(null),B=g.useRef({value:k,onChange:n||(()=>{}),isIOS:typeof window<"u"&&((X=(v=window==null?void 0:window.CSS)==null?void 0:v.supports)==null?void 0:X.call(v,"-webkit-touch-callout","none"))}),R=g.useRef({prev:[null,null,"none"]}),E=h?typeof h=="string"?new RegExp(h):h:null;g.useEffect(()=>{y&&e!==k&&C((e==null?void 0:e.slice(0,t))||"")},[y,e,t,k]);const W=g.useCallback(U=>{let K=U;if(f&&f.length>0&&U){const J=parseInt(U,10);if(!isNaN(J)){let re=f[0],ne=Math.abs(J-re);for(let oe=1;oe<f.length;oe++){const ce=Math.abs(J-f[oe]);ce<ne&&(ne=ce,re=f[oe])}K=re.toString()}}C(K),n&&n(K),i&&i(K),a&&K.length===t&&a(K)},[n,i,a,t,f]),P=g.useCallback(U=>{U&&T.current!==U&&Object.defineProperty(T,"current",{value:U,writable:!0})},[]),H=g.useCallback(U=>{const K=U.currentTarget.value.slice(0,t);if(K.length>0&&E&&!E.test(K)){U.preventDefault();return}W(K),T.current&&(T.current.value=K)},[t,E,W,T]),L=g.useCallback(()=>{var U;if(T.current){const K=Math.min(T.current.value.length,t-1),J=T.current.value.length;(U=T.current)==null||U.setSelectionRange(K,J),z(K),$(J)}j(!0)},[t]),A=g.useCallback(()=>{j(!1)},[]),F=g.useCallback(U=>{l&&l(U)},[]),D=g.useCallback(U=>{d&&d(U)},[]),O=g.useCallback(U=>{const K=T.current;if(!U.clipboardData||!K)return;const J=U.clipboardData.getData("text/plain"),re=x?x(J):J;U.preventDefault();const ne=K.selectionStart||0,oe=K.selectionEnd||0,N=(ne!==oe?k.slice(0,ne)+re+k.slice(oe):k.slice(0,ne)+re+k.slice(ne)).slice(0,t);if(N.length>0&&E&&!E.test(N))return;K.value=N,W(N),C(N);const G=Math.min(N.length,t-1),Z=N.length;K.setSelectionRange(G,Z),z(G),$(Z)},[t,x,E,W,k,C]);return g.useEffect(()=>{const U=T.current,K=_.current;if(!U||!K)return;B.current.value!==U.value&&B.current.onChange&&B.current.onChange(U.value),R.current.prev=[U.selectionStart,U.selectionEnd,U.selectionDirection];function J(){if(document.activeElement!==U){z(null),$(null);return}const oe=(U==null?void 0:U.selectionStart)??null,ce=(U==null?void 0:U.selectionEnd)??null,he=(U==null?void 0:U.selectionDirection)??null,N=(U==null?void 0:U.maxLength)??0,G=(U==null?void 0:U.value)??"",Z=R.current.prev;let Y=-1,Q=-1,le="none";if(G.length!==0&&oe!==null&&ce!==null){const me=oe===ce,jo=oe===G.length&&G.length<N;if(me&&!jo){const Ve=oe;if(Ve===0)Y=0,Q=1,le="forward";else if(Ve===N)Y=Ve-1,Q=Ve,le="backward";else if(N>1&&G.length>1){let ot=0;if(Z[0]!==null&&Z[1]!==null){le=Ve<Z[1]?"backward":"forward";const Ya=Z[0]===Z[1]&&Z[0]<N;le==="backward"&&!Ya&&(ot=-1)}Y=ot+Ve,Q=ot+Ve+1}}Y!==-1&&Q!==-1&&Y!==Q&&T.current&&T.current.setSelectionRange(Y,Q,le)}const ue=Y!==-1?Y:oe,pe=Q!==-1?Q:ce,te=le!=="none"?le:he;z(ue),$(pe),R.current.prev=[ue,pe,te]}document.addEventListener("selectionchange",J,{capture:!0}),J(),document.activeElement===U&&j(!0);const re=()=>{K&&K.style.setProperty("--root-height",`${U.clientHeight}px`)};re();const ne=new window.ResizeObserver(re);return ne.observe(U),()=>{document.removeEventListener("selectionchange",J,{capture:!0}),ne.disconnect()}},[]),g.useEffect(()=>{xu(()=>{var re,ne,oe,ce;(re=T.current)==null||re.dispatchEvent(new Event("input"));const U=(ne=T.current)==null?void 0:ne.selectionStart,K=(oe=T.current)==null?void 0:oe.selectionEnd,J=(ce=T.current)==null?void 0:ce.selectionDirection;U!==null&&K!==null&&U!==void 0&&K!==void 0&&(z(U),$(K),R.current.prev=[U,K,J||"none"])})},[k,S]),{value:k,setValue:W,isFocused:S,setIsFocused:j,isHovered:w,setIsHovered:I,inputRef:T,containerRef:_,mirrorSelectionStart:M,mirrorSelectionEnd:V,setMirrorSelectionStart:z,setMirrorSelectionEnd:$,setInputRef:P,handleChange:H,handleFocus:L,handleBlur:A,handleKeyDown:F,handleKeyPress:D,handlePaste:O}},bu=g.createContext({slots:[],isFocused:!1,isHovering:!1}),yu=`
|
|
34
7
|
@keyframes blink {
|
|
35
8
|
0%, 100% { opacity: 1; }
|
|
36
9
|
50% { opacity: 0; }
|
|
@@ -49,17 +22,17 @@
|
|
|
49
22
|
border-radius: 4px !important;
|
|
50
23
|
width: 100% !important;
|
|
51
24
|
}
|
|
52
|
-
`;function ve(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}const ba=({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:H,setMirrorSelectionStart:z,setMirrorSelectionEnd:V,handlePaste:W,handleChange:P,handleFocus:L,handleBlur:B,handleKeyDown:D,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&&H!==null&&($===H&&q===$||q>=$&&q<H),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,H,$,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(Be,{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":H,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:D,onPaste:W,onFocus:L,onBlur:B,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}=xa(e),w=t!==void 0?t:o;return n.jsx(ba,{...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,ya=g.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Zp=()=>g.useContext(ya),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(ya.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=ta(e);return n.jsx(oa,{...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"}},So={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"}}},wo={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?So.error[E]:f?So.disabled[E]:x?So.hover[E]:{},T=h?wo.error[E]:f?wo.disabled[E]:x?wo.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,ka=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([]),[$,H]=g.useState(!1),z=g.useRef(null),[V,W]=g.useState(!1),[P,L]=g.useState("gpt-4"),[B]=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"}]),D=g.useRef(null),F=g.useRef(null),[A,O]=g.useState(e.showGuideTip||!1);g.useEffect(()=>{a&&D.current&&D.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
|
-
`);
|
|
25
|
+
`;function De(e,o){try{e.insertRule(o)}catch{console.error("input-otp could not insert CSS rule:",o)}}const Rn=({id:e,name:o,label:t,value:n="",length:i=6,onChange:a,onChangeText:l,onComplete:d,helperText:s,placeholder:u="",shadow:p,views:m={},size:h="md",shape:f="rounded",variant:x="outline",gap:y=8,type:b="text",error:k=!1,isFocused:C=!1,isHovered:S=!1,isDisabled:j=!1,isReadOnly:w=!1,isAutoFocus:I=!1,setValue:M,setIsFocused:z,setIsHovered:V,inputRef:$,containerRef:T,mirrorSelectionStart:_,mirrorSelectionEnd:B,setMirrorSelectionStart:R,setMirrorSelectionEnd:E,handlePaste:W,handleChange:P,handleFocus:H,handleBlur:L,handleKeyDown:A,handleKeyPress:F,secureTextEntry:D,isFirstColumn:O,stepValues:v,setInputRef:X,onBlur:U=()=>{},onClick:K=()=>{},onFocus:J=()=>{},...re})=>{c.useTheme();const ne=!!t,oe=g.useMemo(()=>({slots:Array.from({length:i}).map((N,G)=>{const Z=C&&_!==null&&B!==null&&(_===B&&G===_||G>=_&&G<B),Y=n[G]!==void 0?n[G]:null,Q=n[0]!==void 0?null:(u==null?void 0:u[G])??null;return{char:Y,placeholderChar:Q,isActive:Z,hasFakeCaret:Z&&Y===null}}),isFocused:C,isHovering:!j&&S}),[C,S,j,i,B,_,u,n]);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 G="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;";De(N.sheet,"@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }"),De(N.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),De(N.sheet,`[data-input-otp]:autofill { ${G} }`),De(N.sheet,`[data-input-otp]:-webkit-autofill { ${G} }`),De(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; } }"),De(N.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}},[]);const ce=()=>r.jsx(c.Horizontal,{gap:y,width:"100%",justifyContent:"center",minHeight:h==="xs"?"32px":h==="sm"?"36px":h==="md"?"40px":h==="lg"?"48px":"56px",...m.container,children:oe.slots.map((N,G)=>r.jsxs(ze,{size:h,error:k,shape:f,views:m,variant:x,value:N.char||"",color:"theme-primary",isHovered:S,isDisabled:j,isReadOnly:w,isFocused:N.isActive,showLabel:!1,onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!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:[N.char?r.jsx(c.View,{textAlign:"center",fontSize:h==="xs"?"14px":h==="sm"?"16px":h==="md"?"18px":h==="lg"?"20px":"24px",fontWeight:"medium",...m.text,children:b==="password"?"•":N.char}):N.placeholderChar?r.jsx(c.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:N.placeholderChar}):null,N.hasFakeCaret&&r.jsx(c.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||o}-${G}`))}),he={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 r.jsxs(r.Fragment,{children:[r.jsx("noscript",{children:r.jsx("style",{children:yu})}),r.jsxs(Se,{helperText:s,error:k,views:m,...re,children:[ne&&r.jsx($e,{htmlFor:e,color:"theme-primary",error:k,...m.label,children:t}),r.jsxs(c.View,{ref:T,"data-input-otp-container":!0,position:"relative",cursor:j?"default":"text",userSelect:"none",pointerEvents:"none",children:[r.jsx(bu.Provider,{value:oe,children:ce()}),r.jsx(c.View,{position:"absolute",inset:0,pointerEvents:"none",children:r.jsx(c.Input,{ref:N=>X(N),"data-input-otp":!0,"data-input-otp-placeholder-shown":n.length===0||void 0,"data-input-otp-mss":_,"data-input-otp-mse":B,id:e||o,name:o,type:b==="password"?"password":"text",inputMode:b!=="password"?"numeric":void 0,pattern:"[0-9]*",maxLength:i,readOnly:w,disabled:j,placeholder:u,value:n,onChange:P,onKeyDown:A,onPaste:W,onFocus:H,onBlur:L,onClick:K,onMouseOver:()=>V(!0),onMouseLeave:()=>V(!1),autoComplete:"one-time-code","aria-label":`OTP input with ${i} digits`,style:he,...m.input})})]})]})]})},ku=e=>{const{value:o}=e,{value:t,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:C,handlePaste:S,handleKeyPress:j}=zn(e),w=o!==void 0?o:t;return r.jsx(Rn,{...e,value:w,setValue:n,isFocused:i,setIsFocused:a,isHovered:l,setIsHovered:d,inputRef:s,containerRef:u,mirrorSelectionStart:p,mirrorSelectionEnd:m,setMirrorSelectionStart:h,setMirrorSelectionEnd:f,setInputRef:x,handleChange:y,handleFocus:b,handleBlur:k,handleKeyDown:C,handleKeyPress:j,handlePaste:S,stepValues:e.stepValues})},ju=ku,Vn=g.createContext({active:!1,focusNextInput:()=>{},setInputRef:()=>{},handleSubmitEditing:()=>{},getReturnKeyType:()=>"next"}),Cu=()=>g.useContext(Vn),Su=({children:e,autoFocus:o=!1,initFocus:t,onChange:n=()=>{},...i})=>{const a=be.useFormikContext();g.useEffect(()=>{n(a.values)},[a.values]);const l=g.useRef({}),d=g.useRef([]),s=(m,h)=>{l.current[m]=h,d.current.includes(m)||d.current.push(m)},u=m=>{var h;if(o){const x=d.current.indexOf(m)+1;x<d.current.length?(h=l.current[d.current[x]])==null||h.focus():a.onSubmit&&a.onSubmit(a.values)}},p={active:o,focusNextInput:u,setInputRef:s,handleSubmitEditing:u,getReturnKeyType:m=>d.current.indexOf(m)===d.current.length-1?"done":"next"};return g.useEffect(()=>{var m,h;o&&(t&&l.current[t]?(m=l.current[t])==null||m.focus():d.current[0]&&((h=l.current[d.current[0]])==null||h.focus()))},[o,t]),r.jsx(Vn.Provider,{value:p,children:r.jsx(c.Form,{...i,children:e})})},wu=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:o,...t})=>{const n=Cu(),{touched:i,errors:a,submitCount:l,values:d,setFieldTouched:s,setFieldValue:u}=be.useFormikContext(),p=k=>{var C;u(e,k),(C=t.onChangeText)==null||C.call(t,k)},m=k=>{var C;u(e,k),(C=t.onChange)==null||C.call(t,k)},h=()=>{s(e,!0)},f=k=>{k.key==="Enter"&&(k.preventDefault(),n.focusNextInput(e))},x=["text","password","email","digits"].includes(o),y=be.getIn(i,e)||l>0?be.getIn(a,e):void 0,b=be.getIn(d,e);return{...wu(o),...t,value:b,error:y,onBlur:h,onKeyPress:f,...x?{onChangeText:p}:{onChange:m},...n.active?{handleKeyPress:f}:{}}},Iu=e=>{let{value:o,...t}=de(e);t.isChecked=o;const n=gn(e);return r.jsx(pn,{...n,...t})},Tu=Iu,Mu=({defaultIsSelected:e=!1,isChecked:o})=>{const[t,n]=g.useState(!1),[i,a]=g.useState(o!==void 0?o:e);return g.useEffect(()=>{o!==void 0&&a(o)},[o]),{isHovered:t,setIsHovered:n,isSelected:i,setIsSelected:a}},zu={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"}},Ru={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"}},Vu={selected:{borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300"}},Eu={selected:{backgroundColor:"theme-primary"},unselected:{backgroundColor:"transparent"}},it={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"}}},lt={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"}}},Pu=({id:e,icon:o,name:t,label:n,value:i,isChecked:a,onChange:l,onValueChange:d,shadow:s={},labelPosition:u="right",size:p="md",error:m=!1,isSelected:h=!1,isHovered:f=!1,isDisabled:x=!1,isReadOnly:y=!1,defaultIsSelected:b=!1,setIsSelected:k=()=>{},setIsHovered:C=()=>{},views:S={radio:{},label:{}},infoText:j,helperText:w,...I})=>{const M=()=>C(!f),z=()=>{!y&&!x&&(k&&k(!0),l&&l(i),d&&d(i))},V=a||h?"selected":"unselected",$=m?it.error[V]:x?it.disabled[V]:f?it.hover[V]:{},T=m?lt.error[V]:x?lt.disabled[V]:f?lt.hover[V]:{},_={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:m?"color-red-600":x?"color-gray-400":"color-gray-700",cursor:x?"not-allowed":y?"default":"pointer",opacity:x?.6:1,transition:"all 0.2s ease",...S.label},radio:{...Vu[V],...$,borderRadius:"50%",backgroundColor:"color-white",...zu[p],transition:"all 0.2s ease",...s,...S.radio},dot:{...Eu[V],...T,borderRadius:"50%",...Ru[p],transition:"all 0.2s ease"}};return r.jsxs(mo,{htmlFor:e,as:"div",onClick:z,onMouseEnter:M,onMouseLeave:M,size:c.Typography.fontSizes[p],..._.container,...I,children:[r.jsxs(c.Vertical,{gap:8,children:[" ",r.jsxs(c.Horizontal,{gap:12,alignItems:"center",children:[" ",u==="left"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:n}),r.jsx(c.Center,{..._.radio,children:(a||h)&&r.jsx(c.View,{..._.dot})}),u==="right"&&n&&r.jsx(c.Text,{size:p,fontWeight:"500",...S==null?void 0:S.label,children:n})]}),j&&r.jsx(c.Text,{marginLeft:u==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"15px",...S==null?void 0:S.infoText,children:j})]}),m&&r.jsx(c.Text,{size:"xs",marginTop:4,marginHorizontal:0,color:"color-red-500",fontWeight:"500",transition:"all 0.2s ease",children:m})]})},Wu=e=>{let{value:o,...t}=de(e);t.isChecked=o===e.value;const n=Mu(e);return r.jsx(Pu,{...n,...t})},_u=Wu,En=e=>{const{value:o,onChange:t,onSubmit:n,autoFocus:i=!0,loading:a=!1,disabled:l=!1,isAgentRunning:d=!1,onStopAgent:s,sandboxId:u,onUploadProgress:p,onUploadSuccess:m,onUploadError:h,onFileUpload:f}=e,x=o!==void 0&&t!==void 0,[y,b]=g.useState(""),k=x?o:y,[C,S]=g.useState([]),[j,w]=g.useState([]),[I,M]=g.useState(!1),[z,V]=g.useState(0),[$,T]=g.useState([]),[_,B]=g.useState(!1),R=g.useRef(null),[E,W]=g.useState(!1),[P,H]=g.useState("gpt-4"),[L]=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"}]),A=g.useRef(null),F=g.useRef(null),[D,O]=g.useState(e.showGuideTip||!1);g.useEffect(()=>{i&&A.current&&A.current.focus()},[i]),g.useEffect(()=>()=>{C.forEach(Y=>{})},[C]);const v=Y=>{x&&t?t(Y):b(Y)},X=Y=>{if(Y.preventDefault(),!k.trim()&&C.length===0||a||l&&!d)return;if(d&&s){s();return}let Q=k;if(C.length>0){const pe=C.map(te=>`[Uploaded File: ${URL.createObjectURL(te)}}]`).join(`
|
|
26
|
+
`);Q=Q?`${Q}
|
|
54
27
|
|
|
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){H(!0);const G=_[0];z.current=G,E(0);try{x(G)}catch(J){T(ce=>ce.slice(1)),H(!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),D.current&&D.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:D,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:B,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}},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"}}}},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"}},Ar=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(()=>Ar("hovercard-content"),[]),u=g.useMemo(()=>Ar("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}},Ca=g.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),xg=({children:e,value:t})=>n.jsx(Ca.Provider,{value:t,children:e}),ja=()=>{const e=g.useContext(Ca);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}=ja(),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}=ja(),{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 H=0,z=0;switch($){case"bottom":H=T.left+T.width/2,z=T.bottom+a;break;case"top":H=T.left+T.width/2,z=T.top-a;break;case"right":H=T.right+a,z=T.top+T.height/2;break;case"left":H=T.left-a,z=T.top+T.height/2;break}return{position:"fixed",left:H,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)})})},Sa=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),[H,z]=g.useState(-1),[V,W]=g.useState([]),{ref:P,relation:L}=s.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[B,D]=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();D(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")&&H>=0){N.preventDefault(),ne(V[H]);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:B.x,top:B.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===H?"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]})]})]})})]})});Sa.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}=hn();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(Qo,{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(No,{widthHeight:16,color:"currentColor",filled:!1})})]})},wa=({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:H,fileInputRef:z,isUploading:V,uploadProgress:W,isDraggingOver:P,uploadedFiles:L,removeUploadedFile:B,setPendingFiles:D,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={...Dr.container,...gg[j],...C==null?void 0:C.container},G={...Dr.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(qo,{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:B,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(Sa,{ref:H,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(Uo,{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=ka({...r,value:l.value||"",onChange:d,onSubmit:c,getPendingFiles:u,clearPendingFiles:p});return n.jsx(wa,{...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=ra(t);return n.jsx(na,{...o,...t})},Mg=Tg,Rg=e=>{const t=pe(e),o=da();return n.jsx(ua,{...o,...t})},zg=Rg,Eg=e=>{const t=pe(e),o=aa(e);return n.jsx(ia,{...o,...t})},Vg=Eg,Pg=e=>{let t=pe(e);t.selected=t.value;const o=vn(e);return n.jsx(Yn,{...o,...t})},Wg=Pg,_g=e=>{const t=pe(e),o=Xn(e);return n.jsx(Kn,{...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=ma({...o,tags:u,onTagsChange:h,onBlur:m}),{tags:f,...b}=x;return n.jsx(fa,{...b,...o,tags:f,error:p})},Hg=Lg,Bg=e=>{const t=pe(e),o=Zn(e);return n.jsx(ea,{...o,...t})},Dg=Bg,Ag=e=>{const t=pe(e),{value:o,...r}=dr(e);return n.jsx(St,{...r,...t})},Fg=Ag,Og=({visibleIcon:e=n.jsx(Yo,{widthHeight:14}),hiddenIcon:t=n.jsx(Go,{widthHeight:14}),...o})=>{const r=pe(o),{isVisible:a,setIsVisible:i,...l}=pa(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=ga(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(ha,{...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)}},Ia=({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 H=Ke($,e,t);S||m(H),i&&H!==C&&i(H),x&&l&&l(H)},[S,e,t,i,C,x,l]),I=g.useCallback($=>{if(c||!k.current)return;const H=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,H,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 H=V=>{I(V)},z=()=>{f(!1),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",H),document.removeEventListener("touchend",z)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",z),document.addEventListener("touchmove",H),document.addEventListener("touchend",z)},[I,c]),R=g.useCallback($=>{j.current&&j.current.contains($.target)||M($)},[M]),E=g.useCallback($=>{if(c)return;let H=C;switch($.key){case"ArrowLeft":case"ArrowDown":H=C-o;break;case"ArrowRight":case"ArrowUp":H=C+o;break;case"Home":H=e;break;case"End":H=t;break;default:return}$.preventDefault(),w(H)},[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}},Fr={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%"}},Or={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}},vr={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"}}),Nr=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}},Ta=({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:H,...z})=>{var X,U;const{getColorHex:V,themeMode:W}=s.useTheme(),P=V(m,{themeMode:b||W}),L=V("theme-disabled",{themeMode:b||W}),B=V(Nr[d].backgroundColor,{themeMode:b||W}),D=c==="vertical",{trackCrossAxisSize:F,thumbSize:A}=Yg[l]||{trackCrossAxisSize:Fr[l].height,thumbSize:Or[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),...Fr[l],borderRadius:vr[i],backgroundColor:B,...Nr[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:vr[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,...Or[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(_o,{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:B,cursor:u?"not-allowed":"pointer",width:D?`${F}px`:"100%",height:D?"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,...D?{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,...D?{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:D?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...D?{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,...D?{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(_o,{marginTop:8,children:f})]});return D||h?Y:O},Kg=e=>{const t=pe(e),o=Ia({...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(Ta,{...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}=xa(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(ba,{...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],Ma=({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})};Ma.displayName="FormikUploader";const th=e=>{let t=pe(e);t.selected=t.value;const o=Qn(e);return n.jsx(Jn,{...o,...t})},oh=th,Ra=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"}}),za=({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}=Ra(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(za,{shape:t,variant:o,isDisabled:r,isHovered:c,setIsHovered:u,isToggle:p,setIsToggled:h,onToggle:m,...l,children:e})},ih=ah,Ea=()=>{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}=Ra(a);return g.useEffect(()=>{p(a)},[a]),n.jsx(za,{shape:t,variant:o,isDisabled:r,isHovered:d,setIsHovered:c,isToggle:u,setIsToggled:p,onToggle:i,...l,children:e})},Va=lh,Pa=({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(Va,{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}=Ea();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(Pa,{items:e,shape:t,variant:o,activeToggles:l,setActiveToggles:d,onToggleChange:c,...a})},sh=ch,Ur=["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"],Wa=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?Ur.filter(w=>w.toLowerCase().includes(m.toLowerCase())).slice(0,100):Ur.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"}},_a=({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=Wa(o),a=i=>{r.handleIconSelect(i),t.onChange(i)};return n.jsx(_a,{...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(B=>B.name.toLowerCase().includes(L)||B.keywords.some(D=>D.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 B=L.filter(F=>F.emoji!==P.emoji),D=[P,...B].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(D)),D})},[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]),H=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:H,handleSearchChange:z,handleCategoryChange:V,handleClose:W,triggerRef:M,dropdownRef:R}},La=({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:$,...H})=>{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},B={...Re.emojiGrid,...i==null?void 0:i.emojiGrid},D=b.filter(F=>F==="recent"?f&&j.length>0:!0);return n.jsxs(s.View,{...V,...H,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:D.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,{...B,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(La,{...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=Ia(e);return n.jsx(Ta,{...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=Ao.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)},ur=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"}},Ha=({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:ur,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(Ha,{isOpen:a.props.isVisible,onClose:()=>ur(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)})})},De=({children:e})=>n.jsx(n.Fragment,{children:e});De.Overlay=Ha;De.Container=Eh;De.Header=Vh;De.Body=Ph;De.Footer=Wh;De.Layout=_h;const qr={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"}},Ba=({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":qr[t]||t,maxHeight:"100vh"}:{width:t==="full"?"100vw":qr[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]})},Hh=({children:e,...t})=>n.jsx(s.Vertical,{padding:24,flex:1,overflowY:"auto",...t,children:e}),Bh=({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}),Dh=({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(Ba,{isOpen:e,onClose:t,isClosePrevented:a,...l,children:n.jsx(Da,{placement:o,size:r,style:d,children:i})})},nt=Dh;nt.Overlay=Ba;nt.Container=Da;nt.Header=Lh;nt.Body=Hh;nt.Footer=Bh;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}},Lo={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"}}}},Ho={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"}},Aa={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"}},Fa=g.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),Fh=({children:e,value:t})=>n.jsx(Fa.Provider,{value:t,children:e}),It=()=>{const e=g.useContext(Fa);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},pr=({children:e,views:t})=>{const{orientation:o}=It(),r=o==="horizontal"?s.Horizontal:s.Vertical;return n.jsx(r,{width:"100%",...Aa[o],transition:"all 0.2s ease",borderRadius:"4px",...t==null?void 0:t.container,children:e})},Oa=g.createContext({itemValue:null,isDisabled:!1}),Oh=()=>{const e=g.useContext(Oa);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},gr=({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(Oa.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",...Lo[c],...Ho[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(va,{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(Na,{itemId:e.id,children:n.jsx(pr,{children:(k=e.items)==null?void 0:k.map(j=>n.jsx(gr,{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",...Lo[c],...Ho[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},va=({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",...Lo[d],...Ho[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})})]})},Na=({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%",...Aa[t],...o==null?void 0:o.container,children:n.jsx(pr,{views:o,children:e.map(i=>n.jsx(gr,{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=pr;at.Item=gr;at.Trigger=va;at.Content=Na;at.Link=vh;const Ua={},qa=g.createContext({views:Ua,onRowClick:()=>{}}),qh=({children:e,views:t=Ua,onRowClick:o})=>n.jsx(qa.Provider,{value:{views:t,onRowClick:o},children:e}),Pe=()=>g.useContext(qa),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 Ga=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"table",borderCollapse:"collapse",...ue.table,...t==null?void 0:t.table,...e})},Ya=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"thead",textAlign:"left",...ue.thead,...t==null?void 0:t.thead,...e})},Xa=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})},Bo=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})},Ka=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tbody",...ue.tbody,...t==null?void 0:t.tbody,...e})},Qa=e=>{const{views:t}=Pe();return n.jsx(s.Element,{as:"tfoot",...ue.tfoot,...t==null?void 0:t.tfoot,...e})},Ja=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(Ga,{role:"Table",children:[r&&n.jsx(Ja,{children:r}),n.jsx(Ya,{children:n.jsx(At,{children:t.map(i=>n.jsx(Xa,{children:i.title},i.field))})}),n.jsx(Ka,{children:e.map((i,l)=>n.jsx(At,{children:t.map((d,c)=>n.jsx(Bo,{isFirstColumn:c===0,children:i[d.field]},d.field))},l))}),o&&n.jsx(Qa,{children:n.jsx(At,{children:o.map((i,l)=>n.jsx(Bo,{...i.props,children:i.value},l))})})]}),Se=({children:e,views:t,onClick:o})=>n.jsx(qh,{views:t,onRowClick:o,children:e});Se.Head=Ya;Se.HeadCell=Xa;Se.Body=Ka;Se.Row=At;Se.Cell=Bo;Se.Footer=Qa;Se.Caption=Ja;Se.Container=Ga;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,Za=g.createContext(null),ei=()=>{const e=g.useContext(Za);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}=ei(),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}=ei();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(Za.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(B=>B.length>0)),P=W.reduce((L,B)=>L+B.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"}),[]),H=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:H,children:V.map((P,L)=>{const B=z++,D=_(B),F=L===V.length-1;let A;const O=`${t}ms`,Y=`${D}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 Gr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Io=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],H=am[o](r,a),z=(D,F)=>D&&(Array.isArray(D)?D.map(A=>({...A,iterationCount:F.toString()})):{...D,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:$},B=D=>!C&&(M||R)?n.jsx("span",{style:{opacity:0},children:D}):M?n.jsx(im,{text:D,typingSpeed:Math.max(30,m/(D.length*10)),cursorColor:"currentColor",...H}):R?n.jsx(lm,{text:D,duration:E,stagger:_,sequential:T,direction:"up",fontSize:$,wordProps:H}):Io(D);if(typeof P=="string"&&I){const D=Array.isArray(I)?new RegExp(`(${I.map(Y=>Gr(String(Y))).join("|")})`,"gi"):new RegExp(`(${Gr(String(I))})`,"gi"),F=[];let A=0,O;for(;O=D.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:Io(Y)},`text-${X}`):n.jsx(s.Text,{as:"span",display:"inline",animate:C?W:void 0,...R?{}:H,...l==null?void 0:l.highlight,children:B(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?{}:H,...l==null?void 0:l.highlight,children:B(P)})}):n.jsx(s.Text,{...L,...j,...l==null?void 0:l.container,...l==null?void 0:l.text,children:Io(P)})},sm=e=>n.jsx(cm,{...e}),dm=sm,um=({items:e,shape:t,variant:o,onToggleChange:r})=>{const{activeToggles:a,setActiveToggles:i}=Ea();return n.jsx(Pa,{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))}),ti=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=ti,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)"}},oi=({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(Ko,{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(oi,{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"}},ri=g.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),wm=({children:e,value:t})=>n.jsx(ri.Provider,{value:t,children:e}),hr=()=>{const e=g.useContext(ri);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},ni=({children:e,views:t,...o})=>{const{isOpen:r,setIsOpen:a,triggerRef:i}=hr(),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}=hr(),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(ii,{views:r},`divider-${y}`):n.jsx(ai,{item:b,views:r},b.id))})},ai=({item:e,views:t,...o})=>{const{activeSubmenuId:r,setActiveSubmenuId:a,size:i}=hr(),[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(mr,{items:e.items||[],side:"right",align:"start",views:t})]})},ii=({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(ni,{views:a,children:e}),n.jsx(mr,{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=ni;Tt.Content=mr;Tt.Item=ai;Tt.Divider=ii;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 H=$.filter(V=>V!==T),z=[T,...H].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},H={...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,...H,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,B)=>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},B))}),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 B=L.target.value;w(B),C(B)},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,B)=>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)"}},B))})]})]}),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(La,{...t,...e})},Lm=$m,Hm=e=>{const t=Wa(e);return n.jsx(_a,{...t,...e})},Bm=Hm,Dm=(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}},li={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"}},ci=g.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),ho=()=>g.useContext(ci),Om=({value:e,children:t})=>n.jsx(ci.Provider,{value:e,children:t}),si=({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})},di=({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)})},ui=({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",...li[c],...h?Ft.active:{},...o?Ft.disabled:{},_hover:o?{}:Ft.hover,onClick:x,...r==null?void 0:r.trigger,children:e})},pi=({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})},gi=({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,...li[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]})},hi=({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(si,{orientation:t,size:o,variant:r,views:a,children:e.map(l=>n.jsxs(di,{id:l.id,disabled:l.disabled,views:a,children:[n.jsxs(ui,{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(pi,{menuId:l.id,views:a,children:l.items.map((d,c)=>d.separator?n.jsx(hi,{views:a},`separator-${c}`):n.jsx(gi,{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}=Dm(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=si;Ae.Menu=di;Ae.Trigger=ui;Ae.Content=pi;Ae.Item=gi;Ae.Separator=hi;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})},mi=e=>n.jsx(of,{...e}),rf=mi,nf=mi,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(ln,{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"})},Yr=()=>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(Yr(),t),[t]),h=g.useCallback((...m)=>{o==null||o(...m);const x=Yr();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=mn();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)"},fi=g.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),mo=()=>g.useContext(fi),jf=({value:e,children:t})=>n.jsx(fi.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,B)=>{m(D=>D.some(F=>F.id===V)?D:[...D,{id:V,size:W,minSize:P??r,maxSize:L??a,collapsible:B??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 B={...L,collapsed:!L.collapsed},D=[...W];return D[P]=B,D})},[]),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 B=W.match(/\d+$/);if(B&&(L=parseInt(B[0],10)-1),L===-1&&h.length>=2&&(L=0),L<0||L>=h.length-1)return;const D=h[L],F=h[L+1];if(D.collapsed||F.collapsed)return;let A=y.current[L]+P,O=y.current[L+1]-P;A=Math.max(D.minSize??r,Math.min(D.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]),H=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 B=0;e==="horizontal"?(V.key==="ArrowLeft"&&(B=-c),V.key==="ArrowRight"&&(B=c),V.key==="Home"&&(B=-100),V.key==="End"&&(B=100)):(V.key==="ArrowUp"&&(B=-c),V.key==="ArrowDown"&&(B=c),V.key==="Home"&&(B=-100),V.key==="End"&&(B=100)),B!==0&&(V.preventDefault(),$(b.current+B)),V.key==="Escape"&&(m(D=>D.map((F,A)=>({...F,size:y.current[A]}))),H())},[u,h,e,$,H,c]);return g.useEffect(()=>{const V=L=>{if(!u)return;const B=e==="horizontal"?L.clientX:L.clientY;$(B)},W=L=>{if(!u||L.touches.length===0)return;const B=L.touches[0],D=e==="horizontal"?B.clientX:B.clientY;$(D)},P=()=>{u&&H()};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,$,H,z]),g.useEffect(()=>{if(h.length!==0){if(l){const V=S();if(V){m(W=>W.map(P=>{const L=V.find(B=>B.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,B)=>({...L,size:B<W.length?W[B]: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:H}},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"}},xi=g.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),bi=()=>g.useContext(xi),_f=({value:e,children:t})=>n.jsx(xi.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}=bi(),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}=bi(),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"})})})]})},Hf=({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})},Bf=({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(Hf,{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})})},fr=Bf;fr.Panel=$f;fr.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"}}},Df={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=Ao.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),yi=(e,t,o)=>Fe("info",e,t,o),ki=(e,t,o)=>Fe("success",e,t,o),Ci=(e,t,o)=>Fe("warning",e,t,o),ji=(e,t,o)=>Fe("error",e,t,o),Si=e=>{Rt.getState().remove(e)},wi=()=>{Rt.getState().removeAll()},Ii=({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(Oo,{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",...Df[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(Ii,{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)=>yi(e,t,o),success:(e,t,o)=>ki(e,t,o),warning:(e,t,o)=>Ci(e,t,o),error:(e,t,o)=>ji(e,t,o),remove:e=>Si(e),removeAll:()=>wi()}),vf=e=>n.jsx(Ii,{...e}),Nf=Object.assign(vf,{Container:e=>n.jsx(Ff,{...e}),show:Fe,info:yi,success:ki,warning:Ci,error:ji,remove:Si,removeAll:wi}),Uf=Of,Xr=(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||Xr,[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||Xr;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}),Ti=({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}),Mi=({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]}),Do=({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})]})},Ri=({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(Ti,{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(Ri,{views:y==null?void 0:y.empty}):I?f.map(R=>n.jsx(Mi,{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(Do,{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(Do,{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=Ti;it.List=p0;it.Group=Mi;it.Item=Do;it.Empty=Ri;const Kr=()=>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-${Kr()}`).current,h=g.useRef(`tooltip-content-${Kr()}`).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}},zi=g.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),xr=()=>g.useContext(zi),k0=({value:e,children:t})=>n.jsx(zi.Provider,{value:e,children:t}),Ei=({children:e,views:t,asChild:o=!1,...r})=>{const{openTooltip:a,closeTooltip:i,triggerRef:l,contentId:d,triggerId:c}=xr(),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}=xr();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}=xr(),{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(Ei,{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})})},br=S0;br.Trigger=Ei;br.Content=C0;const Vi=g.forwardRef((e,t)=>{const o=ka(e);return n.jsx(wa,{...e,...o})});Vi.displayName="ChatInput";const w0={container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}},Qr={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%"}},To={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}},Mo={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}},Jr={"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"},Ht={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&&Jr[o]?Jr[o]:o||"to right"}, ${i})`;case"radial":const d=a&&Ht[a]?Ht[a]:a||"center";return`radial-gradient(${r||"circle"} at ${d}, ${i})`;case"conic":return`conic-gradient(from 0deg at ${a&&Ht[a]?Ht[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)"}}}},Zr={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,...Zr.container,...b,...p==null?void 0:p.container,...m,children:u&&n.jsx(s.View,{...Zr.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={...Qr.gradient,backgroundImage:`
|
|
28
|
+
${pe}`:pe}let le=P,ue=!1;P.endsWith("-thinking")&&(le=P.replace(/-thinking$/,""),ue=!0),n(Q,{model_name:le,enable_thinking:ue}),x||b(""),S([]),w([])},U=Y=>{S(Q=>Q.filter((le,ue)=>ue!==Y)),!u&&j.length>Y&&w(Q=>Q.filter((le,ue)=>ue!==Y))},K=Y=>{Y.preventDefault(),Y.stopPropagation(),W(!0)},J=Y=>{Y.preventDefault(),Y.stopPropagation(),W(!1)},re=g.useCallback(Y=>{!Y||Y.length===0||(w(Q=>[...Q,...Y]),S(Q=>[...Q,...Y]),T(Q=>[...Q,...Y]),M(!0))},[w,S]),ne=g.useCallback(()=>{if($.length>0&&!_&&f){B(!0);const Y=$[0];R.current=Y,V(0);try{f(Y)}catch(Q){T(le=>le.slice(1)),B(!1),R.current=null,V(0),M(le=>$.length-1>0||!1),h==null||h(Q)}}else $.length===0&&I&&(M(!1),V(0))},[$,_,f,I,h]);g.useEffect(()=>{ne()},[$,_,ne]);const oe="active",ce=Y=>!0,he=()=>{O(!1),e.onGuideClose&&e.onGuideClose()},N=Y=>{x&&t?t(Y.text):b(Y.text),e.onPromptExampleSelect&&e.onPromptExampleSelect(Y),A.current&&A.current.focus()},G=g.useCallback(()=>j,[j]),Z=g.useCallback(()=>w([]),[]);return{onSubmit:n,getPendingFiles:G,clearPendingFiles:Z,value:k,handleChange:v,handleSubmit:X,editableRef:A,fileInputRef:F,isUploading:I,uploadProgress:z,isDraggingOver:E,uploadedFiles:C,pendingFiles:j,removeUploadedFile:U,setPendingFiles:w,setUploadedFiles:S,setIsUploading:M,startUpload:re,selectedModel:P,handleModelChange:H,modelOptions:L,subscriptionStatus:oe,canAccessModel:ce,handleDragOver:K,handleDragLeave:J,isGuideTipShown:D,hideGuideTip:he,handlePromptExampleSelect:N}},$u={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}},cr={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"}}}},Hu={default:{borderRadius:"8px"},square:{borderRadius:"0px"},rounded:{borderRadius:"8px"}},Bu={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"}},Lu={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"}},sr=e=>`${e}-${Math.random().toString(36).substring(2,9)}`,Au=({openDelay:e=200,closeDelay:o=300}={})=>{const[t,n]=g.useState(!1),i=g.useRef(null),a=g.useRef(null),l=g.useRef(null),d=g.useRef(null),s=g.useMemo(()=>sr("hovercard-content"),[]),u=g.useMemo(()=>sr("hovercard-trigger"),[]),p=g.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),m=g.useCallback(()=>{p(),t||(i.current=setTimeout(()=>{n(!0)},e))},[t,e,p]),h=g.useCallback(()=>{p(),t&&(a.current=setTimeout(()=>{n(!1)},o))},[t,o,p]),f=g.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);return g.useEffect(()=>()=>p(),[p]),{isOpen:t,openCard:m,closeCard:h,cancelCloseTimer:f,triggerRef:l,contentRef:d,contentId:s,triggerId:u}},Pn=g.createContext({isOpen:!1,openCard:()=>{},closeCard:()=>{},cancelCloseTimer:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Du=({children:e,value:o})=>r.jsx(Pn.Provider,{value:o,children:e}),Wn=()=>{const e=g.useContext(Pn);if(!e)throw new Error("useHoverCardContext must be used within a HoverCardProvider");return e},Fu=({children:e,views:o,asChild:t=!1,...n})=>{const{openCard:i,closeCard:a,triggerRef:l,contentId:d,triggerId:s}=Wn(),f={ref:l,onMouseEnter:()=>i(),onMouseLeave:()=>a(),onFocus:()=>i(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};if(t&&g.isValidElement(e)){const x=g.Children.only(e);return g.cloneElement(x,{...f,...x.props})}return r.jsx(c.View,{position:"relative",display:"inline-block",...f,children:e})},Ou=({children:e,views:o,side:t="bottom",align:n="center",sideOffset:i=8,style:a,backgroundColor:l="white",borderRadius:d="4px",boxShadow:s="0px 2px 8px rgba(0, 0, 0, 0.15)",padding:u="12px",minWidth:p="50px",maxWidth:m="300px",...h})=>{const{isOpen:f,cancelCloseTimer:x,closeCard:y,contentRef:b,triggerRef:k,contentId:C,triggerId:S}=Wn(),{ref:j,relation:w}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0});g.useEffect(()=>{k!=null&&k.current&&(j==null?void 0:j.current)!==k.current&&j&&(j.current=k.current)},[k,j,f]);const I=()=>x(),M=()=>y();if(!f)return null;const z=()=>{if(!w||!(k!=null&&k.current))return{position:"absolute",top:0,left:0,zIndex:1e3};const T=k.current.getBoundingClientRect();let _=t;t==="bottom"&&w.space.vertical==="top"?_="top":t==="top"&&w.space.vertical==="bottom"?_="bottom":t==="right"&&w.space.horizontal==="left"?_="left":t==="left"&&w.space.horizontal==="right"&&(_="right");let B=0,R=0;switch(_){case"bottom":B=T.left+T.width/2,R=T.bottom+i;break;case"top":B=T.left+T.width/2,R=T.top-i;break;case"right":B=T.right+i,R=T.top+T.height/2;break;case"left":B=T.left-i,R=T.top+T.height/2;break}return{position:"fixed",left:B,top:R,zIndex:1e3,transform:V(_)}},V=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)"}},$=z();return r.jsx(c.View,{ref:b,id:C,role:"tooltip","aria-labelledby":S,onMouseEnter:I,onMouseLeave:M,backgroundColor:l,borderRadius:d,boxShadow:s,padding:u,minWidth:p,maxWidth:m,style:{...$,...a},...o==null?void 0:o.container,...h,children:e})},qu=({children:e,views:o,openDelay:t,closeDelay:n,...i})=>{const a=Au({openDelay:t,closeDelay:n});return r.jsx(Du,{value:a,children:r.jsx(c.View,{position:"relative",display:"inline-block",...o==null?void 0:o.container,...i,children:e})})},fe=qu;fe.Trigger=Fu;fe.Content=Ou;const Nu=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,u)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.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:a&&r.jsxs(fe,{children:[r.jsxs(fe.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(uo,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...$u.attachmentRemove,onClick:x=>{x.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(fe.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},u)})})},_n=g.forwardRef(({value:e,onChange:o,placeholder:t="Type your message...",disabled:n=!1,autoFocus:i=!0,suggestions:a=[],onSuggestionSelect:l,showSuggestions:d=!1,mentionData:s=[],mentionTrigger:u="@",onMentionSelect:p,maxHeight:m="200px",minHeight:h="40px",views:f={}},x)=>{var ce,he;const y=g.useRef(e),[b,k]=g.useState(-1),[C,S]=g.useState(!e),j=g.useRef(null),[w,I]=g.useState(!1),[M,z]=g.useState(!1),[V,$]=g.useState(""),[T,_]=g.useState(-1),[B,R]=g.useState(-1),[E,W]=g.useState([]),{ref:P,relation:H}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[L,A]=g.useState({x:0,y:0}),[F,D]=g.useState({x:0,y:0});g.useEffect(()=>{const N=x;N.current&&e!==y.current&&(N.current.textContent=e,y.current=e,S(!e))},[e,x]),g.useEffect(()=>{i&&x&&typeof x=="object"&&x.current&&x.current.focus()},[i,x]);const O=()=>{const N=window.getSelection();if(!N||N.rangeCount===0)return-1;const G=N.getRangeAt(0),Z=G.cloneRange();return Z.selectNodeContents(x&&typeof x=="object"&&x.current?x.current:document.body),Z.setEnd(G.endContainer,G.endOffset),Z.toString().length},v=g.useCallback((N,G)=>{const Z=N.substring(0,G),Y=Z.lastIndexOf(u);if(Y!==-1){const Q=Z.substring(Y+1);if(!Q.includes(" ")){const ue=Q.toLowerCase(),pe=s.filter(me=>me.name.toLowerCase().includes(ue));$(ue),_(Y),W(pe),z(pe.length>0),R(0);const te=X();A(te);return}}z(!1),$(""),_(-1),R(-1)},[s,u]);g.useEffect(()=>{j.current&&P&&(P.current=j.current)},[j,P]);const X=g.useCallback((N=200)=>{if(!j.current)return{x:0,y:0};const G=j.current.getBoundingClientRect();if(H){const le=H.space.vertical==="top";return{x:G.left,y:le?G.top-N-8:G.bottom+8}}const Z=window.innerHeight,Y={top:G.top,bottom:Z-G.bottom},Q=Y.bottom<N+8&&Y.top>Y.bottom;return{x:G.left,y:Q?G.top-N-8:G.bottom+8}},[H]),U=g.useCallback(()=>{I(!0);const N=X();D(N)},[X]),K=g.useCallback(()=>{setTimeout(()=>{I(!1),k(-1)},150)},[]),J=N=>{const G=N.currentTarget.textContent||"";if(G!==y.current){o(G),y.current=G,S(!G);const Z=O();v(G,Z)}},re=g.useCallback(N=>{if(x&&typeof x=="object"&&x.current){const G=x.current.textContent||"",Z=G.substring(0,T),Y=G.substring(T+u.length+V.length),Q=Z+u+N.name+" "+Y;o(Q),y.current=Q,x.current.textContent=Q;const le=Z.length+u.length+N.name.length+1;setTimeout(()=>{var ue;if(x.current){const pe=document.createRange(),te=window.getSelection(),me=x.current.firstChild;me&&te&&(pe.setStart(me,Math.min(le,((ue=me.textContent)==null?void 0:ue.length)||0)),pe.collapse(!0),te.removeAllRanges(),te.addRange(pe))}},0)}z(!1),$(""),_(-1),R(-1),p&&p(N)},[T,u,V,o,p,x]),ne=g.useCallback(N=>{l&&l(N),k(-1)},[l]),oe=N=>{if(M&&E.length>0){if(N.key==="ArrowDown"){N.preventDefault(),R(G=>G<E.length-1?G+1:0);return}if(N.key==="ArrowUp"){N.preventDefault(),R(G=>G>0?G-1:E.length-1);return}if((N.key==="Tab"||N.key==="Enter")&&B>=0){N.preventDefault(),re(E[B]);return}if(N.key==="Escape"){z(!1),R(-1);return}}if(d&&a.length>0){if(N.key==="ArrowDown"){N.preventDefault(),k(G=>G<a.length-1?G+1:0);return}if(N.key==="ArrowUp"){N.preventDefault(),k(G=>G>0?G-1:a.length-1);return}if(N.key==="Tab"&&b>=0){N.preventDefault(),ne(a[b]);return}if(N.key==="Escape"){k(-1);return}}};return r.jsxs(c.View,{ref:j,width:"100%",position:"relative",...f==null?void 0:f.container,children:[r.jsxs(c.View,{width:"100%",minHeight:h,maxHeight:m,overflowY:"auto",position:"relative",children:[C&&r.jsx(c.Text,{position:"absolute",top:"8px",left:"8px",color:"color-gray-400",pointerEvents:"none",fontSize:"14px",zIndex:1,...f==null?void 0:f.placeholder,children:t}),r.jsx(c.View,{as:"div",ref:x,contentEditable:!n,suppressContentEditableWarning:!0,onInput:J,onKeyDown:oe,onFocus:U,onBlur:K,role:"textbox","aria-multiline":"true","aria-placeholder":t,width:"100%",minHeight:"24px",padding:"8px",outline:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"14px",color:"color-gray-900",backgroundColor:"transparent",...f==null?void 0:f.input})]}),M&&E.length>0&&r.jsx(c.View,{position:"fixed",left:L.x,top:L.y,width:((ce=j.current)==null?void 0:ce.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",...f==null?void 0:f.mentionContainer,children:r.jsxs(c.Vertical,{gap:0,children:[E.map((N,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===B?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>re(N),onMouseEnter:()=>R(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.mentionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsxs(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:[u,N.name]}),N.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:N.description})]})},N.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Mentions (Trigger: ",u,")",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})}),d&&a.length>0&&!M&&w&&!e&&r.jsx(c.View,{position:"fixed",left:F.x,top:F.y,width:((he=j.current)==null?void 0:he.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",...f==null?void 0:f.suggestionsContainer,children:r.jsxs(c.Vertical,{gap:0,children:[a.map((N,G)=>r.jsx(c.View,{as:"button",type:"button",width:"100%",padding:"12px 16px",backgroundColor:G===b?"color-blue-50":"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background-color 0.2s ease",onClick:()=>ne(N),onMouseEnter:()=>k(G),_hover:{backgroundColor:"color-blue-50"},...f==null?void 0:f.suggestionItem,children:r.jsxs(c.Vertical,{gap:4,children:[r.jsx(c.Text,{fontSize:"14px",color:"color-gray-900",fontWeight:"medium",children:N.text}),N.description&&r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:N.description})]})},N.id)),process.env.NODE_ENV==="development"&&r.jsxs("div",{style:{fontSize:"8px",opacity:.7,padding:"4px"},children:["Suggestions (Focus-triggered)",H&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),"Space: ",H.space.vertical,"-",H.space.horizontal]})]})]})})]})});_n.displayName="EditableInput";const Uu=({examples:e,onSelect:o,views:t={}})=>{const{getColor:n}=c.useTheme();return!e||e.length===0?null:r.jsx(c.Horizontal,{gap:8,overflowX:"auto",padding:"8px 0",width:"100%",...t==null?void 0:t.container,children:e.map(i=>r.jsx(c.View,{as:"button",type:"button",padding:"8px 12px",borderRadius:"4px",backgroundColor:"color-gray-100",border:"none",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>o(i),_hover:{backgroundColor:"color-gray-200"},...t==null?void 0:t.item,children:r.jsx(c.Text,{fontSize:"14px",color:"color-gray-700",...t==null?void 0:t.text,children:i.text})},i.id))})},Gu=({onRecordingComplete:e,onRecordingStart:o,views:t={}})=>{const{recording:n,paused:i,audioBlob:a,analyserNode:l,startRecording:d,stopRecording:s}=Hr();g.useEffect(()=>{if(a){const p=new File([a],`recording-${Date.now()}.webm`,{type:a.type||"audio/webm;codecs=opus"});e(p)}},[a]);const u=g.useCallback(()=>{d(),o==null||o()},[]);return r.jsxs(c.Horizontal,{alignItems:"center",gap:4,children:[r.jsx(c.View,{minWidth:90,children:n&&l&&r.jsx(Et,{analyserNode:l,isPaused:i})}),r.jsx(c.View,{as:"button",type:"button",onClick:n?s:u,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n?"theme-error":"color-gray-100",color:n?"color-white":"color-gray-600",borderRadius:"50%",border:"none",cursor:"pointer",_hover:{backgroundColor:n?"color-red-600":"color-gray-200"},...t.button,children:n?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):r.jsx(wt,{widthHeight:16,color:"currentColor",filled:!1})})]})},$n=({onSubmit:e,placeholder:o="Say what you want and Kimmy will surprise you",loading:t=!1,disabled:n=!1,isAgentRunning:i=!1,enableAudioRecording:a=!1,leftButtons:l,rightButtons:d,onStopAgent:s,loadingText:u="Agent is working...",autoFocus:p=!0,sandboxId:m,hideAttachments:h=!1,attachmentText:f="",promptExamples:x=[],suggestions:y=[],errorMessage:b,size:k="md",shape:C="rounded",variant:S="default",views:j={},mentionData:w=[],mentionTrigger:I="@",onMentionSelect:M,onAudioRecordingStart:z,onAudioRecordingStop:V,value:$,handleChange:T,handleSubmit:_,editableRef:B,fileInputRef:R,isUploading:E,uploadProgress:W,isDraggingOver:P,uploadedFiles:H,removeUploadedFile:L,setPendingFiles:A,setUploadedFiles:F,setIsUploading:D,startUpload:O,selectedModel:v,handleModelChange:X,modelOptions:U,subscriptionStatus:K,canAccessModel:J,isGuideTipShown:re,hideGuideTip:ne,handlePromptExampleSelect:oe,handleDragOver:ce,handleDragLeave:he,onChange:N,...G})=>{c.useTheme();const Z={...cr.container,...Hu[C],...j==null?void 0:j.container},Y={...cr.content,...Bu[k],...Lu[S],...j==null?void 0:j.content},Q=(($==null?void 0:$.trim().length)??0)>0||H.length>0,le=g.useCallback(te=>{O([te]),V==null||V(te)},[O,V]),ue=g.useCallback(te=>{const me=te.filter(jo=>jo.size>52428800?(console.error(`File size exceeds 50MB limit: ${jo.name}`),!1):!0);me.length>0&&O(me)},[O]),pe=[...w||[],...H.map((te,me)=>({id:`file-${me}`,name:te.name}))];return r.jsxs(c.View,{display:"flex",flexDirection:"column",boxSizing:"border-box",...Z,...G,onDragOver:ce,onDragLeave:he,onDrop:te=>{if(te.preventDefault(),te.stopPropagation(),he(te),te.dataTransfer.files.length>0){const me=Array.from(te.dataTransfer.files);ue(me)}},children:[x.length>0&&r.jsx(Uu,{examples:x,onSelect:oe,views:{container:j==null?void 0:j.promptExamples,item:j==null?void 0:j.promptExampleItem}}),i&&r.jsxs(c.Horizontal,{justifyContent:"center",alignItems:"center",gap:8,padding:"8px 0",animate:{from:{opacity:0,y:-10},to:{opacity:1,y:0},duration:"0.3s"},...j==null?void 0:j.loadingIndicator,children:[r.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",children:u})]}),r.jsx(c.View,{position:"relative",width:"100%",overflow:"visible",children:r.jsxs(c.View,{as:"form",onSubmit:_,overflow:"visible",display:"flex",flexDirection:"column",position:"relative",...Y,...Z,paddingHorizontal:16,paddingVertical:10,backgroundColor:P?"color-blue-50":void 0,children:[r.jsx(Nu,{files:H,sandboxId:m,onRemove:L,showPreviews:!0,views:{container:j==null?void 0:j.attachments,item:j==null?void 0:j.attachmentItem,name:j==null?void 0:j.attachmentName,size:j==null?void 0:j.attachmentSize,removeButton:j==null?void 0:j.attachmentRemove}}),r.jsx(_n,{ref:B,value:$||"",onChange:T,placeholder:o,disabled:n&&!i,autoFocus:p,suggestions:y||[],showSuggestions:y&&y.length>0&&!$,onSuggestionSelect:te=>{T(te.text)},mentionData:pe,mentionTrigger:I,onMentionSelect:M,views:{container:{},input:j==null?void 0:j.editableInput}}),r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginTop:"8px",children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[!h&&r.jsx(Yo,{accept:"*/*",icon:r.jsx(go,{widthHeight:16}),maxSize:50*1024*1024,multiple:!0,onMultipleFileSelect:ue,isLoading:E,progress:W||0,text:f,fileType:"file",renderError:({errorMessage:te})=>null,views:{container:{height:"36px",cursor:"pointer",_hover:{backgroundColor:"color-gray-100"},...j==null?void 0:j.fileButton}},containerProps:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,borderRadius:C==="rounded"?"50%":4,padding:10},textProps:{fontSize:"14px",color:"color-gray-600"},validateFile:te=>te.size>50*1024*1024?"File size exceeds 50MB limit":null}),l]}),r.jsxs(c.Horizontal,{gap:8,alignItems:"center",children:[a&&r.jsx(Gu,{onRecordingStart:z,onRecordingComplete:le,views:{button:j==null?void 0:j.recordButton}}),r.jsx(c.View,{as:"button",type:"button",onClick:_,height:"40px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i?"theme-error":Q?"theme-primary":"color-gray-300",color:"color-white",borderRadius:C==="rounded"?"50%":4,border:"none",cursor:Q?"pointer":"not-allowed",disabled:!Q||t||n&&!i,transition:"all 0.2s ease",_hover:{backgroundColor:i?"color-red-600":Q?"color-blue-600":"color-gray-300"},...j==null?void 0:j.submitButton,children:i?r.jsx(qo,{widthHeight:16,color:"currentColor",filled:!1}):t?r.jsx(so,{type:"quarter",size:16,color:"color-white"}):r.jsx(It,{widthHeight:16,color:"currentColor",filled:!1})}),d]})]})]})}),b&&r.jsx(c.Text,{color:"theme-error",marginTop:"4px",...j==null?void 0:j.bottomTip,children:b})]})},Yu=e=>{const{name:o,onSubmit:t,...n}=e,[i,a]=g.useState([]),l=de({name:o,type:"text"}),d=h=>{l.onChangeText&&l.onChangeText(h)},s=(h,f)=>{t?t(h,f):d(h)},u=()=>i,p=()=>a([]),m=En({...n,value:l.value||"",onChange:d,onSubmit:s,getPendingFiles:u,clearPendingFiles:p});return r.jsx($n,{...n,...m,value:l.value||"",onChange:d,onSubmit:s,error:l.error,getPendingFiles:u,clearPendingFiles:p})},vu=Yu,Xu=e=>{const o=de(e),t=mn(o);return r.jsx(hn,{...t,...o})},Ku=Xu,Qu=e=>{const o=de(e),t=jn();return r.jsx(Cn,{...t,...o})},Zu=Qu,Ju=e=>{const o=de(e),t=fn(e);return r.jsx(xn,{...t,...o})},eg=Ju,og=e=>{let o=de(e);o.selected=o.value;const t=Jr(e);return r.jsx(nn,{...t,...o})},tg=og,rg=e=>{const o=de(e),t=an(e);return r.jsx(ln,{...t,...o})},ng=rg,ag=e=>{const{name:o,...t}=e,{values:n,errors:i,touched:a,submitCount:l,setFieldValue:d,setFieldTouched:s}=be.useFormikContext(),u=be.getIn(n,o)||[],p=be.getIn(a,o)||l>0?be.getIn(i,o):void 0,m=g.useCallback(b=>{var C;const k=Array.isArray(b)?b.filter(S=>typeof S=="string"):[];d(o,k),(C=e.onTagsChange)==null||C.call(e,k)},[o,d,e.onTagsChange]),h=g.useCallback(()=>{var b;s(o,!0),(b=e.onBlur)==null||b.call(e)},[o,s,e.onBlur]),f=Tn({...t,tags:u,onTagsChange:m,onBlur:h}),{tags:x,...y}=f;return r.jsx(Mn,{...y,...t,tags:x,error:p})},ig=ag,lg=e=>{const o=de(e),t=dn(e);return r.jsx(un,{...t,...o})},cg=lg,sg=e=>{const o=de(e),{value:t,...n}=Lt(e);return r.jsx(ho,{...n,...o})},dg=sg,ug=({visibleIcon:e=r.jsx(zt,{widthHeight:14}),hiddenIcon:o=r.jsx(Mt,{widthHeight:14}),...t})=>{const n=de(t),{isVisible:i,setIsVisible:a,...l}=Sn(n);return r.jsx(ho,{...l,type:i?"text":"password",isClearable:!1,right:r.jsx(c.View,{onClick:()=>{t.isDisabled||a(!i)},children:i?e:o})})},gg=ug,pg=({items:e,placeholder:o,searchPlaceholder:t,isMulti:n=!1,...i})=>{const a=de(i),l=wn(e,o,t);g.useEffect(()=>{if(n&&Array.isArray(a.value))l.setSelectedItems(a.value);else if(!n&&a.value){const s=typeof a.value=="object"?a.value:e.find(u=>u.value===a.value);s&&l.setSelectedItem(s)}},[a.value,n,e]);const d=s=>{a.onChange(s)};return r.jsx(In,{...l,...a,items:e,placeholder:o,isMulti:n,onSelect:d})},mg=pg,Ye=(e,o,t)=>Math.min(Math.max(e,o),t),hg=(e,o,t,n,i,a,l)=>{const d=n-t;let s;if(a==="horizontal"){const u=o.width,p=e-o.left;s=Ye(p/u,0,1)}else{const u=o.height,p=o.bottom-e;s=Ye(p/u,0,1)}if(l&&l.length>0){const u=t+s*d;let p=l[0],m=Math.abs(u-p);for(let h=1;h<l.length;h++){const f=Math.abs(u-l[h]);f<m&&(m=f,p=l[h])}return p}else{const u=t+s*d,p=Math.round(u/i)*i;return Ye(p,t,n)}},Hn=({min:e=0,max:o=100,step:t=1,value:n=0,defaultValue:i,onChange:a,onDrag:l,orientation:d="horizontal",isDisabled:s=!1,stepValues:u})=>{const p=Ye(n??i??e,e,o),[m,h]=g.useState(p),[f,x]=g.useState(!1),[y,b]=g.useState(!1),k=g.useRef(null),C=g.useRef(null),S=n!==void 0,j=S?n:m;g.useEffect(()=>{S&&h(Ye(n,e,o))},[n,S,e,o]);const w=g.useCallback(_=>{const B=Ye(_,e,o);S||h(B),a&&B!==j&&a(B),f&&l&&l(B)},[S,e,o,a,j,f,l]),I=g.useCallback(_=>{if(s||!k.current)return;const B=k.current.getBoundingClientRect();let R;"touches"in _?R=d==="horizontal"?_.touches[0].clientX:_.touches[0].clientY:R=d==="horizontal"?_.clientX:_.clientY;const E=hg(R,B,e,o,t,d,u);w(E)},[e,o,t,d,w,s,u]),M=g.useCallback(_=>{if(s)return;_.preventDefault(),x(!0),I(_);const B=E=>{I(E)},R=()=>{x(!1),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",B),document.removeEventListener("touchend",R)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",R),document.addEventListener("touchmove",B),document.addEventListener("touchend",R)},[I,s]),z=g.useCallback(_=>{C.current&&C.current.contains(_.target)||M(_)},[M]),V=g.useCallback(_=>{if(s)return;let B=j;switch(_.key){case"ArrowLeft":case"ArrowDown":B=j-t;break;case"ArrowRight":case"ArrowUp":B=j+t;break;case"Home":B=e;break;case"End":B=o;break;default:return}_.preventDefault(),w(B)},[j,e,o,t,w,s]),$=o-e,T=$===0?0:(j-e)/$*100;return{currentValue:j,isDragging:f,isHovered:y,setIsHovered:b,trackRef:k,thumbRef:C,handleThumbMouseDown:M,handleTrackMouseDown:z,handleKeyDown:V,thumbPositionPercent:T}},dr={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%"}},ur={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}},gr={square:0,rounded:4,pill:24},fg=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"}}),pr=fg(),xg={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}},bg={horizontal:{width:"100%",minWidth:"120px",height:"auto",flexDirection:"row",paddingVertical:8},vertical:{height:"100%",minHeight:"120px",width:"auto",flexDirection:"column-reverse",paddingHorizontal:8}},Bn=({min:e=0,max:o=100,step:t=1,currentValue:n,stepValues:i,shape:a="rounded",size:l="md",variant:d="default",orientation:s="horizontal",isDisabled:u=!1,showValue:p=!1,showTooltip:m=!1,backgroundColor:h="theme-primary",label:f,helperText:x,themeMode:y,shadow:b={},isDragging:k,isHovered:C,setIsHovered:S,trackRef:j,thumbRef:w,handleThumbMouseDown:I,handleTrackMouseDown:M,handleKeyDown:z,thumbPositionPercent:V,ariaLabel:$="Slider",views:T={container:{},track:{},progress:{},filledTrack:{},thumb:{},label:{},valueLabel:{},stepMarks:{},tooltip:{}},onChange:_,onDrag:B,...R})=>{var X,U;const{getColorHex:E,themeMode:W}=c.useTheme(),P=E(h,{themeMode:y||W}),H=E("theme-disabled",{themeMode:y||W}),L=E(pr[d].backgroundColor,{themeMode:y||W}),A=s==="vertical",{trackCrossAxisSize:F,thumbSize:D}=xg[l]||{trackCrossAxisSize:dr[l].height,thumbSize:ur[l].width||16},O=r.jsxs(c.Vertical,{width:"100%",gap:8,...T.container,...R,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",cursor:u?"not-allowed":"pointer",opacity:u?.6:1,onMouseDown:M,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),...dr[l],borderRadius:gr[a],backgroundColor:L,...pr[d],...b,...T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(K=>{const J=(K-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",top:"50%",left:`${J}%`,transform:"translate(-50%, -50%)",width:4,height:4,borderRadius:"50%",backgroundColor:u?H:P,zIndex:1,...T.stepMarks},K)})}),r.jsx(c.View,{position:"absolute",top:0,left:0,height:"100%",width:`${V}%`,backgroundColor:u?H:P,borderRadius:gr[a],transition:"width 0.1s ease-in-out",...T.progress,...T.filledTrack}),r.jsx(c.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":$,position:"absolute",top:"50%",left:`${V}%`,borderRadius:"50%",backgroundColor:"color-white",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:`2px solid ${u?H:P}`,transition:k?"none":"transform 0.1s ease-in-out",transform:C?"translate(-50%, -50%) scale(1.1)":"translate(-50%, -50%)",zIndex:2,onMouseDown:I,onTouchStart:I,onKeyDown:z,...ur[l],...T.thumb,children:m&&(C||k)&&r.jsx(c.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:r.jsx(c.Text,{...(X=T.tooltip)==null?void 0:X.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(mt,{children:x})]}),v=r.jsxs(c.Center,{...bg[s],position:"relative",onMouseEnter:()=>!u&&S(!0),onMouseLeave:()=>!u&&S(!1),...R,...T==null?void 0:T.container,children:[f&&r.jsxs(c.Horizontal,{justifyContent:"space-between",alignItems:"center",marginBottom:8,width:"100%",children:[r.jsx(c.Text,{fontSize:14,fontWeight:500,...T.label,children:f}),p&&r.jsx(c.Text,{fontSize:14,color:"color-blueGray-500",...T.valueLabel,children:n})]}),r.jsxs(c.View,{ref:j,position:"relative",borderRadius:F/2,backgroundColor:u?H:L,cursor:u?"not-allowed":"pointer",width:A?`${F}px`:"100%",height:A?"100%":`${F}px`,onMouseDown:M,onTouchStart:M,...T==null?void 0:T.track,children:[i&&i.length>0&&r.jsx(r.Fragment,{children:i.map(K=>{const J=(K-e)/(o-e)*100;return r.jsx(c.View,{position:"absolute",width:4,height:4,borderRadius:"50%",backgroundColor:u?H:P,zIndex:1,...A?{bottom:`${J}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${J}%`,top:"50%",transform:"translate(-50%, -50%)"},...T.stepMarks},K)})}),r.jsx(c.View,{position:"absolute",borderRadius:F/2,backgroundColor:u?H:P,...A?{bottom:0,left:0,width:"100%",height:`${V}%`}:{top:0,left:0,height:"100%",width:`${V}%`},...T==null?void 0:T.filledTrack,...T==null?void 0:T.progress}),r.jsx(c.View,{ref:w,role:"slider",tabIndex:u?-1:0,"aria-valuemin":e,"aria-valuemax":o,"aria-valuenow":n,"aria-orientation":s,"aria-disabled":u,"aria-label":$,position:"absolute",width:`${D}px`,height:`${D}px`,borderRadius:"50%",backgroundColor:u?H:P,border:"2px solid color-white",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)",cursor:u?"not-allowed":"grab",transform:A?"translateX(-50%)":"translateY(-50%)",zIndex:2,transition:k?"none":"left 0.1s, bottom 0.1s",...A?{left:"50%",bottom:`${V}%`}:{top:"50%",left:`${V}%`},onMouseDown:I,onTouchStart:I,onKeyDown:z,...T==null?void 0:T.thumb,children:m&&(C||k)&&r.jsx(c.View,{position:"absolute",padding:"4px 8px",backgroundColor:"color-black",color:"color-white",borderRadius:"4px",whiteSpace:"nowrap",zIndex:3,...A?{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:r.jsx(c.Text,{...(U=T==null?void 0:T.tooltip)==null?void 0:U.text,children:n==null?void 0:n.toFixed(t<1?1:0)})})})]}),x&&r.jsx(mt,{marginTop:8,children:x})]});return A||m?v:O},yg=e=>{const o=de(e),t=Hn({...e,value:o.value!==void 0?Number(o.value):void 0,onChange:n=>{var i;o.onChange(n),(i=e.onChange)==null||i.call(e,n)}});return r.jsx(Bn,{...e,...t,...o})},kg=yg,jg=e=>{const o=de(e),{isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b}=zn(e),k=g.useCallback(S=>{o.onChange&&o.onChange(S),e.onComplete&&S.length===(e.length||6)&&e.onComplete(S),l.current&&(l.current.value=S)},[o,e,l]),C=g.useCallback(S=>{const j=S.currentTarget.value.slice(0,e.length||6);k(j),l.current&&(l.current.value=j)},[e.length,k,l]);return r.jsx(Rn,{...e,...o,setValue:k,isFocused:t,setIsFocused:n,isHovered:i,setIsHovered:a,inputRef:l,containerRef:d,mirrorSelectionStart:s,mirrorSelectionEnd:u,setMirrorSelectionStart:p,setMirrorSelectionEnd:m,setInputRef:h,handleChange:C,handleFocus:f,handleBlur:x,handleKeyDown:y,handlePaste:b,stepValues:e.stepValues})},Cg=jg,Sg=e=>Array.isArray(e)?e:e==null?[]:[e],Ln=({name:e,uploadFile:o,onUploadSuccess:t,onUploadError:n,transformResponse:i,onMultipleFileSelect:a,onFileSelect:l,multiple:d=!0,...s})=>{const{setFieldValue:u,setFieldTouched:p,values:m}=be.useFormikContext(),[h,f]=g.useState(!1),[x,y]=g.useState(0),b=g.useCallback(async S=>{if(!S||S.length===0)return;p(e,!0,!0),f(!0);const j=[];for(const w of S){y(0);try{const I=await o(w,z=>{y(z??0)}),M=i?i(I,w):I;j.push(M),t==null||t(w,M)}catch(I){n==null||n(w,I)}}if(j.length>0){const w=Sg(be.getIn(m,e));u(e,[...w,...j],!0),y(100)}else y(0);f(!1)},[e,n,t,p,u,i,o,m]),k=g.useCallback(async S=>{a==null||a(S),await b(S)},[b,a]),C=g.useCallback(async S=>{l==null||l(S),await b([S])},[b,l]);return r.jsx(Yo,{...s,multiple:d,onMultipleFileSelect:d?k:void 0,onFileSelect:d?void 0:C,isLoading:h,progress:x})};Ln.displayName="FormikUploader";const wg=e=>{let o=de(e);o.selected=o.value;const t=cn(e);return r.jsx(sn,{...t,...o})},Ig=wg,An=e=>{const[o,t]=g.useState(!1),[n,i]=g.useState(e);return{isHovered:o,setIsHovered:t,isToggle:n,setIsToggled:i}},Tg={square:0,rounded:4,pill:24},Mg=(e,o)=>({outline:{backgroundColor:"transparent",color:e,borderWidth:1,borderStyle:"solid",borderColor:e,_hover:{backgroundColor:e,color:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"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:o?"color-black":"color-white",transform:"translateY(-1px)"},_active:{backgroundColor:e,color:o?"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"}}),Dn=({children:e,shape:o="rounded",variant:t="ghost",isHovered:n,setIsHovered:i,isDisabled:a,isToggle:l,setIsToggled:d,onToggle:s,views:u,backgroundColor:p,color:m,themeMode:h,...f})=>{const{getColor:x,themeMode:y}=c.useTheme(),b=h??y,C=x(a?"theme-disabled":p??m??"theme-primary",{themeMode:b}),j=Mg(C,b==="light")[t],w=!!(l||n),I=()=>i(!n),M=()=>{a||d(z=>{const V=!z;return s&&s(V),V})};return r.jsx(c.Center,{role:"Toggle",padding:o==="pill"?"10px 12px":"8px",width:"fit-content",cursor:a?"not-allowed":"pointer",borderRadius:Tg[o],onClick:M,onMouseEnter:I,onMouseLeave:()=>i(!1),...j,...w&&{backgroundColor:C,color:b==="light"?"color-black":"color-white"},...f,...u==null?void 0:u.container,children:e})},zg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const d=de(l),{isHovered:s,setIsHovered:u,isToggle:p,setIsToggled:m}=An(d.value??i);g.useEffect(()=>{m(d.value??i)},[d.value,i]);const h=f=>{m(f),d.onChange(f),a==null||a(f)};return r.jsx(Dn,{shape:o,variant:t,isDisabled:n,isHovered:s,setIsHovered:u,isToggle:p,setIsToggled:m,onToggle:h,...l,children:e})},Rg=zg,Fn=()=>{const[e,o]=g.useState([]);return{activeToggles:e,setActiveToggles:o}},Vg=({children:e,shape:o,variant:t,isDisabled:n,isToggled:i=!1,onToggle:a,...l})=>{const{isHovered:d,setIsHovered:s,isToggle:u,setIsToggled:p}=An(i);return g.useEffect(()=>{p(i)},[i]),r.jsx(Dn,{shape:o,variant:t,isDisabled:n,isHovered:d,setIsHovered:s,isToggle:u,setIsToggled:p,onToggle:a,...l,children:e})},On=Vg,qn=({items:e,onToggleChange:o,activeToggles:t,setActiveToggles:n,shape:i="rounded",variant:a="ghost",views:l})=>{const d=g.useCallback((s,u)=>{n(p=>{let m;return u?m=p.includes(s)?p:[...p,s]:m=p.filter(h=>h!==s),o==null||o(m),m})},[o,n]);return r.jsx(c.Horizontal,{role:"ToggleGroup",display:"flex",gap:5,...l==null?void 0:l.container,children:e.map(s=>r.jsx(On,{role:`toggle-${s.id}`,shape:i,variant:a,isToggled:t.includes(s.id)||s.isActive,onToggle:u=>d(s.id,u),isDisabled:s.isDisabled,views:l==null?void 0:l.toggle,children:s.value},s.id))})},Eg=({items:e,shape:o,variant:t,onToggleChange:n,...i})=>{const a=de(i),{activeToggles:l,setActiveToggles:d}=Fn();g.useEffect(()=>{Array.isArray(a.value)&&d(a.value)},[a.value]);const s=u=>{d(u),a.onChange(u),n==null||n(u)};return r.jsx(qn,{items:e,shape:o,variant:t,activeToggles:l,setActiveToggles:d,onToggleChange:s,...i})},Pg=Eg,mr=["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"],Nn=e=>{const{value:o,defaultValue:t,onChange:n,isOpen:i,onOpen:a,onClose:l,closeOnSelect:d=!0}=e,[s,u]=g.useState(i??!1),[p,m]=g.useState(o??t),[h,f]=g.useState(""),x=g.useRef(null),y=g.useRef(null);g.useEffect(()=>{o!==void 0&&m(o)},[o]),g.useEffect(()=>{i!==void 0&&u(i)},[i]);const b=g.useMemo(()=>h?mr.filter(w=>w.toLowerCase().includes(h.toLowerCase())).slice(0,100):mr.slice(0,100),[h]);g.useEffect(()=>{const w=I=>{s&&x.current&&y.current&&!x.current.contains(I.target)&&!y.current.contains(I.target)&&k()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[s]);const k=g.useCallback(()=>{i===void 0&&u(!1),l&&l()},[l,i]),C=g.useCallback(()=>{const w=!s;i===void 0&&u(w),w?(a&&a(),f("")):l&&l()},[s,a,l,i]),S=g.useCallback(w=>{o===void 0&&m(w),n&&n(w),d&&k()},[n,d,k,o]),j=g.useCallback(w=>{f(w)},[]);return{isOpen:s,selectedIcon:p,searchQuery:h,filteredIcons:b,handleToggle:C,handleIconSelect:S,handleSearchChange:j,handleClose:k,triggerRef:x,dropdownRef:y}},Fe={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"}},Wg={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"}},_g={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},$g={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"}},Un=({label:e,placeholder:o="Select an icon",helperText:t,views:n={},size:i="md",shape:a="default",variant:l="default",error:d=!1,isDisabled:s=!1,isReadOnly:u=!1,showSearch:p=!0,isOpen:m,selectedIcon:h,searchQuery:f,filteredIcons:x,handleToggle:y,handleIconSelect:b,handleSearchChange:k,triggerRef:C,dropdownRef:S,handleClose:j,onChange:w,...I})=>{const{getColor:M}=c.useTheme(),z={...Fe.container,...n==null?void 0:n.container},V={...Fe.trigger,...Wg[i],..._g[a],...$g[l],...d&&{borderColor:"color-red-500"},...s&&{opacity:.6,cursor:"not-allowed"},...n==null?void 0:n.trigger},$={...Fe.dropdown,...n==null?void 0:n.dropdown},T={...Fe.iconGrid,...n==null?void 0:n.iconGrid};return r.jsxs(c.View,{...z,...I,children:[e&&r.jsx(c.Text,{fontSize:i==="xs"?"12px":i==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...n==null?void 0:n.label,children:e}),r.jsxs(c.View,{ref:C,onClick:s||u?void 0:y,...V,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:h?r.jsxs(c.Horizontal,{alignItems:"center",gap:8,width:"100%",children:[r.jsx(Eo,{name:h,widthHeight:16}),r.jsx(c.Text,{color:"color-gray-800",fontSize:"inherit",style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]}):r.jsx(c.Text,{color:"color-gray-500",fontSize:"inherit",children:o})}),!u&&!s&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:m?"up":"down"})]}),m&&r.jsxs(c.View,{ref:S,...$,children:[p&&r.jsx(c.View,{...Fe.searchInput,...n==null?void 0:n.searchInput,children:r.jsx(fo,{placeholder:"Search icons...",value:f,onChange:_=>k(_),size:"sm",autoFocus:!0})}),r.jsx(c.View,{...T,children:x.length>0?x.map(_=>r.jsx(c.View,{...Fe.iconItem,onClick:()=>b(_),title:_,_hover:{backgroundColor:"color-gray-100"},backgroundColor:h===_?"color-blue-100":"transparent",...n==null?void 0:n.iconItem,children:r.jsx(Eo,{name:_,widthHeight:20})},_)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:"No icons found"})})})]}),t&&r.jsx(c.Text,{color:d?"color-red-500":"color-gray-600",marginTop:"4px",...n==null?void 0:n.helperText,children:t})]})},Hg=e=>{const o=de(e),t={...e,value:o.value??e.value??e.defaultValue},n=Nn(t),i=a=>{n.handleIconSelect(a),o.onChange(a)};return r.jsx(Un,{...n,...t,handleIconSelect:i})},Bg=Hg,Ie={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"}},Lg={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"}},Ag={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Dg={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"}},Fg={recent:"🕒",smileys:"😀",people:"👤",animals:"🐶",food:"🍎",activities:"⚽",travel:"🚗",objects:"💡",symbols:"❤️",flags:"🏁"},Og=[{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"]}],Gn=e=>{const{value:o,defaultValue:t="",onChange:n,onEmojiSelect:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentEmojis:u=16,showRecentEmojis:p=!0,enabledCategories:m=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],customEmojis:h=[]}=e,[f,x]=g.useState(a??!1),[y,b]=g.useState(o??t),[k,C]=g.useState(""),[S,j]=g.useState("smileys"),[w,I]=g.useState([]),M=g.useRef(null),z=g.useRef(null),V=g.useMemo(()=>[...Og,...h],[h]),$=g.useMemo(()=>{let P=V;if(S!=="recent"?P=P.filter(H=>H.category===S):P=w,k){const H=k.toLowerCase();P=P.filter(L=>L.name.toLowerCase().includes(H)||L.keywords.some(A=>A.toLowerCase().includes(H)))}return P},[V,S,w,k]);g.useEffect(()=>{o!==void 0&&b(o)},[o]),g.useEffect(()=>{a!==void 0&&x(a)},[a]),g.useEffect(()=>{if(p){const P=localStorage.getItem("emojiPicker-recentEmojis");if(P)try{I(JSON.parse(P))}catch{}}},[p]),g.useEffect(()=>{const P=H=>{f&&M.current&&z.current&&!M.current.contains(H.target)&&!z.current.contains(H.target)&&W()};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[f]);const T=g.useCallback(P=>{p&&I(H=>{const L=H.filter(F=>F.emoji!==P.emoji),A=[P,...L].slice(0,u);return localStorage.setItem("emojiPicker-recentEmojis",JSON.stringify(A)),A})},[p,u]),_=g.useCallback(()=>{const P=!f;x(P),P?(l==null||l(),C(""),p&&w.length>0?j("recent"):j("smileys")):d==null||d()},[f,l,d,p,w.length]),B=g.useCallback(P=>{b(P.emoji),T(P),n==null||n(P.emoji),i==null||i(P),s&&(x(!1),d==null||d())},[n,i,s,d,T]),R=g.useCallback(P=>{C(P),P&&S==="recent"&&j("smileys")},[S]),E=g.useCallback(P=>{j(P),C("")},[]),W=g.useCallback(()=>{x(!1),d==null||d()},[d]);return{isOpen:f,selectedEmoji:y,recentEmojis:w,searchQuery:k,activeCategory:S,filteredEmojis:$,handleToggle:_,handleEmojiSelect:B,handleSearchChange:R,handleCategoryChange:E,handleClose:W,triggerRef:M,dropdownRef:z}},Yn=({id:e,name:o,label:t,placeholder:n="Select an emoji",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:u=!1,isDisabled:p=!1,isReadOnly:m=!1,showSearch:h=!0,showCategories:f=!0,showRecentEmojis:x=!0,enabledCategories:y=["recent","smileys","people","animals","food","activities","travel","objects","symbols","flags"],isOpen:b,selectedEmoji:k,recentEmojis:C,searchQuery:S,activeCategory:j,filteredEmojis:w,handleToggle:I,handleEmojiSelect:M,handleSearchChange:z,handleCategoryChange:V,triggerRef:$,dropdownRef:T,onChange:_,...B})=>{const{getColor:R}=c.useTheme(),E={...Ie.container,...a==null?void 0:a.container},W={...Ie.trigger,...Lg[l],...Ag[d],...Dg[s],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},P={...Ie.dropdown,...a==null?void 0:a.dropdown},H={...Ie.categoryTabs,...a==null?void 0:a.categoryTabs},L={...Ie.emojiGrid,...a==null?void 0:a.emojiGrid},A=y.filter(F=>F==="recent"?x&&C.length>0:!0);return r.jsxs(c.View,{...E,...B,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:$,onClick:p||m?void 0:I,...W,children:[r.jsx(c.Horizontal,{alignItems:"center",gap:8,children:r.jsx(c.Text,{color:k?"color-gray-800":"color-gray-500",fontSize:"inherit",children:k||n})}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:b?"up":"down"})]}),b&&r.jsxs(c.View,{ref:T,...P,children:[h&&r.jsx(c.View,{...Ie.searchInput,...a==null?void 0:a.searchInput,children:r.jsx(fo,{placeholder:"Search emojis...",value:S,onChange:F=>z(F.target.value),size:"sm"})}),f&&r.jsx(c.View,{...H,children:A.map(F=>r.jsx(c.View,{...Ie.categoryTab,...j===F&&{borderBottomColor:"color-blue-500",color:"color-blue-600"},onClick:()=>V(F),title:F.charAt(0).toUpperCase()+F.slice(1),...a==null?void 0:a.categoryTab,children:Fg[F]},F))}),r.jsx(c.View,{...L,children:w.length>0?w.map((F,D)=>r.jsx(c.View,{...Ie.emoji,onClick:()=>M(F),title:F.name,_hover:{backgroundColor:"color-gray-100"},color:"color-gray-800",...a==null?void 0:a.emoji,children:F.emoji},`${F.emoji}-${D}`)):r.jsx(c.View,{gridColumn:"1 / -1",padding:"20px",textAlign:"center",color:"color-gray-500",children:r.jsx(c.Text,{fontSize:"14px",children:S?"No emojis found":"No emojis in this category"})})})]}),i&&r.jsx(c.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},qg=e=>{const o=de(e),t={...e,value:o.value??e.value??e.defaultValue},n=Gn(t),i=a=>{var l;n.handleEmojiSelect(a),o.onChange(a.emoji),(l=e.onEmojiSelect)==null||l.call(e,a)};return r.jsx(Yn,{...n,...t,handleEmojiSelect:i})},Ng=qg,Ug=({files:e,onRemove:o,maxHeight:t="120px",views:n={}})=>{if(e.length===0)return null;const i=g.useCallback(a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:t,overflowY:"auto",...n==null?void 0:n.container,children:e.map((a,l)=>{const d=a.url||"",s=a.type.startsWith("image/"),u=a.type.startsWith("video/"),p=a.type.startsWith("audio/");return r.jsx(c.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,...n==null?void 0:n.item,children:r.jsxs(fe,{children:[r.jsx(fe.Trigger,{children:r.jsxs(c.View,{position:"relative",children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),u&&d&&r.jsx(c.View,{as:"video",src:d,alt:a.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}),p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!s&&!u&&!p&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",borderRadius:"4px",children:r.jsx(uo,{widthHeight:24,color:"color-black"})}),o&&r.jsx(c.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(),o(l)},"aria-label":`Remove ${a.name}`,children:"×"})]})}),r.jsxs(fe.Content,{children:[s&&d&&r.jsx(c.Image,{src:d,alt:a.name,maxWidth:"300px"}),u&&d&&r.jsx(c.View,{as:"video",src:d,controls:!0,maxWidth:"300px"}),p&&d&&r.jsx(c.View,{as:"audio",src:d,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",fontSize:12,...n==null?void 0:n.name,children:[a.name," (",i(a.size),")"]})]})]})},l)})})},Gg=e=>{const o=Hn(e);return r.jsx(Bn,{...e,...o})},Yg=Gg,vg=({url:e,type:o,name:t,onOpen:n})=>{const i=o.toLowerCase(),a=i.startsWith("image"),l=i.startsWith("video"),d=i.startsWith("audio"),s=()=>{n&&n()};return r.jsxs(c.View,{width:"60px",height:"60px",flexShrink:0,borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"color-gray-200",cursor:"pointer",onClick:s,children:[a&&r.jsx(c.Image,{src:e,alt:t,width:"100%",height:"100%",objectFit:"cover"}),l&&r.jsx(c.View,{as:"video",src:e,controls:!0,width:"100%",height:"100%",style:{objectFit:"cover"},onClick:u=>u.stopPropagation()}),d&&r.jsx(c.View,{as:"audio",controls:!0,src:e,width:"100%",onClick:u=>u.stopPropagation()}),!a&&!l&&!d&&r.jsx(uo,{widthHeight:24,color:"color-gray-600"})]})},Me=kt.create(e=>({modals:[],onHide:o=>o,onShow:(o,t)=>({name:o,props:t}),show:(o,t={},n={})=>{e(i=>({...i,modals:[...i.modals,{name:o,props:{...t,isVisible:!0},overlayProps:n}]}))},hide:o=>{e(t=>o?{...t,modals:t.modals.filter(n=>n.name!==o)}:{modals:[]})},setOnHide:o=>{e(t=>({...t,onHide:o}))},setOnShow:o=>{e(t=>({...t,onShow:o}))}})),Xg=(e,o={},t={})=>{Me.getState().show(e,o,t),Me.getState().onShow(e,o)},At=e=>{console.log("hideModal",e),Me.getState().onHide(e),Me.getState().hide(typeof e=="string"?e:void 0)},Kg={square:{borderRadius:0},rounded:{borderRadius:"8px"}},Qg={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"}},Zg={xs:12,sm:16,md:20,lg:24,xl:28},wo={body:{fontSize:"16px",fontWeight:"400",lineHeight:"24px",color:"color-gray-700"}},vn=({children:e,blur:o,isOpen:t=!1,isClosePrevented:n=!1,onClose:i=()=>{},position:a="center",views:l,...d})=>{const s=()=>{n||i()};return r.jsx(c.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:s,visibility:t?"visible":"hidden",transition:"all 0.3s ease",...l==null?void 0:l.container,children:r.jsx(c.View,{position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-blackAlpha-500",backdropFilter:o?`blur(${o}px)`:void 0,transition:"all 0.3s ease",onClick:s,...Qg[a],...d,...l==null?void 0:l.view,children:e})})},Jg=({children:e,shadow:o,isFullScreen:t=!1,shape:n="rounded",views:i,isOpen:a,...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},s=u=>{u&&u.stopPropagation&&u.stopPropagation()};return r.jsx(c.Vertical,{cursor:"default",backgroundColor:"color-white",width:t?"100%":600,height:t?"100%":"fit-content",onClick:s,transition:"all 0.3s ease",...o||d,...Kg[n],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...l,...i==null?void 0:i.container,children:e})},ep=({children:e,buttonColor:o="theme-primary",iconSize:t="md",buttonPosition:n="right",views:i,...a})=>{const l=a.onClose?a.onClose:At,d=r.jsx(c.View,{onClick:l,children:r.jsx(xe,{widthHeight:Zg[t],color:o})});return r.jsxs(c.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...a,...i==null?void 0:i.header,children:[n==="left"&&d,e,n==="right"&&d]})},op=({children:e,views:o,...t})=>r.jsx(c.View,{paddingVertical:16,paddingHorizontal:24,fontSize:wo.body.fontSize,fontWeight:wo.body.fontWeight,lineHeight:wo.body.lineHeight,color:wo.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...t,...o==null?void 0:o.view,children:e}),tp=({children:e,views:o,...t})=>r.jsx(c.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}},...t,...o==null?void 0:o.container,children:e}),rp=({modals:e,onShow:o,onHide:t})=>{const n=Me(i=>i.modals);return o&&Me.getState().setOnShow(o),t&&Me.getState().setOnHide(t),n.length===0?null:r.jsx(g.Fragment,{children:n.map((i,a)=>{const l=e[i.name];return l?r.jsx(vn,{isOpen:i.props.isVisible,onClose:()=>At(i.name),blur:5,...i.overlayProps,style:{zIndex:1e3+a},children:r.jsx(l,{...i.props})},a):(console.error(`${i.name} modal doesn't exist`),null)})})},He=({children:e})=>r.jsx(r.Fragment,{children:e});He.Overlay=vn;He.Container=Jg;He.Header=ep;He.Body=op;He.Footer=tp;He.Layout=rp;const hr={xs:"320px",sm:"380px",md:"480px",lg:"640px",xl:"768px",full:"100%"},np={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"}},Xn=({isOpen:e,onClose:o,isClosePrevented:t,blur:n,children:i,...a})=>{const l=()=>{t||o()};return g.useEffect(()=>{const d=s=>{s.key==="Escape"&&e&&!t&&o()};return e&&document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[e,t,o]),r.jsx(c.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:n?`blur(${n}px)`:void 0,pointerEvents:e?"auto":"none",...a,children:i})},Kn=({placement:e="right",size:o="md",children:t,...n})=>{const i=d=>{d.stopPropagation()},l=e==="top"||e==="bottom"?{height:o==="full"?"100vh":hr[o]||o,maxHeight:"100vh"}:{width:o==="full"?"100vw":hr[o]||o,maxWidth:"100vw"};return r.jsx(c.Vertical,{position:"absolute",backgroundColor:"color-white",...np[e],...l,onClick:i,transition:"transform 0.3s ease",...n,children:t})},ap=({children:e,onClose:o,buttonPosition:t="right",...n})=>{const i=o&&r.jsx(c.View,{onClick:o,cursor:"pointer",padding:8,children:r.jsx(xe,{widthHeight:20,color:"color-gray-500"})});return r.jsxs(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderBottomWidth:"1px",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:t==="none"?"center":"space-between",...n,children:[t==="left"&&i,e,t==="right"&&i]})},ip=({children:e,...o})=>r.jsx(c.Vertical,{padding:24,flex:1,overflowY:"auto",...o,children:e}),lp=({children:e,...o})=>r.jsx(c.Horizontal,{paddingHorizontal:24,paddingVertical:16,borderTopWidth:"1px",borderTopColor:"color-gray-200",alignItems:"center",justifyContent:"flex-end",gap:12,...o,children:e}),cp=({isOpen:e,onClose:o,placement:t="right",size:n="md",isClosePrevented:i,children:a,...l})=>{const d=e?{}:{transform:t==="left"||t==="right"?`translateX(${t==="left"?"-100%":"100%"})`:`translateY(${t==="top"?"-100%":"100%"})`};return r.jsx(Xn,{isOpen:e,onClose:o,isClosePrevented:i,...l,children:r.jsx(Kn,{placement:t,size:n,style:d,children:a})})},Qe=cp;Qe.Overlay=Xn;Qe.Container=Kn;Qe.Header=ap;Qe.Body=ip;Qe.Footer=lp;const sp=(e=null,o=[])=>{const[t,n]=g.useState(e),[i,a]=g.useState(o),l=g.useRef({});return{activeItemId:t,setActiveItemId:n,expandedItemIds:i,toggleExpandedItem:u=>{a(p=>p.includes(u)?p.filter(h=>h!==u):[...p,u])},isItemExpanded:u=>i.includes(u),triggerRefs:l}},ft={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"}}}},xt={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"}},Qn={horizontal:{flexDirection:"row",gap:"8px",media:{mobile:{flexDirection:"column",gap:"4px"}}},vertical:{flexDirection:"column",gap:"4px"}},Ge={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"}},Zn=g.createContext({activeItemId:null,setActiveItemId:()=>{},expandedItemIds:[],toggleExpandedItem:()=>{},isItemExpanded:()=>!1,orientation:"vertical",size:"md",variant:"default",triggerRefs:{current:{}}}),dp=({children:e,value:o})=>r.jsx(Zn.Provider,{value:o,children:e}),xo=()=>{const e=g.useContext(Zn);if(!e)throw new Error("useNavigationMenuContext must be used within a NavigationMenuProvider");return e},Dt=({children:e,views:o})=>{const{orientation:t}=xo(),n=t==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(n,{width:"100%",...Qn[t],transition:"all 0.2s ease",borderRadius:"4px",...o==null?void 0:o.container,children:e})},Jn=g.createContext({itemValue:null,isDisabled:!1}),up=()=>{const e=g.useContext(Jn);if(!e)throw new Error("useNavigationMenuItemContext must be used within a NavigationMenuItem");return e},Ft=({item:e,value:o,isDisabled:t=!1,children:n,views:i})=>{var k;const{activeItemId:a,setActiveItemId:l,orientation:d,size:s,variant:u,onItemActivate:p}=xo(),m=(e==null?void 0:e.id)||o,h=a===m,f=(e==null?void 0:e.items)&&e.items.length>0,x=(e==null?void 0:e.disabled)||t,y=()=>{x||m&&(l(m),p&&p(m))},b=d==="horizontal"?c.Horizontal:c.Vertical;return n?r.jsx(Jn.Provider,{value:{itemValue:m||null,isDisabled:x},children:r.jsx(c.View,{width:"100%",cursor:x?"not-allowed":"pointer",opacity:x?.6:1,borderRadius:"4px",transition:"all 0.2s ease",...ft[s],...xt[u],...h?Ge.active:{},_hover:x?{}:Ge.hover,...i==null?void 0:i.item,children:n})}):f&&e?r.jsxs(b,{width:"100%",flexDirection:"column",position:"relative",...i==null?void 0:i.item,children:[r.jsxs(ea,{itemId:e.id,disabled:e.disabled,views:i,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}),r.jsx(oa,{itemId:e.id,children:r.jsx(Dt,{children:(k=e.items)==null?void 0:k.map(C=>r.jsx(Ft,{item:C},C.id))})})]}):e?r.jsxs(c.View,{as:e.href?"a":"div",to:e.href,onClick:y,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",...ft[s],...xt[u],...h?Ge.active:{},_hover:e.disabled?{}:Ge.hover,...i==null?void 0:i.item,children:[e.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:e.icon}),e.label]}):null},ea=({children:e,itemId:o,disabled:t,views:n})=>{const{activeItemId:i,toggleExpandedItem:a,isItemExpanded:l,size:d,variant:s,triggerRefs:u}=xo(),p=g.useRef(null),m=i===o,h=l(o);g.useEffect(()=>(p.current&&o&&(u.current[o]=p.current),()=>{o&&delete u.current[o]}),[o,u]);const f=x=>{x.preventDefault(),!t&&a(o)};return r.jsxs(c.View,{ref:p,onClick:f,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:4,transition:"background-color 0.2s ease",...ft[d],...xt[s],...m?Ge.active:{},_hover:t?{}:Ge.hover,...n==null?void 0:n.trigger,children:[r.jsx(c.View,{display:"flex",alignItems:"center",children:e}),r.jsx(c.View,{transition:"transform 0.2s ease",transform:h?"rotate(180deg)":"rotate(0deg)",...n==null?void 0:n.indicator,children:r.jsx(ae,{orientation:"down",widthHeight:16,color:"currentColor",filled:!0})})]})},oa=({children:e,itemId:o,views:t})=>{const{isItemExpanded:n,orientation:i,triggerRefs:a}=xo(),l=g.useRef(null),[d,s]=g.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),u=n(o);if(g.useEffect(()=>{if(u&&l.current&&o&&a.current[o]&&i==="horizontal"){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},C=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],S=C.find(M=>M.fits);if(S){s({x:S.x,y:S.y,placement:S.placement});return}const j=C.reduce((M,z)=>z.space>M.space?z:M);let w=j.x,I=j.y;w+f>y&&(w=y-f-8),w<8&&(w=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:w,y:I,placement:j.placement})}},[u,i,o,a]),!u)return null;if(i==="vertical")return r.jsx(c.View,{paddingLeft:16,width:"100%",position:"relative",backgroundColor:"transparent",...t==null?void 0:t.container,children:e});const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.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,...t==null?void 0:t.container,children:e})},gp=({href:e,children:o,views:t,...n})=>{const{itemValue:i,isDisabled:a}=up(),{activeItemId:l,setActiveItemId:d,onItemActivate:s}=xo(),u=l===i,p=m=>{if(a){m.preventDefault();return}i&&(d(i),s&&s(i)),n.onClick&&n.onClick(m)};return r.jsx(c.View,{as:"a",href:a?void 0:e,onClick:p,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:"100%",display:"flex",alignItems:"center","aria-current":u?"page":void 0,"aria-disabled":a,"data-active":u?"":void 0,"data-disabled":a?"":void 0,...u?{fontWeight:"bold"}:{},...t==null?void 0:t.container,...n,children:o})},pp=({items:e,orientation:o,views:t,themeMode:n})=>{const i=o==="horizontal"?c.Horizontal:c.Vertical;return!e||e.length===0?null:r.jsx(i,{width:"100%",...Qn[o],...t==null?void 0:t.container,children:r.jsx(Dt,{views:t,children:e.map(a=>r.jsx(Ft,{item:a,views:t},a.id))})})},mp=({items:e,children:o,orientation:t="vertical",size:n="md",variant:i="default",defaultActiveItemId:a=null,defaultExpandedItemIds:l=[],onItemActivate:d,views:s,...u})=>{const{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,triggerRefs:y}=sp(a,l);return r.jsx(dp,{value:{activeItemId:p,setActiveItemId:m,expandedItemIds:h,toggleExpandedItem:f,isItemExpanded:x,orientation:t,size:n,variant:i,onItemActivate:d,triggerRefs:y},children:e?r.jsx(pp,{items:e,orientation:t,size:n,variant:i,views:s,...u}):o})},Ze=mp;Ze.List=Dt;Ze.Item=Ft;Ze.Trigger=ea;Ze.Content=oa;Ze.Link=gp;const ta={},ra=g.createContext({views:ta,onRowClick:()=>{}}),hp=({children:e,views:o=ta,onRowClick:t})=>r.jsx(ra.Provider,{value:{views:o,onRowClick:t},children:e}),Re=()=>g.useContext(ra),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 na=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"table",borderCollapse:"collapse",...se.table,...o==null?void 0:o.table,...e})},aa=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"thead",textAlign:"left",...se.thead,...o==null?void 0:o.thead,...e})},ia=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"th",whiteSpace:"nowrap",...se.th,...o==null?void 0:o.th,...e})},Ro=e=>{const{views:o,onRowClick:t}=Re();return r.jsx(c.Element,{as:"tr",...se.tr,...o==null?void 0:o.tr,onClick:t,...e})},bt=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"td",whiteSpace:"nowrap",fontWeight:e.isFirstColumn?"500":"400",...se.td,...o==null?void 0:o.td,...e})},la=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"tbody",...se.tbody,...o==null?void 0:o.tbody,...e})},ca=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"tfoot",...se.tfoot,...o==null?void 0:o.tfoot,...e})},sa=e=>{const{views:o}=Re();return r.jsx(c.Element,{as:"caption",...se.caption,...o==null?void 0:o.caption,...e})},fp=({data:e,columns:o,footer:t,caption:n,themeMode:i})=>r.jsxs(na,{role:"Table",children:[n&&r.jsx(sa,{children:n}),r.jsx(aa,{children:r.jsx(Ro,{children:o.map(a=>r.jsx(ia,{children:a.title},a.field))})}),r.jsx(la,{children:e.map((a,l)=>r.jsx(Ro,{children:o.map((d,s)=>r.jsx(bt,{isFirstColumn:s===0,children:a[d.field]},d.field))},l))}),t&&r.jsx(ca,{children:r.jsx(Ro,{children:t.map((a,l)=>r.jsx(bt,{...a.props,children:a.value},l))})})]}),je=({children:e,views:o,onClick:t})=>r.jsx(hp,{views:o,onRowClick:t,children:e});je.Head=aa;je.HeadCell=ia;je.Body=la;je.Row=Ro;je.Cell=bt;je.Footer=ca;je.Caption=sa;je.Container=na;je.Template=fp;const xp=(e,o,t)=>{const n=u=>u.value!==void 0?u.value:u.title,i=()=>{if(!(!e||e.length===0)){if(o!==void 0){const u=e.find(p=>n(p)===o);if(u)return u}return e[0]}},[a,l]=g.useState(i()),d=t!==void 0?e.find(u=>n(u)===t):a,s=u=>{t===void 0&&l(u)};return g.useEffect(()=>{if(t!==void 0)return;const u=i(),p=a&&e.some(m=>n(m)===n(a));u&&(!p||o!==void 0&&a&&n(a)!==o)?l(u):!u&&a&&l(void 0)},[e,o]),{activeTab:d,setActiveTab:s}},bp=(e,o,t)=>{const[n,i]=g.useState(e||null);return{activeValue:o!==void 0?o:n,setActiveValue:d=>{o===void 0&&i(d),t&&t(d)}}},yp=({tab:e,isActive:o,onClick:t,iconPosition:n="left",tabStyles:i,textStyles:a})=>{const l={display:"flex",alignItems:"center",justifyContent:"center",padding:"12px 16px",cursor:"pointer",borderBottom:"2px solid",borderBottomColor:o?"theme-primary":"transparent",backgroundColor:"transparent",color:o?"theme-primary":"color-gray-600",fontWeight:o?"600":"500",marginBottom:"-1px",transition:"all 0.2s ease",on:{hover:{color:"theme-primary",borderBottomColor:o?"theme-primary":"color-gray-300"}}},d=()=>{switch(n){case"top":return"column";case"bottom":return"column-reverse";case"right":return"row-reverse";case"left":default:return"row"}},s=()=>["top","bottom"].includes(n)?"4px":"8px",u=e.icon&&g.isValidElement(e.icon)?g.cloneElement(e.icon,{strokeWidth:o?2.5:2}):e.icon;return r.jsxs(c.Element,{as:"div",role:"tab","aria-selected":o,tabIndex:o?0:-1,...l,...i,flexDirection:d(),gap:s(),onClick:t,"data-state":o?"active":"inactive",children:[u&&r.jsx(c.Element,{children:u},o?"active-icon":"inactive-icon"),r.jsxs(c.Element,{display:"grid",alignItems:"center",justifyContent:"center",children:[r.jsx(c.Text,{...a,fontWeight:"600",visibility:"hidden",gridColumn:"1",gridRow:"1","aria-hidden":"true",children:e.title}),r.jsx(c.Text,{...a,fontWeight:o?"600":"500",gridColumn:"1",gridRow:"1",children:e.title})]})]})},kp=({tabs:e=[],activeTab:o,handleTabClick:t,views:n={},renderTab:i,renderContent:a,iconPosition:l="left"})=>o?r.jsxs(c.Vertical,{width:"100%",height:"100%",...n.container,children:[r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...n.headerTabs,children:e.map(d=>{const s=(d.value!==void 0?d.value:d.title)===(o.value!==void 0?o.value:o.title),u=()=>t(d);return i?i(d,s,u):r.jsx(yp,{tab:d,isActive:s,onClick:u,iconPosition:l,tabStyles:{...n.tab,...s?n.activeTab:{}},textStyles:{...n.title,...s?n.activeText:{}}},d.title)})}),r.jsx(c.View,{width:"100%",height:"100%",...n.content,children:a?a(o):o.content})]}):null,da=g.createContext(null),ua=()=>{const e=g.useContext(da);if(!e)throw new Error("useTabsContext must be used within a Tabs component");return e},jp=({children:e,views:o})=>r.jsx(c.Horizontal,{width:"100%",borderBottom:"1px solid",borderBottomColor:"color-gray-200",...o==null?void 0:o.container,children:e}),Cp=({value:e,children:o,disabled:t=!1,views:n})=>{const{activeValue:i,setActiveValue:a}=ua(),l=i===e,d=()=>{t||a(e)};return r.jsx(c.View,{cursor:t?"not-allowed":"pointer",opacity:t?.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:t?{}:{color:"theme-primary"},onClick:d,...n==null?void 0:n.trigger,...l?n==null?void 0:n.activeState:{},children:o})},Sp=({value:e,children:o,views:t})=>{const{activeValue:n}=ua();return n!==e?null:r.jsx(c.View,{width:"100%",padding:"24px",...t==null?void 0:t.content,children:o})},wp=({tabs:e,views:o,defaultValue:t,onTabChange:n,renderTab:i,renderContent:a,iconPosition:l="left",value:d,onValueChange:s,children:u})=>{const p=bp(t,d,s),m=xp(e||[],t,d);if(u)return r.jsx(da.Provider,{value:p,children:u});if(e){const h=f=>{const x=y=>y.value!==void 0?y.value:y.title;(!m.activeTab||x(m.activeTab)!==x(f))&&(m.setActiveTab(f),n&&n(f))};return r.jsx(kp,{tabs:e,views:o,activeTab:m.activeTab,handleTabClick:h,renderTab:i,renderContent:a,iconPosition:l})}return null},Ip=g.memo(wp),Zo=Ip;Zo.List=jp;Zo.Trigger=Cp;Zo.Content=Sp;const Tp=e=>{const{children:o,_isInView:t=!1,alternateHighlightText:n=[],alternateAnimation:i=!1,alternateDuration:a=3e3,highlightText:l,highlightTypewriter:d=!1,highlightSlide:s=!1,highlightSlideDuration:u=500,highlightSlideStagger:p=50,highlightSlideSequential:m=!0}=e,[h,f]=g.useState(o),[x,y]=g.useState(l);return g.useEffect(()=>{if(!i||n.length===0||!t||typeof o!="string"||typeof l!="string")return f(o),y(l),()=>{};const b=o,k=l;let C=0;const S=w=>{const I=n[w],M=k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),z=new RegExp(M,"gi"),V=b.replace(z,I);f(V),y(I)};S(C);const j=setInterval(()=>{C=(C+1)%n.length,S(C)},a);return()=>clearInterval(j)},[i,n,a,l,o,t]),{finalDisplayedText:h,activeHighlightTarget:x,highlightTypewriter:d,highlightSlide:s,highlightSlideDuration:u,highlightSlideStagger:p,highlightSlideSequential:m}},Mp={xs:24,sm:36,md:48,lg:64,xl:72},zp={underline:e=>({textDecoration:"underline",textDecorationColor:e,textDecorationThickness:"4px",textUnderlineOffset:"4px"}),background:e=>({backgroundColor:e,color:"color-white",padding:"0 8px",borderRadius:"4px"}),gradient:(e,o)=>({background:`linear-gradient(135deg, ${e}, ${o||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:()=>({})},Rp=({text:e,typingSpeed:o=50,pauseTime:t=500,onComplete:n,showCursor:i=!0,cursorColor:a="currentColor",textStyle:l,textComponent:d,as:s,...u})=>{const p=d||c.Text,m=Array.isArray(e)?e:[e],[h,f]=g.useState(m.map(()=>"")),[x,y]=g.useState(!1),[b,k]=g.useState(0),[C,S]=g.useState(0);g.useEffect(()=>{f(m.map(()=>"")),y(!1),k(0),S(0)},[e]),g.useEffect(()=>{if(x){n&&n();return}const w=m[b];if(C>=w.length){if(b>=m.length-1){y(!0);return}const M=setTimeout(()=>{k(z=>z+1),S(0)},t);return()=>clearTimeout(M)}const I=setTimeout(()=>{f(M=>{const z=[...M];return z[b]=w.substring(0,C+1),z}),S(M=>M+1)},o);return()=>clearTimeout(I)},[m,b,C,x,n,t,o]);const j=w=>{if(!w||typeof w!="string")return w;const I=w.split("|");return I.length===1?w:I.map((M,z)=>r.jsxs(g.Fragment,{children:[M,z<I.length-1&&r.jsx("br",{})]},z))};return r.jsx(r.Fragment,{children:h.map((w,I)=>r.jsxs(g.Fragment,{children:[j(w),i&&I===b&&!x&&r.jsx(p,{as:"span",display:"inline-block",width:"0.1em",height:"1em",backgroundColor:a,animation:"blink 1s step-end infinite",verticalAlign:"text-bottom",marginLeft:"1px",...l})]},I))})},Vp=({text:e,duration:o=500,direction:t="up",stagger:n=50,sequential:i=!1,textStyle:a,as:l,wordProps:d,textComponent:s,...u})=>{const[p,m]=g.useState(e),[h,f]=g.useState("entering"),[x,y]=g.useState(0),b=s||c.Text,k=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{e===p&&h==="visible"||e!==p&&(h==="entering"||h==="visible"?(k.current=e,f("exiting")):h==="exiting"&&(k.current=e))},[e,p,h]);const{lines:S,totalWordCount:j}=g.useMemo(()=>{const W=p.split("|").map(H=>H.trim().split(/\s+/).filter(L=>L.length>0)),P=W.reduce((H,L)=>H+L.length,0);return{lines:W,totalWordCount:P}},[p]),w=g.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]),I=g.useMemo(()=>i?j*(o+n):(j-1)*n+o,[j,o,n,i]);g.useEffect(()=>(C.current&&clearTimeout(C.current),h==="entering"?C.current=setTimeout(()=>{f("visible")},w+50):h==="exiting"&&(C.current=setTimeout(()=>{k.current!==null&&(m(k.current),k.current=null),y(E=>E+1),f("entering")},I+50)),()=>{C.current&&clearTimeout(C.current)}),[h,w,I]);const{style:M,...z}=d||{},V=t==="up",$=E=>i?E*(o+n):E*n,T=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"bottom",whiteSpace:"nowrap",lineHeight:"normal",...a}),[a]),_=g.useMemo(()=>({display:"inline-flex",flexDirection:"column",alignItems:"center"}),[]),B=g.useMemo(()=>({display:"block",whiteSpace:"nowrap"}),[]);let R=0;return r.jsx(c.Element,{as:"span",style:T,...u,children:r.jsx("span",{style:_,children:S.map((E,W)=>r.jsx("span",{style:B,children:E.map((P,H)=>{const L=R++,A=$(L),F=H===E.length-1;let D;const O=`${o}ms`,v=`${A}ms`;h==="entering"?D=V?c.Animation.slideInUp({duration:O,delay:v,timingFunction:"ease-out",fillMode:"both"}):c.Animation.slideInDown({duration:O,delay:v,timingFunction:"ease-out",fillMode:"both"}):h==="exiting"&&(D=V?{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(-100%)",opacity:0},duration:O,delay:v,timingFunction:"ease-in",fillMode:"both"}:{from:{transform:"translateY(0)",opacity:1},to:{transform:"translateY(100%)",opacity:0},duration:O,delay:v,timingFunction:"ease-in",fillMode:"both"});const X={...M,display:"inline-block",marginRight:F?0:"0.25em",transform:h==="visible"?"translateY(0)":void 0,opacity:h==="visible"?1:void 0};return r.jsx(b,{as:"span",animate:D,...z,...X,children:P},`${x}-${W}-${H}`)})},`line-${W}`))})})};function fr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ct=e=>{if(!e||typeof e!="string")return e;const o=e.split("|");return o.length===1?e:o.map((t,n)=>r.jsxs(g.Fragment,{children:[t,n<o.length-1&&r.jsx("br",{})]},n))},Ep=({children:e,highlightText:o,highlightStyle:t="solid",highlightColor:n="theme-primary",highlightSecondaryColor:i,size:a="lg",views:l,highlightAnimate:d,animate:s,animationLoop:u=1,highlightAnimationLoop:p=1,highlightTypewriter:m=!1,highlightTypewriterDuration:h=3e3,highlightSlide:f=!1,highlightSlideDuration:x=500,highlightSlideStagger:y=50,highlightSlideSequential:b=!0,themeMode:k,...C})=>{const{ref:S,inView:j}=c.useInView(),{finalDisplayedText:w,activeHighlightTarget:I,highlightTypewriter:M,highlightSlide:z,highlightSlideDuration:V,highlightSlideStagger:$,highlightSlideSequential:T}=Tp({children:e,highlightText:o,_isInView:j,highlightTypewriter:m,highlightSlide:f,highlightSlideDuration:x,highlightSlideStagger:y,highlightSlideSequential:b,...C}),_=Mp[a],B=zp[t](n,i),R=(A,F)=>A&&(Array.isArray(A)?A.map(D=>({...D,iterationCount:F.toString()})):{...A,iterationCount:F.toString()}),E=R(s,u),W=R(d,p),P=typeof w=="string"?w:typeof e=="string"?e:"",H={ref:S,animate:j?E:void 0,as:"h1",fontSize:_},L=A=>!j&&(M||z)?r.jsx("span",{style:{opacity:0},children:A}):M?r.jsx(Rp,{text:A,typingSpeed:Math.max(30,h/(A.length*10)),cursorColor:"currentColor",...B}):z?r.jsx(Vp,{text:A,duration:V,stagger:$,sequential:T,direction:"up",fontSize:_,wordProps:B}):ct(A);if(typeof P=="string"&&I){const A=Array.isArray(I)?new RegExp(`(${I.map(v=>fr(String(v))).join("|")})`,"gi"):new RegExp(`(${fr(String(I))})`,"gi"),F=[];let D=0,O;for(;O=A.exec(P);)O.index>D&&F.push(P.substring(D,O.index)),F.push({highlight:!0,text:O[0]}),D=O.index+O[0].length;return D<P.length&&F.push(P.substring(D)),r.jsx(c.Element,{...H,...l==null?void 0:l.container,...C,children:F.map((v,X)=>typeof v=="string"?r.jsx(c.Text,{as:"span",display:"inline",...l==null?void 0:l.text,children:ct(v)},`text-${X}`):r.jsx(c.Text,{as:"span",display:"inline",animate:j?W:void 0,...z?{}:B,...l==null?void 0:l.highlight,children:L(v.text)},`highlight-${X}`))})}return t&&!I?r.jsx(c.Element,{...H,...C,...l==null?void 0:l.container,children:r.jsx(c.Text,{as:"span",display:"inline",animate:j?W:void 0,...z?{}:B,...l==null?void 0:l.highlight,children:L(P)})}):r.jsx(c.Text,{...H,...C,...l==null?void 0:l.container,...l==null?void 0:l.text,children:ct(P)})},Pp=e=>r.jsx(Ep,{...e}),Wp=Pp,_p=({items:e,shape:o,variant:t,onToggleChange:n})=>{const{activeToggles:i,setActiveToggles:a}=Fn();return r.jsx(qn,{items:e,shape:o,variant:t,activeToggles:i,setActiveToggles:a,onToggleChange:n})},$p=_p,Hp=({items:e,onChange:o})=>{const[t,n]=g.useState(e),[i,a]=g.useState(null),[l,d]=g.useState(null),s=g.useRef({x:0,y:0}),u=g.useRef([]),p=g.useCallback((f,x)=>{f.preventDefault(),document.body.style.cursor="grabbing";const y="touches"in f?f.touches[0].clientX:f.clientX,b="touches"in f?f.touches[0].clientY:f.clientY;s.current={x:y,y:b},d(x),a(t[x])},[t]),m=g.useCallback(f=>{if(l===null)return;const x="touches"in f?f.touches[0].clientX:f.clientX,y="touches"in f?f.touches[0].clientY:f.clientY,b=u.current[l];if(!b)return;const k=x-s.current.x,C=y-s.current.y;b.style.transform=`translate(${k}px, ${C}px)`,b.style.zIndex="1000";const S=u.current.findIndex((j,w)=>{if(!j||w===l)return!1;const I=j.getBoundingClientRect();return y>=I.top&&y<=I.bottom});if(S!==-1&&S!==l){const j=[...t],[w]=j.splice(l,1);j.splice(S,0,w),n(j),d(S),o==null||o(j),s.current={x,y}}},[l,t,o]),h=g.useCallback(()=>{document.body.style.cursor="",u.current.forEach(f=>{f&&(f.style.transform="",f.style.zIndex="")}),d(null),a(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:t,draggedItem:i,draggedIndex:l,itemRefs:u,handleDragStart:p}},Bp=({items:e,renderItem:o,containerProps:t,itemProps:n,draggedIndex:i,itemRefs:a,handleDragStart:l,views:d,themeMode:s})=>r.jsx(c.View,{overflow:"hidden",position:"relative",...t,...d==null?void 0:d.container,children:e.map((u,p)=>r.jsx(c.View,{ref:m=>a.current[p]=m,onMouseDown:m=>l(m,p),onTouchStart:m=>l(m,p),position:"relative",cursor:"grab",transition:"transform 0.2s",...n,...d==null?void 0:d.item,children:o?o(u,p):u},p))}),ga=e=>{const{items:o,draggedIndex:t,itemRefs:n,handleDragStart:i}=Hp(e);return r.jsx(Bp,{...e,items:o,draggedIndex:t,itemRefs:n,handleDragStart:i})},Lp=ga,Ap=({onFileSelect:e,onMultipleFileSelect:o,validateFile:t,accept:n,multiple:i,disabled:a,previewUrl:l})=>{const[d,s]=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 f=g.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),x=g.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!1)},[a]),y=g.useCallback(j=>{j.preventDefault(),j.stopPropagation(),!a&&s(!0)},[a]),b=g.useCallback(j=>{if(!j||j.length===0)return;const w=Array.from(j);if(!i&&w.length>0){const I=w[0];if(I.type.startsWith("image/")){const M=URL.createObjectURL(I);p(z=>(z&&URL.revokeObjectURL(z),M))}else p(null)}i?o&&o(w):w.length>0&&e&&e(w[0])},[i,o,e]),k=g.useCallback(j=>{j.preventDefault(),j.stopPropagation(),s(!1),!a&&j.dataTransfer.files&&j.dataTransfer.files.length>0&&(b(j.dataTransfer.files),j.dataTransfer.clearData())},[a,b]),C=g.useCallback(()=>{var j;a||(j=m.current)==null||j.click()},[a]),S=g.useCallback(j=>{b(j.target.files),j.target.value&&(j.target.value="")},[b]);return{isDragActive:d,handleDragEnter:f,handleDragLeave:x,handleDragOver:y,handleDrop:k,handleClick:C,handleFileChange:S,inputRef:m,preview:h}},Dp={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)"}},pa=({files:e,sandboxId:o,onRemove:t,layout:n="inline",maxHeight:i="120px",showPreviews:a=!1,views:l={}})=>{if(e.length===0)return null;const d=g.useCallback(s=>s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`,[]);return r.jsx(c.View,{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 0",maxHeight:i,overflowY:"auto",...l==null?void 0:l.container,children:e.map((s,u)=>{const p=URL.createObjectURL(s)||(s==null?void 0:s.path)||(s==null?void 0:s.url)||"",m=s.type.startsWith("image/"),h=s.type.startsWith("video/"),f=s.type.startsWith("audio/");return r.jsx(c.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:a&&r.jsxs(fe,{children:[r.jsxs(fe.Trigger,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,width:"60px",height:"60px",objectFit:"cover"}),h&&r.jsx(c.View,{as:"video",src:p,alt:s.name,controls:!1,muted:!0,width:"60px",height:"60px",objectFit:"cover"}),f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(Fo,{widthHeight:24,color:"color-black"})}),!m&&!h&&!f&&r.jsx(c.Center,{width:"60px",height:"60px",backgroundColor:"color-gray-200",children:r.jsx(uo,{widthHeight:24,color:"color-black"})}),t&&r.jsx(c.Button,{...Dp,onClick:x=>{x.stopPropagation(),t(u)},"aria-label":`Remove ${s.name}`,children:"×"})]}),r.jsxs(fe.Content,{children:[m&&r.jsx(c.Image,{src:p,alt:s.name,maxWidth:"100%"}),h&&r.jsx(c.View,{as:"video",src:p,controls:!0,maxWidth:"100%"}),f&&r.jsx(c.View,{as:"audio",src:p,controls:!0,width:"100%"}),r.jsxs(c.Text,{marginTop:"4px",truncateText:!0,textOverflow:"ellipsis",overflow:"hidden",width:"100%",...l==null?void 0:l.name,children:[s.name," (",d(s.size),")"]})]})]})},u)})})},Fp=({children:e,text:o="Drop files here or click to upload",textProps:t,containerProps:n,disabled:i,accept:a,multiple:l,isDragActive:d,handleDragEnter:s,handleDragLeave:u,handleDragOver:p,handleDrop:m,handleClick:h,handleFileChange:f,inputRef:x,preview:y,imageProps:b,selectedFiles:k,onRemove:C})=>r.jsxs(c.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:i?"not-allowed":"pointer",opacity:i?.6:1,onClick:h,onDragEnter:s,onDragLeave:u,onDragOver:p,onDrop:m,transition:"all 0.2s ease-in-out",overflow:"hidden",position:"relative",padding:16,...n,children:[r.jsx("input",{type:"file",ref:x,onChange:f,accept:a,multiple:l,style:{display:"none"},disabled:i}),y&&!l?r.jsxs(c.View,{width:"100%",height:"200px",position:"relative",children:[r.jsx(c.Image,{src:y,alt:"Preview",width:"100%",height:"100%",objectFit:"contain",...b}),r.jsx(c.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:r.jsx(c.Text,{color:"white",fontWeight:600,children:"Click to replace"})})]}):r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[e||r.jsxs(c.View,{flexDirection:"column",alignItems:"center",width:"100%",children:[r.jsx(Vt,{widthHeight:40,color:d?"primary":"rgba(0,0,0,0.4)"}),r.jsx(c.Text,{marginTop:16,color:d?"primary":"rgba(0,0,0,0.6)",fontWeight:500,textAlign:"center",...t,children:o})]}),l&&k&&k.length>0&&r.jsx(c.View,{marginTop:16,width:"100%",children:r.jsx(pa,{files:k,onRemove:C||(()=>{}),showPreviews:!0,layout:"inline",maxHeight:"160px"})})]})]}),Op=e=>{const o=Ap(e);return r.jsx(Fp,{...e,...o})},qp=(e=!1)=>{const[o,t]=g.useState(e),[n,i]=g.useState(null);return g.useEffect(()=>{const a=s=>{!s.composedPath().some(m=>(m==null?void 0:m.id)==="dropdown-menu"||(m==null?void 0:m.id)==="dropdown-trigger")&&o&&(t(!1),i(null))},l=()=>{o&&(t(!1),i(null))},d=s=>{s.key==="Escape"&&o&&(t(!1),i(null))};return document.addEventListener("mousedown",a),window.addEventListener("resize",l),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",a),window.removeEventListener("resize",l),document.removeEventListener("keydown",d)}},[o]),{isOpen:o,setIsOpen:t,activeSubmenuId:n,setActiveSubmenuId:i}},Np={sm:{padding:"6px 8px",fontSize:"14px",minWidth:"160px"},md:{padding:"8px 12px",fontSize:"16px",minWidth:"180px"},lg:{padding:"10px 16px",fontSize:"18px",minWidth:"200px"}},Up={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"}},Gp={hover:{backgroundColor:"color-gray-100"}},ma=g.createContext({isOpen:!1,setIsOpen:()=>{},activeSubmenuId:null,setActiveSubmenuId:()=>{},size:"md",variant:"default",triggerRef:{current:null}}),Yp=({children:e,value:o})=>r.jsx(ma.Provider,{value:o,children:e}),Ot=()=>{const e=g.useContext(ma);if(!e)throw new Error("useDropdownMenuContext must be used within a DropdownMenuProvider");return e},ha=({children:e,views:o,...t})=>{const{isOpen:n,setIsOpen:i,triggerRef:a}=Ot(),l=d=>{d.stopPropagation(),i(!n)};return r.jsx(c.View,{ref:a,id:"dropdown-trigger",onClick:l,cursor:"pointer",position:"relative",display:"inline-block",...o==null?void 0:o.container,...t,children:e})},qt=({items:e,side:o="bottom",align:t="start",views:n,...i})=>{const{isOpen:a,variant:l,triggerRef:d}=Ot(),s=g.useRef(null),{ref:u,relation:p}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[m,h]=g.useState({x:0,y:0,placement:o});if(g.useEffect(()=>{d.current&&u&&(u.current=d.current)},[d,u,a]),g.useEffect(()=>{if(a&&s.current&&d.current){const y=d.current.getBoundingClientRect();let b=o;p&&(o==="bottom"&&p.space.vertical==="top"?b="top":o==="top"&&p.space.vertical==="bottom"?b="bottom":o==="right"&&p.space.horizontal==="left"?b="left":o==="left"&&p.space.horizontal==="right"&&(b="right"));let k=0,C=0;switch(b){case"bottom":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,C=y.bottom+8;break;case"top":k=t==="start"?y.left:t==="end"?y.right-180:y.left+y.width/2-90,C=y.top-8;break;case"right":k=y.right+8,C=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break;case"left":k=y.left-8,C=t==="start"?y.top:t==="end"?y.bottom-100:y.top+y.height/2-50;break}h({x:k,y:C,placement:b})}},[a,o,t,d,p]),!a)return null;const x=(()=>{const y={position:"fixed",left:m.x,top:m.y,zIndex:1e3};switch(m.placement){case"top":return{...y,transform:"translateY(-100%)"};case"left":return{...y,transform:"translateX(-100%)"};case"bottom":case"right":default:return y}})();return r.jsx(c.View,{ref:s,id:"dropdown-menu",borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",overflow:"hidden",style:x,...Up[l],...n==null?void 0:n.menu,...i,children:e.map((y,b)=>y.divider?r.jsx(xa,{views:n},`divider-${b}`):r.jsx(fa,{item:y,views:n},y.id))})},fa=({item:e,views:o,...t})=>{const{activeSubmenuId:n,setActiveSubmenuId:i,size:a}=Ot(),[l,d]=g.useState(!1),s=e.items&&e.items.length>0,u=n===e.id,p=g.useRef(null),m=()=>{d(!0),s&&i(e.id)},h=()=>{d(!1)},f=x=>{x.stopPropagation(),!e.disabled&&!s&&e.onClick&&e.onClick()};return r.jsxs(c.View,{ref:p,display:"flex",alignItems:"center",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,position:"relative",...Np[a],_hover:e.disabled?{}:Gp.hover,backgroundColor:l&&!e.disabled?"color-gray-100":"transparent",onMouseEnter:m,onMouseLeave:h,onClick:f,...o==null?void 0:o.item,...t,children:[e.icon&&r.jsx(c.View,{marginRight:8,...o==null?void 0:o.icon,children:e.icon}),r.jsx(c.View,{flexGrow:1,children:e.label}),s&&r.jsx(c.View,{marginLeft:8,...o==null?void 0:o.submenuIndicator,children:r.jsx(ae,{orientation:"right",widthHeight:16,color:"currentColor",filled:!0})}),u&&s&&r.jsx(qt,{items:e.items||[],side:"right",align:"start",views:o})]})},xa=({views:e,...o})=>r.jsx(c.View,{height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.divider,...o}),vp=({trigger:e,items:o,side:t="bottom",align:n="start",views:i,themeMode:a,...l})=>r.jsxs(c.View,{position:"relative",display:"inline-block",...i==null?void 0:i.container,...l,children:[r.jsx(ha,{views:i,children:e}),r.jsx(qt,{items:o,side:t,align:n,views:i})]}),Xp=({trigger:e,items:o,size:t="md",variant:n="default",side:i="bottom",align:a="start",defaultOpen:l=!1,views:d,...s})=>{const{isOpen:u,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h}=qp(l),f=g.useRef(null);return r.jsx(Yp,{value:{isOpen:u,setIsOpen:p,activeSubmenuId:m,setActiveSubmenuId:h,size:t,variant:n,triggerRef:f},children:r.jsx(vp,{trigger:e,items:o,side:i,align:a,views:d,...s})})},bo=Xp;bo.Trigger=ha;bo.Content=qt;bo.Item=fa;bo.Divider=xa;const Kp=e=>{const{value:o,defaultValue:t="",onChange:n,onChangeComplete:i,isOpen:a,onOpen:l,onClose:d,closeOnSelect:s=!0,maxRecentColors:u=8,showRecentColors:p=!0}=e,[m,h]=g.useState(a??!1),[f,x]=g.useState(o??t),[y,b]=g.useState(""),[k,C]=g.useState([]),S=g.useRef(null),j=g.useRef(null);g.useEffect(()=>{o!==void 0&&x(o)},[o]),g.useEffect(()=>{a!==void 0&&h(a)},[a]),g.useEffect(()=>{if(p){const T=localStorage.getItem("colorPicker-recentColors");if(T)try{C(JSON.parse(T))}catch{}}},[p]),g.useEffect(()=>{const T=_=>{m&&S.current&&j.current&&!S.current.contains(_.target)&&!j.current.contains(_.target)&&$()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[m]);const w=g.useCallback(T=>{p&&C(_=>{const B=_.filter(E=>E!==T),R=[T,...B].slice(0,u);return localStorage.setItem("colorPicker-recentColors",JSON.stringify(R)),R})},[p,u]),I=g.useCallback(()=>{const T=!m;h(T),T?l==null||l():d==null||d()},[m,l,d]),M=g.useCallback(T=>{x(T),w(T),n==null||n(T),i==null||i(T),s&&(h(!1),d==null||d())},[n,i,s,d,w]),z=g.useCallback(T=>{b(T)},[]),V=g.useCallback(()=>{y&&(M(y),b(""))},[y,M]),$=g.useCallback(()=>{h(!1),d==null||d()},[d]);return{isOpen:m,selectedColor:f,recentColors:k,customColor:y,handleToggle:I,handleColorSelect:M,handleCustomColorChange:z,handleCustomColorSubmit:V,handleClose:$,triggerRef:S,dropdownRef:j}},Oe={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"}},Qp={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"}},Zp={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},Jp={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"}},em=[{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"}],om=({id:e,name:o,label:t,placeholder:n="Select a color",helperText:i,views:a={},size:l="md",shape:d="default",variant:s="default",error:u=!1,isDisabled:p=!1,isReadOnly:m=!1,predefinedColors:h=em,showCustomInput:f=!0,showRecentColors:x=!0,isOpen:y,selectedColor:b,recentColors:k,customColor:C,handleToggle:S,handleColorSelect:j,handleCustomColorChange:w,handleCustomColorSubmit:I,triggerRef:M,dropdownRef:z,onChange:V,...$})=>{const{getColor:T}=c.useTheme(),_={...Oe.container,...a==null?void 0:a.container},B={...Oe.trigger,...Qp[l],...Zp[d],...Jp[s],...u&&{borderColor:"color-red-500"},...p&&{opacity:.6,cursor:"not-allowed"},...a==null?void 0:a.trigger},R={...Oe.dropdown,...a==null?void 0:a.dropdown},E={...Oe.colorGrid,...a==null?void 0:a.colorGrid},W={...Oe.recentColors,...a==null?void 0:a.recentColors},P=b||"color-gray-200";return r.jsxs(c.View,{..._,...$,children:[t&&r.jsx(c.Text,{fontSize:l==="xs"?"12px":l==="sm"?"14px":"16px",fontWeight:"500",color:"color-gray-700",marginBottom:"4px",...a==null?void 0:a.label,children:t}),r.jsxs(c.View,{ref:M,onClick:p||m?void 0:S,...B,children:[r.jsxs(c.Horizontal,{alignItems:"center",gap:8,children:[r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:P,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300"}),r.jsx(c.Text,{color:b?"color-gray-800":"color-gray-500",fontSize:"inherit",children:b||n})]}),!m&&!p&&r.jsx(ae,{widthHeight:16,color:"color-gray-500",orientation:y?"up":"down"})]}),y&&r.jsxs(c.View,{ref:z,...R,children:[r.jsx(c.View,{...E,children:h.map((H,L)=>r.jsx(c.View,{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:H.value,borderWidth:"2px",borderStyle:"solid",borderColor:b===H.value?"color-blue-500":"transparent",cursor:"pointer",transition:"all 0.2s ease",onClick:()=>j(H.value),title:H.name,_hover:{transform:"scale(1.1)",borderColor:"color-gray-400"},...a==null?void 0:a.colorSwatch},L))}),f&&r.jsxs(c.View,{...Oe.customInput,...a==null?void 0:a.customInput,children:[r.jsxs(c.Horizontal,{gap:8,alignItems:"center",marginBottom:"8px",children:[r.jsx("input",{type:"color",value:C||"#000000",onChange:H=>{const L=H.target.value;w(L),j(L)},style:{width:"40px",height:"32px",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent"},title:"Pick a color"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",children:"Use native color picker"})]}),r.jsx(fo,{placeholder:"Enter hex color (e.g., #ff0000)",value:C,onChange:H=>w(H.target.value),onKeyPress:H=>{H.key==="Enter"&&I()},size:"sm",right:C&&r.jsx(c.View,{width:"16px",height:"16px",borderRadius:"2px",backgroundColor:C,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:I})})]}),x&&k.length>0&&r.jsxs(c.View,{...W,children:[r.jsx(c.Text,{fontWeight:"500",color:"color-gray-600",marginBottom:"8px",children:"Recent Colors"}),r.jsx(c.Horizontal,{gap:8,flexWrap:"wrap",children:k.map((H,L)=>r.jsx(c.View,{width:"20px",height:"20px",borderRadius:"4px",backgroundColor:H,borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-300",cursor:"pointer",onClick:()=>j(H),title:H,_hover:{transform:"scale(1.1)"}},L))})]})]}),i&&r.jsx(c.Text,{color:u?"color-red-500":"color-gray-600",marginTop:"4px",...a==null?void 0:a.helperText,children:i})]})},tm=e=>{const o=Kp(e);return r.jsx(om,{...o,...e})},rm=tm,nm=e=>{const o=Gn(e);return r.jsx(Yn,{...o,...e})},am=nm,im=e=>{const o=Nn(e);return r.jsx(Un,{...o,...e})},lm=im,cm=(e=null,o=null)=>{const[t,n]=g.useState(e),[i,a]=g.useState(o),l=s=>i===s,d=s=>{a(u=>u===s?null:s)};return g.useEffect(()=>{const s=p=>{!p.composedPath().some(f=>(f==null?void 0:f.id)==="menubar-content"||(f==null?void 0:f.id)==="menubar-trigger")&&i!==null&&a(null)},u=p=>{p.key==="Escape"&&i!==null&&a(null)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",u)}},[i]),{activeMenuId:t,setActiveMenuId:n,openMenuId:i,setOpenMenuId:a,isMenuOpen:l,toggleMenu:d}},ba={sm:{padding:"6px 10px",fontSize:"14px"},md:{padding:"8px 12px",fontSize:"16px"},lg:{padding:"10px 16px",fontSize:"18px"}},sm={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"}},dm={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Vo={active:{backgroundColor:"color-gray-200",fontWeight:"bold"},hover:{backgroundColor:"color-gray-100"},disabled:{opacity:.5,cursor:"not-allowed"}},ya=g.createContext({activeMenuId:null,setActiveMenuId:()=>{},openMenuId:null,setOpenMenuId:()=>{},isMenuOpen:()=>!1,toggleMenu:()=>{},orientation:"horizontal",size:"md",variant:"default",triggerRefs:{current:{}}}),Jo=()=>g.useContext(ya),um=({value:e,children:o})=>r.jsx(ya.Provider,{value:e,children:o}),ka=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",views:i,...a})=>{const l=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(l,{role:"menubar","aria-orientation":o,...dm[o],...sm[n],...i==null?void 0:i.container,...a,children:e})},ja=({children:e,id:o,disabled:t=!1,views:n})=>{const{orientation:i}=Jo(),a=i==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(a,{role:"none",position:"relative",opacity:t?.5:1,pointerEvents:t?"none":"auto",...n==null?void 0:n.menu,children:g.Children.map(e,l=>g.isValidElement(l)?g.cloneElement(l,{...l.props,menuId:o}):l)})},Ca=({children:e,menuId:o,disabled:t=!1,views:n})=>{const{activeMenuId:i,setActiveMenuId:a,toggleMenu:l,isMenuOpen:d,size:s,triggerRefs:u}=Jo(),p=g.useRef(null),m=i===o,h=d(o);g.useEffect(()=>(p.current&&o&&(u.current[o]=p.current),()=>{o&&delete u.current[o]}),[o,u]);const f=()=>{t||(a(o),l(o))};return r.jsx(c.View,{ref:p,id:"menubar-trigger",role:"menuitem","aria-haspopup":"true","aria-expanded":h,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",...ba[s],...m?Vo.active:{},...t?Vo.disabled:{},_hover:t?{}:Vo.hover,onClick:f,...n==null?void 0:n.trigger,children:e})},Sa=({children:e,menuId:o,views:t})=>{const{isMenuOpen:n,orientation:i,triggerRefs:a}=Jo(),l=g.useRef(null),[d,s]=g.useState({x:0,y:0,placement:i==="horizontal"?"bottom":"right"}),u=n(o);if(g.useEffect(()=>{if(u&&l.current&&o&&a.current[o]){const m=l.current.getBoundingClientRect(),h=a.current[o].getBoundingClientRect(),f=Math.max(m.width||200,200),x=Math.max(m.height||150,150),y=window.innerWidth,b=window.innerHeight,k={top:h.top,right:y-h.right,bottom:b-h.bottom,left:h.left},C=i==="horizontal"?[{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8},{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top}]:[{placement:"right",space:k.right,fits:k.right>=f+8,x:h.right+8,y:h.top},{placement:"left",space:k.left,fits:k.left>=f+8,x:h.left-f-8,y:h.top},{placement:"bottom",space:k.bottom,fits:k.bottom>=x+8,x:h.left,y:h.bottom+8},{placement:"top",space:k.top,fits:k.top>=x+8,x:h.left,y:h.top-x-8}],S=C.find(M=>M.fits);if(S){s({x:S.x,y:S.y,placement:S.placement});return}const j=C.reduce((M,z)=>z.space>M.space?z:M);let w=j.x,I=j.y;w+f>y&&(w=y-f-8),w<8&&(w=8),I+x>b&&(I=b-x-8),I<8&&(I=8),s({x:w,y:I,placement:j.placement})}},[u,i,o,a]),!u)return null;const p={position:"fixed",left:d.x,top:d.y,zIndex:1e3};return r.jsx(c.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,...t==null?void 0:t.content,children:e})},wa=({children:e,icon:o,disabled:t=!1,onClick:n,views:i})=>{const{size:a}=Jo(),l=()=>{t||!n||n()};return r.jsxs(c.View,{role:"menuitem",cursor:t?"not-allowed":"pointer",userSelect:"none",display:"flex",alignItems:"center",opacity:t?.5:1,...ba[a],_hover:t?{}:Vo.hover,onClick:l,...i==null?void 0:i.item,children:[o&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:o}),e]})},Ia=({views:e})=>r.jsx(c.View,{role:"separator",height:"1px",backgroundColor:"color-gray-200",margin:"4px 0",...e==null?void 0:e.separator}),gm=({items:e,orientation:o,size:t,variant:n,views:i,themeMode:a})=>r.jsx(ka,{orientation:o,size:t,variant:n,views:i,children:e.map(l=>r.jsxs(ja,{id:l.id,disabled:l.disabled,views:i,children:[r.jsxs(Ca,{menuId:l.id,views:i,children:[l.icon&&r.jsx(c.View,{marginRight:8,...i==null?void 0:i.icon,children:l.icon}),l.label]}),l.items&&l.items.length>0&&r.jsx(Sa,{menuId:l.id,views:i,children:l.items.map((d,s)=>d.separator?r.jsx(Ia,{views:i},`separator-${s}`):r.jsx(wa,{id:d.id,icon:d.icon,disabled:d.disabled,onClick:d.onClick,views:i,children:d.label},d.id))})]},l.id))}),pm=({items:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultActiveMenuId:i=null,defaultOpenMenuId:a=null,views:l,...d})=>{const{activeMenuId:s,setActiveMenuId:u,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f}=cm(i,a),x=g.useRef({});return r.jsx(um,{value:{activeMenuId:s,setActiveMenuId:u,openMenuId:p,setOpenMenuId:m,isMenuOpen:h,toggleMenu:f,orientation:o,size:t,variant:n,triggerRefs:x},children:r.jsx(gm,{items:e,orientation:o,size:t,variant:n,views:l,...d})})},Be=pm;Be.Root=ka;Be.Menu=ja;Be.Trigger=Ca;Be.Content=Sa;Be.Item=wa;Be.Separator=Ia;const mm=(e,o,t)=>{const[n,i]=g.useState([]);return g.useEffect(()=>{i((()=>{const l=[];if(o<=t)for(let d=1;d<=o;d++)l.push(d);else{l.push(1);let d=Math.max(2,e-Math.floor((t-2)/2)),s=Math.min(o-1,d+t-3);s>=o-1&&(s=o-1,d=Math.max(2,s-(t-3))),d>2&&l.push("...");for(let u=d;u<=s;u++)l.push(u);s<o-1&&l.push("..."),l.push(o)}return l})())},[e,o,t]),{visiblePageNumbers:n}},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"}}}},ao={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"}}},io={rounded:{borderRadius:"4px"},square:{borderRadius:"0px"},circular:{borderRadius:"50%"}},hm={backgroundColor:"color-blue-500",color:"color-white",_hover:{backgroundColor:"color-blue-600"}},Io={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},fm=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"100 / page",value:100}],onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:p="md",variant:m="default",shape:h="rounded",visiblePageNumbers:f,views:x,...y})=>{const b=S=>{S<1||S>o||S===e||t(S)},k=S=>{a&&a(Number(S.target.value))},C=(S,j)=>{if(S==="...")return r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",...qe[p],...x==null?void 0:x.ellipsis,children:"..."},`ellipsis-${j}`);const w=S===e;return r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:w?"default":"pointer",...qe[p],...ao[m],...io[h],...w?hm:{},onClick:()=>b(S),"aria-label":`Page ${S}`,"aria-current":w?"page":void 0,...w?x==null?void 0:x.activePageButton:x==null?void 0:x.pageButton,children:S},`page-${S}`)};return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,...x==null?void 0:x.container,...y,children:[u&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...ao[m],...io[h],...e===1?Io:{},onClick:()=>b(1),"aria-label":"First page",disabled:e===1,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"left",widthHeight:16}),r.jsx(ae,{orientation:"left",widthHeight:16,marginLeft:"-8px"})]}),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===1?"not-allowed":"pointer",...qe[p],...ao[m],...io[h],...e===1?Io:{},onClick:()=>b(e-1),"aria-label":"Previous page",disabled:e===1,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"left",widthHeight:16})}),f.map((S,j)=>C(S,j)),r.jsx(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...qe[p],...ao[m],...io[h],...e===o?Io:{},onClick:()=>b(e+1),"aria-label":"Next page",disabled:e===o,...x==null?void 0:x.navigationButton,children:r.jsx(ae,{orientation:"right",widthHeight:16})}),u&&r.jsxs(c.View,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",cursor:e===o?"not-allowed":"pointer",...qe[p],...ao[m],...io[h],...e===o?Io:{},onClick:()=>b(o),"aria-label":"Last page",disabled:e===o,...x==null?void 0:x.navigationButton,children:[r.jsx(ae,{orientation:"right",widthHeight:16}),r.jsx(ae,{orientation:"right",widthHeight:16,marginLeft:"-8px"})]}),d&&r.jsxs(c.Text,{marginLeft:16,color:"color-gray-600",...x==null?void 0:x.pageInfo,children:["Page ",e," of ",o]}),l&&a&&r.jsx(c.View,{as:"select",marginLeft:16,padding:"4px 8px",borderRadius:"4px",borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"color-white",cursor:"pointer",value:n,onChange:k,...x==null?void 0:x.pageSizeSelector,children:i.map(S=>r.jsx("option",{value:S.value,children:S.label},S.value))})]})},xm=({currentPage:e,totalPages:o,onPageChange:t,pageSize:n=10,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l=!1,showPageInfo:d=!0,maxPageButtons:s=5,showFirstLastButtons:u=!1,size:p="md",variant:m="default",shape:h="rounded",views:f,...x})=>{const{visiblePageNumbers:y}=mm(e,o,s);return r.jsx(fm,{currentPage:e,totalPages:o,onPageChange:t,pageSize:n,pageSizeOptions:i,onPageSizeChange:a,showPageSizeSelector:l,showPageInfo:d,maxPageButtons:s,showFirstLastButtons:u,size:p,variant:m,shape:h,visiblePageNumbers:y,views:f,...x})},bm=xm,ym=({shape:e="linear",value:o=0,max:t=100,color:n="theme-primary",backgroundColor:i="color-gray-200",height:a,size:l,radius:d=4,strokeWidth:s=10,showLabel:u=!1,labelColor:p="theme-text-primary",animated:m=!0,animationDuration:h="0.5s",views:f,themeMode:x,...y})=>{const{getColor:b,themeMode:k}=c.useTheme(),C=x||k,j=Math.min(t,Math.max(0,o))/t*100,w=b(i,{themeMode:C}),I=b(n,{themeMode:C});if(e==="circle"){const z=l||(typeof a=="number"?a:100),V=(z-s)/2,$=2*Math.PI*V,T=$-j/100*$;return r.jsxs(c.View,{width:z,height:z,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",...f==null?void 0:f.container,...y,children:[r.jsxs("svg",{width:z,height:z,viewBox:`0 0 ${z} ${z}`,style:{transform:"rotate(-90deg)"},children:[r.jsx("circle",{cx:z/2,cy:z/2,r:V,stroke:w,strokeWidth:s,fill:"transparent",...f==null?void 0:f.track}),r.jsx("circle",{cx:z/2,cy:z/2,r:V,stroke:I,strokeWidth:s,strokeDasharray:$,strokeDashoffset:T,strokeLinecap:"round",fill:"transparent",style:{transition:m?`stroke-dashoffset ${h} ease-in-out`:"none"},...f==null?void 0:f.indicator})]}),u&&r.jsx(c.View,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",children:r.jsxs(c.Text,{color:p,fontSize:`${z*.2}px`,fontWeight:"bold",...f==null?void 0:f.text,children:[Math.round(j),"%"]})})]})}const M=a||8;return r.jsx(c.View,{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":t,width:"100%",height:M,backgroundColor:w,borderRadius:d,overflow:"hidden",...f==null?void 0:f.container,...y,children:r.jsx(c.View,{width:`${j}%`,height:"100%",backgroundColor:I,borderRadius:d,style:{transition:m?`width ${h} ease-in-out`:"none"},...f==null?void 0:f.bar})})},km=e=>r.jsx(ym,{...e}),jm=km,Cm=e=>({solid:"solid",dashed:"dashed",dotted:"dotted"}),Sm=Cm(),wm={thin:"1px",medium:"2px",thick:"4px"},lo={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"}},Im=({orientation:e="horizontal",variant:o="solid",thickness:t="thin",color:n,spacing:i="0px",label:a,decorative:l=!1,views:d,themeMode:s,...u})=>{const{themeMode:p}=c.useTheme(),m=n||"color-gray-200",h=Sm[o],f=wm[t],x=l?{"aria-hidden":!0}:{role:"separator","aria-orientation":e};return a&&e==="horizontal"?r.jsxs(c.Horizontal,{alignItems:"center",justifyContent:"center",width:"100%",padding:i,...x,...u,children:[r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...lo.container,...d==null?void 0:d.container}),r.jsx(c.Text,{...lo.label,...d==null?void 0:d.label,children:a}),r.jsx(c.View,{height:"0px",flexGrow:1,borderTopWidth:f,borderTopStyle:h,borderTopColor:m,...lo.container,...d==null?void 0:d.container})]}):e==="horizontal"?r.jsx(c.View,{height:"0px",width:"100%",borderTopWidth:f,borderTopStyle:h,borderTopColor:m,padding:i,...lo.container,...x,...d==null?void 0:d.container,...u}):r.jsx(c.View,{width:"0px",height:"100%",borderLeftWidth:f,borderLeftStyle:h,borderLeftColor:m,padding:i,...lo.container,...x,...d==null?void 0:d.container,...u})},Ta=e=>r.jsx(Im,{...e}),Tm=Ta,Mm=Ta,zm={xs:12,sm:14,md:16,lg:18,xl:20},Rm=({isSupported:e,isSharing:o,onShare:t,label:n,children:i,icon:a,size:l,isDisabled:d,isLoading:s,iconPosition:u,disableWhenUnsupported:p=!0,...m})=>{const h=l??"md",f=a??r.jsx(Rr,{widthHeight:zm[h],strokeWidth:1.5,filled:!1}),x=!!d||!e&&p,y=!!s||o;return r.jsx(We,{...m,size:h,icon:f,iconPosition:u??"left",isDisabled:x,isLoading:y,onClick:t,children:i??n??"Share"})},xr=()=>typeof navigator>"u"?void 0:navigator,Vm=(e,o)=>{if(!e||typeof e.share!="function")return!1;if(typeof e.canShare=="function")try{return e.canShare(o)}catch{return!1}return!0},Em=e=>{if(typeof e=="object"&&e!==null&&"name"in e)return String(e.name)},Pm=e=>{const{shareData:o,onClick:t,onUnsupported:n,onShareStart:i,onShareSuccess:a,onShareCancel:l,onShareError:d}=e,[s,u]=g.useState(!1),p=g.useMemo(()=>Vm(xr(),o),[o]),m=g.useCallback((...h)=>{t==null||t(...h);const f=xr();if(!f||typeof f.share!="function"){n==null||n();return}if(!s){if(typeof f.canShare=="function")try{if(!f.canShare(o)){n==null||n();return}}catch(x){d==null||d(x);return}u(!0),i==null||i();try{f.share(o).then(()=>{a==null||a()}).catch(x=>{if(Em(x)==="AbortError"){l==null||l();return}d==null||d(x)}).finally(()=>{u(!1)})}catch(x){u(!1),d==null||d(x)}}},[s,t,l,d,i,a,n,o]);return{isSupported:p,isSharing:s,handleShare:m}},Wm=e=>{const{isSupported:o,isSharing:t,handleShare:n}=Pm(e),{shareData:i,onShareStart:a,onShareSuccess:l,onShareCancel:d,onShareError:s,onUnsupported:u,onClick:p,...m}=e;return r.jsx(Rm,{...m,isSupported:o,isSharing:t,onShare:n})},_m=Wm,$m=({label:e,status:o="default",views:t,themeMode:n,...i})=>{const{themeMode:a}=c.useTheme(),l=Br();return r.jsxs(c.Horizontal,{alignItems:"center",gap:8,role:"status-indicator",...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{role:"status-dot",width:"8px",height:"8px",borderRadius:"50%",...l[o].indicator,...t==null?void 0:t.indicator}),e&&r.jsx(c.Text,{role:"status-label",fontSize:"14px",lineHeight:"20px",...l[o].label,...t==null?void 0:t.label,children:e})]})},Hm=e=>r.jsx($m,{...e}),Bm=(e=!0,o,t,n)=>{const{on:i}=c.useResponsive(),a=i("mobile"),[l,d]=g.useState(o!==void 0?o:e);return g.useEffect(()=>{o!==void 0&&d(o)},[o]),{isExpanded:l,toggleExpanded:()=>{const m=!l;d(m),t&&t(m)},expand:()=>{l||(d(!0),t&&t(!0))},collapse:()=>{l&&(d(!1),t&&t(!1))},isMobile:a}},Lm={sm:{expandedWidth:"240px",collapsedWidth:"64px"},md:{expandedWidth:"280px",collapsedWidth:"72px"},lg:{expandedWidth:"320px",collapsedWidth:"80px"},xl:{expandedWidth:"360px",collapsedWidth:"88px"}},Am=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"}}),Dm=Am(),Fm={left:{left:0,borderRightWidth:"1px",borderRightStyle:"solid",borderRightColor:"color-gray-200"},right:{right:0,borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"color-gray-200"}},Om={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)"}},qm={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)"},Ma=g.createContext({isExpanded:!0,toggleExpanded:()=>{},expand:()=>{},collapse:()=>{},position:"left",size:"md",variant:"default"}),et=()=>g.useContext(Ma),Nm=({value:e,children:o})=>r.jsx(Ma.Provider,{value:e,children:o}),Um=({children:e,showToggleButton:o=!0,views:t,...n})=>{const{isExpanded:i,toggleExpanded:a,position:l}=et();return r.jsx(c.Horizontal,{width:"100%",padding:"16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",alignItems:"center",justifyContent:"space-between",...t==null?void 0:t.header,...n,children:i?r.jsxs(c.Horizontal,{width:"100%",alignItems:"center",justifyContent:"space-between",children:[e,o&&r.jsx(c.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:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"left":"right",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})]}):r.jsx(c.View,{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:o&&r.jsx(c.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:a,"aria-label":i?"Collapse sidebar":"Expand sidebar",...t==null?void 0:t.toggleButton,children:r.jsx(ae,{orientation:l==="left"?"right":"left",widthHeight:16,...t==null?void 0:t.toggleButtonIcon})})})})},Gm=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{flex:"1",width:"100%",overflowY:"auto",overflowX:"hidden",padding:n?"16px":"8px",...o==null?void 0:o.content,...t,children:e})},Ym=({children:e,views:o,...t})=>{const{isExpanded:n}=et();return r.jsx(c.View,{width:"100%",padding:"16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",...o==null?void 0:o.footer,...t,children:n?e:null})},vm=({children:e,position:o="left",size:t="md",variant:n="default",fixed:i=!1,hasBackdrop:a=!0,expandedWidth:l,collapsedWidth:d,breakpointBehavior:s="overlay",elevation:u="none",transitionPreset:p="normal",ariaLabel:m="Sidebar navigation",isExpanded:h,isMobile:f,collapse:x,views:y,themeMode:b,...k})=>{const C=Lm[t],S=h?l||C.expandedWidth:d||C.collapsedWidth,j=!f||f&&s!=="hide",w=i||f&&s==="overlay"?"fixed":"relative",I=a&&f&&h&&s==="overlay";return r.jsxs(r.Fragment,{children:[I&&r.jsx(c.View,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"color-blackAlpha-500",zIndex:998,onClick:x,...y==null?void 0:y.backdrop}),j&&r.jsx(c.Vertical,{position:w,top:0,height:"100vh",width:S,zIndex:999,transition:qm[p],transform:f&&s==="overlay"&&!h?`translateX(${o==="left"?"-100%":"100%"})`:"translateX(0)",role:"navigation","aria-label":m,...Dm[n],...Fm[o],...Om[u],...y==null?void 0:y.container,...k,children:g.Children.map(e,M=>M)})]})},Xm=({children:e,position:o="left",size:t="md",variant:n="default",defaultExpanded:i=!0,expanded:a,onExpandedChange:l,fixed:d=!1,hasBackdrop:s=!0,showToggleButton:u=!0,expandedWidth:p,collapsedWidth:m,breakpoint:h=768,breakpointBehavior:f="overlay",views:x,...y})=>{const{isExpanded:b,toggleExpanded:k,expand:C,collapse:S,isMobile:j}=Bm(i,a,l);return r.jsx(Nm,{value:{isExpanded:b,toggleExpanded:k,expand:C,collapse:S,position:o,size:t,variant:n,views:x},children:r.jsx(vm,{position:o,size:t,variant:n,fixed:d,hasBackdrop:s,showToggleButton:u,expandedWidth:p,collapsedWidth:m,breakpoint:h,breakpointBehavior:f,isExpanded:b,isMobile:j,toggleExpanded:k,expand:C,collapse:S,views:x,...y,children:e})})},yo=Xm;yo.Header=Um;yo.Content=Gm;yo.Footer=Ym;yo.useContext=et;const Km=()=>({getItem:e=>{try{return localStorage.getItem(`resizable-${e}`)}catch(o){return console.warn("Failed to access localStorage:",o),null}},setItem:(e,o)=>{try{localStorage.setItem(`resizable-${e}`,o)}catch(t){console.warn("Failed to write to localStorage:",t)}}}),Qm=(e,o,t,n=50,i=1/0,a=!1,l,d,s=10)=>{const[u,p]=g.useState(!1),[m,h]=g.useState([]),f=g.useRef(null),x=g.useRef(null),y=g.useRef(0),b=g.useRef([]),k=g.useRef(d||(typeof window<"u"?Km():null)),C=g.useCallback(()=>f.current?e==="horizontal"?f.current.offsetWidth:f.current.offsetHeight:0,[e]),S=g.useCallback(()=>{if(!l||!k.current)return null;const E=k.current.getItem(l);if(!E)return null;try{const W=JSON.parse(E);return Array.isArray(W.sizes)?W.sizes:null}catch(W){return console.warn("Failed to parse saved panel sizes:",W),null}},[l]),j=g.useCallback(()=>{if(!l||!k.current||m.length===0)return;const E=m.map(W=>({id:W.id,size:W.size,collapsed:W.collapsed||!1}));k.current.setItem(l,JSON.stringify({sizes:E}))},[l,m]),w=g.useCallback((E,W,P,H,L)=>{h(A=>A.some(F=>F.id===E)?A:[...A,{id:E,size:W,minSize:P??n,maxSize:H??i,collapsible:L??a,collapsed:!1}])},[n,i,a]),I=g.useCallback(E=>{h(W=>W.filter(P=>P.id!==E))},[]),M=g.useCallback(E=>{const W=m.find(P=>P.id===E);return W?W.size:0},[m]),z=g.useCallback((E,W)=>{h(P=>P.map(H=>H.id===E?{...H,size:W}:H))},[]),V=g.useCallback(E=>{const W=m.find(P=>P.id===E);return W?!!W.collapsed:!1},[m]),$=g.useCallback(E=>{h(W=>{const P=W.findIndex(F=>F.id===E);if(P===-1)return W;const H=W[P];if(!H.collapsible)return W;const L={...H,collapsed:!H.collapsed},A=[...W];return A[P]=L,A})},[]),T=g.useCallback((E,W)=>{x.current=E,y.current=W,b.current=m.map(P=>P.size),p(!0)},[m]),_=g.useCallback(E=>{if(!u||!x.current)return;const W=x.current,P=E-y.current;let H=-1;const L=W.match(/\d+$/);if(L&&(H=parseInt(L[0],10)-1),H===-1&&m.length>=2&&(H=0),H<0||H>=m.length-1)return;const A=m[H],F=m[H+1];if(A.collapsed||F.collapsed)return;let D=b.current[H]+P,O=b.current[H+1]-P;D=Math.max(A.minSize??n,Math.min(A.maxSize??i,D)),O=Math.max(F.minSize??n,Math.min(F.maxSize??i,O)),h(v=>v.map((X,U)=>U===H?{...X,size:D}:U===H+1?{...X,size:O}:X))},[u,m,e,n,i]),B=g.useCallback(()=>{u&&t&&t(m.map(E=>E.size)),x.current=null,p(!1),l&&j()},[u,m,t,l,j]),R=g.useCallback(E=>{if(!u||!x.current)return;const W=x.current;let P=-1;const H=W.match(/\d+$/);if(H&&(P=parseInt(H[0],10)-1),P===-1&&m.length>=2&&(P=0),P<0||P>=m.length-1)return;let L=0;e==="horizontal"?(E.key==="ArrowLeft"&&(L=-s),E.key==="ArrowRight"&&(L=s),E.key==="Home"&&(L=-100),E.key==="End"&&(L=100)):(E.key==="ArrowUp"&&(L=-s),E.key==="ArrowDown"&&(L=s),E.key==="Home"&&(L=-100),E.key==="End"&&(L=100)),L!==0&&(E.preventDefault(),_(y.current+L)),E.key==="Escape"&&(h(A=>A.map((F,D)=>({...F,size:b.current[D]}))),B())},[u,m,e,_,B,s]);return g.useEffect(()=>{const E=H=>{if(!u)return;const L=e==="horizontal"?H.clientX:H.clientY;_(L)},W=H=>{if(!u||H.touches.length===0)return;const L=H.touches[0],A=e==="horizontal"?L.clientX:L.clientY;_(A)},P=()=>{u&&B()};return u&&(document.addEventListener("mousemove",E),document.addEventListener("touchmove",W),document.addEventListener("mouseup",P),document.addEventListener("touchend",P),document.addEventListener("keydown",R),document.body.style.cursor=e==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("touchmove",W),document.removeEventListener("mouseup",P),document.removeEventListener("touchend",P),document.removeEventListener("keydown",R),document.body.style.cursor="",document.body.style.userSelect=""}},[u,e,_,B,R]),g.useEffect(()=>{if(m.length!==0){if(l){const E=S();if(E){h(W=>W.map(P=>{const H=E.find(L=>L.id===P.id);return H?{...P,size:H.size,collapsed:H.collapsed||!1}:P}));return}}if(!o){const W=C()/m.length;h(P=>P.map(H=>({...H,size:W})))}}},[m.length,o,C,l,S]),g.useEffect(()=>{if(!o||o.length===0||m.length===0)return;const E=C(),W=o.map(P=>typeof P=="string"&&P.endsWith("%")?parseFloat(P)/100*E:typeof P=="number"?P:parseFloat(P));h(P=>P.map((H,L)=>({...H,size:L<W.length?W[L]:H.size})))},[o,m.length,C]),g.useEffect(()=>{m.length>0&&l&&!u&&j()},[m,l,u,j]),{isResizing:u,setIsResizing:p,containerRef:f,panels:m,registerPanel:w,unregisterPanel:I,getPanelSize:M,setPanelSize:z,isPanelCollapsed:V,togglePanelCollapse:$,startResize:T,onResize:_,endResize:B}},Zm={horizontal:{flexDirection:"row"},vertical:{flexDirection:"column"}},Jm=(e,o)=>({sm:{width:o==="horizontal"?"4px":"100%",height:o==="vertical"?"4px":"100%"},md:{width:o==="horizontal"?"6px":"100%",height:o==="vertical"?"6px":"100%"},lg:{width:o==="horizontal"?"8px":"100%",height:o==="vertical"?"8px":"100%"}})[e],eh=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"}}}),oh=eh(),To={horizontal:{width:"2px",height:"20px",backgroundColor:"color-gray-400",margin:"0 1px"},vertical:{width:"20px",height:"2px",backgroundColor:"color-gray-400",margin:"1px 0"}},za=g.createContext({orientation:"horizontal",size:"md",variant:"default",isResizing:!1,setIsResizing:()=>{},registerPanel:()=>{},unregisterPanel:()=>{},getPanelSize:()=>0,setPanelSize:()=>{},isPanelCollapsed:()=>!1,togglePanelCollapse:()=>{},startResize:()=>{},onResize:()=>{},endResize:()=>{}}),Ra=()=>g.useContext(za),th=({value:e,children:o})=>r.jsx(za.Provider,{value:e,children:o}),rh=({children:e,id:o,defaultSize:t,minSize:n,maxSize:i,collapsible:a,defaultCollapsed:l,onCollapseChange:d,views:s,...u})=>{const{orientation:p,registerPanel:m,unregisterPanel:h,getPanelSize:f,isPanelCollapsed:x,togglePanelCollapse:y}=Ra(),b=typeof t=="string"&&t.endsWith("%")?0:typeof t=="number"?t:0;g.useEffect(()=>(m(o,b,n,i,a),()=>h(o)),[o,b,n,i,a,m,h]);const k=f(o),C=x(o);return g.useEffect(()=>{d&&C!==void 0&&d(C)},[C,d]),g.useEffect(()=>{a&&l&&!C&&y(o)},[o,a,l,C,y]),C?r.jsx(c.View,{flex:"0 0 auto",width:p==="horizontal"?"10px":"100%",height:p==="vertical"?"10px":"100%",backgroundColor:"color-gray-200",cursor:"pointer",onClick:()=>y(o),"aria-label":`Expand panel ${o}`,role:"button",tabIndex:0,...s==null?void 0:s.collapsedPanel,...u}):r.jsx(c.View,{flex:k>0?"0 0 auto":"1",width:p==="horizontal"?`${k}px`:"100%",height:p==="vertical"?`${k}px`:"100%",overflow:"auto",...s==null?void 0:s.panel,...u,children:e})},nh=({id:e,position:o="both",disabled:t=!1,withVisualIndicator:n=!0,withCollapseButton:i=!1,collapseTarget:a,views:l,...d})=>{const{orientation:s,size:u,variant:p,startResize:m,isPanelCollapsed:h,togglePanelCollapse:f}=Ra(),y=(()=>{if(a)return a;const w=e.match(/\d+$/);if(!w)return"";const I=parseInt(w[0],10);return isNaN(I)?"":`panel${I}`})(),b=h(y),k=w=>{if(t)return;w.preventDefault();const I=s==="horizontal"?w.clientX:w.clientY;m(e,I)},C=w=>{if(t||w.touches.length===0)return;w.preventDefault();const I=w.touches[0],M=s==="horizontal"?I.clientX:I.clientY;m(e,M)},S=w=>{t||(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),m(e,0))},j=w=>{w.stopPropagation(),y&&f(y)};return r.jsxs(c.View,{role:"separator","aria-orientation":s,"aria-valuemin":0,"aria-valuemax":100,tabIndex:t?-1:0,cursor:s==="horizontal"?"col-resize":"row-resize",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...Jm(u,s),...oh[p],onMouseDown:k,onTouchStart:C,onKeyDown:S,opacity:t?.5:1,pointerEvents:t?"none":"auto",...l==null?void 0:l.handle,...d,children:[n&&r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",width:s==="horizontal"?"100%":"auto",height:s==="vertical"?"100%":"auto",pointerEvents:"none",...l==null?void 0:l.handleIcon,children:s==="horizontal"?r.jsxs(c.Horizontal,{gap:1,children:[r.jsx(c.View,{...To.horizontal}),r.jsx(c.View,{...To.horizontal})]}):r.jsxs(c.Vertical,{gap:1,children:[r.jsx(c.View,{...To.vertical}),r.jsx(c.View,{...To.vertical})]})}),i&&y&&r.jsx(c.View,{position:"absolute",top:s==="horizontal"?"-20px":"50%",left:s==="horizontal"?"50%":"-20px",transform:s==="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:j,"aria-label":b?`Expand panel ${y}`:`Collapse panel ${y}`,role:"button",tabIndex:0,pointerEvents:"auto",_hover:{backgroundColor:"color-gray-200"},...l==null?void 0:l.collapseIcon,children:r.jsx(c.View,{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center",children:b?r.jsxs(c.Horizontal,{children:[r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"}),r.jsx(c.View,{width:"2px",height:"6px",backgroundColor:"color-gray-600",position:"absolute"})]}):r.jsx(c.View,{width:"6px",height:"2px",backgroundColor:"color-gray-600"})})})]})},ah=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,minSize:a,maxSize:l,collapsible:d=!1,containerRef:s,autoSaveId:u,views:p,...m})=>{const h=o==="horizontal"?c.Horizontal:c.Vertical;return r.jsx(h,{ref:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",...Zm[o],...p==null?void 0:p.container,...m,children:e})},ih=({children:e,orientation:o="horizontal",size:t="md",variant:n="default",defaultSizes:i,onSizesChange:a,minSize:l=50,maxSize:d,collapsible:s=!1,autoSaveId:u,storage:p,keyboardResizeBy:m=10,views:h,...f})=>{const{isResizing:x,setIsResizing:y,containerRef:b,registerPanel:k,unregisterPanel:C,getPanelSize:S,setPanelSize:j,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:z,endResize:V}=Qm(o,i,a,l,d,s,u,p,m);return r.jsx(th,{value:{orientation:o,size:t,variant:n,isResizing:x,setIsResizing:y,registerPanel:k,unregisterPanel:C,getPanelSize:S,setPanelSize:j,isPanelCollapsed:w,togglePanelCollapse:I,startResize:M,onResize:z,endResize:V},children:r.jsx(ah,{orientation:o,size:t,variant:n,defaultSizes:i,minSize:l,maxSize:d,collapsible:s,autoSaveId:u,keyboardResizeBy:m,containerRef:b,views:h,...f,children:e})})},Nt=ih;Nt.Panel=rh;Nt.Handle=nh;const Mo={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"}}},lh={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"}},ch=()=>Math.random().toString(36).substring(2,9);let Ne=new Map;const ko=kt.create(e=>({toasts:[],add:(o,t,n,i={})=>{const a=i.id||ch(),l={id:a,variant:o,title:t,description:n,createdAt:Date.now(),isVisible:!0,...i};if(e(d=>({toasts:[...d.toasts,l]})),i.duration!==0){const d=i.duration||5e3,s=setTimeout(()=>{ko.getState().remove(a)},d);Ne.set(a,s)}return a},remove:o=>{e(t=>({toasts:t.toasts.map(n=>n.id===o?{...n,isVisible:!1}:n)})),Ne.has(o)&&(clearTimeout(Ne.get(o)),Ne.delete(o)),setTimeout(()=>{e(t=>({toasts:t.toasts.filter(n=>n.id!==o)}))},300)},removeAll:()=>{Ne.forEach(clearTimeout),Ne.clear(),e(o=>({toasts:o.toasts.map(t=>({...t,isVisible:!1}))})),setTimeout(()=>{e({toasts:[]})},300)}})),Le=(e,o,t,n)=>ko.getState().add(e,o,t,n),Va=(e,o,t)=>Le("info",e,o,t),Ea=(e,o,t)=>Le("success",e,o,t),Pa=(e,o,t)=>Le("warning",e,o,t),Wa=(e,o,t)=>Le("error",e,o,t),_a=e=>{ko.getState().remove(e)},$a=()=>{ko.getState().removeAll()},Ha=({variant:e,title:o,description:t,onClose:n,isClosable:i=!0,action:a,actionText:l,showIcon:d=!0,theme:s,views:u,render:p,icon:m,id:h,isVisible:f=!0,themeMode:x})=>{const y=s??Mo,b=()=>{var j,w;if(m!==void 0)return m;const S=e?(w=(j=Mo[e])==null?void 0:j.icon)==null?void 0:w.color:Mo.info.icon.color;switch(e){case"info":return r.jsx(Te,{widthHeight:20,color:S});case"success":return r.jsx(Ct,{widthHeight:20,color:S});case"warning":return r.jsx(Te,{widthHeight:20,color:S,orientation:"down"});case"error":return r.jsx(Oo,{widthHeight:20,color:S});default:return r.jsx(Te,{widthHeight:20,color:Mo.info.icon.color})}};if(p)return r.jsx(r.Fragment,{children:p({id:h||"",onClose:n})});const k=e==="error"?"alert":"status",C=e==="error"||e==="warning"?"assertive":"polite";return r.jsxs(c.Horizontal,{role:k,"aria-live":C,"aria-atomic":"true","data-state":f?"open":"closed",gap:12,width:"100%",maxWidth:"400px",borderWidth:"1px",borderStyle:"solid",borderRadius:"8px",padding:"12px 16px",alignItems:"flex-start",position:"relative",backgroundColor:y[e].container.backgroundColor,borderColor:y[e].container.border,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",opacity:f?1:0,transform:f?"scale(1)":"scale(0.95)",transition:"all 0.3s ease",...u==null?void 0:u.container,children:[d&&r.jsx(c.View,{marginTop:"2px",...u==null?void 0:u.icon,children:b()}),r.jsxs(c.Vertical,{gap:4,flex:"1",children:[r.jsx(c.Text,{size:"md",fontWeight:"600",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,...u==null?void 0:u.title,children:o}),t&&r.jsx(c.Text,{size:"sm",color:y[e].content.color,fontWeight:"400",backgroundColor:y[e].container.backgroundColor,...u==null?void 0:u.description,children:t}),a&&l&&r.jsx(c.Text,{size:"sm",fontWeight:"600",marginTop:"8px",cursor:"pointer",color:y[e].content.color,backgroundColor:y[e].container.backgroundColor,onClick:S=>{S.stopPropagation(),a()},_hover:{textDecoration:"underline"},transition:"all 0.2s ease",...u==null?void 0:u.actionButton,children:l})]}),i&&r.jsx(c.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(),n()},_hover:{backgroundColor:"rgba(0, 0, 0, 0.05)"},transition:"all 0.2s ease",...u==null?void 0:u.closeButton,children:r.jsx(xe,{widthHeight:16,color:y[e].content.color})})]})},sh=({position:e="top-right",gap:o=8,limit:t=5,containerStyle:n})=>{const{toasts:i,remove:a}=ko(),d=g.useMemo(()=>{const s={top:[],"top-right":[],"top-left":[],bottom:[],"bottom-right":[],"bottom-left":[]};return i.forEach(u=>{const p=u.position||e;s[p].push(u)}),Object.keys(s).forEach(u=>{s[u]=s[u].slice(-t)}),s},[i,e,t])[e];return r.jsx(c.View,{position:"fixed",zIndex:9999,display:"flex",flexDirection:e.includes("bottom")?"column-reverse":"column",gap:`${o}px`,width:"fit-content",maxWidth:"100%",pointerEvents:"none",...lh[e],style:n,children:d.map(s=>r.jsx(c.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:r.jsx(Ha,{id:s.id,variant:s.variant,title:s.title,description:s.description,onClose:()=>a(s.id),isClosable:s.isClosable,action:s.action,actionText:s.actionText,showIcon:s.showIcon,views:s.views,render:s.render,icon:s.icon,isVisible:s.isVisible})},s.id))})},dh=()=>({toast:(e,o,t,n)=>Le(e,o,t,n),info:(e,o,t)=>Va(e,o,t),success:(e,o,t)=>Ea(e,o,t),warning:(e,o,t)=>Pa(e,o,t),error:(e,o,t)=>Wa(e,o,t),remove:e=>_a(e),removeAll:()=>$a()}),uh=e=>r.jsx(Ha,{...e}),gh=Object.assign(uh,{Container:e=>r.jsx(sh,{...e}),show:Le,info:Va,success:Ea,warning:Pa,error:Wa,remove:_a,removeAll:$a}),ph=dh,br=(e,o)=>{var l,d;if(!e)return!0;const t=e.toLowerCase(),n=o.name.toLowerCase().includes(t),i=((l=o.description)==null?void 0:l.toLowerCase().includes(t))||!1,a=((d=o.keywords)==null?void 0:d.some(s=>s.toLowerCase().includes(t)))||!1;return n||i||a},mh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],filter:i})=>{const[a,l]=g.useState(""),[d,s]=g.useState(0),u=g.useRef(null),p=g.useMemo(()=>i||br,[i]),m=g.useMemo(()=>[...t.flatMap(b=>b.commands),...n],[t,n]),h=g.useMemo(()=>a.trim()?m.filter(y=>p(a,y)):m,[m,a,p]),f=g.useMemo(()=>{if(!a)return t;const y=i||br;return t.map(b=>({...b,commands:b.commands.filter(k=>y(a,k))})).filter(b=>b.commands.length)},[t,a,i]);g.useEffect(()=>{s(0)},[h.length]);const x=g.useCallback(y=>{if(e)switch(y.key){case"ArrowDown":y.preventDefault(),s(b=>b<h.length-1?b+1:b);break;case"ArrowUp":y.preventDefault(),s(b=>b>0?b-1:b);break;case"Enter":y.preventDefault(),h[d]&&(h[d].onSelect(),o(!1),l(""));break;case"Escape":y.preventDefault(),o(!1),l("");break}},[e,h,d,o]);return g.useEffect(()=>(document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}),[x]),g.useEffect(()=>{if(u.current&&e){const y=u.current.querySelector(`[data-index="${d}"]`);y&&y.scrollIntoView({block:"nearest"})}},[d,e]),g.useEffect(()=>{e?s(0):l("")},[e]),{search:a,setSearch:l,selectedIndex:d,setSelectedIndex:s,filteredCommands:h,filteredGroups:f,listRef:u}},hh={sm:{width:"400px",maxHeight:"300px"},md:{width:"500px",maxHeight:"400px"},lg:{width:"600px",maxHeight:"500px"}},fh=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)"}}),xh=fh(),bh={display:"flex",alignItems:"center",padding:"12px 16px",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200"},yh={overflow:"auto",padding:"8px 0"},kh={marginBottom:"8px"},jh={padding:"8px 16px",fontSize:"12px",fontWeight:"bold",color:"color-gray-500",textTransform:"uppercase"},Ch={display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",userSelect:"none",borderRadius:"4px",margin:"0 8px",_hover:{backgroundColor:"color-gray-100"}},Sh={backgroundColor:"color-blue-50",_hover:{backgroundColor:"color-blue-100"}},wh={opacity:.5,cursor:"not-allowed",_hover:{backgroundColor:"transparent"}},Ih={display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",color:"color-gray-500"},Th={display:"flex",flexDirection:"column",flex:1},Mh={fontSize:"14px",fontWeight:"medium"},zh={fontSize:"12px",color:"color-gray-500",marginTop:"2px"},Rh={display:"flex",alignItems:"center",marginLeft:"12px",fontSize:"12px",color:"color-gray-500"},Vh={display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",color:"color-gray-500",textAlign:"center"},Eh={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",fontSize:"12px",color:"color-gray-500"},Ph=g.createContext({search:"",setSearch:()=>{},selectedIndex:0,setSelectedIndex:()=>{},filteredCommands:[],onSelect:()=>{}}),Wh=({value:e,children:o})=>r.jsx(Ph.Provider,{value:e,children:o}),Ba=({value:e,onValueChange:o,placeholder:t="Type a command or search...",views:n,...i})=>{const a=g.useRef(null);return g.useEffect(()=>{a.current&&a.current.focus()},[]),r.jsxs(c.View,{...bh,...n==null?void 0:n.container,...i,children:[r.jsx(Po,{widthHeight:16,color:"color-gray-400",marginRight:"8px"}),r.jsx(c.View,{as:"input",type:"text",value:e,onChange:l=>o(l.target.value),placeholder:t,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",fontSize:"14px",ref:a,...n==null?void 0:n.input})]})},_h=({children:e,views:o,...t})=>r.jsx(c.View,{...yh,...o==null?void 0:o.container,...t,children:e}),La=({heading:e,children:o,views:t,...n})=>r.jsxs(c.View,{...kh,...t==null?void 0:t.container,...n,children:[r.jsx(c.Text,{...jh,...t==null?void 0:t.heading,children:e}),o]}),yt=({item:e,selected:o=!1,onSelect:t,views:n,...i})=>{const a=()=>{!e.disabled&&t&&t()};return r.jsxs(c.Horizontal,{...Ch,...o?Sh:{},...e.disabled?wh:{},onClick:a,...n==null?void 0:n.container,...i,children:[e.icon&&r.jsx(c.View,{...Ih,...n==null?void 0:n.icon,children:e.icon}),r.jsxs(c.Vertical,{...Th,...n==null?void 0:n.content,children:[r.jsx(c.Text,{...Mh,...n==null?void 0:n.name,children:e.name}),e.description&&r.jsx(c.Text,{...zh,...n==null?void 0:n.description,children:e.description})]}),e.shortcut&&r.jsx(c.Text,{...Rh,...n==null?void 0:n.shortcut,children:e.shortcut})]})},Aa=({children:e="No results found.",views:o,...t})=>r.jsx(c.View,{...Vh,...o==null?void 0:o.container,...t,children:e}),$h=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",emptyState:d,footer:s,search:u,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,filteredGroups:x,listRef:y,views:b,filter:k,...C})=>{if(!e)return null;const S=g.useCallback(z=>{z.disabled||(z.onSelect(),o(!1),p(""))},[o,p]),j=g.useCallback(z=>z.target===z.currentTarget&&o(!1),[o]),w=g.useMemo(()=>({search:u,setSearch:p,selectedIndex:m,setSelectedIndex:h,filteredCommands:f,onSelect:S}),[u,m,f,S,p,h]),I=t.length>0,M=f.length===0;return r.jsx(c.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:j,...C,children:r.jsx(Wh,{value:w,children:r.jsxs(c.View,{borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",...hh[a],...xh[l],...b==null?void 0:b.container,onClick:z=>z.stopPropagation(),children:[r.jsx(Ba,{value:u,onValueChange:p,placeholder:i,views:b==null?void 0:b.searchInput}),r.jsx(c.View,{ref:y,flex:1,overflow:"auto",...b==null?void 0:b.list,children:M?d||r.jsx(Aa,{views:b==null?void 0:b.empty}):I?x.map(z=>r.jsx(La,{heading:z.name,views:b==null?void 0:b.groupHeading,children:z.commands.map(V=>{const $=f.findIndex(T=>T.id===V.id);return r.jsx(yt,{item:V,selected:$===m,onSelect:()=>S(V),"data-index":$,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},V.id)})},z.id)):f.map((z,V)=>r.jsx(yt,{item:z,selected:V===m,onSelect:()=>S(z),"data-index":V,views:{container:b==null?void 0:b.item,icon:b==null?void 0:b.icon,content:b==null?void 0:b.content,name:b==null?void 0:b.name,description:b==null?void 0:b.description,shortcut:b==null?void 0:b.shortcut}},z.id))}),s&&r.jsx(c.View,{...Eh,...b==null?void 0:b.footer,children:s})]})})})},Hh=({open:e,onOpenChange:o,groups:t=[],commands:n=[],placeholder:i,size:a="md",variant:l="default",filter:d,emptyState:s,footer:u,views:p,...m})=>{const{search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:C}=mh({open:e,onOpenChange:o,groups:t,commands:n,filter:d});return r.jsx($h,{open:e,onOpenChange:o,groups:t,commands:n,placeholder:i,size:a,variant:l,emptyState:s,footer:u,search:h,setSearch:f,selectedIndex:x,setSelectedIndex:y,filteredCommands:b,filteredGroups:k,listRef:C,views:p,...m})},Je=Hh;Je.Input=Ba;Je.List=_h;Je.Group=La;Je.Item=yt;Je.Empty=Aa;const yr=()=>Math.random().toString(36).substring(2,11),Bh=({defaultOpen:e=!1,openDelay:o=200,closeDelay:t=200,isDisabled:n=!1}={})=>{const[i,a]=g.useState(e),l=g.useRef(null),d=g.useRef(null),s=g.useRef(null),u=g.useRef(null),p=g.useRef(`tooltip-trigger-${yr()}`).current,m=g.useRef(`tooltip-content-${yr()}`).current,h=g.useCallback(()=>{n||(u.current&&(clearTimeout(u.current),u.current=null),!i&&!s.current&&(s.current=setTimeout(()=>{a(!0),s.current=null},o)))},[i,o,n]),f=g.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),i&&!u.current&&(u.current=setTimeout(()=>{a(!1),u.current=null},t))},[i,t]),x=g.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]);return g.useEffect(()=>()=>{s.current&&clearTimeout(s.current),u.current&&clearTimeout(u.current)},[]),g.useEffect(()=>{const y=b=>{b.key==="Escape"&&i&&a(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[i]),{isOpen:i,openTooltip:h,closeTooltip:f,cancelCloseTimer:x,triggerRef:l,contentRef:d,triggerId:p,contentId:m}},Lh={sm:{padding:"4px 8px",fontSize:"12px",maxWidth:"200px"},md:{padding:"6px 10px",fontSize:"14px",maxWidth:"250px"},lg:{padding:"8px 12px",fontSize:"16px",maxWidth:"300px"}},Ah=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"}}),Dh=Ah(),Fh=e=>{const o={position:"absolute",width:"8px",height:"8px",backgroundColor:"inherit",borderStyle:"inherit",borderWidth:"inherit",borderColor:"inherit",transform:"rotate(45deg)"};switch(e){case"top":return{...o,bottom:"-4px",left:"50%",marginLeft:"-4px",borderTop:"none",borderLeft:"none"};case"right":return{...o,left:"-4px",top:"50%",marginTop:"-4px",borderRight:"none",borderTop:"none"};case"bottom":return{...o,top:"-4px",left:"50%",marginLeft:"-4px",borderBottom:"none",borderRight:"none"};case"left":return{...o,right:"-4px",top:"50%",marginTop:"-4px",borderLeft:"none",borderBottom:"none"};default:return o}},Da=g.createContext({isOpen:!1,openTooltip:()=>{},closeTooltip:()=>{},triggerRef:{current:null},contentRef:{current:null},contentId:"",triggerId:""}),Ut=()=>g.useContext(Da),Oh=({value:e,children:o})=>r.jsx(Da.Provider,{value:e,children:o}),Fa=({children:e,views:o,asChild:t=!1,...n})=>{const{openTooltip:i,closeTooltip:a,triggerRef:l,contentId:d,triggerId:s}=Ut(),f={ref:l,onMouseEnter:()=>i(),onMouseLeave:()=>a(),onFocus:()=>i(),onBlur:()=>a(),id:s,"aria-describedby":d,...o==null?void 0:o.container,...n};return t&&g.isValidElement(e)?g.cloneElement(e,f):r.jsx(c.View,{display:"inline-block",...f,children:e})},qh=({children:e,views:o,...t})=>{const{isOpen:n,contentRef:i,contentId:a,triggerId:l}=Ut();return n?r.jsx(c.View,{ref:i,id:a,role:"tooltip","aria-labelledby":l,...o==null?void 0:o.container,...t,children:e}):null},Nh=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",showArrow:l=!0,views:d,themeMode:s,...u})=>{const{isOpen:p,triggerRef:m,contentRef:h,contentId:f,triggerId:x}=Ut(),{ref:y,relation:b}=c.useElementPosition({trackChanges:!0,trackOnHover:!0,trackOnScroll:!0,trackOnResize:!0}),[k,C]=g.useState({x:0,y:0,placement:t});g.useEffect(()=>{m!=null&&m.current&&y&&(y.current=m.current)},[m,y,p]),g.useEffect(()=>{if(p&&(h!=null&&h.current)&&(m!=null&&m.current)){const I=m.current.getBoundingClientRect();let M=t;b&&(t==="top"&&b.space.vertical==="bottom"?M="bottom":t==="bottom"&&b.space.vertical==="top"?M="top":t==="right"&&b.space.horizontal==="left"?M="left":t==="left"&&b.space.horizontal==="right"&&(M="right"));let z=0,V=0;switch(M){case"top":z=n==="start"?I.left:n==="end"?I.right-120:I.left+I.width/2-60,V=I.top-8;break;case"bottom":z=n==="start"?I.left:n==="end"?I.right-120:I.left+I.width/2-60,V=I.bottom+8;break;case"right":z=I.right+8,V=n==="start"?I.top:n==="end"?I.bottom-32:I.top+I.height/2-16;break;case"left":z=I.left-8,V=n==="start"?I.top:n==="end"?I.bottom-32:I.top+I.height/2-16;break}C({x:z,y:V,placement:M})}},[p,t,n,m,h,b]);const S=l?Fh(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 r.jsxs(c.View,{position:"relative",display:"inline-block",...d==null?void 0:d.container,...u,children:[r.jsx(Fa,{children:o}),p&&r.jsxs(c.View,{ref:h,id:f,role:"tooltip","aria-labelledby":x,borderRadius:4,boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.15)",style:w,...Lh[i],...Dh[a],...d==null?void 0:d.content,children:[typeof e=="string"?r.jsx(c.Text,{...d==null?void 0:d.text,children:e}):e,l&&r.jsx(c.View,{...S,...d==null?void 0:d.arrow})]})]})},Uh=({content:e,children:o,position:t="top",align:n="center",size:i="md",variant:a="default",openDelay:l=200,closeDelay:d=200,showArrow:s=!0,defaultOpen:u=!1,isDisabled:p=!1,views:m,...h})=>{const f=Bh({defaultOpen:u,openDelay:l,closeDelay:d,isDisabled:p});return r.jsx(Oh,{value:f,children:r.jsx(Nh,{content:e,position:t,align:n,size:i,variant:a,showArrow:s,views:m,...h,children:o})})},Gt=Uh;Gt.Trigger=Fa;Gt.Content=qh;const Oa=g.forwardRef((e,o)=>{const t=En(e);return r.jsx($n,{...e,...t})});Oa.displayName="ChatInput";const Gh={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%"}},st={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}},dt={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}},jr={"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"},zo={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"},Yh={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"}]},vh=(e,o,t,n,i)=>{const a=o.map(l=>`${l.color} ${l.position||""}`).join(", ");switch(e){case"linear":return`linear-gradient(${t&&jr[t]?jr[t]:t||"to right"}, ${a})`;case"radial":const d=i&&zo[i]?zo[i]:i||"center";return`radial-gradient(${n||"circle"} at ${d}, ${a})`;case"conic":return`conic-gradient(from 0deg at ${i&&zo[i]?zo[i]:i||"center"}, ${a})`;default:return`linear-gradient(to right, ${a})`}},Xh={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)"}}}},Cr={container:{position:"relative",overflow:"hidden",borderRadius:"8px",transition:"all 0.2s ease"},content:{position:"relative",zIndex:1,width:"100%",height:"100%",padding:"16px"}},Kh=({type:e="linear",direction:o="to-right",shape:t="circle",position:n="center",from:i,to:a,colors:l,animate:d=!1,animationDuration:s=3,children:u,views:p,themeMode:m,...h})=>{const f=g.useMemo(()=>l&&l.length>0?l:i&&a?[{color:i,position:"0%"},{color:a,position:"100%"}]:Yh[e],[l,i,a,e]),x=g.useMemo(()=>{const b=f.map(k=>({...k,color:k.color}));return vh(e,b,o,t,n)},[e,f,o,t,n]),y=g.useMemo(()=>{if(!d)return{};const b=Xh[e];return{...b,transition:b.transition.replace("3s",`${s}s`),animationDuration:`${s}s`,animationIterationCount:"infinite",animationTimingFunction:e==="conic"?"linear":"ease-in-out"}},[d,s,e]);return r.jsx(c.View,{background:x,...Cr.container,...y,...p==null?void 0:p.container,...h,children:u&&r.jsx(c.View,{...Cr.content,...p==null?void 0:p.content,children:u})})},Qh=e=>r.jsx(Kh,{...e}),Zh=g.createContext({}),Jh=({children:e,showRadialGradient:o=!0,views:t,themeMode:n,...i})=>{const a={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
29
|
repeating-linear-gradient(100deg, ${l.join(", ")}),
|
|
57
|
-
repeating-linear-gradient(100deg, ${
|
|
58
|
-
`,animation:"aurora 4s ease infinite",...
|
|
30
|
+
repeating-linear-gradient(100deg, ${a.white} 0%, ${a.white} 7%, ${a.transparent} 10%, ${a.transparent} 12%, ${a.white} 16%)
|
|
31
|
+
`,animation:"aurora 4s ease infinite",...o?{maskImage:"radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%)"}:{}};return r.jsxs(c.View,{...kr.container,...t==null?void 0:t.container,...i,children:[r.jsx(c.View,{style:d}),e,r.jsx("style",{children:`
|
|
59
32
|
@keyframes aurora {
|
|
60
33
|
0% { background-position: 0% 50%; }
|
|
61
34
|
50% { background-position: 100% 50%; }
|
|
62
35
|
100% { background-position: 0% 50%; }
|
|
63
36
|
}
|
|
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})]})},en=["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=()=>en[Math.floor(Math.random()*en.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)})})},H0=({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)})]})},B0=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],D0=({rippleCount:e=5,colors:t=B0,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={...To.image,backgroundImage:`url(${t})`,backgroundSize:o,backgroundPosition:r,backgroundRepeat:a,backgroundAttachment:i,opacity:l};return n.jsxs(s.View,{...To.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,{...To.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,{...Mo.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:Mo.video,...c==null?void 0:c.video}),l,e&&n.jsx(s.View,{...Mo.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})}),Pi=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})]})})});Pi.displayName="Background.Layout";const le=N0;le.Aurora=V0;le.Meteors=P0;le.Wall=_0;le.Particles=L0;le.Grid=H0;le.Ripples=D0;le.Image=A0;le.Video=F0;le.Gradient=O0;le.Overlay=v0;le.Layout=Pi;const Wi=g.forwardRef((e,t)=>n.jsx(le,{...e,ref:t}));Wi.displayName="Background";const _i=Object.assign(Wi,{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});_i.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:$,...H}=C;return n.jsxs(s.View,{...w,...H,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(qo,{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(dn,{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(Uo,{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(an,{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))]})]})})},yr=e=>{const t=U0(e);return n.jsx(J0,{...e,...t})};yr.displayName="ChatWidget";const $i=yr;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(sn,{widthHeight:24,color:"white"})})]})};exports.Accordion=Jt;exports.Alert=gc;exports.ArrowIcon=nc;exports.AspectRatio=fc;exports.AttachmentGroup=oi;exports.AttachmentIcon=bt;exports.AttachmentPreview=jh;exports.AudioIcon=Zt;exports.AudioInput=Tc;exports.AudioWaveform=Qo;exports.Avatar=Vc;exports.BackIcon=Rl;exports.Background=_i;exports.Badge=Hc;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=Vi;exports.ChatWidget=$i;exports.ChatWidgetComponent=yr;exports.ChatWidgetWidget=ox;exports.CheckIcon=Ml;exports.Checkbox=pu;exports.ChevronIcon=ie;exports.ClockIcon=Ul;exports.CloseEyeIcon=Go;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=ti;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=cn;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=Hg;exports.FormikTextArea=Dg;exports.FormikTextField=Fg;exports.FormikToggle=ih;exports.FormikToggleGroup=sh;exports.FormikUploader=Ma;exports.GiftIcon=Wl;exports.HeartIcon=sl;exports.HelpIcon=Ki;exports.HomeIcon=bl;exports.HoverCard=be;exports.Icon=Ot;exports.IconPicker=Bm;exports.ImageIcon=el;exports.InfoIcon=ze;exports.InstagramIcon=nl;exports.LayoutIcon=Bl;exports.LikeIcon=Jl;exports.Link=Rn;exports.LinkIcon=Hl;exports.LinkedinIcon=ll;exports.Loader=ft;exports.LoadingSpinnerIcon=qo;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=gn;exports.MicrophoneIcon=No;exports.MinusIcon=rn;exports.Modal=De;exports.MoonIcon=Tl;exports.MoreIcon=Fl;exports.MousePointerIcon=dn;exports.NavigationMenu=at;exports.NotificationIcon=Sl;exports.OTPInput=Jp;exports.OpenEyeIcon=Yo;exports.Pagination=Xm;exports.PanelIcon=sn;exports.Password=Hp;exports.PauseIcon=nn;exports.PlayIcon=Oo;exports.PlusIcon=kl;exports.PowerOffIcon=Ll;exports.PrintIcon=Xl;exports.ProfileIcon=jl;exports.ProgressBar=Jm;exports.RefreshIcon=Yl;exports.Resizable=fr;exports.RotateIcon=Pl;exports.SaveIcon=ul;exports.SearchIcon=vt;exports.Select=Kd;exports.Selector=nu;exports.SendIcon=Uo;exports.Separator=rf;exports.SettingsIcon=an;exports.ShapeIcon=Vl;exports.ShareButton=pf;exports.ShareIcon=ln;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=Xo;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=Va;exports.ToggleGroup=pm;exports.Tooltip=br;exports.TrashIcon=Ol;exports.TwitchIcon=rl;exports.TwitterIcon=tl;exports.UnLikeIcon=Ql;exports.UnlockIcon=tc;exports.UploadIcon=Ko;exports.Uploader=ao;exports.UserIcon=Xi;exports.VideoIcon=Zi;exports.WarningIcon=vo;exports.WifiIcon=oc;exports.XIcon=ol;exports.YoutubeIcon=al;exports.ZapIcon=Dl;exports.ZoomInIcon=cc;exports.ZoomOutIcon=zl;exports.hideMessage=pn;exports.hideModal=ur;exports.showMessage=un;exports.showModal=Th;exports.showToast=Fe;exports.useMessageStore=no;exports.useModalStore=Ee;exports.useToast=Uf;
|
|
37
|
+
`})]})},ef=({number:e=20,children:o,...t})=>{const n=Array.from({length:e},(i,a)=>a);return r.jsxs(c.View,{width:"100%",height:"100%",backgroundColor:"black",position:"relative",overflow:"hidden",...t,children:[n.map(i=>{const a=i*37%200-100+"px",l=.2+i*13%6*.1+"s",d=(1+i*7%9)/2+"s",s=300+i*17%100+"px";return r.jsx(c.View,{position:"absolute",top:"0px",left:a,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(${s}) translateY(${s})`},iterationCount:"infinite",timingFunction:"linear",fillMode:"forwards",duration:d,delay:l},children:r.jsx(c.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)"})},i)}),o&&r.jsx(c.View,{position:"relative",zIndex:1,width:"100%",height:"100%",children:o})]})},Sr=["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)"],of=()=>Sr[Math.floor(Math.random()*Sr.length)],tf=({rows:e=15,cols:o=10,squareSize:t=40,...n})=>{const i=Array(e).fill(1),a=Array(o).fill(1);return r.jsx(c.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)",...n,children:i.map((l,d)=>r.jsx(c.Horizontal,{gap:0,children:a.map((s,u)=>r.jsx(c.View,{height:t/3,width:t,borderStyle:"solid",borderColor:"color-gray-200",borderWidth:.5,backgroundColor:"transparent",cursor:"pointer",on:{hover:{backgroundColor:of(),transition:"background-color 0.2s ease"}}},`col-${u}`))},`row-${d}`))})},rf=["rgb(59, 130, 246)","rgb(147, 51, 234)","rgb(236, 72, 153)","rgb(34, 197, 94)","rgb(251, 146, 60)","rgb(168, 85, 247)"],nf=({count:e=50,colors:o=rf,speed:t="medium",shapes:n=["circle"],...i})=>{const a=Array.from({length:e},(u,p)=>p),l=()=>{switch(t){case"slow":return .5;case"fast":return 2;default:return 1}},d=()=>n[Math.floor(Math.random()*n.length)],s=()=>o[Math.floor(Math.random()*o.length)];return r.jsx(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:a.map(u=>{const p=Math.random()*8+4,m=Math.random()*400,h=Math.random()*300,f=Math.random()*400,x=Math.random()*300,y=(Math.random()*10+5)/l(),b=Math.random()*5,k=d(),C=s(),S={circle:{borderRadius:"50%"},square:{borderRadius:"2px"},triangle:{borderRadius:"0",clipPath:"polygon(50% 0%, 0% 100%, 100% 100%)"}};return r.jsx(c.View,{position:"absolute",width:p,height:p,backgroundColor:C,opacity:.7,style:{left:m,top:h,...S[k]},animate:{from:{transform:"translate(0px, 0px) scale(0.5)",opacity:0},to:{transform:`translate(${f-m}px, ${x-h}px) scale(1)`,opacity:.7},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${y}s`,delay:`${b}s`}},u)})})},af=({gridSize:e=30,lineColor:o="rgba(59, 130, 246, 0.3)",pulseColor:t="rgba(59, 130, 246, 0.8)",animationSpeed:n="medium",...i})=>{const a=()=>{switch(n){case"slow":return 4;case"fast":return 1;default:return 2}},l=Math.floor(400/e),d=Math.floor(300/e),s=l*d,u=Array.from({length:s},(p,m)=>m);return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-900",...i,children:[Array.from({length:l+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:m*e,top:0,width:1,height:"100%",backgroundColor:o},`v-line-${m}`)),Array.from({length:d+1},(p,m)=>r.jsx(c.View,{position:"absolute",left:0,top:m*e,width:"100%",height:1,backgroundColor:o},`h-line-${m}`)),u.map(p=>{const m=p%l,h=Math.floor(p/l),f=(m+h)*.1;return r.jsx(c.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:t},iterationCount:"infinite",direction:"alternate",timingFunction:"ease-in-out",duration:`${a()}s`,delay:`${f}s`}},p)})]})},lf=["rgba(59, 130, 246, 0.6)","rgba(147, 51, 234, 0.6)","rgba(236, 72, 153, 0.6)","rgba(34, 197, 94, 0.6)"],cf=({rippleCount:e=5,colors:o=lf,maxSize:t=200,frequency:n=3,...i})=>{const a=Array.from({length:e},(l,d)=>({id:d,x:Math.random()*400,y:Math.random()*300,color:o[d%o.length],delay:d*(n/e),duration:3+Math.random()*2}));return r.jsxs(c.View,{width:400,height:300,position:"relative",overflow:"hidden",backgroundColor:"color-gray-100",...i,children:[a.map(l=>r.jsx(c.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(${t/20})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration}s`,delay:`${l.delay}s`}},l.id)),a.map(l=>r.jsx(c.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(${t/40})`,opacity:0},iterationCount:"infinite",timingFunction:"ease-out",duration:`${l.duration*1.2}s`,delay:`${l.delay+.5}s`}},`secondary-${l.id}`))]})},sf=({children:e,src:o,backgroundSize:t="cover",backgroundPosition:n="center",backgroundRepeat:i="no-repeat",backgroundAttachment:a="scroll",imageOpacity:l=1,overlay:d=null,blendMode:s="normal",views:u,themeMode:p,...m})=>{const h={...st.image,backgroundImage:`url(${o})`,backgroundSize:t,backgroundPosition:n,backgroundRepeat:i,backgroundAttachment:a,opacity:l};return r.jsxs(c.View,{...st.container,...u==null?void 0:u.container,...m,children:[r.jsx(c.View,{style:h,...u==null?void 0:u.image}),d,e&&r.jsx(c.View,{...st.content,...u==null?void 0:u.content,children:e})]})},df=({children:e,src:o,autoPlay:t=!0,loop:n=!0,muted:i=!0,playsInline:a=!0,overlay:l=null,blendMode:d="normal",views:s,themeMode:u,...p})=>r.jsxs(c.View,{...dt.container,...s==null?void 0:s.container,...p,children:[r.jsx(c.View,{as:"video",src:o,autoPlay:t,loop:n,muted:i,playsInline:a,style:dt.video,...s==null?void 0:s.video}),l,e&&r.jsx(c.View,{...dt.content,...s==null?void 0:s.content,children:e})]}),uf=({children:e,...o})=>r.jsx(Qh,{...o,children:e}),gf=({contentPosition:e,backgroundColor:o="color-black-900",...t})=>{const i=(()=>{let a=`${o}-100`,l=`${o}-900`,d=`${o}-600`,s=`${o}-400`;switch(o.indexOf("-")===-1&&(a=`color-mix(in srgb, ${o} 10%, transparent)`,l=`color-mix(in srgb, ${o} 90%, transparent)`,d=`color-mix(in srgb, ${o} 70%, transparent)`,s=`color-mix(in srgb, ${o} 50%, transparent)`),e){case"left":return`radial-gradient(circle at 70% 50%, ${a} 0%, ${a} 100%), linear-gradient(to right, ${l} 0%, ${d} 65%, ${a} 100%)`;case"right":return`radial-gradient(circle at 30% 50%, ${a} 0%, ${a} 100%), linear-gradient(to left, ${l} 0%, ${d} 65%, ${a} 100%)`;case"top":return`radial-gradient(circle at 50% 40%, ${a} 0%, ${a} 100%), linear-gradient(to bottom, ${l} 0%, ${d} 60%, ${a} 100%)`;case"bottom":return`radial-gradient(circle at 50% 60%, ${a} 0%, ${a} 100%), linear-gradient(to top, ${l} 0%, ${d} 60%, ${a} 100%)`;case"center":return`radial-gradient(circle at 50% 70%, ${l} 0%, ${a} 100%)`;default:return s}})();return r.jsx(c.View,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:i,pointerEvents:"none",zIndex:1,...t})},pf=({children:e,views:o,...t})=>r.jsx(Zh.Provider,{value:{},children:r.jsx(c.View,{...Gh.container,...o==null?void 0:o.container,...t,children:e})}),qa=g.forwardRef(({children:e,designProps:o,shape:t="rounded",decorationRotation:n=5,decorationScale:i=1,decorationOpacity:a=.8,views:l,...d},s)=>{const p=(b=>{switch(b){case"square":return"0px";case"pill":return"9999px";case"rounded":default:return"16px"}})(t),m=Math.abs(n)*(Math.PI/180),h=Math.sin(m)*100,f=(i-1)*100/2,x=Math.ceil(h+f),y=d.backgroundColor??"theme-primary";return r.jsx(c.View,{...d,ref:s,backgroundColor:"transparent",position:"relative",overflow:"visible",...l==null?void 0:l.container,children:r.jsxs(c.View,{padding:d.padding??`${96+x}px ${x}px`,position:"relative",overflow:"visible",children:[r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,backgroundColor:y,borderRadius:p,opacity:a/1.5,transform:`scale(${i})`,pointerEvents:"none",zIndex:1,...l==null?void 0:l.back}),r.jsx(c.View,{position:"absolute",top:x,left:x,right:x,bottom:x,transform:`rotate(${n}deg) scale(${i})`,opacity:a/1.2,backgroundColor:y,borderRadius:p,pointerEvents:"none",zIndex:2,...l==null?void 0:l.front}),r.jsx(c.View,{margin:"0 auto",position:"relative",zIndex:3,...l==null?void 0:l.content,children:e})]})})});qa.displayName="Background.Layout";const ie=pf;ie.Aurora=Jh;ie.Meteors=ef;ie.Wall=tf;ie.Particles=nf;ie.Grid=af;ie.Ripples=cf;ie.Image=sf;ie.Video=df;ie.Gradient=uf;ie.Overlay=gf;ie.Layout=qa;const Na=g.forwardRef((e,o)=>r.jsx(ie,{...e,ref:o}));Na.displayName="Background";const Ua=Object.assign(Na,{Layout:ie.Layout,Aurora:ie.Aurora,Meteors:ie.Meteors,Wall:ie.Wall,Particles:ie.Particles,Grid:ie.Grid,Ripples:ie.Ripples,Image:ie.Image,Video:ie.Video,Gradient:ie.Gradient,Overlay:ie.Overlay});Ua.displayName="Background";function mf(e){const{inputValue:o,onInputChange:t,onSubmit:n,messages:i=[]}=e,[a,l]=g.useState(""),d=g.useRef(null),s=g.useRef(null),u=o!==void 0,p=o!==void 0?o:a,m=g.useCallback(f=>{u?t==null||t(f):l(f)},[u,t]),h=g.useCallback(f=>{f&&f.preventDefault();const x=p.trim();x&&n&&(n(x),u||l(""),d.current&&(d.current.style.height="auto"))},[p,n,u]);return g.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[i.length]),{internalInputValue:p,handleInputChange:m,handleSubmit:h,inputRef:d,messagesRef:s}}const hf={sm:{fontSize:"13px",padding:"8px"},md:{fontSize:"14px",padding:"12px"},lg:{fontSize:"16px",padding:"16px"}},ff={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"}},xf={sm:{fontSize:"13px",padding:"6px 10px",borderRadius:"14px"},md:{fontSize:"14px",padding:"8px 12px",borderRadius:"16px"},lg:{fontSize:"16px",padding:"10px 16px",borderRadius:"18px"}},bf={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)"},yf={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)"},kf={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"},Ce={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:kf,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}},jf=({messages:e=[],inputPlaceholder:o="Type a message...",disableInput:t=!1,variant:n="default",size:i="md",showTimestamps:a=!0,enableAttachments:l=!1,enableContextPicker:d=!1,selectedContextElements:s=[],onContextPickerClick:u,onRemoveContextElement:p,isLoading:m=!1,loadingText:h="Loading...",styles:f={},maxHeight:x="600px",internalInputValue:y,handleInputChange:b,handleSubmit:k,inputRef:C,messagesRef:S,...j})=>{var R;const w={...Ce.container,...ff[n],...f.container},I={...Ce.messagesContainer,maxHeight:x,...f.messagesContainer},M={...Ce.inputContainer,...f.inputContainer},z={...Ce.input,...hf[i],...f.input},V=g.useCallback(E=>{b(E.target.value),E.target.style.height="auto",E.target.style.height=`${E.target.scrollHeight}px`},[b]),$=g.useCallback(E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),k())},[k]),T=y.trim().length>0,{onSubmit:_,...B}=j;return r.jsxs(c.View,{...w,...B,children:[r.jsxs(c.View,{ref:S,...I,children:[e.length===0?r.jsx(c.View,{display:"flex",alignItems:"center",justifyContent:"center",flex:1,color:"color-gray-400",children:r.jsx(c.Text,{fontSize:"14px",children:"No messages yet. Start a conversation!"})}):e.map(E=>r.jsx(Cf,{message:E,size:i,showTimestamp:a,styles:{bubble:f.bubble,userBubble:f.userBubble,assistantBubble:f.assistantBubble,timestamp:f.timestamp,reasoningContainer:f.reasoningContainer,reasoningContent:f.reasoningContent,errorMessage:f.errorMessage,systemMessage:f.systemMessage,toolMessage:f.toolMessage}},E.id)),m&&r.jsxs(c.Horizontal,{justifyContent:"flex-start",alignItems:"center",gap:8,marginTop:"8px",...f.loadingIndicator,children:[r.jsx(Tt,{widthHeight:12,color:"currentColor",filled:!1,style:{animation:"spin 1s linear infinite"}}),r.jsx(c.Text,{color:"color-gray-500",fontSize:"14px",children:h})]})]}),r.jsxs(c.View,{children:[s.length>0&&r.jsx(c.Horizontal,{gap:8,marginBottom:"8px",flexWrap:"wrap",paddingHorizontal:"20px",...f.contextChipsContainer,children:s.map(E=>r.jsxs(c.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:[r.jsx(c.Text,{fontSize:"12px",color:"color-blue-700",fontWeight:"500",children:E.name}),r.jsx(c.View,{as:"button",type:"button",onClick:()=>p==null?void 0:p(E.id),cursor:"pointer",border:"none",backgroundColor:"transparent",display:"flex",alignItems:"center",children:r.jsx(xe,{widthHeight:12,color:"color-blue-700"})})]},E.id))}),r.jsxs(c.View,{as:"form",onSubmit:k,...M,children:[l&&r.jsx(c.View,{as:"button",type:"button",...Ce.attachmentButton,...f.attachmentButton,_hover:{backgroundColor:"color-gray-100"},children:r.jsx(go,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"textarea",ref:C,value:y,onChange:V,onKeyDown:$,placeholder:o,disabled:t||m,...z,style:{...z,opacity:t||m?.5:1}}),r.jsxs(c.Vertical,{gap:4,alignItems:"center",children:[d&&r.jsx(c.View,{as:"button",type:"button",onClick:u,...Ce.attachmentButton,...f.contextPickerButton,_hover:{backgroundColor:"color-gray-100",...(R=f.contextPickerButton)==null?void 0:R._hover},title:"Select element from page",children:r.jsx(Pr,{widthHeight:16,color:"color-gray-600"})}),r.jsx(c.View,{as:"button",type:"submit",disabled:!T||t||m,...Ce.sendButton,backgroundColor:T?"theme-primary":"color-gray-300",_hover:{backgroundColor:T?"color-blue-600":"color-gray-300"},...f.sendButton,style:{cursor:T?"pointer":"not-allowed",opacity:!T||t||m?.6:1},children:r.jsx(It,{widthHeight:16,color:"color-white",filled:!1})})]})]})]})]})},Cf=({message:e,size:o,showTimestamp:t,styles:n})=>{const[i,a]=g.useState(!1),[l,d]=g.useState(!1),s=e.role==="user",u=e.messageType==="system",p=e.messageType==="error",m=e.messageType==="tool";if(u)return r.jsx(c.View,{display:"flex",justifyContent:"center",padding:"8px",width:"100%",...n.systemMessage,children:r.jsxs(c.Horizontal,{gap:6,alignItems:"center",opacity:.7,children:[r.jsx(Te,{widthHeight:12,color:"color-gray-600"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.content})]})});if(m)return r.jsx(c.View,{display:"flex",justifyContent:"flex-start",padding:"8px 16px",width:"100%",...n.toolMessage,children:r.jsxs(c.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:[r.jsx(zr,{widthHeight:14,color:"color-gray-600"}),r.jsxs(c.Vertical,{gap:2,children:[r.jsx(c.Text,{fontSize:"11px",fontWeight:"600",color:"color-gray-700",children:"Tool Usage"}),r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontFamily:"monospace",children:e.content})]})]})});const h={...Ce.bubble,...xf[o],...s?bf:yf,...p?{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)",color:"#b91c1c"}:{},...n.bubble,...s?n.userBubble:n.assistantBubble,...p?n.errorMessage:{}},f={...Ce.timestamp,[s?"right":"left"]:"8px",opacity:i?1:0,...n.timestamp};return r.jsx(c.View,{position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",justifyContent:s?"flex-end":"flex-start",children:r.jsxs(c.View,{...h,children:[t&&r.jsx(c.View,{...f,children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),p&&r.jsxs(c.Horizontal,{gap:6,marginBottom:"4px",alignItems:"center",children:[r.jsx(Uo,{widthHeight:14,color:"#b91c1c"}),r.jsx(c.Text,{fontWeight:"600",fontSize:"12px",children:"Error"})]}),e.reasoning&&r.jsxs(c.View,{marginBottom:"8px",borderBottom:"1px solid rgba(0,0,0,0.05)",paddingBottom:"8px",...n.reasoningContainer,children:[r.jsxs(c.Horizontal,{as:"button",onClick:()=>d(!l),cursor:"pointer",gap:4,alignItems:"center",backgroundColor:"transparent",border:"none",padding:0,children:[r.jsx(c.Text,{fontSize:"11px",color:"color-gray-500",fontWeight:"600",children:"Thinking Process"}),r.jsx(ae,{orientation:l?"down":"right",widthHeight:10,color:"color-gray-500"})]}),l&&r.jsx(c.View,{padding:"8px",backgroundColor:"rgba(0,0,0,0.03)",borderRadius:"8px",marginTop:"4px",...n.reasoningContent,children:r.jsx(c.Text,{fontSize:"12px",color:"color-gray-600",fontStyle:"italic",children:e.reasoning})})]}),r.jsx(c.View,{whiteSpace:"pre-wrap",wordBreak:"break-word",children:e.content}),e.attachments&&e.attachments.length>0&&r.jsx(c.Vertical,{gap:4,marginTop:"8px",children:e.attachments.map(x=>r.jsxs(c.Horizontal,{gap:6,padding:"6px 8px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",fontSize:"12px",children:[r.jsx(go,{widthHeight:14}),r.jsx(c.Text,{children:x.name})]},x.id))}),e.contextElements&&e.contextElements.length>0&&r.jsxs(c.Vertical,{gap:4,marginTop:"8px",children:[r.jsx(c.Text,{fontSize:"11px",color:"rgba(0,0,0,0.5)",fontWeight:"600",children:"Context:"}),e.contextElements.map(x=>r.jsx(c.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:r.jsx(c.Text,{color:"color-blue-700",fontWeight:"500",children:x.name})},x.id))]})]})})},Yt=e=>{const o=mf(e);return r.jsx(jf,{...e,...o})};Yt.displayName="ChatWidget";const Ga=Yt;function Sf({onSelect:e,onCancel:o,active:t}){const[n,i]=g.useState(null);g.useRef(null);const a=g.useCallback(s=>{var f;if(!t)return;const u=document.elementFromPoint(s.clientX,s.clientY);if(!u||u===document.body||u.closest('[data-chatwidget-ignore="true"]')||u.closest("#chatwidget-overlay")){i(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 x=u.className.split(" ")[0];x&&(m+=`.${x}`)}const h=(f=u.innerText)==null?void 0:f.slice(0,20);h&&(m+=` ("${h}...")`),i({id:u.id||`el-${Date.now()}`,name:m,tagName:u.tagName.toLowerCase(),rect:p})},[t]),l=g.useCallback(s=>{!t||s.target.closest('[data-chatwidget-ignore="true"]')||(s.preventDefault(),s.stopPropagation(),n&&e(n))},[t,n,e]),d=g.useCallback(s=>{t&&s.key==="Escape"&&o()},[t,o]);return g.useEffect(()=>(t?(document.addEventListener("mousemove",a),document.addEventListener("click",l,!0),document.addEventListener("keydown",d),document.body.style.cursor="crosshair"):(i(null),document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",d),document.body.style.cursor=""}),[t,a,l,d]),{highlightedElement:n}}function wf({element:e}){return e?r.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:r.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 If=({initialMessages:e=[],onSendMessage:o,bubbleSize:t="md"})=>{const[n,i]=g.useState(!1),[a,l]=g.useState(!1),[d,s]=g.useState(e),[u,p]=g.useState([]),{highlightedElement:m}=Sf({active:a,onSelect:b=>{p(k=>[...k,b]),l(!1),i(!0)},onCancel:()=>{l(!1),i(!0)}}),h=()=>i(!n),f=()=>{l(!0),i(!1)},x=b=>{p(k=>k.filter(C=>C.id!==b))},y=b=>{const k={id:Date.now().toString(),role:"user",content:b,timestamp:new Date,contextElements:[...u]};s(C=>[...C,k]),o==null||o(b,u),p([]),setTimeout(()=>{var w;const C=Math.random()>.7,S=Math.random()>.4,j={id:(Date.now()+1).toString(),role:"assistant",timestamp:new Date,content:C?"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:C?"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};s(I=>[...I,j]),C&&setTimeout(()=>{s(I=>[...I,{id:(Date.now()+2).toString(),role:"assistant",messageType:"system",content:'Tool "highlightElement" executed successfully.',timestamp:new Date}])},800)},1e3)};return r.jsxs(c.View,{position:"fixed",bottom:24,right:24,zIndex:9999,children:[r.jsx(wf,{element:m}),a&&r.jsx(c.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:r.jsx(c.Text,{fontWeight:"600",fontSize:"14px",children:"Click an element to select it. Press ESC to cancel."})}),n&&r.jsxs(c.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:[r.jsxs(c.View,{padding:"16px",borderBottom:"1px solid rgba(0,0,0,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsx(c.Text,{fontWeight:"bold",color:"color-gray-800",children:"ChatWidget Assistant"}),r.jsx(c.View,{as:"button",onClick:()=>i(!1),cursor:"pointer",padding:"4px",borderRadius:"50%",border:"none",backgroundColor:"transparent",_hover:{backgroundColor:"rgba(0,0,0,0.05)"},children:r.jsx(xe,{widthHeight:16,color:"color-gray-500"})})]}),r.jsx(Ga,{messages:d,onSubmit:y,size:t,variant:"minimal",enableContextPicker:!0,selectedContextElements:u,onContextPickerClick:f,onRemoveContextElement:x,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)"}}})]}),!a&&r.jsx(c.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:n?r.jsx(xe,{widthHeight:24,color:"white"}):r.jsx(Er,{widthHeight:24,color:"white"})})]})};exports.Accordion=Do;exports.Alert=wl;exports.ArrowIcon=hl;exports.AspectRatio=Ml;exports.AttachmentGroup=pa;exports.AttachmentIcon=go;exports.AttachmentPreview=Ug;exports.AudioIcon=Fo;exports.AudioInput=Bl;exports.AudioWaveform=Et;exports.Avatar=Ol;exports.BackIcon=Ai;exports.Background=Ua;exports.Badge=vl;exports.BatteryIcon=Si;exports.BluetoothIcon=ul;exports.BoldArrowIcon=ml;exports.BookmarkIcon=wi;exports.Button=We;exports.CalendarIcon=ol;exports.CameraIcon=dl;exports.Card=Xo;exports.Carousel=ve;exports.Chart=qc;exports.ChartIcon=Hi;exports.ChatInput=Oa;exports.ChatWidget=Ga;exports.ChatWidgetComponent=Yt;exports.ChatWidgetWidget=If;exports.CheckIcon=Li;exports.Checkbox=$s;exports.ChevronIcon=ae;exports.ClockIcon=tl;exports.CloseEyeIcon=Mt;exports.CloseIcon=xe;exports.CloudIcon=Ii;exports.ColorInput=Fs;exports.ColorPicker=rm;exports.ComboBox=pu;exports.Command=Je;exports.ContextMenu=Xe;exports.CookieConsent=vc;exports.CopyIcon=Ti;exports.CountryPicker=vs;exports.CreditCardIcon=Qi;exports.CropIcon=bl;exports.DatePicker=nu;exports.DeleteIcon=Mi;exports.Divider=Mm;exports.DocumentIcon=$i;exports.DownloadIcon=Vi;exports.DragAndDrop=Lp;exports.DragAndDropComponent=ga;exports.DragHandleIcon=si;exports.DragHandleLinesIcon=kl;exports.Drawer=Qe;exports.DropZone=Op;exports.DropdownMenu=bo;exports.DustBinIcon=Oo;exports.EditIcon=zi;exports.EmojiPicker=am;exports.ErrorIcon=Uo;exports.ExternalLinkIcon=Vr;exports.FacebookIcon=xi;exports.FileIcon=uo;exports.FileImage=ts;exports.FileSVG=os;exports.FilterIcon=el;exports.FolderIcon=ci;exports.FormikChatInput=vu;exports.FormikCheckbox=Tu;exports.FormikColorInput=Ku;exports.FormikComboBox=mg;exports.FormikCountryPicker=eg;exports.FormikDatePicker=Zu;exports.FormikEmojiPicker=Ng;exports.FormikForm=Su;exports.FormikIconPicker=Bg;exports.FormikOTPInput=Cg;exports.FormikPassword=gg;exports.FormikRadio=_u;exports.FormikSelect=tg;exports.FormikSelector=Ig;exports.FormikSlider=kg;exports.FormikSwitch=ng;exports.FormikTagInput=ig;exports.FormikTextArea=cg;exports.FormikTextField=dg;exports.FormikToggle=Rg;exports.FormikToggleGroup=Pg;exports.FormikUploader=Ln;exports.GiftIcon=Ni;exports.HeartIcon=ki;exports.HelpIcon=li;exports.HomeIcon=Ri;exports.HoverCard=fe;exports.Icon=Eo;exports.IconPicker=lm;exports.ImageIcon=ui;exports.InfoIcon=Te;exports.InstagramIcon=hi;exports.LayoutIcon=Xi;exports.LikeIcon=sl;exports.Link=Lr;exports.LinkIcon=vi;exports.LinkedinIcon=bi;exports.Loader=so;exports.LoadingSpinnerIcon=Tt;exports.LockIcon=Pi;exports.LogoutIcon=Gi;exports.MagicWandIcon=ll;exports.MapPinIcon=rl;exports.MediaPreview=vg;exports.MenuIcon=nl;exports.Menubar=Be;exports.MessageLayout=El;exports.MessageView=$r;exports.MicrophoneIcon=wt;exports.MinusIcon=Tr;exports.Modal=He;exports.MoonIcon=Bi;exports.MoreIcon=Zi;exports.MousePointerIcon=Pr;exports.NavigationMenu=Ze;exports.NotificationIcon=_i;exports.OTPInput=ju;exports.OpenEyeIcon=zt;exports.Pagination=bm;exports.PanelIcon=Er;exports.Password=iu;exports.PauseIcon=Mr;exports.PlayIcon=Ct;exports.PlusIcon=Ei;exports.PowerOffIcon=Yi;exports.PrintIcon=il;exports.ProfileIcon=Wi;exports.ProgressBar=jm;exports.RefreshIcon=al;exports.Resizable=Nt;exports.RotateIcon=qi;exports.SaveIcon=Ci;exports.SearchIcon=Po;exports.Select=ys;exports.Selector=Ms;exports.SendIcon=It;exports.Separator=Tm;exports.SettingsIcon=zr;exports.ShapeIcon=Oi;exports.ShareButton=_m;exports.ShareIcon=Rr;exports.ShieldIcon=Ui;exports.Sidebar=yo;exports.Slider=Yg;exports.SliderIcon=xl;exports.SpinnerIcon=fl;exports.StarIcon=ji;exports.StatusIndicator=Hm;exports.StopIcon=qo;exports.SuccessIcon=Rt;exports.Switch=Is;exports.Table=je;exports.Tabs=Zo;exports.TagInput=fu;exports.TextArea=Rs;exports.TextField=fo;exports.TextIcon=Fi;exports.ThreadsIcon=yi;exports.TickIcon=No;exports.Title=Wp;exports.Toast=gh;exports.Toggle=On;exports.ToggleGroup=$p;exports.Tooltip=Gt;exports.TrashIcon=Ji;exports.TwitchIcon=mi;exports.TwitterIcon=gi;exports.UnLikeIcon=cl;exports.UnlockIcon=gl;exports.UploadIcon=Vt;exports.Uploader=Yo;exports.UserIcon=ii;exports.VideoIcon=di;exports.WarningIcon=St;exports.WifiIcon=pl;exports.XIcon=pi;exports.YoutubeIcon=fi;exports.ZapIcon=Ki;exports.ZoomInIcon=yl;exports.ZoomOutIcon=Di;exports.hideMessage=_r;exports.hideModal=At;exports.showMessage=Wr;exports.showModal=Xg;exports.showToast=Le;exports.useMessageStore=Go;exports.useModalStore=Me;exports.useToast=ph;
|
|
65
38
|
//# sourceMappingURL=web.cjs.js.map
|