obeyaka-ui 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2767 -5586
- package/dist/index.js +2 -717
- package/dist/types/components/organisms/AvatarSelector/AvatarSelector.d.ts +1 -1
- package/dist/types/components/organisms/AvatarSelector/Tabs.d.ts +2 -2
- package/dist/types/components/organisms/AvatarSelector/index.d.ts +9 -9
- package/dist/types/components/organisms/ModalSettings/ModalSettings.d.ts +29 -0
- package/dist/types/components/organisms/ModalSettings/ModalSettings.d.ts.map +1 -0
- package/dist/types/components/organisms/ModalSettings/ModalSettings.types.d.ts +19 -0
- package/dist/types/components/organisms/ModalSettings/ModalSettings.types.d.ts.map +1 -0
- package/dist/types/components/organisms/ModalSettings/index.d.ts +3 -0
- package/dist/types/components/organisms/ModalSettings/index.d.ts.map +1 -0
- package/dist/types/components/organisms/ShareModal/ShareModal.d.ts +3 -0
- package/dist/types/components/organisms/ShareModal/ShareModal.d.ts.map +1 -0
- package/dist/types/components/organisms/ShareModal/ShareModal.types.d.ts +27 -0
- package/dist/types/components/organisms/ShareModal/ShareModal.types.d.ts.map +1 -0
- package/dist/types/components/organisms/ShareModal/index.d.ts +3 -0
- package/dist/types/components/organisms/ShareModal/index.d.ts.map +1 -0
- package/dist/types/components/organisms/index.d.ts +4 -0
- package/dist/types/components/organisms/index.d.ts.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ct=Object.create;var Ke=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var St=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var $t=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of _t(n))!Mt.call(e,s)&&s!==t&&Ke(e,s,{get:()=>n[s],enumerable:!(r=jt(n,s))||r.enumerable});return e};var Ee=(e,n,t)=>(t=e!=null?Ct(St(e)):{},$t(n||!e||!e.__esModule?Ke(t,"default",{value:e,enumerable:!0}):t,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),a=require("@mantine/core"),C=require("@tabler/icons-react"),je=require("@emoji-mart/data"),zt=require("@mantine/hooks"),Ot=require("@mantine/notifications"),Dt=require("@mantine/modals"),Tt=require("@mantine/dates"),W=p.memo(({onClick:e,icon:n,changeIconOnHover:t=!1,iconHovered:r,iconColor:s="var(--mantine-color-gray-7)",size:i="md",variant:c="transparent",bg:u,disabled:l=!1,loading:f=!1,tooltip:d,"aria-label":g,className:h,style:x,onMouseEnter:v,onMouseLeave:I,...m})=>{const[y,w]=p.useState(!1),S=p.useCallback(()=>{l||f||(e==null||e(),console.log("Clicked"))},[l,f,e]),_=p.useMemo(()=>({xs:14,sm:16,md:20,lg:24,xl:28})[i]||20,[i]),$=p.useMemo(()=>({xs:2,sm:2,md:2,lg:2,xl:2.5})[i]||2,[i]),D=p.useCallback(B=>{w(!0),v==null||v(B)},[v]),z=p.useCallback(B=>{w(!1),I==null||I(B)},[I]),k=p.useMemo(()=>{if(u)return u;if(c==="transparent")return y?"var(--mantine-color-gray-2)":"transparent"},[u,c,y]),R=p.useMemo(()=>t&&r&&y?r:n,[t,r,y,n]),L=p.useMemo(()=>o.jsx(R,{size:_,strokeWidth:$,color:s}),[R,_,$,s]),T=o.jsx(a.ActionIcon,{onClick:S,bg:k,color:s,radius:"md",variant:c==="transparent"?"transparent":c,size:i,disabled:l||f,loading:f,onMouseEnter:D,onMouseLeave:z,"aria-label":g||d,className:h,style:x,...m,children:L});return d&&!l&&!f?o.jsx(a.Tooltip,{label:d,position:"top",withArrow:!0,children:T}):T});W.displayName="ActionButton";const Rt=e=>{const n={xs:{width:28,height:28,fontSize:16},sm:{width:32,height:32,fontSize:24},md:{width:36,height:36,fontSize:32},lg:{width:40,height:40,fontSize:40},xl:{width:44,height:44,fontSize:48}};return typeof e=="number"?{width:e,height:e,fontSize:e-8}:n[e]},Cn=({emoji:e,size:n="lg",editable:t=!1,onClick:r,className:s,style:i})=>{const c=Rt(n),u=t&&r;return o.jsx(a.Box,{className:s,style:{...c,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:u?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...i},onClick:u?r:void 0,onMouseEnter:l=>{u&&(l.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:l=>{u&&(l.currentTarget.style.backgroundColor="transparent")},children:o.jsx(a.Box,{style:{fontSize:c.fontSize,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},children:e})})},ie=e=>{if(typeof e=="number")return e;switch(e){case"xs":return 24;case"sm":return 32;case"md":return 48;case"lg":return 64;case"xl":return 80;default:return 64}},J=new Map,Et=["IconUser","IconHeart","IconStar","IconSmile","IconSun","IconMoon","IconCamera","IconMusic","IconCode","IconBriefcase","IconHome","IconSearch","IconSettings","IconMail","IconPhone","IconBell","IconBookmark","IconCalendar","IconClock","IconDownload","IconEdit","IconEye","IconFile","IconFolder","IconImage","IconLink","IconLock","IconMessage","IconPlus","IconShare","IconThumbUp","IconTrash"],Bt=async()=>{try{const e=await import("@tabler/icons-react");Et.forEach(n=>{if(!J.has(n)){const t=e[n];t&&J.set(n,t)}})}catch(e){console.warn("Error preloading common icons:",e)}};Bt();const Pt=async e=>{if(J.has(e))return J.get(e);try{const r=(await import("@tabler/icons-react"))[e]||C.IconQuestionMark;return J.set(e,r),r}catch{return J.set(e,C.IconQuestionMark),C.IconQuestionMark}},Lt=e=>e.replace(/^Icon/,"").replace(/([A-Z])/g," $1").trim().toLowerCase().replace(/^./,t=>t.toUpperCase()),jn=p.memo(({iconName:e,onClick:n,size:t=20})=>{const[r,s]=p.useState(null),[i,c]=p.useState(!0),u=p.useRef(null),l=p.useRef(!0);p.useEffect(()=>(l.current=!0,(async()=>{try{const h=(await import("@tabler/icons-react"))[e];l.current&&(s(h?()=>h:C.IconQuestionMark),c(!1))}catch{l.current&&(s(()=>C.IconQuestionMark),c(!1))}})(),()=>{l.current=!1}),[e]);const f=()=>{i||n()};return i?o.jsx(a.Box,{ref:u,style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",border:"none",borderRadius:"var(--mantine-radius-sm)"},children:o.jsx(a.Skeleton,{width:t,height:t})}):o.jsx(a.Tooltip,{label:Lt(e),position:"top",withArrow:!0,openDelay:300,withinPortal:!0,zIndex:1e3,color:"dark",children:o.jsx(a.Box,{ref:u,onClick:f,style:{width:"40px",height:"40px",fontSize:`${t}px`,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",border:"none",transition:"all 0.2s ease",cursor:i?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)"},onMouseEnter:d=>{i||(d.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)",d.currentTarget.style.transform="scale(1.05)")},onMouseLeave:d=>{i||(d.currentTarget.style.backgroundColor="transparent",d.currentTarget.style.transform="scale(1)")},onMouseDown:d=>{i||(d.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)",d.currentTarget.style.transform="scale(0.95)")},onMouseUp:d=>{i||(d.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)",d.currentTarget.style.transform="scale(1.05)")},children:r&&o.jsx(r,{size:t,color:"var(--mantine-color-gray-7)"})})})});jn.displayName="IconButton";const _n=p.memo(({iconName:e,size:n="lg",style:t,withBorder:r=!1,radius:s="md",onClick:i,onMouseEnter:c,onMouseLeave:u})=>{const[l,f]=p.useState(!1),[d,g]=p.useState(()=>J.get(e)||null),h=ie(n),x=Math.round(h*.9);p.useEffect(()=>{if(J.has(e)){g(()=>J.get(e));return}let I=!0;return Pt(e).then(m=>{I&&g(()=>m)}),()=>{I=!1}},[e]);const v=()=>typeof s=="number"?s:`var(--mantine-radius-${s})`;return d?o.jsx(a.Box,{style:{width:`${h}px !important`,height:`${h}px !important`,minWidth:`${h}px`,minHeight:`${h}px`,maxWidth:`${h}px`,maxHeight:`${h}px`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:v(),cursor:i?"pointer":"default",border:r?"1px solid var(--mantine-color-gray-4)":"none",backgroundColor:l?"var(--mantine-color-gray-0)":"transparent",flexShrink:0,boxSizing:"border-box",transition:"background-color 0.2s ease",...t},onClick:i,onMouseEnter:I=>{f(!0),c==null||c(I)},onMouseLeave:I=>{f(!1),u==null||u(I)},children:o.jsx(d,{size:x,color:"var(--mantine-color-gray-8)"})}):o.jsx(a.Box,{style:{width:`${h}px !important`,height:`${h}px !important`,minWidth:`${h}px`,minHeight:`${h}px`,maxWidth:`${h}px`,maxHeight:`${h}px`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:v(),cursor:i?"pointer":"default",border:r?"1px solid var(--mantine-color-gray-4)":"none",backgroundColor:l?"var(--mantine-color-gray-0)":"transparent",flexShrink:0,boxSizing:"border-box",transition:"background-color 0.2s ease",...t},onClick:i,onMouseEnter:I=>{f(!0),c==null||c(I)},onMouseLeave:I=>{f(!1),u==null||u(I)}})});_n.displayName="IconAvatar";const At=e=>{const n={xs:{width:28,height:28},sm:{width:32,height:32},md:{width:36,height:36},lg:{width:40,height:40},xl:{width:44,height:44}};return typeof e=="number"?{width:e,height:e}:n[e]},Sn=({iconName:e,size:n="lg",editable:t=!1,onClick:r,className:s,style:i})=>{const c=At(n),u=t&&r;return o.jsx(a.Box,{className:s,style:{...c,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:u?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...i},onClick:u?r:void 0,onMouseEnter:l=>{u&&(l.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:l=>{u&&(l.currentTarget.style.backgroundColor="transparent")},children:o.jsx(a.Box,{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(_n,{iconName:e,size:c.width,onClick:void 0})})})},Ht=e=>{const n={xs:{width:28,height:28},sm:{width:32,height:32},md:{width:36,height:36},lg:{width:40,height:40},xl:{width:44,height:44}};return typeof e=="number"?{width:e,height:e}:n[e]},Mn=({src:e,size:n="lg",editable:t=!1,onClick:r,className:s,style:i,loading:c=!1,alt:u="Avatar"})=>{const[l,f]=p.useState(!1),d=Ht(n),g=t&&r,h=()=>{f(!0)},x=()=>{f(!1)};return o.jsx(a.Box,{className:s,style:{...d,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:g?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...i},onClick:g?r:void 0,onMouseEnter:v=>{g&&(v.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:v=>{g&&(v.currentTarget.style.backgroundColor="transparent")},children:c?o.jsx(a.Loader,{size:"sm",color:"var(--mantine-color-gray-6)",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}):!l&&o.jsx("img",{src:e,alt:u,style:{width:"100%",height:"100%",objectFit:"cover"},onError:h,onLoad:x})})},Ft=e=>{const n={xs:{width:28,height:28,fontSize:14},sm:{width:32,height:32,fontSize:16},md:{width:36,height:36,fontSize:20},lg:{width:40,height:40,fontSize:24},xl:{width:44,height:44,fontSize:32}};return typeof e=="number"?{width:e,height:e,fontSize:e*.5}:n[e]},_e=({text:e="?",size:n="lg",editable:t=!1,onClick:r,className:s,style:i,loading:c=!1})=>{const u=Ft(n),l=t&&r;return o.jsx(a.Box,{className:s,style:{...u,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:l?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"var(--mantine-color-gray-2)",...i},onClick:l?r:void 0,onMouseEnter:f=>{l&&(f.currentTarget.style.backgroundColor="var(--mantine-color-gray-3)")},onMouseLeave:f=>{l&&(f.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)")},children:c?o.jsx(a.Loader,{size:"sm",color:"var(--mantine-color-gray-6)",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}):o.jsx(a.Box,{style:{fontSize:u.fontSize,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,color:"var(--mantine-color-gray-7)"},children:e})})},$n=e=>{if(!e)return"";const n=["de","del","la","las","los","y","el","en","con"],r=e.trim().split(/\s+/).filter(s=>!n.includes(s.toLowerCase())).map(s=>{var i;return((i=s[0])==null?void 0:i.toUpperCase())||""}).filter(Boolean).slice(0,2).join("");return r.length===1?r+r:r.length===0?e.slice(0,2).toUpperCase():r},ae=({avatar:e,size:n="lg",loading:t=!1,onClick:r,className:s,style:i,showPlaceholder:c=!0,placeholder:u,editable:l=!1})=>{const f=()=>{if(e)switch(e.type){case"emoji":return o.jsx(Cn,{emoji:e.value,size:n,editable:l,onClick:r});case"icon":return o.jsx(Sn,{iconName:e.value,size:n,editable:l,onClick:r});case"image":return o.jsx(Mn,{src:e.value,size:n,editable:l,onClick:r})}if(c){const g=u?$n(u):"?";return o.jsx(_e,{text:g,size:n,editable:l,onClick:r})}return null};if(t)return o.jsx(_e,{size:n,loading:!0,className:s,style:i});const d=f();return d?o.jsx("div",{className:s,style:i,children:d}):null},zn=({label:e,onClick:n,isActive:t=!1})=>{const[r,s]=p.useState(!1);return o.jsx(a.Box,{onClick:n,bg:r||t?"var(--mantine-color-gray-0)":"transparent",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),h:28,style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",padding:"0px 10px",cursor:"pointer"},children:o.jsx(a.Text,{fw:500,fz:"sm",truncate:"end",c:"var(--mantine-color-gray-9)",children:e})})},Ut=new URL("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTUiIGhlaWdodD0iNTYiIHZpZXdCb3g9IjAgMCA1NSA1NiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMC43NUg1NVY1NS43NUgwVjAuNzVaIiBmaWxsPSIjRjZGNUY0Ii8+CjxwYXRoIGQ9Ik04LjgwMDI5IDM0LjYzQzguODAwMjkgMzQuMTQ0IDkuMTk0MjggMzMuNzUgOS42ODAyOSAzMy43NUgxOC45MjAzQzE5LjQwNjMgMzMuNzUgMTkuODAwMyAzNC4xNDQgMTkuODAwMyAzNC42M1Y0My44N0MxOS44MDAzIDQ0LjM1NiAxOS40MDYzIDQ0Ljc1IDE4LjkyMDMgNDQuNzVIOS42ODAyOUM5LjE5NDI4IDQ0Ljc1IDguODAwMjkgNDQuMzU2IDguODAwMjkgNDMuODdWMzQuNjNaIiBmaWxsPSIjRkZDQTAwIi8+CjxwYXRoIGQ9Ik0yMi4wMDAyIDIzLjYzQzIyLjAwMDIgMjMuMTQ0IDIyLjM5NDIgMjIuNzUgMjIuODgwMiAyMi43NUgzMi4xMjAyQzMyLjYwNjMgMjIuNzUgMzMuMDAwMiAyMy4xNDQgMzMuMDAwMiAyMy42M1Y0My44N0MzMy4wMDAyIDQ0LjM1NiAzMi42MDYzIDQ0Ljc1IDMyLjEyMDIgNDQuNzVIMjIuODgwMkMyMi4zOTQyIDQ0Ljc1IDIyLjAwMDIgNDQuMzU2IDIyLjAwMDIgNDMuODdWMjMuNjNaIiBmaWxsPSIjMzdDRTkxIi8+CjxwYXRoIGQ9Ik0zNS4yMDAyIDEyLjYzQzM1LjIwMDIgMTIuMTQ0IDM1LjU5NDIgMTEuNzUgMzYuMDgwMiAxMS43NUg0NS4zMjAyQzQ1LjgwNjIgMTEuNzUgNDYuMjAwMiAxMi4xNDQgNDYuMjAwMiAxMi42M1Y0My44N0M0Ni4yMDAyIDQ0LjM1NiA0NS44MDYyIDQ0Ljc1IDQ1LjMyMDIgNDQuNzVIMzYuMDgwMkMzNS41OTQyIDQ0Ljc1IDM1LjIwMDIgNDQuMzU2IDM1LjIwMDIgNDMuODdWMTIuNjNaIiBmaWxsPSIjRkIzNzU3Ii8+CjxwYXRoIGQ9Ik04LjgwMDA1IDE3LjI1QzguODAwMDUgMTQuMjEyNCAxMS4yNjI1IDExLjc1IDE0LjMgMTEuNzVDMTcuMzM3NiAxMS43NSAxOS44IDE0LjIxMjQgMTkuOCAxNy4yNUMxOS44IDIwLjI4NzYgMTcuMzM3NiAyMi43NSAxNC4zIDIyLjc1QzExLjI2MjUgMjIuNzUgOC44MDAwNSAyMC4yODc2IDguODAwMDUgMTcuMjVaIiBmaWxsPSIjMDA3MkZGIi8+Cjwvc3ZnPgo=",self.location).href,On=({appName:e="Obeyaka",size:n="md",showText:t=!0,color:r="var(--mantine-color-dark-6)",radius:s})=>{const i=()=>{switch(n){case"xs":return{icon:20,text:"xs"};case"sm":return{icon:28,text:"md"};case"md":return{icon:36,text:"lg"};case"lg":return{icon:44,text:"xl"};default:return{icon:36,text:"lg"}}},c=()=>{switch(s){case"full":return"9999px";case"xs":return"var(--mantine-radius-xs)";case"sm":return"var(--mantine-radius-sm)";case"md":return"var(--mantine-radius-md)";case"lg":return"var(--mantine-radius-lg)";case"xl":return"var(--mantine-radius-xl)";default:return 0}},{icon:u,text:l}=i(),f=()=>{const d=u*56/55;return o.jsx("img",{src:Ut,alt:`${e} Logo`,width:u,height:d,style:{display:"block",flexShrink:0,borderRadius:c()}})};return o.jsxs(a.Group,{gap:"xs",align:"center",wrap:"nowrap",children:[f(),t&&o.jsx(a.Text,{size:l,fw:700,c:r==="white"?"white":r,style:{fontFamily:"Inter, -apple-system, BlinkMacSystemFont, sans-serif"},children:e})]})},Dn=({expandDirection:e="right",placeholder:n="Type to search",value:t="",onChange:r,onSearch:s,onClear:i,size:c="md",disabled:u=!1,className:l})=>{const[f,d]=p.useState(!1),[g,h]=p.useState(!1),[x,v]=p.useState(t),I=p.useRef(null),m=p.useRef(null);p.useEffect(()=>{v(t)},[t]),p.useEffect(()=>{f&&I.current&&I.current.focus()},[f]),p.useEffect(()=>{const k=R=>{m.current&&!m.current.contains(R.target)&&y()};if(f)return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[f]);const y=()=>{h(!0),setTimeout(()=>{d(!1),h(!1)},200)},w=()=>{u||d(!0)},S=k=>{const R=k.target.value;v(R),r==null||r(R)},_=k=>{k.key==="Enter"&&(s==null||s(x)),k.key==="Escape"&&y()},$=()=>{v(""),r==null||r(""),i==null||i(),y()},z=(()=>{switch(c){case"sm":return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-sm)"};case"lg":return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-md)"};default:return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-sm)"}}})();return o.jsxs(a.Box,{ref:m,className:l,style:{position:"relative",display:"inline-flex",alignItems:"center"},children:[o.jsxs(a.Group,{gap:0,style:{position:"relative",transition:"all 0.2s ease",borderRadius:"var(--mantine-radius-md)"},children:[o.jsx(a.Box,{onClick:w,style:{display:"flex",alignItems:"center",justifyContent:"center",width:z.inputHeight,height:z.inputHeight,cursor:u?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)",transition:"background-color 0.2s ease",opacity:u?.5:1},onMouseEnter:k=>{u||(k.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},children:o.jsx(C.IconSearch,{size:z.iconSize,color:"var(--mantine-color-gray-6)",strokeWidth:2.3})}),f&&o.jsx(a.TextInput,{ref:I,value:x,onChange:S,onKeyDown:_,placeholder:n,disabled:u,height:z.inputHeight,fw:500,styles:{root:{position:"relative",animation:g?`shrink${e==="right"?"Right":"Left"} 0.2s ease forwards`:`expand${e==="right"?"Right":"Left"} 0.2s ease forwards`},input:{border:"none",outline:"none",backgroundColor:"transparent",padding:"0 8px",height:z.inputHeight,minHeight:z.inputHeight,fontSize:z.fontSize,color:"var(--mantine-color-gray-8)",borderRadius:"var(--mantine-radius-md)",transition:"background-color 0.2s ease",display:"flex",alignItems:"center","&:hover":{backgroundColor:"var(--mantine-color-gray-1)"},"&:focus":{backgroundColor:"var(--mantine-color-gray-1)"},"&::placeholder":{color:"var(--mantine-color-gray-5)"}}},rightSection:x&&o.jsx(a.Box,{onClick:$,style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"4px",borderRadius:"var(--mantine-radius-xl)",transition:"background-color 0.2s ease"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},children:o.jsx(C.IconX,{size:14,color:"var(--mantine-color-gray-6)",strokeWidth:2.3})}),rightSectionWidth:x?24:0})]}),o.jsx("style",{children:`
|
|
1
|
+
"use strict";var _e=Object.create;var he=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Je=(o,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ye(r))!Ke.call(o,a)&&a!==t&&he(o,a,{get:()=>r[a],enumerable:!(s=Ze(r,a))||s.enumerable});return o};var le=(o,r,t)=>(t=o!=null?_e(Xe(o)):{},Je(r||!o||!o.__esModule?he(t,"default",{value:o,enumerable:!0}):t,o));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),n=require("@mantine/core"),w=require("@tabler/icons-react"),ae=require("@emoji-mart/data"),me=require("emoji-mart"),en=require("@mantine/hooks"),nn=require("@mantine/notifications"),on=require("@mantine/modals"),tn=require("@mantine/dates"),H=l.memo(({onClick:o,icon:r,changeIconOnHover:t=!1,iconHovered:s,iconColor:a="var(--mantine-color-gray-7)",size:c="md",variant:i="transparent",bg:u,disabled:d=!1,loading:f=!1,tooltip:I,"aria-label":m,className:h,style:b,onMouseEnter:j,onMouseLeave:x,...g})=>{const[v,y]=l.useState(!1),C=l.useCallback(()=>{d||f||(o==null||o(),console.log("Clicked"))},[d,f,o]),k=l.useMemo(()=>({xs:14,sm:16,md:20,lg:24,xl:28})[c]||20,[c]),O=l.useMemo(()=>({xs:2,sm:2,md:2,lg:2,xl:2.5})[c]||2,[c]),z=l.useCallback(B=>{y(!0),j==null||j(B)},[j]),M=l.useCallback(B=>{y(!1),x==null||x(B)},[x]),p=l.useMemo(()=>{if(u)return u;if(i==="transparent")return v?"var(--mantine-color-gray-2)":"transparent"},[u,i,v]),R=l.useMemo(()=>t&&s&&v?s:r,[t,s,v,r]),E=l.useMemo(()=>e.jsx(R,{size:k,strokeWidth:O,color:a}),[R,k,O,a]),D=e.jsx(n.ActionIcon,{onClick:C,bg:p,color:a,radius:"md",variant:i==="transparent"?"transparent":i,size:c,disabled:d||f,loading:f,onMouseEnter:z,onMouseLeave:M,"aria-label":m||I,className:h,style:b,...g,children:E});return I&&!d&&!f?e.jsx(n.Tooltip,{label:I,position:"top",withArrow:!0,children:D}):D});H.displayName="ActionButton";const rn=o=>{const r={xs:{width:28,height:28,fontSize:16},sm:{width:32,height:32,fontSize:24},md:{width:36,height:36,fontSize:32},lg:{width:40,height:40,fontSize:40},xl:{width:44,height:44,fontSize:48}};return typeof o=="number"?{width:o,height:o,fontSize:o-8}:r[o]},ye=({emoji:o,size:r="lg",editable:t=!1,onClick:s,className:a,style:c})=>{const i=rn(r),u=t&&s;return e.jsx(n.Box,{className:a,style:{...i,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:u?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...c},onClick:u?s:void 0,onMouseEnter:d=>{u&&(d.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:d=>{u&&(d.currentTarget.style.backgroundColor="transparent")},children:e.jsx(n.Box,{style:{fontSize:i.fontSize,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},children:o})})},_=o=>{if(typeof o=="number")return o;switch(o){case"xs":return 24;case"sm":return 32;case"md":return 48;case"lg":return 64;case"xl":return 80;default:return 64}},G=new Map,sn=["IconUser","IconHeart","IconStar","IconSmile","IconSun","IconMoon","IconCamera","IconMusic","IconCode","IconBriefcase","IconHome","IconSearch","IconSettings","IconMail","IconPhone","IconBell","IconBookmark","IconCalendar","IconClock","IconDownload","IconEdit","IconEye","IconFile","IconFolder","IconImage","IconLink","IconLock","IconMessage","IconPlus","IconShare","IconThumbUp","IconTrash"],an=async()=>{try{const o=await import("@tabler/icons-react");sn.forEach(r=>{if(!G.has(r)){const t=o[r];t&&G.set(r,t)}})}catch(o){console.warn("Error preloading common icons:",o)}};an();const cn=async o=>{if(G.has(o))return G.get(o);try{const s=(await import("@tabler/icons-react"))[o]||w.IconQuestionMark;return G.set(o,s),s}catch{return G.set(o,w.IconQuestionMark),w.IconQuestionMark}},ln=o=>o.replace(/^Icon/,"").replace(/([A-Z])/g," $1").trim().toLowerCase().replace(/^./,t=>t.toUpperCase()),ve=l.memo(({iconName:o,onClick:r,size:t=20})=>{const[s,a]=l.useState(null),[c,i]=l.useState(!0),u=l.useRef(null),d=l.useRef(!0);l.useEffect(()=>(d.current=!0,(async()=>{try{const h=(await import("@tabler/icons-react"))[o];d.current&&(a(h?()=>h:w.IconQuestionMark),i(!1))}catch{d.current&&(a(()=>w.IconQuestionMark),i(!1))}})(),()=>{d.current=!1}),[o]);const f=()=>{c||r()};return c?e.jsx(n.Box,{ref:u,style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",border:"none",borderRadius:"var(--mantine-radius-sm)"},children:e.jsx(n.Skeleton,{width:t,height:t})}):e.jsx(n.Tooltip,{label:ln(o),position:"top",withArrow:!0,openDelay:300,withinPortal:!0,zIndex:1e3,color:"dark",children:e.jsx(n.Box,{ref:u,onClick:f,style:{width:"40px",height:"40px",fontSize:`${t}px`,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",border:"none",transition:"all 0.2s ease",cursor:c?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)"},onMouseEnter:I=>{c||(I.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)",I.currentTarget.style.transform="scale(1.05)")},onMouseLeave:I=>{c||(I.currentTarget.style.backgroundColor="transparent",I.currentTarget.style.transform="scale(1)")},onMouseDown:I=>{c||(I.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)",I.currentTarget.style.transform="scale(0.95)")},onMouseUp:I=>{c||(I.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)",I.currentTarget.style.transform="scale(1.05)")},children:s&&e.jsx(s,{size:t,color:"var(--mantine-color-gray-7)"})})})});ve.displayName="IconButton";const je=l.memo(({iconName:o,size:r="lg",style:t,withBorder:s=!1,radius:a="md",onClick:c,onMouseEnter:i,onMouseLeave:u})=>{const[d,f]=l.useState(!1),[I,m]=l.useState(()=>G.get(o)||null),h=_(r),b=Math.round(h*.9);l.useEffect(()=>{if(G.has(o)){m(()=>G.get(o));return}let x=!0;return cn(o).then(g=>{x&&m(()=>g)}),()=>{x=!1}},[o]);const j=()=>typeof a=="number"?a:`var(--mantine-radius-${a})`;return I?e.jsx(n.Box,{style:{width:`${h}px !important`,height:`${h}px !important`,minWidth:`${h}px`,minHeight:`${h}px`,maxWidth:`${h}px`,maxHeight:`${h}px`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:j(),cursor:c?"pointer":"default",border:s?"1px solid var(--mantine-color-gray-4)":"none",backgroundColor:d?"var(--mantine-color-gray-0)":"transparent",flexShrink:0,boxSizing:"border-box",transition:"background-color 0.2s ease",...t},onClick:c,onMouseEnter:x=>{f(!0),i==null||i(x)},onMouseLeave:x=>{f(!1),u==null||u(x)},children:e.jsx(I,{size:b,color:"var(--mantine-color-gray-8)"})}):e.jsx(n.Box,{style:{width:`${h}px !important`,height:`${h}px !important`,minWidth:`${h}px`,minHeight:`${h}px`,maxWidth:`${h}px`,maxHeight:`${h}px`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:j(),cursor:c?"pointer":"default",border:s?"1px solid var(--mantine-color-gray-4)":"none",backgroundColor:d?"var(--mantine-color-gray-0)":"transparent",flexShrink:0,boxSizing:"border-box",transition:"background-color 0.2s ease",...t},onClick:c,onMouseEnter:x=>{f(!0),i==null||i(x)},onMouseLeave:x=>{f(!1),u==null||u(x)}})});je.displayName="IconAvatar";const dn=o=>{const r={xs:{width:28,height:28},sm:{width:32,height:32},md:{width:36,height:36},lg:{width:40,height:40},xl:{width:44,height:44}};return typeof o=="number"?{width:o,height:o}:r[o]},be=({iconName:o,size:r="lg",editable:t=!1,onClick:s,className:a,style:c})=>{const i=dn(r),u=t&&s;return e.jsx(n.Box,{className:a,style:{...i,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:u?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...c},onClick:u?s:void 0,onMouseEnter:d=>{u&&(d.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:d=>{u&&(d.currentTarget.style.backgroundColor="transparent")},children:e.jsx(n.Box,{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:e.jsx(je,{iconName:o,size:i.width,onClick:void 0})})})},un=o=>{const r={xs:{width:28,height:28},sm:{width:32,height:32},md:{width:36,height:36},lg:{width:40,height:40},xl:{width:44,height:44}};return typeof o=="number"?{width:o,height:o}:r[o]},we=({src:o,size:r="lg",editable:t=!1,onClick:s,className:a,style:c,loading:i=!1,alt:u="Avatar"})=>{const[d,f]=l.useState(!1),I=un(r),m=t&&s,h=()=>{f(!0)},b=()=>{f(!1)};return e.jsx(n.Box,{className:a,style:{...I,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:m?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"transparent",...c},onClick:m?s:void 0,onMouseEnter:j=>{m&&(j.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:j=>{m&&(j.currentTarget.style.backgroundColor="transparent")},children:i?e.jsx(n.Loader,{size:"sm",color:"var(--mantine-color-gray-6)",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}):!d&&e.jsx("img",{src:o,alt:u,style:{width:"100%",height:"100%",objectFit:"cover"},onError:h,onLoad:b})})},fn=o=>{const r={xs:{width:28,height:28,fontSize:14},sm:{width:32,height:32,fontSize:16},md:{width:36,height:36,fontSize:20},lg:{width:40,height:40,fontSize:24},xl:{width:44,height:44,fontSize:32}};return typeof o=="number"?{width:o,height:o,fontSize:o*.5}:r[o]},ie=({text:o="?",size:r="lg",editable:t=!1,onClick:s,className:a,style:c,loading:i=!1})=>{const u=fn(r),d=t&&s;return e.jsx(n.Box,{className:a,style:{...u,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",cursor:d?"pointer":"default",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease",backgroundColor:"var(--mantine-color-gray-2)",...c},onClick:d?s:void 0,onMouseEnter:f=>{d&&(f.currentTarget.style.backgroundColor="var(--mantine-color-gray-3)")},onMouseLeave:f=>{d&&(f.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)")},children:i?e.jsx(n.Loader,{size:"sm",color:"var(--mantine-color-gray-6)",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}):e.jsx(n.Box,{style:{fontSize:u.fontSize,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,color:"var(--mantine-color-gray-7)"},children:o})})},Se=o=>{if(!o)return"";const r=["de","del","la","las","los","y","el","en","con"],s=o.trim().split(/\s+/).filter(a=>!r.includes(a.toLowerCase())).map(a=>{var c;return((c=a[0])==null?void 0:c.toUpperCase())||""}).filter(Boolean).slice(0,2).join("");return s.length===1?s+s:s.length===0?o.slice(0,2).toUpperCase():s},Z=({avatar:o,size:r="lg",loading:t=!1,onClick:s,className:a,style:c,showPlaceholder:i=!0,placeholder:u,editable:d=!1})=>{const f=()=>{if(o)switch(o.type){case"emoji":return e.jsx(ye,{emoji:o.value,size:r,editable:d,onClick:s});case"icon":return e.jsx(be,{iconName:o.value,size:r,editable:d,onClick:s});case"image":return e.jsx(we,{src:o.value,size:r,editable:d,onClick:s})}if(i){const m=u?Se(u):"?";return e.jsx(ie,{text:m,size:r,editable:d,onClick:s})}return null};if(t)return e.jsx(ie,{size:r,loading:!0,className:a,style:c});const I=f();return I?e.jsx("div",{className:a,style:c,children:I}):null},Ce=({label:o,onClick:r,isActive:t=!1})=>{const[s,a]=l.useState(!1);return e.jsx(n.Box,{onClick:r,bg:s||t?"var(--mantine-color-gray-0)":"transparent",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),h:28,style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",padding:"0px 10px",cursor:"pointer"},children:e.jsx(n.Text,{fw:500,fz:"sm",truncate:"end",c:"var(--mantine-color-gray-9)",children:o})})},In=new URL("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTUiIGhlaWdodD0iNTYiIHZpZXdCb3g9IjAgMCA1NSA1NiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMC43NUg1NVY1NS43NUgwVjAuNzVaIiBmaWxsPSIjRjZGNUY0Ii8+CjxwYXRoIGQ9Ik04LjgwMDI5IDM0LjYzQzguODAwMjkgMzQuMTQ0IDkuMTk0MjggMzMuNzUgOS42ODAyOSAzMy43NUgxOC45MjAzQzE5LjQwNjMgMzMuNzUgMTkuODAwMyAzNC4xNDQgMTkuODAwMyAzNC42M1Y0My44N0MxOS44MDAzIDQ0LjM1NiAxOS40MDYzIDQ0Ljc1IDE4LjkyMDMgNDQuNzVIOS42ODAyOUM5LjE5NDI4IDQ0Ljc1IDguODAwMjkgNDQuMzU2IDguODAwMjkgNDMuODdWMzQuNjNaIiBmaWxsPSIjRkZDQTAwIi8+CjxwYXRoIGQ9Ik0yMi4wMDAyIDIzLjYzQzIyLjAwMDIgMjMuMTQ0IDIyLjM5NDIgMjIuNzUgMjIuODgwMiAyMi43NUgzMi4xMjAyQzMyLjYwNjMgMjIuNzUgMzMuMDAwMiAyMy4xNDQgMzMuMDAwMiAyMy42M1Y0My44N0MzMy4wMDAyIDQ0LjM1NiAzMi42MDYzIDQ0Ljc1IDMyLjEyMDIgNDQuNzVIMjIuODgwMkMyMi4zOTQyIDQ0Ljc1IDIyLjAwMDIgNDQuMzU2IDIyLjAwMDIgNDMuODdWMjMuNjNaIiBmaWxsPSIjMzdDRTkxIi8+CjxwYXRoIGQ9Ik0zNS4yMDAyIDEyLjYzQzM1LjIwMDIgMTIuMTQ0IDM1LjU5NDIgMTEuNzUgMzYuMDgwMiAxMS43NUg0NS4zMjAyQzQ1LjgwNjIgMTEuNzUgNDYuMjAwMiAxMi4xNDQgNDYuMjAwMiAxMi42M1Y0My44N0M0Ni4yMDAyIDQ0LjM1NiA0NS44MDYyIDQ0Ljc1IDQ1LjMyMDIgNDQuNzVIMzYuMDgwMkMzNS41OTQyIDQ0Ljc1IDM1LjIwMDIgNDQuMzU2IDM1LjIwMDIgNDMuODdWMTIuNjNaIiBmaWxsPSIjRkIzNzU3Ii8+CjxwYXRoIGQ9Ik04LjgwMDA1IDE3LjI1QzguODAwMDUgMTQuMjEyNCAxMS4yNjI1IDExLjc1IDE0LjMgMTEuNzVDMTcuMzM3NiAxMS43NSAxOS44IDE0LjIxMjQgMTkuOCAxNy4yNUMxOS44IDIwLjI4NzYgMTcuMzM3NiAyMi43NSAxNC4zIDIyLjc1QzExLjI2MjUgMjIuNzUgOC44MDAwNSAyMC4yODc2IDguODAwMDUgMTcuMjVaIiBmaWxsPSIjMDA3MkZGIi8+Cjwvc3ZnPgo=",self.location).href,ke=({appName:o="Obeyaka",size:r="md",showText:t=!0,color:s="var(--mantine-color-dark-6)",radius:a})=>{const c=()=>{switch(r){case"xs":return{icon:20,text:"xs"};case"sm":return{icon:28,text:"md"};case"md":return{icon:36,text:"lg"};case"lg":return{icon:44,text:"xl"};default:return{icon:36,text:"lg"}}},i=()=>{switch(a){case"full":return"9999px";case"xs":return"var(--mantine-radius-xs)";case"sm":return"var(--mantine-radius-sm)";case"md":return"var(--mantine-radius-md)";case"lg":return"var(--mantine-radius-lg)";case"xl":return"var(--mantine-radius-xl)";default:return 0}},{icon:u,text:d}=c(),f=()=>{const I=u*56/55;return e.jsx("img",{src:In,alt:`${o} Logo`,width:u,height:I,style:{display:"block",flexShrink:0,borderRadius:i()}})};return e.jsxs(n.Group,{gap:"xs",align:"center",wrap:"nowrap",children:[f(),t&&e.jsx(n.Text,{size:d,fw:700,c:s==="white"?"white":s,style:{fontFamily:"Inter, -apple-system, BlinkMacSystemFont, sans-serif"},children:o})]})},Me=({expandDirection:o="right",placeholder:r="Type to search",value:t="",onChange:s,onSearch:a,onClear:c,size:i="md",disabled:u=!1,className:d})=>{const[f,I]=l.useState(!1),[m,h]=l.useState(!1),[b,j]=l.useState(t),x=l.useRef(null),g=l.useRef(null);l.useEffect(()=>{j(t)},[t]),l.useEffect(()=>{f&&x.current&&x.current.focus()},[f]),l.useEffect(()=>{const p=R=>{g.current&&!g.current.contains(R.target)&&v()};if(f)return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[f]);const v=()=>{h(!0),setTimeout(()=>{I(!1),h(!1)},200)},y=()=>{u||I(!0)},C=p=>{const R=p.target.value;j(R),s==null||s(R)},k=p=>{p.key==="Enter"&&(a==null||a(b)),p.key==="Escape"&&v()},O=()=>{j(""),s==null||s(""),c==null||c(),v()},M=(()=>{switch(i){case"sm":return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-sm)"};case"lg":return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-md)"};default:return{iconSize:20,inputHeight:32,fontSize:"var(--mantine-font-size-sm)"}}})();return e.jsxs(n.Box,{ref:g,className:d,style:{position:"relative",display:"inline-flex",alignItems:"center"},children:[e.jsxs(n.Group,{gap:0,style:{position:"relative",transition:"all 0.2s ease",borderRadius:"var(--mantine-radius-md)"},children:[e.jsx(n.Box,{onClick:y,style:{display:"flex",alignItems:"center",justifyContent:"center",width:M.inputHeight,height:M.inputHeight,cursor:u?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)",transition:"background-color 0.2s ease",opacity:u?.5:1},onMouseEnter:p=>{u||(p.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)")},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},children:e.jsx(w.IconSearch,{size:M.iconSize,color:"var(--mantine-color-gray-6)",strokeWidth:2.3})}),f&&e.jsx(n.TextInput,{ref:x,value:b,onChange:C,onKeyDown:k,placeholder:r,disabled:u,height:M.inputHeight,fw:500,styles:{root:{position:"relative",animation:m?`shrink${o==="right"?"Right":"Left"} 0.2s ease forwards`:`expand${o==="right"?"Right":"Left"} 0.2s ease forwards`},input:{border:"none",outline:"none",backgroundColor:"transparent",padding:"0 8px",height:M.inputHeight,minHeight:M.inputHeight,fontSize:M.fontSize,color:"var(--mantine-color-gray-8)",borderRadius:"var(--mantine-radius-md)",transition:"background-color 0.2s ease",display:"flex",alignItems:"center","&:hover":{backgroundColor:"var(--mantine-color-gray-1)"},"&:focus":{backgroundColor:"var(--mantine-color-gray-1)"},"&::placeholder":{color:"var(--mantine-color-gray-5)"}}},rightSection:b&&e.jsx(n.Box,{onClick:O,style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"4px",borderRadius:"var(--mantine-radius-xl)",transition:"background-color 0.2s ease"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--mantine-color-gray-2)"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},children:e.jsx(w.IconX,{size:14,color:"var(--mantine-color-gray-6)",strokeWidth:2.3})}),rightSectionWidth:b?24:0})]}),e.jsx("style",{children:`
|
|
2
2
|
@keyframes expandRight {
|
|
3
3
|
from { width: 0; opacity: 0; }
|
|
4
4
|
to { width: 200px; opacity: 1; }
|
|
@@ -15,719 +15,4 @@
|
|
|
15
15
|
from { width: 200px; opacity: 1; }
|
|
16
16
|
to { width: 0; opacity: 0; }
|
|
17
17
|
}
|
|
18
|
-
`})]})},Qe=({activeFilters:e,onFiltersChange:n,availableFilters:t,size:r="md",filterButtonDropdownPosition:s="bottom-end"})=>{const i=a.useCombobox({onDropdownClose:()=>i.resetSelectedOption(),onDropdownOpen:()=>i.updateSelectedOptionIndex("active")}),[c,u]=p.useState(!1),l=e.length>0,f=I=>{if(I==="remove-filters")n([]);else{const m=t==null?void 0:t.find(y=>y.value===I);if(m){const y={id:`${m.value}-${Date.now()}`,filterOption:m};n([...e,y])}}i.closeDropdown()},d=(t||[]).filter(I=>!e.some(m=>m.filterOption.value===I.value)),g={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"},x=(()=>{switch(r){case"sm":return{height:"32px",width:"32px",iconSize:20};case"md":return{height:"32px",width:"32px",iconSize:20};default:return{height:"32px",width:"32px",iconSize:20}}})(),v=o.jsx(a.Box,{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:l||c?"var(--mantine-color-gray-0)":"transparent",color:"var(--mantine-color-gray-6)",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",transition:"all 0.2s ease",...x},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:()=>i.toggleDropdown(),children:o.jsx(C.IconFilter,{size:20,stroke:2.3})});return o.jsxs(a.Combobox,{store:i,onOptionSubmit:f,withinPortal:!1,offset:4,position:s,children:[o.jsx(a.Combobox.Target,{children:l?o.jsx(a.Indicator,{offset:2,position:"top-end",color:"var(--mantine-color-yellow-7)",children:v}):v}),o.jsx(a.Combobox.Dropdown,{styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",width:"auto",minWidth:"160px"}},children:o.jsxs(a.Combobox.Options,{children:[d.map(I=>o.jsx(a.Combobox.Option,{value:I.value,style:{...g},children:o.jsxs(a.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[I.icon,I.label]})},I.value)),l&&o.jsx(a.Combobox.Option,{value:"remove-filters",style:{borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",fontWeight:"500",color:"var(--mantine-color-red-6)"},children:o.jsxs(a.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(C.IconFilterOff,{size:16,stroke:2}),"Remove filters"]})})]})})]})},Nt=({filterTag:e,onUpdate:n,onRemove:t,options:r=[],filterTagDropdownPosition:s="bottom-start"})=>{var h;const i=a.useCombobox({onDropdownClose:()=>i.resetSelectedOption(),onDropdownOpen:()=>i.updateSelectedOptionIndex("active")}),c=!!e.selectedOption,u=c?`${e.filterOption.label}: ${(h=e.selectedOption)==null?void 0:h.label}`:e.filterOption.label,l=r&&r.length>0?r:[{value:"option-a",label:"TagFilterOptionA"},{value:"option-b",label:"TagFilterOptionB"},{value:"option-c",label:"TagFilterOptionC"}],f=x=>{if(x==="remove")t();else{const v=l.find(I=>I.value===x);v&&n({...e,selectedOption:v})}i.closeDropdown()},d={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"},g={display:"inline-flex",alignItems:"center",gap:"4px",backgroundColor:c?"var(--mantine-color-blue-0)":"var(--mantine-color-gray-0)",color:c?"var(--mantine-color-blue-7)":"var(--mantine-color-gray-6)",borderRadius:"var(--mantine-radius-xl)",cursor:"pointer",transition:"all 0.2s ease",height:"32px",fontSize:"var(--mantine-font-size-sm)",padding:"0 12px"};return o.jsxs(a.Combobox,{store:i,onOptionSubmit:f,withinPortal:!1,offset:4,position:s,middlewares:{flip:!1,shift:!0},children:[o.jsx(a.Combobox.Target,{children:o.jsxs(a.Box,{style:{...g},onClick:()=>i.toggleDropdown(),fw:500,pl:"sm",children:[o.jsxs(a.Box,{style:{display:"flex",alignItems:"center",gap:"4px"},children:[e.filterOption.icon,u]}),o.jsx(C.IconChevronDown,{size:16,strokeWidth:2,color:"var(--mantine-color-gray-5)"})]})}),o.jsx(a.Combobox.Dropdown,{styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",minWidth:"150px"}},children:o.jsxs(a.Combobox.Options,{children:[l.map(x=>{var v;return o.jsx(a.Combobox.Option,{value:x.value,active:((v=e.selectedOption)==null?void 0:v.value)===x.value,style:{...d},children:x.label},x.value)}),o.jsx(a.Combobox.Option,{value:"remove",style:{borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",fontWeight:"500",color:"var(--mantine-color-red-6)"},children:"Or remove filter"})]})})]})},Wt=({activeFilters:e,onFiltersChange:n,availableFilters:t,addFilterButtonDropdownPosition:r="bottom-start"})=>{const s=a.useCombobox({onDropdownClose:()=>s.resetSelectedOption(),onDropdownOpen:()=>s.updateSelectedOptionIndex("active")}),[i,c]=p.useState(!1),u=h=>{const x=t==null?void 0:t.find(v=>v.value===h);if(x){const v={id:`${x.value}-${Date.now()}`,filterOption:x};n([...e,v])}s.closeDropdown()},l=(t||[]).filter(h=>!e.some(x=>x.filterOption.value===h.value)),f={display:"inline-flex",alignItems:"center",backgroundColor:i?"var(--mantine-color-gray-0)":"transparent",borderRadius:"var(--mantine-radius-xl)",cursor:"pointer",transition:"all 0.2s ease",border:"1px solid transparent",height:"32px",fontSize:"var(--mantine-font-size-sm)",padding:"0 12px"},d={dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",width:"auto",minWidth:"120px"}},g={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"};return o.jsxs(a.Combobox,{store:s,onOptionSubmit:u,withinPortal:!1,offset:4,position:r,children:[o.jsx(a.Combobox.Target,{children:o.jsx(a.Box,{style:{...f},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:()=>s.toggleDropdown(),children:o.jsx(a.Box,{style:{fontWeight:"500",color:"var(--mantine-color-blue-6)"},children:"Add filter"})})}),o.jsx(a.Combobox.Dropdown,{styles:{...d},children:o.jsx(a.Combobox.Options,{children:l.map(h=>o.jsx(a.Combobox.Option,{value:h.value,style:{...g},children:o.jsxs(a.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h.icon,h.label]})},h.value))})})]})},Ze=({activeFilters:e,onFiltersChange:n,availableFilters:t,size:r="sm",getFilterOptions:s,filterTagDropdownPosition:i="bottom-start"})=>{const c=f=>{const d=(e||[]).map(g=>g.id===f.id?f:g);n(d)},u=f=>{const d=(e||[]).filter(g=>g.id!==f);n(d)},l=(t||[]).filter(f=>!e.some(d=>d.filterOption.value===f.value));return!e||e.length===0?null:o.jsx("div",{style:{width:"100%"},children:o.jsxs(a.Group,{gap:"sm",align:"center",wrap:"wrap",children:[(e||[]).map(f=>{const d=s?s(f.filterOption.value)||[]:[];return o.jsx(Nt,{filterTag:f,onUpdate:c,onRemove:()=>u(f.id),size:r,options:d,filterTagDropdownPosition:i},f.id)}),l.length>0&&o.jsx(Wt,{activeFilters:e,onFiltersChange:n,availableFilters:l,size:r})]})})},Gt=({activeFilters:e,onFiltersChange:n,availableFilters:t,size:r="md",getFilterOptions:s,filterTagDropdownPosition:i="bottom-start"})=>o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[o.jsx(Qe,{activeFilters:e,onFiltersChange:n,availableFilters:t,size:r}),o.jsx(Ze,{activeFilters:e,onFiltersChange:n,availableFilters:t,size:"sm",getFilterOptions:s,filterTagDropdownPosition:i})]}),Vt=Object.assign(Gt,{Button:Qe,Filters:Ze}),qt=({children:e,danger:n,active:t,...r})=>o.jsx(a.MenuItem,{...r,style:{borderRadius:"8px",color:t?"var(--mantine-color-blue-7)":n?"var(--mantine-color-red-9)":"var(--mantine-color-gray-9)",backgroundColor:t?"var(--mantine-color-blue-0)":"transparent",...r.style},children:e}),me=({trigger:e,menuItems:n,children:t,...r})=>{const s=p.useRef(null),[i,c]=p.useState(0);return p.useEffect(()=>{s.current&&c(s.current.offsetWidth)},[e]),o.jsxs(a.Menu,{...r,children:[o.jsx(a.Menu.Target,{children:o.jsx("div",{ref:s,onClick:u=>u.stopPropagation(),style:{cursor:"pointer",outline:"none",boxShadow:"none",display:"flex",alignItems:"center"},children:e})}),o.jsxs(a.Menu.Dropdown,{styles:{dropdown:{cursor:"pointer",borderRadius:"8px",minWidth:`${i}px`}},children:[t,n==null?void 0:n.map((u,l)=>o.jsx(qt,{...u},l))]})]})},Tn=({label:e,icon:n,onClick:t,color:r="gray",disabled:s=!1,"aria-label":i,indicator:c,fullWidth:u,isActive:l=!1,...f})=>{const[d,g]=p.useState(!1),h=()=>{s||t==null||t()};return o.jsx(a.Box,{style:{cursor:s?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)"},variant:"transparent",justify:"flex-start",display:"flex",color:r,radius:"md",w:u?"100%":"auto",px:6,h:40,onMouseEnter:()=>!s&&g(!0),onMouseLeave:()=>g(!1),onClick:h,bg:d||l?"gray.1":"transparent","aria-label":i||`${e} navigation button`,...f,children:o.jsxs(a.Group,{w:"100%",wrap:"nowrap",gap:8,justify:"left",align:"center",children:[n,o.jsx(a.Text,{ta:"left",size:"sm",fw:500,c:d?"gray.8":"gray.7",truncate:!0,style:{flex:1,opacity:s?.5:1},children:e}),c&&o.jsx(a.Box,{style:{cursor:"pointer",backgroundColor:"var(--mantine-color-red-7)",color:"var(--mantine-color-white)",borderRadius:"var(--mantine-radius-lg)",padding:"0px 4px",fontSize:"12px",fontWeight:600,height:"20px",minWidth:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:c})]})})},Qt=({label:e,rightLabel:n,children:t,onAddChild:r,onMenuAction:s,menuItems:i,color:c="gray",defaultText:u="No items",level:l=0,disabled:f=!1,noChild:d=!1,isActive:g=!1,showAvatar:h=!1,avatar:x,placeholder:v,onClick:I,"aria-label":m,...y})=>{const[w,S]=p.useState(!1),[_,$]=p.useState(!1),[D,z]=p.useState(!1),k=p.Children.count(t)>0,R=D?C.IconChevronDown:C.IconChevronRight,L=!d&&k&&(h?_:!0),T=p.useCallback(F=>{f||(console.log("NavLink clicked",{hasChildren:k,noChild:d,isExpanded:w}),k&&!d&&(console.log("Toggling expansion"),S(!w)),I==null||I())},[I,f,k,d,w]),B=p.useCallback(F=>{F.stopPropagation(),!f&&(r==null||r())},[r,f]),H=p.useCallback(()=>{f||(k&&!d&&S(!w),I==null||I())},[f,k,d,w,I]),ee=p.useCallback(()=>{f||r==null||r()},[r,f]),ne=p.useCallback(F=>{f||s==null||s(F)},[s,f,e]),U=p.useCallback(()=>k?p.Children.map(t,F=>p.isValidElement(F)?p.cloneElement(F,{...F.props,level:l+1}):F):null,[t,k,l]),ce=(i==null?void 0:i.map(F=>({children:o.jsxs(a.Group,{gap:"xs",wrap:"nowrap",children:[F.icon&&o.jsx(F.icon,{size:16}),o.jsx(a.Text,{size:"sm",children:F.label})]}),onClick:()=>ne(F.action)})))||[],fe=[{children:o.jsxs(a.Group,{gap:"xs",wrap:"nowrap",children:[o.jsx(C.IconPlus,{size:16}),o.jsx(a.Text,{size:"sm",children:"Add child"})]}),onClick:B}],he=ce.length>0?ce:fe;return o.jsxs(a.Stack,{gap:0,children:[o.jsx(a.Box,{style:{cursor:f?"not-allowed":"pointer",borderRadius:"8px"},variant:"transparent",justify:"space-between",display:"flex",color:c,size:"md",radius:"md",w:"100%",px:6,h:40,onMouseEnter:()=>!f&&$(!0),onMouseLeave:()=>$(!1),onClick:T,bg:g||_?"var(--mantine-color-gray-1)":"transparent","aria-expanded":w,"aria-label":m||`${e} navigation link`,...y,children:o.jsxs(a.Group,{w:"100%",wrap:"nowrap",gap:8,onClick:T,style:{paddingLeft:d&&!L?`${(l+1)*16}px`:l>0?`${l*16}px`:"0px"},children:[L?o.jsx(W,{icon:R,size:"md",color:c,onClick:H,disabled:f,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),"aria-label":k?`${w?"Collapse":"Expand"} ${e}`:void 0}):h?o.jsx(ae,{size:"xs",avatar:x,showPlaceholder:!0,placeholder:v}):null,o.jsx(a.Text,{size:"sm",fw:500,c:g?"black":_?"gray.9":"gray.8",truncate:!0,w:"100%",style:{opacity:f?.5:1},children:e}),o.jsxs(a.Group,{gap:"xs",align:"center",children:[n&&o.jsx(a.Text,{size:"xs",c:"dimmed",children:n}),_&&!f&&o.jsxs(a.Group,{gap:4,wrap:"nowrap",children:[r&&o.jsx(W,{icon:C.IconPlus,onClick:ee,"aria-label":`Add child to ${e}`}),(i&&i.length>0||r)&&o.jsx("div",{onClick:F=>F.stopPropagation(),children:o.jsx(me,{menuItems:he,trigger:o.jsx(W,{icon:C.IconDots,"aria-label":`More options for ${e}`,size:"md"}),position:"bottom-end",shadow:"md"})})]})]})]})}),w&&!d&&o.jsx(a.Stack,{gap:0,style:{width:"100%"},children:k?U():o.jsx(a.Box,{style:{marginLeft:l>0?`${l*16}px`:"0px"},children:o.jsx(a.Text,{size:"sm",c:"dimmed",ta:"left",p:"sm",fw:500,children:u})})})]})},Zt="200px",Yt="4px 8px",Xt=40,Kt="var(--mantine-radius-md)",Jt=16,Rn=({item:e,withAvatars:n,disabled:t=!1,onClick:r,selected:s=!1})=>{const[i,c]=p.useState(!1);return o.jsx(a.Box,{onMouseEnter:()=>!t&&c(!0),onMouseLeave:()=>!t&&c(!1),onClick:u=>{u.preventDefault(),u.stopPropagation(),t||r==null||r(e.value)},onMouseDown:u=>{u.stopPropagation()},style:{minWidth:Zt,backgroundColor:t?"transparent":i?"var(--mantine-color-gray-1)":"transparent",cursor:t?"default":"pointer",borderRadius:Kt,padding:Yt,transition:"background-color 0.2s ease",opacity:t?.5:1},children:o.jsxs(a.Group,{gap:"sm",wrap:"nowrap",align:"flex-start",style:{alignItems:"center"},h:Xt,children:[n&&e.avatar&&o.jsx("img",{src:e.avatar,alt:e.label,style:{width:"24px",height:"24px",borderRadius:"var(--mantine-radius-sm)",objectFit:"cover"}}),o.jsxs(a.Stack,{gap:0,style:{flex:1},children:[o.jsx(a.Text,{size:"sm",fw:500,lh:-1,c:t?"var(--mantine-color-gray-5)":"var(--mantine-color-gray-9)",children:e.label}),o.jsx(a.Text,{size:"xs",c:t?"var(--mantine-color-gray-4)":"dimmed",children:e.description})]}),s&&o.jsx(C.IconCheck,{size:Jt,color:"var(--mantine-color-gray-9)"})]})})},eo="bottom-end",no=1e4,to="24px",oo="0 8px",ro="6px",Je="var(--mantine-radius-md)",io="46px",Te=({value:e,onChange:n,data:t,withRemove:r=!1,withAvatars:s=!1,onRemove:i,disabledOptions:c=[],disabled:u=!1,defaultOption:l,popoverStyles:f,dropdownStyles:d,triggerStyles:g,textStyles:h})=>{const[x,v]=p.useState(!1),I=(t||[]).find(k=>k.value===e)||l,[m,y]=p.useState(!1),[w,S]=p.useState(!1),[_,$]=p.useState(!1),D=r?o.jsx(a.Group,{p:"sm",onClick:k=>{k.stopPropagation(),i==null||i(e)},style:{cursor:"pointer",height:io,display:"flex",alignItems:"center",borderRadius:Je,backgroundColor:w?"var(--mantine-color-red-0)":"transparent",transition:"background-color 0.2s ease"},onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:o.jsx(a.Text,{size:"sm",c:"var(--mantine-color-red-6)",fw:500,children:"Remove user"})}):null,z=o.jsxs(a.Box,{onMouseEnter:()=>!u&&y(!0),onMouseLeave:()=>!u&&y(!1),onClick:()=>{u||(v(!0),$(!0))},style:{height:to,cursor:u?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",borderRadius:Je,backgroundColor:u?"transparent":m||_?"var(--mantine-color-gray-1)":"transparent",transition:"background-color 0.2s ease",padding:oo,gap:ro,width:"auto",opacity:u?.6:1,...g},children:[o.jsx(a.Text,{size:"sm",fw:h!=null&&h.fontWeight?void 0:500,c:u?"var(--mantine-color-gray-4)":"var(--mantine-color-gray-6)",style:{color:u?"var(--mantine-color-gray-4)":"var(--mantine-color-gray-6)",lineHeight:"24px",whiteSpace:"nowrap",...h},children:(I==null?void 0:I.label)||"Select option"}),o.jsx(C.IconChevronDown,{size:16,style:{color:u?"var(--mantine-color-gray-3)":"var(--mantine-color-gray-6)"}})]});return o.jsxs(a.Popover,{opened:x,onChange:k=>{v(k),k||$(!1)},position:eo,shadow:"md",withinPortal:!0,zIndex:no,styles:f,children:[o.jsx(a.Popover.Target,{children:z}),o.jsx(a.Popover.Dropdown,{onClick:k=>k.stopPropagation(),onMouseDown:k=>k.stopPropagation(),styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",padding:"4px",...d}},children:o.jsxs(a.Stack,{gap:0,onClick:k=>k.stopPropagation(),onMouseDown:k=>k.stopPropagation(),children:[(t||[]).map(k=>{const R=c.includes(k.value),L=k.value===e;return o.jsx(Rn,{item:k,withAvatars:s,disabled:R,selected:L,onClick:T=>{n==null||n(T),v(!1),$(!1)}},k.value)}),D]})})]})},so=(e,n,t,r)=>{const s=p.useRef(null),i=p.useRef(null),c=p.useCallback(l=>{l[0].isIntersecting&&t&&!r&&n&&n()},[t,r,n]),u=p.useCallback(()=>{if(!(!s.current||!e||!n)){i.current&&(i.current.disconnect(),i.current=null);try{const l=new IntersectionObserver(c,{threshold:.1,rootMargin:"50px"});l.observe(s.current),i.current=l}catch(l){console.error("Failed to setup intersection observer:",l)}}},[e,n,c]);return p.useEffect(()=>(u(),()=>{i.current&&(i.current.disconnect(),i.current=null)}),[u]),p.useEffect(()=>()=>{i.current&&(i.current.disconnect(),i.current=null)},[]),{loadMoreRef:s}},En=({tableName:e,data:n,columns:t,onAddItem:r,addItemComponent:s,addItemLabel:i="Add item",loading:c=!1,emptyMessage:u="No data found",searchPlaceholder:l="Search...",enableAutoFilters:f=!0,customFilters:d=[],onCustomFilter:g,onSort:h,sortColumn:x,sortDirection:v,onSearch:I,onRowClick:m,size:y="md",striped:w=!1,highlightOnHover:S=!0,enableInfiniteScroll:_=!1,isLoadingMore:$=!1,hasMore:D=!1,onLoadMore:z})=>{const[k,R]=p.useState(""),[L,T]=p.useState([]),{loadMoreRef:B}=so(_,z||(()=>{}),D,$),H=p.useMemo(()=>[...f?t.filter(O=>O.type==="select"&&O.options).map(O=>({value:O.key,label:O.label})):[],...d],[t,f,d]),ee=p.useMemo(()=>{let j=n||[];if(k){const O=k.toLowerCase();j=j.filter(P=>t.some(A=>{if(!A.searchable)return!1;const Q=P[A.key];return Q==null?!1:String(Q).toLowerCase().includes(O)}))}return L.forEach(O=>{if(O.filterTag.selectedOption){const P=t.find(A=>A.key===O.filterTag.filterOption.value);P&&(j=j.filter(A=>{var re;const Q=A[P.key];return String(Q)===((re=O.filterTag.selectedOption)==null?void 0:re.value)}))}}),j},[n,k,L,t]),ne=j=>{R(j),I==null||I(j)},U=j=>{const O=t.find(A=>A.key===j);if(!(O!=null&&O.sortable))return;const P=x===j&&v==="asc"?"desc":"asc";h==null||h(j,P)},ce=j=>{const O=t.find(P=>P.key===j);return(O==null?void 0:O.type)==="select"&&O.options?O.options.map(P=>({value:P.value,label:P.label})):(O==null?void 0:O.type)==="badge"?[...new Set(n.map(A=>A[O.key]).filter(Boolean))].map(A=>({value:String(A),label:String(A).charAt(0).toUpperCase()+String(A).slice(1)})):O?[...new Set(n.map(A=>A[O.key]).filter(Boolean))].map(A=>({value:String(A),label:String(A).charAt(0).toUpperCase()+String(A).slice(1)})):[]},fe=(j,O)=>{var A,Q,re,Ie,ve;const P=O[j.key];switch(j.type){case"text":return o.jsx(a.Text,{size:"sm",c:P?void 0:"dimmed",children:P||"—"});case"date":if(!P)return o.jsx(a.Text,{size:"sm",c:"dimmed",children:"—"});const q=new Date(P),yt=j.format?q.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}):q.toLocaleDateString();return o.jsx(a.Text,{size:"sm",c:"dimmed",children:yt});case"select":return j.options?o.jsx(Te,{value:P,data:j.options,placeholder:j.label,onChange:Y=>{var be;return(be=j.onSelectChange)==null?void 0:be.call(j,Y,O)},disabled:(A=j.disabled)==null?void 0:A.call(j,O)}):o.jsx(a.Text,{size:"sm",c:"dimmed",children:"—"});case"badge":const wt=((Q=j.badgeColors)==null?void 0:Q[P])||"gray";return o.jsx(a.Badge,{color:wt,variant:"light",size:"sm",radius:"md",fw:600,children:P||"Unknown"});case"avatar":const kt=((re=j.fallbackText)==null?void 0:re.call(j,O))||String(P).charAt(0).toUpperCase();return o.jsx(ae,{avatar:P,size:"xs",placeholder:kt,showPlaceholder:!0});case"custom":return((Ie=j.render)==null?void 0:Ie.call(j,P,O))||o.jsx(a.Text,{size:"sm",c:"dimmed",children:"—"});case"actions":return(ve=j.actions)!=null&&ve.length?o.jsxs(a.Menu,{shadow:"md",width:200,position:"bottom-end",styles:{dropdown:{borderRadius:"var(--mantine-radius-md)"}},children:[o.jsx(a.Menu.Target,{children:o.jsx(a.ActionIcon,{variant:"subtle",size:"md",color:"gray",radius:"md",children:o.jsx(C.IconDots,{size:16})})}),o.jsx(a.Menu.Dropdown,{children:j.actions.map((Y,be)=>{var Xe;return o.jsx(a.Menu.Item,{color:Y.color,leftSection:Y.icon,disabled:(Xe=Y.disabled)==null?void 0:Xe.call(Y,O),onClick:()=>Y.onClick(O),styles:{item:{borderRadius:"var(--mantine-radius-md)"}},children:Y.label},be)})})]}):null;default:return o.jsx(a.Text,{size:"sm",c:"dimmed",children:"—"})}},he=j=>{var O;return(O=t.find(P=>P.key===j))!=null&&O.sortable?x===j?v==="asc"?o.jsx(C.IconChevronUp,{size:14}):o.jsx(C.IconChevronDown,{size:14}):o.jsx(C.IconChevronUp,{size:14,style:{opacity:.3}}):null},le=(()=>{switch(y){case"sm":return{buttonSize:"xs",textSize:"sm"};case"lg":return{buttonSize:"md",textSize:"md"};default:return{buttonSize:"sm",textSize:"sm"}}})();return o.jsxs(a.Box,{pos:"relative",children:[o.jsx(a.LoadingOverlay,{visible:c}),o.jsxs(a.Stack,{gap:"sm",w:"100%",children:[o.jsxs(a.Group,{gap:"sm",wrap:"nowrap",justify:"space-between",children:[o.jsx(a.Text,{fw:600,c:"var(--mantine-color-gray-8)",children:e}),o.jsxs(a.Group,{gap:"xs",wrap:"nowrap",children:[o.jsxs(a.Group,{gap:4,wrap:"nowrap",children:[o.jsx(Dn,{placeholder:l,value:k,onChange:ne,onSearch:ne,expandDirection:"right",size:le.buttonSize}),H.length>0&&o.jsx(Qe,{activeFilters:L.map(j=>j.filterTag),onFiltersChange:j=>{T(j.map(O=>({filterTag:O,onUpdate:()=>{},onRemove:()=>{}}))),g==null||g(j)},availableFilters:H,size:le.buttonSize})]}),r&&o.jsx(a.Button,{size:"compact-md",h:32,style:{fontSize:`var(--mantine-font-size-${le.textSize})`,border:"none"},radius:"md",onClick:r,children:i})]})]}),H.length>0&&o.jsx(Ze,{activeFilters:L.map(j=>j.filterTag),onFiltersChange:j=>{T(j.map(O=>({filterTag:O,onUpdate:()=>{},onRemove:()=>{}}))),g==null||g(j)},availableFilters:H,size:"md",getFilterOptions:ce})]}),s,o.jsxs(a.Table,{striped:w,highlightOnHover:S,highlightOnHoverColor:"var(--mantine-color-gray-0)",mt:"xs",children:[o.jsx(a.Table.Thead,{children:o.jsx(a.Table.Tr,{children:t.map(j=>o.jsx(a.Table.Th,{c:"var(--mantine-color-gray-6)",style:{width:j.width,textAlign:j.align||"left",cursor:j.sortable?"pointer":"default"},onClick:()=>j.sortable&&U(j.key),children:o.jsxs(a.Group,{gap:"xs",wrap:"nowrap",children:[j.icon&&o.jsx(a.Box,{style:{display:"flex",alignItems:"center"},children:j.icon}),o.jsx(a.Text,{size:le.textSize,fw:500,children:j.label}),he(j.key)]})},String(j.key)))})}),o.jsx(a.Table.Tbody,{children:ee.length===0?o.jsx(a.Table.Tr,{children:o.jsx(a.Table.Td,{colSpan:t.length,ta:"center",py:"xl",children:o.jsx(a.Text,{c:"dimmed",children:u})})}):ee.map((j,O)=>o.jsx(a.Table.Tr,{style:{cursor:m?"pointer":"default"},onClick:()=>m==null?void 0:m(j),children:t.map(P=>o.jsx(a.Table.Td,{style:{textAlign:P.align||"left"},children:fe(P,j)},String(P.key)))},j.id||O))})]}),_&&o.jsx(a.Box,{ref:B,style:{padding:"16px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60px"},children:$&&o.jsxs(a.Group,{display:"flex",ta:"center",gap:"xs",children:[o.jsx(a.Loader,{size:"sm",color:"gray.5"}),o.jsx(a.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more..."})]})})]})};Object.assign(En,{});const ao=({onAvatarSelect:e,onEmojiSelect:n,onImageSelect:t,onIconSelect:r}={})=>{const[s,i]=p.useState("emoji"),[c,u]=p.useState(null),[l,f]=p.useState(null),[d,g]=p.useState(null),[h,x]=p.useState(null),[v,I]=p.useState(null),m=p.useCallback(k=>{i(k)},[]),y=p.useCallback(k=>{u(k)},[]),w=p.useCallback(k=>{I(k);const R=new FileReader;R.onload=L=>{var B;const T=(B=L.target)==null?void 0:B.result;f(T)},R.readAsDataURL(k)},[]),S=p.useCallback(k=>{g(k),f(null),I(null),x(null),e==null||e({type:"emoji",value:k}),n==null||n(k)},[e,n]),_=p.useCallback(k=>{x(k),f(null),I(null),g(null),e==null||e({type:"icon",value:k}),r==null||r(k)},[e,r]),$=p.useCallback(()=>{if(v&&l){const k=URL.createObjectURL(v);e==null||e({type:"image",value:k}),t==null||t(v)}},[v,l,e,t]),D=p.useCallback(()=>{f(null),I(null),g(null),x(null)},[]),z=p.useCallback(()=>{f(null),g(null),x(null),I(null),i("emoji"),u(null)},[]);return{selectedTab:s,tabHovered:c,previewImage:l,selectedEmoji:d,selectedIcon:h,selectedFile:v,handleTabChange:m,handleTabHover:y,handleImagePreview:w,handleImageAccept:$,handleEmojiSelect:S,handleIconSelect:_,clearImagePreview:D,resetState:z}},co=({opened:e,onClose:n,popoverRef:t})=>{const r=p.useCallback(i=>{e&&t.current&&!t.current.contains(i.target)&&(console.log("Click outside detected, closing popover"),n())},[e,n,t]),s=p.useCallback(i=>{i.key==="Escape"&&e&&(console.log("Escape key pressed, closing popover"),n())},[e,n]);return p.useEffect(()=>{if(e)return document.addEventListener("mousedown",r),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",s)}},[e,r,s]),{handleClickOutside:r,handleEscape:s}},lo=({selectedTab:e,tabHovered:n,onTabChange:t,onTabHover:r,onRemove:s,hasAvatar:i=!1,children:c})=>{const[u,l]=p.useState(!1);return o.jsxs(a.Tabs,{color:"black",value:e,styles:{tab:{backgroundColor:"transparent"}},children:[o.jsxs(a.Tabs.List,{px:"var(--mantine-spacing-sm)",pt:"xs",w:"100%",children:[o.jsx(a.Tabs.Tab,{value:"emoji",p:0,pb:"xs",onClick:()=>t("emoji"),onMouseEnter:()=>r("emoji"),onMouseLeave:()=>r(null),style:{backgroundColor:"transparent"},children:o.jsx(a.Box,{style:{borderRadius:"var(--mantine-radius-md)",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",border:"none",backgroundColor:n==="emoji"?"var(--mantine-color-gray-1)":"transparent",color:e==="emoji"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:o.jsx(a.Group,{gap:4,children:"Emoji"})})}),o.jsx(a.Tabs.Tab,{value:"icons",p:0,pb:"xs",onClick:()=>t("icons"),onMouseEnter:()=>r("icons"),onMouseLeave:()=>r(null),style:{backgroundColor:"transparent"},children:o.jsx(a.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:n==="icons"?"var(--mantine-color-gray-1)":"transparent",color:e==="icons"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:o.jsx(a.Group,{gap:4,children:"Icons"})})}),o.jsx(a.Tabs.Tab,{value:"image",p:0,pb:"xs",onClick:()=>t("image"),onMouseEnter:()=>r("image"),onMouseLeave:()=>r(null),style:{backgroundColor:"transparent"},children:o.jsx(a.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:n==="image"?"var(--mantine-color-gray-1)":"transparent",color:e==="image"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:o.jsx(a.Group,{gap:4,children:"Image"})})}),s&&i&&o.jsx(a.Group,{justify:"flex-end",display:"flex",flex:1,pb:"xs",children:o.jsx(a.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:u?"var(--mantine-color-red-0)":"transparent",color:u?"var(--mantine-color-red-6)":"var(--mantine-color-gray-6)",cursor:"pointer",transition:"all 0.1s ease"},fw:500,fz:"var(--mantine-font-size-sm)",onClick:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:"Remove"})})]}),o.jsx(a.Tabs.Panel,{value:"emoji",children:e==="emoji"?c:null}),o.jsx(a.Tabs.Panel,{value:"icons",children:e==="icons"?c:null}),o.jsx(a.Tabs.Panel,{value:"image",children:e==="image"?c:null})]})};function Bn(e){return e&&e.__esModule?e.default:e}function V(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var Re,M,Pn,ge,Ln,en,Se={},An=[],uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function te(e,n){for(var t in n)e[t]=n[t];return e}function Hn(e){var n=e.parentNode;n&&n.removeChild(e)}function Fe(e,n,t){var r,s,i,c={};for(i in n)i=="key"?r=n[i]:i=="ref"?s=n[i]:c[i]=n[i];if(arguments.length>2&&(c.children=arguments.length>3?Re.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)c[i]===void 0&&(c[i]=e.defaultProps[i]);return ke(e,c,r,s,null)}function ke(e,n,t,r,s){var i={type:e,props:n,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++Pn};return s==null&&M.vnode!=null&&M.vnode(i),i}function X(){return{current:null}}function de(e){return e.children}function Z(e,n){this.props=e,this.context=n}function ue(e,n){if(n==null)return e.__?ue(e.__,e.__.__k.indexOf(e)+1):null;for(var t;n<e.__k.length;n++)if((t=e.__k[n])!=null&&t.__e!=null)return t.__e;return typeof e.type=="function"?ue(e):null}function Fn(e){var n,t;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((t=e.__k[n])!=null&&t.__e!=null){e.__e=e.__c.base=t.__e;break}return Fn(e)}}function nn(e){(!e.__d&&(e.__d=!0)&&ge.push(e)&&!Me.__r++||en!==M.debounceRendering)&&((en=M.debounceRendering)||Ln)(Me)}function Me(){for(var e;Me.__r=ge.length;)e=ge.sort(function(n,t){return n.__v.__b-t.__v.__b}),ge=[],e.some(function(n){var t,r,s,i,c,u;n.__d&&(c=(i=(t=n).__v).__e,(u=t.__P)&&(r=[],(s=te({},i)).__v=i.__v+1,Ye(u,i,s,t.__n,u.ownerSVGElement!==void 0,i.__h!=null?[c]:null,r,c??ue(i),i.__h),Gn(r,i),i.__e!=c&&Fn(i)))})}function Un(e,n,t,r,s,i,c,u,l,f){var d,g,h,x,v,I,m,y=r&&r.__k||An,w=y.length;for(t.__k=[],d=0;d<n.length;d++)if((x=t.__k[d]=(x=n[d])==null||typeof x=="boolean"?null:typeof x=="string"||typeof x=="number"||typeof x=="bigint"?ke(null,x,null,null,x):Array.isArray(x)?ke(de,{children:x},null,null,null):x.__b>0?ke(x.type,x.props,x.key,null,x.__v):x)!=null){if(x.__=t,x.__b=t.__b+1,(h=y[d])===null||h&&x.key==h.key&&x.type===h.type)y[d]=void 0;else for(g=0;g<w;g++){if((h=y[g])&&x.key==h.key&&x.type===h.type){y[g]=void 0;break}h=null}Ye(e,x,h=h||Se,s,i,c,u,l,f),v=x.__e,(g=x.ref)&&h.ref!=g&&(m||(m=[]),h.ref&&m.push(h.ref,null,x),m.push(g,x.__c||v,x)),v!=null?(I==null&&(I=v),typeof x.type=="function"&&x.__k===h.__k?x.__d=l=Nn(x,l,e):l=Wn(e,x,h,y,v,l),typeof t.type=="function"&&(t.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=ue(h))}for(t.__e=I,d=w;d--;)y[d]!=null&&(typeof t.type=="function"&&y[d].__e!=null&&y[d].__e==t.__d&&(t.__d=ue(r,d+1)),qn(y[d],y[d]));if(m)for(d=0;d<m.length;d++)Vn(m[d],m[++d],m[++d])}function Nn(e,n,t){for(var r,s=e.__k,i=0;s&&i<s.length;i++)(r=s[i])&&(r.__=e,n=typeof r.type=="function"?Nn(r,n,t):Wn(t,r,r,s,r.__e,n));return n}function $e(e,n){return n=n||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(t){$e(t,n)}):n.push(e)),n}function Wn(e,n,t,r,s,i){var c,u,l;if(n.__d!==void 0)c=n.__d,n.__d=void 0;else if(t==null||s!=i||s.parentNode==null)e:if(i==null||i.parentNode!==e)e.appendChild(s),c=null;else{for(u=i,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==s)break e;e.insertBefore(s,i),c=i}return c!==void 0?c:s.nextSibling}function fo(e,n,t,r,s){var i;for(i in t)i==="children"||i==="key"||i in n||ze(e,i,null,t[i],r);for(i in n)s&&typeof n[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||t[i]===n[i]||ze(e,i,n[i],t[i],r)}function tn(e,n,t){n[0]==="-"?e.setProperty(n,t):e[n]=t==null?"":typeof t!="number"||uo.test(n)?t:t+"px"}function ze(e,n,t,r,s){var i;e:if(n==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||tn(e.style,n,"");if(t)for(n in t)r&&t[n]===r[n]||tn(e.style,n,t[n])}else if(n[0]==="o"&&n[1]==="n")i=n!==(n=n.replace(/Capture$/,"")),n=n.toLowerCase()in e?n.toLowerCase().slice(2):n.slice(2),e.l||(e.l={}),e.l[n+i]=t,t?r||e.addEventListener(n,i?rn:on,i):e.removeEventListener(n,i?rn:on,i);else if(n!=="dangerouslySetInnerHTML"){if(s)n=n.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(n!=="href"&&n!=="list"&&n!=="form"&&n!=="tabIndex"&&n!=="download"&&n in e)try{e[n]=t??"";break e}catch{}typeof t=="function"||(t!=null&&(t!==!1||n[0]==="a"&&n[1]==="r")?e.setAttribute(n,t):e.removeAttribute(n))}}function on(e){this.l[e.type+!1](M.event?M.event(e):e)}function rn(e){this.l[e.type+!0](M.event?M.event(e):e)}function Ye(e,n,t,r,s,i,c,u,l){var f,d,g,h,x,v,I,m,y,w,S,_=n.type;if(n.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,u=n.__e=t.__e,n.__h=null,i=[u]),(f=M.__b)&&f(n);try{e:if(typeof _=="function"){if(m=n.props,y=(f=_.contextType)&&r[f.__c],w=f?y?y.props.value:f.__:r,t.__c?I=(d=n.__c=t.__c).__=d.__E:("prototype"in _&&_.prototype.render?n.__c=d=new _(m,w):(n.__c=d=new Z(m,w),d.constructor=_,d.render=po),y&&y.sub(d),d.props=m,d.state||(d.state={}),d.context=w,d.__n=r,g=d.__d=!0,d.__h=[]),d.__s==null&&(d.__s=d.state),_.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=te({},d.__s)),te(d.__s,_.getDerivedStateFromProps(m,d.__s))),h=d.props,x=d.state,g)_.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(_.getDerivedStateFromProps==null&&m!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(m,w),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(m,d.__s,w)===!1||n.__v===t.__v){d.props=m,d.state=d.__s,n.__v!==t.__v&&(d.__d=!1),d.__v=n,n.__e=t.__e,n.__k=t.__k,n.__k.forEach(function($){$&&($.__=n)}),d.__h.length&&c.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(m,d.__s,w),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,x,v)})}d.context=w,d.props=m,d.state=d.__s,(f=M.__r)&&f(n),d.__d=!1,d.__v=n,d.__P=e,f=d.render(d.props,d.state,d.context),d.state=d.__s,d.getChildContext!=null&&(r=te(te({},r),d.getChildContext())),g||d.getSnapshotBeforeUpdate==null||(v=d.getSnapshotBeforeUpdate(h,x)),S=f!=null&&f.type===de&&f.key==null?f.props.children:f,Un(e,Array.isArray(S)?S:[S],n,t,r,s,i,c,u,l),d.base=n.__e,n.__h=null,d.__h.length&&c.push(d),I&&(d.__E=d.__=null),d.__e=!1}else i==null&&n.__v===t.__v?(n.__k=t.__k,n.__e=t.__e):n.__e=ho(t.__e,n,t,r,s,i,c,l);(f=M.diffed)&&f(n)}catch($){n.__v=null,(l||i!=null)&&(n.__e=u,n.__h=!!l,i[i.indexOf(u)]=null),M.__e($,n,t)}}function Gn(e,n){M.__c&&M.__c(n,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(r){r.call(t)})}catch(r){M.__e(r,t.__v)}})}function ho(e,n,t,r,s,i,c,u){var l,f,d,g=t.props,h=n.props,x=n.type,v=0;if(x==="svg"&&(s=!0),i!=null){for(;v<i.length;v++)if((l=i[v])&&"setAttribute"in l==!!x&&(x?l.localName===x:l.nodeType===3)){e=l,i[v]=null;break}}if(e==null){if(x===null)return document.createTextNode(h);e=s?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,h.is&&h),i=null,u=!1}if(x===null)g===h||u&&e.data===h||(e.data=h);else{if(i=i&&Re.call(e.childNodes),f=(g=t.props||Se).dangerouslySetInnerHTML,d=h.dangerouslySetInnerHTML,!u){if(i!=null)for(g={},v=0;v<e.attributes.length;v++)g[e.attributes[v].name]=e.attributes[v].value;(d||f)&&(d&&(f&&d.__html==f.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(fo(e,h,g,s,u),d)n.__k=[];else if(v=n.props.children,Un(e,Array.isArray(v)?v:[v],n,t,r,s&&x!=="foreignObject",i,c,i?i[0]:t.__k&&ue(t,0),u),i!=null)for(v=i.length;v--;)i[v]!=null&&Hn(i[v]);u||("value"in h&&(v=h.value)!==void 0&&(v!==g.value||v!==e.value||x==="progress"&&!v)&&ze(e,"value",v,g.value,!1),"checked"in h&&(v=h.checked)!==void 0&&v!==e.checked&&ze(e,"checked",v,g.checked,!1))}return e}function Vn(e,n,t){try{typeof e=="function"?e(n):e.current=n}catch(r){M.__e(r,t)}}function qn(e,n,t){var r,s;if(M.unmount&&M.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Vn(r,null,n)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){M.__e(i,n)}r.base=r.__P=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&qn(r[s],n,typeof e.type!="function");t||e.__e==null||Hn(e.__e),e.__e=e.__d=void 0}function po(e,n,t){return this.constructor(e,t)}function Qn(e,n,t){var r,s,i;M.__&&M.__(e,n),s=(r=typeof t=="function")?null:t&&t.__k||n.__k,i=[],Ye(n,e=(!r&&t||n).__k=Fe(de,null,[e]),s||Se,Se,n.ownerSVGElement!==void 0,!r&&t?[t]:s?null:n.firstChild?Re.call(n.childNodes):null,i,!r&&t?t:s?s.__e:n.firstChild,r),Gn(i,e)}Re=An.slice,M={__e:function(e,n){for(var t,r,s;n=n.__;)if((t=n.__c)&&!t.__)try{if((r=t.constructor)&&r.getDerivedStateFromError!=null&&(t.setState(r.getDerivedStateFromError(e)),s=t.__d),t.componentDidCatch!=null&&(t.componentDidCatch(e),s=t.__d),s)return t.__E=t}catch(i){e=i}throw e}},Pn=0,Z.prototype.setState=function(e,n){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=te({},this.state),typeof e=="function"&&(e=e(te({},t),this.props)),e&&te(t,e),e!=null&&this.__v&&(n&&this.__h.push(n),nn(this))},Z.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nn(this))},Z.prototype.render=de,ge=[],Ln=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Me.__r=0;var go=0;function b(e,n,t,r,s){var i,c,u={};for(c in n)c=="ref"?i=n[c]:u[c]=n[c];var l={type:e,props:u,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--go,__source:r,__self:s};if(typeof e=="function"&&(i=e.defaultProps))for(c in i)u[c]===void 0&&(u[c]=i[c]);return M.vnode&&M.vnode(l),l}function mo(e,n){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(n)}catch{}}function xo(e){try{const n=window.localStorage[`emoji-mart.${e}`];if(n)return JSON.parse(n)}catch{}}var oe={set:mo,get:xo};const Be=new Map,Io=[{v:15,emoji:"🫨"},{v:14,emoji:"🫠"},{v:13.1,emoji:"😶🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];function vo(){for(const{v:e,emoji:n}of Io)if(Zn(n))return e}function bo(){return!Zn("🇨🇦")}function Zn(e){if(Be.has(e))return Be.get(e);const n=yo(e);return Be.set(e,n),n}const yo=(()=>{let e=null;try{navigator.userAgent.includes("jsdom")||(e=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}))}catch{}if(!e)return()=>!1;const n=25,t=20,r=Math.floor(n/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=t*2,e.canvas.height=n,s=>{e.clearRect(0,0,t*2,n),e.fillStyle="#FF0000",e.fillText(s,0,22),e.fillStyle="#0000FF",e.fillText(s,t,22);const i=e.getImageData(0,0,t,n).data,c=i.length;let u=0;for(;u<c&&!i[u+3];u+=4);if(u>=c)return!1;const l=t+u/4%t,f=Math.floor(u/4/t),d=e.getImageData(l,f,1,1).data;return!(i[u]!==d[0]||i[u+2]!==d[2]||e.measureText(s).width>=t)}})();var sn={latestVersion:vo,noCountryFlags:bo};const Ue=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let N=null;function wo(e){N||(N=oe.get("frequently")||{});const n=e.id||e;n&&(N[n]||(N[n]=0),N[n]+=1,oe.set("last",n),oe.set("frequently",N))}function ko({maxFrequentRows:e,perLine:n}){if(!e)return[];N||(N=oe.get("frequently"));let t=[];if(!N){N={};for(let i in Ue.slice(0,n)){const c=Ue[i];N[c]=n-i,t.push(c)}return t}const r=e*n,s=oe.get("last");for(let i in N)t.push(i);if(t.sort((i,c)=>{const u=N[c],l=N[i];return u==l?i.localeCompare(c):u-l}),t.length>r){const i=t.slice(r);t=t.slice(0,r);for(let c of i)c!=s&&delete N[c];s&&t.indexOf(s)==-1&&(delete N[t[t.length-1]],t.splice(-1,1,s)),oe.set("frequently",N)}return t}var Yn={add:wo,get:ko,DEFAULTS:Ue},Xn={};Xn=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var K={autoFocus:{value:!1},dynamicWidth:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:15,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14,15]},exceptEmojis:{value:[]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","be","cs","de","es","fa","fi","fr","hi","it","ja","ko","nl","pl","pt","ru","sa","tr","uk","vi","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};let G=null,E=null;const Pe={};async function an(e){if(Pe[e])return Pe[e];const t=await(await fetch(e)).json();return Pe[e]=t,t}let Le=null,Kn=null,Jn=!1;function xe(e,{caller:n}={}){return Le||(Le=new Promise(t=>{Kn=t})),e?Co(e):n&&!Jn&&console.warn(`\`${n}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`),Le}async function Co(e){Jn=!0;let{emojiVersion:n,set:t,locale:r}=e;if(n||(n=K.emojiVersion.value),t||(t=K.set.value),r||(r=K.locale.value),E)E.categories=E.categories.filter(l=>!l.name);else{E=(typeof e.data=="function"?await e.data():e.data)||await an(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${n}/${t}.json`),E.emoticons={},E.natives={},E.categories.unshift({id:"frequent",emojis:[]});for(const l in E.aliases){const f=E.aliases[l],d=E.emojis[f];d&&(d.aliases||(d.aliases=[]),d.aliases.push(l))}E.originalCategories=E.categories}if(G=(typeof e.i18n=="function"?await e.i18n():e.i18n)||(r=="en"?Bn(Xn):await an(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)),e.custom)for(let l in e.custom){l=parseInt(l);const f=e.custom[l],d=e.custom[l-1];if(!(!f.emojis||!f.emojis.length)){f.id||(f.id=`custom_${l+1}`),f.name||(f.name=G.categories.custom),d&&!f.icon&&(f.target=d.target||d),E.categories.push(f);for(const g of f.emojis)E.emojis[g.id]=g}}e.categories&&(E.categories=E.originalCategories.filter(l=>e.categories.indexOf(l.id)!=-1).sort((l,f)=>{const d=e.categories.indexOf(l.id),g=e.categories.indexOf(f.id);return d-g}));let s=null,i=null;t=="native"&&(s=sn.latestVersion(),i=e.noCountryFlags||sn.noCountryFlags());let c=E.categories.length,u=!1;for(;c--;){const l=E.categories[c];if(l.id=="frequent"){let{maxFrequentRows:g,perLine:h}=e;g=g>=0?g:K.maxFrequentRows.value,h||(h=K.perLine.value),l.emojis=Yn.get({maxFrequentRows:g,perLine:h})}if(!l.emojis||!l.emojis.length){E.categories.splice(c,1);continue}const{categoryIcons:f}=e;if(f){const g=f[l.id];g&&!l.icon&&(l.icon=g)}let d=l.emojis.length;for(;d--;){const g=l.emojis[d],h=g.id?g:E.emojis[g],x=()=>{l.emojis.splice(d,1)};if(!h||e.exceptEmojis&&e.exceptEmojis.includes(h.id)){x();continue}if(s&&h.version>s){x();continue}if(i&&l.id=="flags"&&!$o.includes(h.id)){x();continue}if(!h.search){if(u=!0,h.search=","+[[h.id,!1],[h.name,!0],[h.keywords,!1],[h.emoticons,!1]].map(([I,m])=>{if(I)return(Array.isArray(I)?I:[I]).map(y=>(m?y.split(/[-|_|\s]+/):[y]).map(w=>w.toLowerCase())).flat()}).flat().filter(I=>I&&I.trim()).join(","),h.emoticons)for(const I of h.emoticons)E.emoticons[I]||(E.emoticons[I]=h.id);let v=0;for(const I of h.skins){if(!I)continue;v++;const{native:m}=I;m&&(E.natives[m]=h.id,h.search+=`,${m}`);const y=v==1?"":`:skin-tone-${v}:`;I.shortcodes=`:${h.id}:${y}`}}}}u&&se.reset(),Kn()}function et(e,n,t){e||(e={});const r={};for(let s in n)r[s]=nt(s,e,n,t);return r}function nt(e,n,t,r){const s=t[e];let i=r&&r.getAttribute(e)||(n[e]!=null&&n[e]!=null?n[e]:null);return s&&(i!=null&&s.value&&typeof s.value!=typeof i&&(typeof s.value=="boolean"?i=i!="false":i=s.value.constructor(i)),s.transform&&i&&(i=s.transform(i)),(i==null||s.choices&&s.choices.indexOf(i)==-1)&&(i=s.value)),i}const jo=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;let Ne=null;function _o(e){return e.id?e:E.emojis[e]||E.emojis[E.aliases[e]]||E.emojis[E.natives[e]]}function So(){Ne=null}async function Mo(e,{maxResults:n,caller:t}={}){if(!e||!e.trim().length)return null;n||(n=90),await xe(null,{caller:t||"SearchIndex.search"});const r=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter((u,l,f)=>u.trim()&&f.indexOf(u)==l);if(!r.length)return;let s=Ne||(Ne=Object.values(E.emojis)),i,c;for(const u of r){if(!s.length)break;i=[],c={};for(const l of s){if(!l.search)continue;const f=l.search.indexOf(`,${u}`);f!=-1&&(i.push(l),c[l.id]||(c[l.id]=0),c[l.id]+=l.id==u?0:f+1)}s=i}return i.length<2||(i.sort((u,l)=>{const f=c[u.id],d=c[l.id];return f==d?u.id.localeCompare(l.id):f-d}),i.length>n&&(i=i.slice(0,n))),i}var se={search:Mo,get:_o,reset:So,SHORTCODES_REGEX:jo};const $o=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];function zo(e,n){return Array.isArray(e)&&Array.isArray(n)&&e.length===n.length&&e.every((t,r)=>t==n[r])}async function Oo(e=1){for(let n in[...Array(e).keys()])await new Promise(requestAnimationFrame)}function Do(e,{skinIndex:n=0}={}){const t=e.skins[n]||(()=>(n=0,e.skins[n]))(),r={id:e.id,name:e.name,native:t.native,unified:t.unified,keywords:e.keywords,shortcodes:t.shortcodes||e.shortcodes};return e.skins.length>1&&(r.skin=n+1),t.src&&(r.src=t.src),e.aliases&&e.aliases.length&&(r.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(r.emoticons=e.emoticons),r}const To={activity:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:b("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:b("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:b("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:b("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[b("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),b("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[b("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),b("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:b("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[b("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),b("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:b("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[b("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),b("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[b("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),b("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:b("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:b("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},Ro={loupe:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:b("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:b("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})};var Oe={categories:To,search:Ro};function We(e){let{id:n,skin:t,emoji:r}=e;if(e.shortcodes){const u=e.shortcodes.match(se.SHORTCODES_REGEX);u&&(n=u[1],u[2]&&(t=u[2]))}if(r||(r=se.get(n||e.native)),!r)return e.fallback;const s=r.skins[t-1]||r.skins[0],i=s.src||(e.set!="native"&&!e.spritesheet?typeof e.getImageURL=="function"?e.getImageURL(e.set,s.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/64/${s.unified}.png`:void 0),c=typeof e.getSpritesheetURL=="function"?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/sheets-256/64.png`;return b("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:i?b("img",{style:{maxWidth:e.size||"1em",maxHeight:e.size||"1em",display:"inline-block"},alt:s.native||s.shortcodes,src:i}):e.set=="native"?b("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:s.native}):b("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${c})`,backgroundSize:`${100*E.sheet.cols}% ${100*E.sheet.rows}%`,backgroundPosition:`${100/(E.sheet.cols-1)*s.x}% ${100/(E.sheet.rows-1)*s.y}%`}})})}const Eo=typeof window<"u"&&window.HTMLElement?window.HTMLElement:Object;class tt extends Eo{static get observedAttributes(){return Object.keys(this.Props)}update(n={}){for(let t in n)this.attributeChangedCallback(t,null,n[t])}attributeChangedCallback(n,t,r){if(!this.component)return;const s=nt(n,{[n]:r},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[n]:s}):(this.component.props[n]=s,this.component.forceUpdate())}disconnectedCallback(){this.disconnected=!0,this.component&&this.component.unregister&&this.component.unregister()}constructor(n={}){if(super(),this.props=n,n.parent||n.ref){let t=null;const r=n.parent||(t=n.ref&&n.ref.current);t&&(t.innerHTML=""),r&&r.appendChild(this)}}}class Bo extends tt{setShadow(){this.attachShadow({mode:"open"})}injectStyles(n){if(!n)return;const t=document.createElement("style");t.textContent=n,this.shadowRoot.insertBefore(t,this.shadowRoot.firstChild)}constructor(n,{styles:t}={}){super(n),this.setShadow(),this.injectStyles(t)}}var ot={fallback:"",id:"",native:"",shortcodes:"",size:{value:"",transform:e=>/\D/.test(e)?e:`${e}px`},set:K.set,skin:K.skin};class rt extends tt{async connectedCallback(){const n=et(this.props,ot,this);n.element=this,n.ref=t=>{this.component=t},await xe(),!this.disconnected&&Qn(b(We,{...n}),this)}constructor(n){super(n)}}V(rt,"Props",ot);typeof customElements<"u"&&!customElements.get("em-emoji")&&customElements.define("em-emoji",rt);var cn,Ge=[],ln=M.__b,dn=M.__r,un=M.diffed,fn=M.__c,hn=M.unmount;function Po(){var e;for(Ge.sort(function(n,t){return n.__v.__b-t.__v.__b});e=Ge.pop();)if(e.__P)try{e.__H.__h.forEach(Ce),e.__H.__h.forEach(Ve),e.__H.__h=[]}catch(n){e.__H.__h=[],M.__e(n,e.__v)}}M.__b=function(e){ln&&ln(e)},M.__r=function(e){dn&&dn(e);var n=e.__c.__H;n&&(n.__h.forEach(Ce),n.__h.forEach(Ve),n.__h=[])},M.diffed=function(e){un&&un(e);var n=e.__c;n&&n.__H&&n.__H.__h.length&&(Ge.push(n)!==1&&cn===M.requestAnimationFrame||((cn=M.requestAnimationFrame)||function(t){var r,s=function(){clearTimeout(i),pn&&cancelAnimationFrame(r),setTimeout(t)},i=setTimeout(s,100);pn&&(r=requestAnimationFrame(s))})(Po))},M.__c=function(e,n){n.some(function(t){try{t.__h.forEach(Ce),t.__h=t.__h.filter(function(r){return!r.__||Ve(r)})}catch(r){n.some(function(s){s.__h&&(s.__h=[])}),n=[],M.__e(r,t.__v)}}),fn&&fn(e,n)},M.unmount=function(e){hn&&hn(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Ce(r)}catch(s){n=s}}),n&&M.__e(n,t.__v))};var pn=typeof requestAnimationFrame=="function";function Ce(e){var n=e.__c;typeof n=="function"&&(e.__c=void 0,n())}function Ve(e){e.__c=e.__()}function Lo(e,n){for(var t in n)e[t]=n[t];return e}function gn(e,n){for(var t in e)if(t!=="__source"&&!(t in n))return!0;for(var r in n)if(r!=="__source"&&e[r]!==n[r])return!0;return!1}function De(e){this.props=e}(De.prototype=new Z).isPureReactComponent=!0,De.prototype.shouldComponentUpdate=function(e,n){return gn(this.props,e)||gn(this.state,n)};var mn=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),mn&&mn(e)};var Ao=M.__e;M.__e=function(e,n,t){if(e.then){for(var r,s=n;s=s.__;)if((r=s.__c)&&r.__c)return n.__e==null&&(n.__e=t.__e,n.__k=t.__k),r.__c(e,n)}Ao(e,n,t)};var xn=M.unmount;function Ae(){this.__u=0,this.t=null,this.__b=null}function it(e){var n=e.__.__c;return n&&n.__e&&n.__e(e)}function ye(){this.u=null,this.o=null}M.unmount=function(e){var n=e.__c;n&&n.__R&&n.__R(),n&&e.__h===!0&&(e.type=null),xn&&xn(e)},(Ae.prototype=new Z).__c=function(e,n){var t=n.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var s=it(r.__v),i=!1,c=function(){i||(i=!0,t.__R=null,s?s(u):u())};t.__R=c;var u=function(){if(!--r.__u){if(r.state.__e){var f=r.state.__e;r.__v.__k[0]=function g(h,x,v){return h&&(h.__v=null,h.__k=h.__k&&h.__k.map(function(I){return g(I,x,v)}),h.__c&&h.__c.__P===x&&(h.__e&&v.insertBefore(h.__e,h.__d),h.__c.__e=!0,h.__c.__P=v)),h}(f,f.__c.__P,f.__c.__O)}var d;for(r.setState({__e:r.__b=null});d=r.t.pop();)d.forceUpdate()}},l=n.__h===!0;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(c,c)},Ae.prototype.componentWillUnmount=function(){this.t=[]},Ae.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function i(c,u,l){return c&&(c.__c&&c.__c.__H&&(c.__c.__H.__.forEach(function(f){typeof f.__c=="function"&&f.__c()}),c.__c.__H=null),(c=Lo({},c)).__c!=null&&(c.__c.__P===l&&(c.__c.__P=u),c.__c=null),c.__k=c.__k&&c.__k.map(function(f){return i(f,u,l)})),c}(this.__b,t,r.__O=r.__P)}this.__b=null}var s=n.__e&&Fe(de,null,e.fallback);return s&&(s.__h=null),[Fe(de,null,n.__e?null:e.children),s]};var In=function(e,n,t){if(++t[1]===t[0]&&e.o.delete(n),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(t=e.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.u=t=t[2]}};(ye.prototype=new Z).__e=function(e){var n=this,t=it(n.__v),r=n.o.get(e);return r[0]++,function(s){var i=function(){n.props.revealOrder?(r.push(s),In(n,e,r)):s()};t?t(i):i()}},ye.prototype.render=function(e){this.u=null,this.o=new Map;var n=$e(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&n.reverse();for(var t=n.length;t--;)this.o.set(n[t],this.u=[1,0,this.u]);return e.children},ye.prototype.componentDidUpdate=ye.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(n,t){In(e,t,n)})};var Ho=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Fo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Uo=typeof document<"u",No=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};Z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var vn=M.event;function Wo(){}function Go(){return this.cancelBubble}function Vo(){return this.defaultPrevented}M.event=function(e){return vn&&(e=vn(e)),e.persist=Wo,e.isPropagationStopped=Go,e.isDefaultPrevented=Vo,e.nativeEvent=e};var bn={configurable:!0,get:function(){return this.class}},yn=M.vnode;M.vnode=function(e){var n=e.type,t=e.props,r=t;if(typeof n=="string"){var s=n.indexOf("-")===-1;for(var i in r={},t){var c=t[i];Uo&&i==="children"&&n==="noscript"||i==="value"&&"defaultValue"in t&&c==null||(i==="defaultValue"&&"value"in t&&t.value==null?i="value":i==="download"&&c===!0?c="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+n)&&!No(t.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():s&&Fo.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():c===null&&(c=void 0),r[i]=c)}n=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=$e(t.children).forEach(function(u){u.props.selected=r.value.indexOf(u.props.value)!=-1})),n=="select"&&r.defaultValue!=null&&(r.value=$e(t.children).forEach(function(u){u.props.selected=r.multiple?r.defaultValue.indexOf(u.props.value)!=-1:r.defaultValue==u.props.value})),e.props=r,t.class!=t.className&&(bn.enumerable="className"in t,t.className!=null&&(r.class=t.className),Object.defineProperty(r,"className",bn))}e.$$typeof=Ho,yn&&yn(e)};var wn=M.__r;M.__r=function(e){wn&&wn(e),e.__c};const qo={light:"outline",dark:"solid"};class Qo extends De{renderIcon(n){const{icon:t}=n;if(t){if(t.svg)return b("span",{class:"flex",dangerouslySetInnerHTML:{__html:t.svg}});if(t.src)return b("img",{src:t.src})}const r=Oe.categories[n.id]||Oe.categories.custom,s=this.props.icons=="auto"?qo[this.props.theme]:this.props.icons;return r[s]||r}render(){let n=null;return b("nav",{id:"nav",class:"padding","data-position":this.props.position,dir:this.props.dir,children:b("div",{class:"flex relative",children:[this.categories.map((t,r)=>{const s=t.name||G.categories[t.id],i=!this.props.unfocused&&t.id==this.state.categoryId;return i&&(n=r),b("button",{"aria-label":s,"aria-selected":i||void 0,title:s,type:"button",class:"flex flex-grow flex-center",onMouseDown:c=>c.preventDefault(),onClick:()=>{this.props.onClick({category:t,i:r})},children:this.renderIcon(t)})}),b("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:n==null?0:1,transform:this.props.dir==="rtl"?`scaleX(-1) translateX(${n*100}%)`:`translateX(${n*100}%)`}})]})})}constructor(){super(),this.categories=E.categories.filter(n=>!n.target),this.state={categoryId:this.categories[0].id}}}class Zo extends De{shouldComponentUpdate(n){for(let t in n)if(t!="children"&&n[t]!=this.props[t])return!0;return!1}render(){return this.props.children}}const we={rowsPerRender:10};class Yo extends Z{getInitialState(n=this.props){return{skin:oe.get("skin")||n.skin,theme:this.initTheme(n.theme)}}componentWillMount(){this.dir=G.rtl?"rtl":"ltr",this.refs={menu:X(),navigation:X(),scroll:X(),search:X(),searchInput:X(),skinToneButton:X(),skinToneRadio:X()},this.initGrid(),this.props.stickySearch==!1&&this.props.searchPosition=="sticky"&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:n}=this.refs;n.current&&n.current.focus()}}componentWillReceiveProps(n){this.nextState||(this.nextState={});for(const t in n)this.nextState[t]=n[t];clearTimeout(this.nextStateTimer),this.nextStateTimer=setTimeout(()=>{let t=!1;for(const s in this.nextState)this.props[s]=this.nextState[s],(s==="custom"||s==="categories")&&(t=!0);delete this.nextState;const r=this.getInitialState();if(t)return this.reset(r);this.setState(r)})}componentWillUnmount(){this.unregister()}async reset(n={}){await xe(this.props),this.initGrid(),this.unobserve(),this.setState(n,()=>{this.observeCategories(),this.observeRows()})}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){var n;document.removeEventListener("click",this.handleClickOutside),(n=this.darkMedia)==null||n.removeEventListener("change",this.darkMediaCallback),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve({except:n=[]}={}){Array.isArray(n)||(n=[n]);for(const t of this.observers)n.includes(t)||t.disconnect();this.observers=[].concat(n)}initGrid(){const{categories:n}=E;this.refs.categories=new Map;const t=E.categories.map(s=>s.id).join(",");this.navKey&&this.navKey!=t&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=t,this.grid=[],this.grid.setsize=0;const r=(s,i)=>{const c=[];c.__categoryId=i.id,c.__index=s.length,this.grid.push(c);const u=this.grid.length-1,l=u%we.rowsPerRender?{}:X();return l.index=u,l.posinset=this.grid.setsize+1,s.push(l),c};for(let s of n){const i=[];let c=r(i,s);for(let u of s.emojis)c.length==this.getPerLine()&&(c=r(i,s)),this.grid.setsize+=1,c.push(u);this.refs.categories.set(s.id,{root:X(),rows:i})}}initTheme(n){if(n!="auto")return n;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addEventListener("change",this.darkMediaCallback)}return this.darkMedia.matches?"dark":"light"}initDynamicPerLine(n=this.props){if(!n.dynamicWidth)return;const{element:t,emojiButtonSize:r}=n,s=()=>{const{width:c}=t.getBoundingClientRect();return Math.floor(c/r)},i=new ResizeObserver(()=>{this.unobserve({except:i}),this.setState({perLine:s()},()=>{this.initGrid(),this.forceUpdate(()=>{this.observeCategories(),this.observeRows()})})});return i.observe(t),this.observers.push(i),s()}getPerLine(){return this.state.perLine||this.props.perLine}getEmojiByPos([n,t]){const r=this.state.searchResults||this.grid,s=r[n]&&r[n][t];if(s)return se.get(s)}observeCategories(){const n=this.refs.navigation.current;if(!n)return;const t=new Map,r=c=>{c!=n.state.categoryId&&n.setState({categoryId:c})},s={root:this.refs.scroll.current,threshold:[0,1]},i=new IntersectionObserver(c=>{for(const l of c){const f=l.target.dataset.id;t.set(f,l.intersectionRatio)}const u=[...t];for(const[l,f]of u)if(f){r(l);break}},s);for(const{root:c}of this.refs.categories.values())i.observe(c.current);this.observers.push(i)}observeRows(){const n={...this.state.visibleRows},t=new IntersectionObserver(r=>{for(const s of r){const i=parseInt(s.target.dataset.index);s.isIntersecting?n[i]=!0:delete n[i]}this.setState({visibleRows:n})},{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(we.rowsPerRender+5)}px 0px ${this.props.emojiButtonSize*we.rowsPerRender}px`});for(const{rows:r}of this.refs.categories.values())for(const s of r)s.current&&t.observe(s.current);this.observers.push(t)}preventDefault(n){n.preventDefault()}unfocusSearch(){const n=this.refs.searchInput.current;n&&n.blur()}navigate({e:n,input:t,left:r,right:s,up:i,down:c}){const u=this.state.searchResults||this.grid;if(!u.length)return;let[l,f]=this.state.pos;const d=(()=>{if(l==0&&f==0&&!n.repeat&&(r||i))return null;if(l==-1)return!n.repeat&&(s||c)&&t.selectionStart==t.value.length?[0,0]:null;if(r||s){let g=u[l];const h=r?-1:1;if(f+=h,!g[f]){if(l+=h,g=u[l],!g)return l=r?0:u.length-1,f=r?0:u[l].length-1,[l,f];f=r?g.length-1:0}return[l,f]}if(i||c){l+=i?-1:1;const g=u[l];return g?(g[f]||(f=g.length-1),[l,f]):(l=i?0:u.length-1,f=i?0:u[l].length-1,[l,f])}})();if(d)n.preventDefault();else{this.state.pos[0]>-1&&this.setState({pos:[-1,-1]});return}this.setState({pos:d,keyboard:!0},()=>{this.scrollTo({row:d[0]})})}scrollTo({categoryId:n,row:t}){const r=this.state.searchResults||this.grid;if(!r.length)return;const s=this.refs.scroll.current,i=s.getBoundingClientRect();let c=0;if(t>=0&&(n=r[t].__categoryId),n&&(c=(this.refs[n]||this.refs.categories.get(n).root).current.getBoundingClientRect().top-(i.top-s.scrollTop)+1),t>=0)if(!t)c=0;else{const u=r[t].__index,l=c+u*this.props.emojiButtonSize,f=l+this.props.emojiButtonSize+this.props.emojiButtonSize*.88;if(l<s.scrollTop)c=l;else if(f>s.scrollTop+i.height)c=f-i.height;else return}this.ignoreMouse(),s.scrollTop=c}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout(()=>{delete this.mouseIsIgnored},100)}handleEmojiOver(n){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:n||[-1,-1],keyboard:!1})}handleEmojiClick({e:n,emoji:t,pos:r}){if(this.props.onEmojiSelect&&(!t&&r&&(t=this.getEmojiByPos(r)),t)){const s=Do(t,{skinIndex:this.state.skin-1});this.props.maxFrequentRows&&Yn.add(s,this.props),this.props.onEmojiSelect(s,n)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(n){this.setState({tempSkin:n})}handleSkinClick(n){this.ignoreMouse(),this.closeSkins(),this.setState({skin:n,tempSkin:null}),oe.set("skin",n)}renderNav(){return b(Qo,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,dir:this.dir,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const n=this.getEmojiByPos(this.state.pos),t=this.state.searchResults&&!this.state.searchResults.length;return b("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[b("div",{class:"flex flex-middle flex-grow",children:[b("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:b(We,{emoji:n,id:t?this.props.noResultsEmoji||"cry":this.props.previewEmoji||(this.props.previewPosition=="top"?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),b("div",{class:`margin-${this.dir[0]}`,children:n||t?b("div",{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[b("div",{class:"preview-title ellipsis",children:n?n.name:G.search_no_results_1}),b("div",{class:"preview-subtitle ellipsis color-c",children:n?n.skins[0].shortcodes:G.search_no_results_2})]}):b("div",{class:"preview-placeholder color-c",children:G.pick})})]}),!n&&this.props.skinTonePosition=="preview"&&this.renderSkinToneButton()]})}renderEmojiButton(n,{pos:t,posinset:r,grid:s}){const i=this.props.emojiButtonSize,c=this.state.tempSkin||this.state.skin,l=(n.skins[c-1]||n.skins[0]).native,f=zo(this.state.pos,t),d=t.concat(n.id).join("");return b(Zo,{selected:f,skin:c,size:i,children:b("button",{"aria-label":l,"aria-selected":f||void 0,"aria-posinset":r,"aria-setsize":s.setsize,"data-keyboard":this.state.keyboard,title:this.props.previewPosition=="none"?n.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:g=>this.handleEmojiClick({e:g,emoji:n}),onMouseEnter:()=>this.handleEmojiOver(t),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[b("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(r-1)%this.props.emojiButtonColors.length]:void 0}}),b(We,{emoji:n,set:this.props.set,size:this.props.emojiSize,skin:c,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},d)}renderSearch(){const n=this.props.previewPosition=="none"||this.props.skinTonePosition=="search";return b("div",{children:[b("div",{class:"spacer"}),b("div",{class:"flex flex-middle",children:[b("div",{class:"search relative flex-grow",children:[b("input",{type:"search",ref:this.refs.searchInput,placeholder:G.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown,autoComplete:"off"}),b("span",{class:"icon loupe flex",children:Oe.search.loupe}),this.state.searchResults&&b("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:Oe.search.delete})]}),n&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:n}=this.state;return n?b("div",{class:"category",ref:this.refs.search,children:[b("div",{class:`sticky padding-small align-${this.dir[0]}`,children:G.categories.search}),b("div",{children:n.length?n.map((t,r)=>b("div",{class:"flex",children:t.map((s,i)=>this.renderEmojiButton(s,{pos:[r,i],posinset:r*this.props.perLine+i+1,grid:n}))})):b("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&b("a",{onClick:this.props.onAddCustomEmoji,children:G.add_custom})})})]}):null}renderCategories(){const{categories:n}=E,t=!!this.state.searchResults,r=this.getPerLine();return b("div",{style:{visibility:t?"hidden":void 0,display:t?"none":void 0,height:"100%"},children:n.map(s=>{const{root:i,rows:c}=this.refs.categories.get(s.id);return b("div",{"data-id":s.target?s.target.id:s.id,class:"category",ref:i,children:[b("div",{class:`sticky padding-small align-${this.dir[0]}`,children:s.name||G.categories[s.id]}),b("div",{class:"relative",style:{height:c.length*this.props.emojiButtonSize},children:c.map((u,l)=>{const f=u.index-u.index%we.rowsPerRender,d=this.state.visibleRows[f],g="current"in u?u:void 0;if(!d&&!g)return null;const h=l*r,x=h+r,v=s.emojis.slice(h,x);return v.length<r&&v.push(...new Array(r-v.length)),b("div",{"data-index":u.index,ref:g,class:"flex row",style:{top:l*this.props.emojiButtonSize},children:d&&v.map((I,m)=>{if(!I)return b("div",{style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize}});const y=se.get(I);return this.renderEmojiButton(y,{pos:[u.index,m],posinset:u.posinset+m,grid:this.grid})})},u.index)})})]})})})}renderSkinToneButton(){return this.props.skinTonePosition=="none"?null:b("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:b("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":G.skins.choose,title:G.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:b("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderLiveRegion(){const n=this.getEmojiByPos(this.state.pos),t=n?n.name:"";return b("div",{"aria-live":"polite",class:"sr-only",children:t})}renderSkins(){const t=this.refs.skinToneButton.current.getBoundingClientRect(),r=this.base.getBoundingClientRect(),s={};return this.dir=="ltr"?s.right=r.right-t.right-3:s.left=t.left-r.left-3,this.props.previewPosition=="bottom"&&this.props.skinTonePosition=="preview"?s.bottom=r.bottom-t.top+6:(s.top=t.bottom-r.top+3,s.bottom="auto"),b("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":G.skins.choose,class:"menu hidden","data-position":s.top?"top":"bottom",style:s,children:[...Array(6).keys()].map(i=>{const c=i+1,u=this.state.skin==c;return b("div",{children:[b("input",{type:"radio",name:"skin-tone",value:c,"aria-label":G.skins[c],ref:u?this.refs.skinToneRadio:null,defaultChecked:u,onChange:()=>this.handleSkinMouseOver(c),onKeyDown:l=>{(l.code=="Enter"||l.code=="Space"||l.code=="Tab")&&(l.preventDefault(),this.handleSkinClick(c))}}),b("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(c),onMouseEnter:()=>this.handleSkinMouseOver(c),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[b("span",{class:`skin-tone skin-tone-${c}`}),b("span",{class:"margin-small-lr",children:G.skins[c]})]})]})})})}render(){const n=this.props.perLine*this.props.emojiButtonSize;return b("section",{id:"root",class:"flex flex-column",dir:this.dir,style:{width:this.props.dynamicWidth?"100%":`calc(${n}px + (var(--padding) + var(--sidebar-width)))`},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:[this.props.previewPosition=="top"&&this.renderPreview(),this.props.navPosition=="top"&&this.renderNav(),this.props.searchPosition=="sticky"&&b("div",{class:"padding-lr",children:this.renderSearch()}),b("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:b("div",{style:{width:this.props.dynamicWidth?"100%":n,height:"100%"},children:[this.props.searchPosition=="static"&&this.renderSearch(),this.renderSearchResults(),this.renderCategories()]})}),this.props.navPosition=="bottom"&&this.renderNav(),this.props.previewPosition=="bottom"&&this.renderPreview(),this.state.showSkins&&this.renderSkins(),this.renderLiveRegion()]})}constructor(n){super(),V(this,"darkMediaCallback",()=>{this.props.theme=="auto"&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}),V(this,"handleClickOutside",t=>{const{element:r}=this.props;t.target!=r&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside(t))}),V(this,"handleBaseClick",t=>{this.state.showSkins&&(t.target.closest(".menu")||(t.preventDefault(),t.stopImmediatePropagation(),this.closeSkins()))}),V(this,"handleBaseKeydown",t=>{this.state.showSkins&&t.key=="Escape"&&(t.preventDefault(),t.stopImmediatePropagation(),this.closeSkins())}),V(this,"handleSearchClick",()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})}),V(this,"handleSearchInput",async()=>{const t=this.refs.searchInput.current;if(!t)return;const{value:r}=t,s=await se.search(r),i=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!s)return this.setState({searchResults:s,pos:[-1,-1]},i);const c=t.selectionStart==t.value.length?[0,0]:[-1,-1],u=[];u.setsize=s.length;let l=null;for(let f of s)(!u.length||l.length==this.getPerLine())&&(l=[],l.__categoryId="search",l.__index=u.length,u.push(l)),l.push(f);this.ignoreMouse(),this.setState({searchResults:u,pos:c},i)}),V(this,"handleSearchKeyDown",t=>{const r=t.currentTarget;switch(t.stopImmediatePropagation(),t.key){case"ArrowLeft":this.navigate({e:t,input:r,left:!0});break;case"ArrowRight":this.navigate({e:t,input:r,right:!0});break;case"ArrowUp":this.navigate({e:t,input:r,up:!0});break;case"ArrowDown":this.navigate({e:t,input:r,down:!0});break;case"Enter":t.preventDefault(),this.handleEmojiClick({e:t,pos:this.state.pos});break;case"Escape":t.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch();break}}),V(this,"clearSearch",()=>{const t=this.refs.searchInput.current;t&&(t.value="",t.focus(),this.handleSearchInput())}),V(this,"handleCategoryClick",({category:t,i:r})=>{this.scrollTo(r==0?{row:-1}:{categoryId:t.id})}),V(this,"openSkins",t=>{const{currentTarget:r}=t,s=r.getBoundingClientRect();this.setState({showSkins:s},async()=>{await Oo(2);const i=this.refs.menu.current;i&&(i.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))})}),this.observers=[],this.state={pos:[-1,-1],perLine:this.initDynamicPerLine(n),visibleRows:{0:!0},...this.getInitialState(n)}}}class st extends Bo{async connectedCallback(){const n=et(this.props,K,this);n.element=this,n.ref=t=>{this.component=t},await xe(n),!this.disconnected&&Qn(b(Yo,{...n}),this.shadowRoot)}constructor(n){super(n,{styles:Bn(at)})}}V(st,"Props",K);typeof customElements<"u"&&!customElements.get("em-emoji-picker")&&customElements.define("em-emoji-picker",st);var at={};at=`:host {
|
|
19
|
-
width: min-content;
|
|
20
|
-
height: 435px;
|
|
21
|
-
min-height: 230px;
|
|
22
|
-
border-radius: var(--border-radius);
|
|
23
|
-
box-shadow: var(--shadow);
|
|
24
|
-
--border-radius: 10px;
|
|
25
|
-
--category-icon-size: 18px;
|
|
26
|
-
--font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
|
|
27
|
-
--font-size: 15px;
|
|
28
|
-
--preview-placeholder-size: 21px;
|
|
29
|
-
--preview-title-size: 1.1em;
|
|
30
|
-
--preview-subtitle-size: .9em;
|
|
31
|
-
--shadow-color: 0deg 0% 0%;
|
|
32
|
-
--shadow: .3px .5px 2.7px hsl(var(--shadow-color) / .14), .4px .8px 1px -3.2px hsl(var(--shadow-color) / .14), 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / .14);
|
|
33
|
-
display: flex;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[data-theme="light"] {
|
|
37
|
-
--em-rgb-color: var(--rgb-color, 34, 36, 39);
|
|
38
|
-
--em-rgb-accent: var(--rgb-accent, 34, 102, 237);
|
|
39
|
-
--em-rgb-background: var(--rgb-background, 255, 255, 255);
|
|
40
|
-
--em-rgb-input: var(--rgb-input, 255, 255, 255);
|
|
41
|
-
--em-color-border: var(--color-border, rgba(0, 0, 0, .05));
|
|
42
|
-
--em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
[data-theme="dark"] {
|
|
46
|
-
--em-rgb-color: var(--rgb-color, 222, 222, 221);
|
|
47
|
-
--em-rgb-accent: var(--rgb-accent, 58, 130, 247);
|
|
48
|
-
--em-rgb-background: var(--rgb-background, 21, 22, 23);
|
|
49
|
-
--em-rgb-input: var(--rgb-input, 0, 0, 0);
|
|
50
|
-
--em-color-border: var(--color-border, rgba(255, 255, 255, .1));
|
|
51
|
-
--em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
#root {
|
|
55
|
-
--color-a: rgb(var(--em-rgb-color));
|
|
56
|
-
--color-b: rgba(var(--em-rgb-color), .65);
|
|
57
|
-
--color-c: rgba(var(--em-rgb-color), .45);
|
|
58
|
-
--padding: 12px;
|
|
59
|
-
--padding-small: calc(var(--padding) / 2);
|
|
60
|
-
--sidebar-width: 16px;
|
|
61
|
-
--duration: 225ms;
|
|
62
|
-
--duration-fast: 125ms;
|
|
63
|
-
--duration-instant: 50ms;
|
|
64
|
-
--easing: cubic-bezier(.4, 0, .2, 1);
|
|
65
|
-
width: 100%;
|
|
66
|
-
text-align: left;
|
|
67
|
-
border-radius: var(--border-radius);
|
|
68
|
-
background-color: rgb(var(--em-rgb-background));
|
|
69
|
-
position: relative;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@media (prefers-reduced-motion) {
|
|
73
|
-
#root {
|
|
74
|
-
--duration: 0;
|
|
75
|
-
--duration-fast: 0;
|
|
76
|
-
--duration-instant: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
#root[data-menu] button {
|
|
81
|
-
cursor: auto;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
#root[data-menu] .menu button {
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
:host, #root, input, button {
|
|
89
|
-
color: rgb(var(--em-rgb-color));
|
|
90
|
-
font-family: var(--font-family);
|
|
91
|
-
font-size: var(--font-size);
|
|
92
|
-
-webkit-font-smoothing: antialiased;
|
|
93
|
-
-moz-osx-font-smoothing: grayscale;
|
|
94
|
-
line-height: normal;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
*, :before, :after {
|
|
98
|
-
box-sizing: border-box;
|
|
99
|
-
min-width: 0;
|
|
100
|
-
margin: 0;
|
|
101
|
-
padding: 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.relative {
|
|
105
|
-
position: relative;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.flex {
|
|
109
|
-
display: flex;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.flex-auto {
|
|
113
|
-
flex: none;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.flex-center {
|
|
117
|
-
justify-content: center;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.flex-column {
|
|
121
|
-
flex-direction: column;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.flex-grow {
|
|
125
|
-
flex: auto;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.flex-middle {
|
|
129
|
-
align-items: center;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.flex-wrap {
|
|
133
|
-
flex-wrap: wrap;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.padding {
|
|
137
|
-
padding: var(--padding);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.padding-t {
|
|
141
|
-
padding-top: var(--padding);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.padding-lr {
|
|
145
|
-
padding-left: var(--padding);
|
|
146
|
-
padding-right: var(--padding);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.padding-r {
|
|
150
|
-
padding-right: var(--padding);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.padding-small {
|
|
154
|
-
padding: var(--padding-small);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.padding-small-b {
|
|
158
|
-
padding-bottom: var(--padding-small);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.padding-small-lr {
|
|
162
|
-
padding-left: var(--padding-small);
|
|
163
|
-
padding-right: var(--padding-small);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.margin {
|
|
167
|
-
margin: var(--padding);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.margin-r {
|
|
171
|
-
margin-right: var(--padding);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.margin-l {
|
|
175
|
-
margin-left: var(--padding);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.margin-small-l {
|
|
179
|
-
margin-left: var(--padding-small);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.margin-small-lr {
|
|
183
|
-
margin-left: var(--padding-small);
|
|
184
|
-
margin-right: var(--padding-small);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.align-l {
|
|
188
|
-
text-align: left;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.align-r {
|
|
192
|
-
text-align: right;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.color-a {
|
|
196
|
-
color: var(--color-a);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.color-b {
|
|
200
|
-
color: var(--color-b);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.color-c {
|
|
204
|
-
color: var(--color-c);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.ellipsis {
|
|
208
|
-
white-space: nowrap;
|
|
209
|
-
max-width: 100%;
|
|
210
|
-
width: auto;
|
|
211
|
-
text-overflow: ellipsis;
|
|
212
|
-
overflow: hidden;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.sr-only {
|
|
216
|
-
width: 1px;
|
|
217
|
-
height: 1px;
|
|
218
|
-
position: absolute;
|
|
219
|
-
top: auto;
|
|
220
|
-
left: -10000px;
|
|
221
|
-
overflow: hidden;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
a {
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
color: rgb(var(--em-rgb-accent));
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
a:hover {
|
|
230
|
-
text-decoration: underline;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.spacer {
|
|
234
|
-
height: 10px;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
[dir="rtl"] .scroll {
|
|
238
|
-
padding-left: 0;
|
|
239
|
-
padding-right: var(--padding);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.scroll {
|
|
243
|
-
padding-right: 0;
|
|
244
|
-
overflow-x: hidden;
|
|
245
|
-
overflow-y: auto;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.scroll::-webkit-scrollbar {
|
|
249
|
-
width: var(--sidebar-width);
|
|
250
|
-
height: var(--sidebar-width);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.scroll::-webkit-scrollbar-track {
|
|
254
|
-
border: 0;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.scroll::-webkit-scrollbar-button {
|
|
258
|
-
width: 0;
|
|
259
|
-
height: 0;
|
|
260
|
-
display: none;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.scroll::-webkit-scrollbar-corner {
|
|
264
|
-
background-color: rgba(0, 0, 0, 0);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.scroll::-webkit-scrollbar-thumb {
|
|
268
|
-
min-height: 20%;
|
|
269
|
-
min-height: 65px;
|
|
270
|
-
border: 4px solid rgb(var(--em-rgb-background));
|
|
271
|
-
border-radius: 8px;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.scroll::-webkit-scrollbar-thumb:hover {
|
|
275
|
-
background-color: var(--em-color-border-over) !important;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.scroll:hover::-webkit-scrollbar-thumb {
|
|
279
|
-
background-color: var(--em-color-border);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.sticky {
|
|
283
|
-
z-index: 1;
|
|
284
|
-
background-color: rgba(var(--em-rgb-background), .9);
|
|
285
|
-
-webkit-backdrop-filter: blur(4px);
|
|
286
|
-
backdrop-filter: blur(4px);
|
|
287
|
-
font-weight: 500;
|
|
288
|
-
position: sticky;
|
|
289
|
-
top: -1px;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
[dir="rtl"] .search input[type="search"] {
|
|
293
|
-
padding: 10px 2.2em 10px 2em;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
[dir="rtl"] .search .loupe {
|
|
297
|
-
left: auto;
|
|
298
|
-
right: .7em;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
[dir="rtl"] .search .delete {
|
|
302
|
-
left: .7em;
|
|
303
|
-
right: auto;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.search {
|
|
307
|
-
z-index: 2;
|
|
308
|
-
position: relative;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.search input, .search button {
|
|
312
|
-
font-size: calc(var(--font-size) - 1px);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.search input[type="search"] {
|
|
316
|
-
width: 100%;
|
|
317
|
-
background-color: var(--em-color-border);
|
|
318
|
-
transition-duration: var(--duration);
|
|
319
|
-
transition-property: background-color, box-shadow;
|
|
320
|
-
transition-timing-function: var(--easing);
|
|
321
|
-
border: 0;
|
|
322
|
-
border-radius: 10px;
|
|
323
|
-
outline: 0;
|
|
324
|
-
padding: 10px 2em 10px 2.2em;
|
|
325
|
-
display: block;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.search input[type="search"]::-ms-input-placeholder {
|
|
329
|
-
color: inherit;
|
|
330
|
-
opacity: .6;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.search input[type="search"]::placeholder {
|
|
334
|
-
color: inherit;
|
|
335
|
-
opacity: .6;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.search input[type="search"], .search input[type="search"]::-webkit-search-decoration, .search input[type="search"]::-webkit-search-cancel-button, .search input[type="search"]::-webkit-search-results-button, .search input[type="search"]::-webkit-search-results-decoration {
|
|
339
|
-
-webkit-appearance: none;
|
|
340
|
-
-ms-appearance: none;
|
|
341
|
-
appearance: none;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.search input[type="search"]:focus {
|
|
345
|
-
background-color: rgb(var(--em-rgb-input));
|
|
346
|
-
box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, .2);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.search .icon {
|
|
350
|
-
z-index: 1;
|
|
351
|
-
color: rgba(var(--em-rgb-color), .7);
|
|
352
|
-
position: absolute;
|
|
353
|
-
top: 50%;
|
|
354
|
-
transform: translateY(-50%);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.search .loupe {
|
|
358
|
-
pointer-events: none;
|
|
359
|
-
left: .7em;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.search .delete {
|
|
363
|
-
right: .7em;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
svg {
|
|
367
|
-
fill: currentColor;
|
|
368
|
-
width: 1em;
|
|
369
|
-
height: 1em;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
button {
|
|
373
|
-
-webkit-appearance: none;
|
|
374
|
-
-ms-appearance: none;
|
|
375
|
-
appearance: none;
|
|
376
|
-
cursor: pointer;
|
|
377
|
-
color: currentColor;
|
|
378
|
-
background-color: rgba(0, 0, 0, 0);
|
|
379
|
-
border: 0;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
#nav {
|
|
383
|
-
z-index: 2;
|
|
384
|
-
padding-top: 12px;
|
|
385
|
-
padding-bottom: 12px;
|
|
386
|
-
padding-right: var(--sidebar-width);
|
|
387
|
-
position: relative;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
#nav button {
|
|
391
|
-
color: var(--color-b);
|
|
392
|
-
transition: color var(--duration) var(--easing);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
#nav button:hover {
|
|
396
|
-
color: var(--color-a);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
#nav svg, #nav img {
|
|
400
|
-
width: var(--category-icon-size);
|
|
401
|
-
height: var(--category-icon-size);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
#nav[dir="rtl"] .bar {
|
|
405
|
-
left: auto;
|
|
406
|
-
right: 0;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
#nav .bar {
|
|
410
|
-
width: 100%;
|
|
411
|
-
height: 3px;
|
|
412
|
-
background-color: rgb(var(--em-rgb-accent));
|
|
413
|
-
transition: transform var(--duration) var(--easing);
|
|
414
|
-
border-radius: 3px 3px 0 0;
|
|
415
|
-
position: absolute;
|
|
416
|
-
bottom: -12px;
|
|
417
|
-
left: 0;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
#nav button[aria-selected] {
|
|
421
|
-
color: rgb(var(--em-rgb-accent));
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
#preview {
|
|
425
|
-
z-index: 2;
|
|
426
|
-
padding: calc(var(--padding) + 4px) var(--padding);
|
|
427
|
-
padding-right: var(--sidebar-width);
|
|
428
|
-
position: relative;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
#preview .preview-placeholder {
|
|
432
|
-
font-size: var(--preview-placeholder-size);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
#preview .preview-title {
|
|
436
|
-
font-size: var(--preview-title-size);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
#preview .preview-subtitle {
|
|
440
|
-
font-size: var(--preview-subtitle-size);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
#nav:before, #preview:before {
|
|
444
|
-
content: "";
|
|
445
|
-
height: 2px;
|
|
446
|
-
position: absolute;
|
|
447
|
-
left: 0;
|
|
448
|
-
right: 0;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
#nav[data-position="top"]:before, #preview[data-position="top"]:before {
|
|
452
|
-
background: linear-gradient(to bottom, var(--em-color-border), transparent);
|
|
453
|
-
top: 100%;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
#nav[data-position="bottom"]:before, #preview[data-position="bottom"]:before {
|
|
457
|
-
background: linear-gradient(to top, var(--em-color-border), transparent);
|
|
458
|
-
bottom: 100%;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
.category:last-child {
|
|
462
|
-
min-height: calc(100% + 1px);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.category button {
|
|
466
|
-
font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;
|
|
467
|
-
position: relative;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.category button > * {
|
|
471
|
-
position: relative;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.category button .background {
|
|
475
|
-
opacity: 0;
|
|
476
|
-
background-color: var(--em-color-border);
|
|
477
|
-
transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);
|
|
478
|
-
position: absolute;
|
|
479
|
-
top: 0;
|
|
480
|
-
bottom: 0;
|
|
481
|
-
left: 0;
|
|
482
|
-
right: 0;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.category button:hover .background {
|
|
486
|
-
transition-duration: var(--duration-instant);
|
|
487
|
-
transition-delay: 0s;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.category button[aria-selected] .background {
|
|
491
|
-
opacity: 1;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
.category button[data-keyboard] .background {
|
|
495
|
-
transition: none;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
.row {
|
|
499
|
-
width: 100%;
|
|
500
|
-
position: absolute;
|
|
501
|
-
top: 0;
|
|
502
|
-
left: 0;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.skin-tone-button {
|
|
506
|
-
border: 1px solid rgba(0, 0, 0, 0);
|
|
507
|
-
border-radius: 100%;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.skin-tone-button:hover {
|
|
511
|
-
border-color: var(--em-color-border);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.skin-tone-button:active .skin-tone {
|
|
515
|
-
transform: scale(.85) !important;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
.skin-tone-button .skin-tone {
|
|
519
|
-
transition: transform var(--duration) var(--easing);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
.skin-tone-button[aria-selected] {
|
|
523
|
-
background-color: var(--em-color-border);
|
|
524
|
-
border-top-color: rgba(0, 0, 0, .05);
|
|
525
|
-
border-bottom-color: rgba(0, 0, 0, 0);
|
|
526
|
-
border-left-width: 0;
|
|
527
|
-
border-right-width: 0;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
.skin-tone-button[aria-selected] .skin-tone {
|
|
531
|
-
transform: scale(.9);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.menu {
|
|
535
|
-
z-index: 2;
|
|
536
|
-
white-space: nowrap;
|
|
537
|
-
border: 1px solid var(--em-color-border);
|
|
538
|
-
background-color: rgba(var(--em-rgb-background), .9);
|
|
539
|
-
-webkit-backdrop-filter: blur(4px);
|
|
540
|
-
backdrop-filter: blur(4px);
|
|
541
|
-
transition-property: opacity, transform;
|
|
542
|
-
transition-duration: var(--duration);
|
|
543
|
-
transition-timing-function: var(--easing);
|
|
544
|
-
border-radius: 10px;
|
|
545
|
-
padding: 4px;
|
|
546
|
-
position: absolute;
|
|
547
|
-
box-shadow: 1px 1px 5px rgba(0, 0, 0, .05);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
.menu.hidden {
|
|
551
|
-
opacity: 0;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.menu[data-position="bottom"] {
|
|
555
|
-
transform-origin: 100% 100%;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
.menu[data-position="bottom"].hidden {
|
|
559
|
-
transform: scale(.9)rotate(-3deg)translateY(5%);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.menu[data-position="top"] {
|
|
563
|
-
transform-origin: 100% 0;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
.menu[data-position="top"].hidden {
|
|
567
|
-
transform: scale(.9)rotate(3deg)translateY(-5%);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
.menu input[type="radio"] {
|
|
571
|
-
clip: rect(0 0 0 0);
|
|
572
|
-
width: 1px;
|
|
573
|
-
height: 1px;
|
|
574
|
-
border: 0;
|
|
575
|
-
margin: 0;
|
|
576
|
-
padding: 0;
|
|
577
|
-
position: absolute;
|
|
578
|
-
overflow: hidden;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.menu input[type="radio"]:checked + .option {
|
|
582
|
-
box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.option {
|
|
586
|
-
width: 100%;
|
|
587
|
-
border-radius: 6px;
|
|
588
|
-
padding: 4px 6px;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.option:hover {
|
|
592
|
-
color: #fff;
|
|
593
|
-
background-color: rgb(var(--em-rgb-accent));
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.skin-tone {
|
|
597
|
-
width: 16px;
|
|
598
|
-
height: 16px;
|
|
599
|
-
border-radius: 100%;
|
|
600
|
-
display: inline-block;
|
|
601
|
-
position: relative;
|
|
602
|
-
overflow: hidden;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
.skin-tone:after {
|
|
606
|
-
content: "";
|
|
607
|
-
mix-blend-mode: overlay;
|
|
608
|
-
background: linear-gradient(rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
|
|
609
|
-
border: 1px solid rgba(0, 0, 0, .8);
|
|
610
|
-
border-radius: 100%;
|
|
611
|
-
position: absolute;
|
|
612
|
-
top: 0;
|
|
613
|
-
bottom: 0;
|
|
614
|
-
left: 0;
|
|
615
|
-
right: 0;
|
|
616
|
-
box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.skin-tone-1 {
|
|
620
|
-
background-color: #ffc93a;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
.skin-tone-2 {
|
|
624
|
-
background-color: #ffdab7;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
.skin-tone-3 {
|
|
628
|
-
background-color: #e7b98f;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.skin-tone-4 {
|
|
632
|
-
background-color: #c88c61;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
.skin-tone-5 {
|
|
636
|
-
background-color: #a46134;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
.skin-tone-6 {
|
|
640
|
-
background-color: #5d4437;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
[data-index] {
|
|
644
|
-
justify-content: space-between;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
[data-emoji-set="twitter"] .skin-tone:after {
|
|
648
|
-
box-shadow: none;
|
|
649
|
-
border-color: rgba(0, 0, 0, .5);
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
[data-emoji-set="twitter"] .skin-tone-1 {
|
|
653
|
-
background-color: #fade72;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
[data-emoji-set="twitter"] .skin-tone-2 {
|
|
657
|
-
background-color: #f3dfd0;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
[data-emoji-set="twitter"] .skin-tone-3 {
|
|
661
|
-
background-color: #eed3a8;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
[data-emoji-set="twitter"] .skin-tone-4 {
|
|
665
|
-
background-color: #cfad8d;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
[data-emoji-set="twitter"] .skin-tone-5 {
|
|
669
|
-
background-color: #a8805d;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
[data-emoji-set="twitter"] .skin-tone-6 {
|
|
673
|
-
background-color: #765542;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
[data-emoji-set="google"] .skin-tone:after {
|
|
677
|
-
box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, .4);
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
[data-emoji-set="google"] .skin-tone-1 {
|
|
681
|
-
background-color: #f5c748;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
[data-emoji-set="google"] .skin-tone-2 {
|
|
685
|
-
background-color: #f1d5aa;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
[data-emoji-set="google"] .skin-tone-3 {
|
|
689
|
-
background-color: #d4b48d;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
[data-emoji-set="google"] .skin-tone-4 {
|
|
693
|
-
background-color: #aa876b;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
[data-emoji-set="google"] .skin-tone-5 {
|
|
697
|
-
background-color: #916544;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
[data-emoji-set="google"] .skin-tone-6 {
|
|
701
|
-
background-color: #61493f;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
[data-emoji-set="facebook"] .skin-tone:after {
|
|
705
|
-
border-color: rgba(0, 0, 0, .4);
|
|
706
|
-
box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
[data-emoji-set="facebook"] .skin-tone-1 {
|
|
710
|
-
background-color: #f5c748;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
[data-emoji-set="facebook"] .skin-tone-2 {
|
|
714
|
-
background-color: #f1d5aa;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
[data-emoji-set="facebook"] .skin-tone-3 {
|
|
718
|
-
background-color: #d4b48d;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
[data-emoji-set="facebook"] .skin-tone-4 {
|
|
722
|
-
background-color: #aa876b;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
[data-emoji-set="facebook"] .skin-tone-5 {
|
|
726
|
-
background-color: #916544;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
[data-emoji-set="facebook"] .skin-tone-6 {
|
|
730
|
-
background-color: #61493f;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
`;let kn=!1;kn||(xe({data:je}),kn=!0);const Xo=()=>{const e=[{id:"frequent",name:"Frequently Used",icon:o.jsx(C.IconClock,{size:20,strokeWidth:2.5})}];return je.categories.forEach(n=>{if(n.emojis&&n.emojis.length>0){let t=o.jsx(C.IconMoodSmile,{size:20,strokeWidth:2}),r=n.name;switch(n.id){case"people":t=o.jsx(C.IconMoodSmile,{size:20,strokeWidth:2}),r="Smileys & People";break;case"nature":t=o.jsx(C.IconTrees,{size:20,strokeWidth:2}),r="Animals & Nature";break;case"foods":t=o.jsx(C.IconApple,{size:20,strokeWidth:2}),r="Food & Drink";break;case"activity":t=o.jsx(C.IconBallBasketball,{size:20,strokeWidth:2}),r="Activities";break;case"travel":t=o.jsx(C.IconPlane,{size:20,strokeWidth:2}),r="Travel & Places";break;case"places":t=o.jsx(C.IconPlane,{size:20,strokeWidth:2}),r="Travel & Places";break;case"objects":t=o.jsx(C.IconBulb,{size:20,strokeWidth:2}),r="Objects";break;case"symbols":t=o.jsx(C.IconHeart,{size:20,strokeWidth:2}),r="Symbols";break;case"flags":t=o.jsx(C.IconFlag,{size:20,strokeWidth:2}),r="Flags";break;case"frequent":return;default:t=o.jsx(C.IconMoodSmile,{size:20,strokeWidth:2}),r=`Category: ${n.id}`;break}e.push({id:n.id,name:r,icon:t})}}),e},Ko=({onEmojiSelect:e,height:n=200})=>{const[t,r]=p.useState(""),[s,i]=p.useState("people"),[c,u]=p.useState(()=>{if(typeof window<"u"){const m=localStorage.getItem("emoji-frequent");return m?JSON.parse(m):[]}return[]}),[l,f]=p.useState([]),[d,g]=p.useState(!1),h=Xo();p.useEffect(()=>{t.trim()?(g(!0),se.search(t).then(m=>{f(m.map(y=>({id:y.id,native:y.skins[0].native,name:y.name,keywords:y.keywords}))),g(!1)})):f([])},[t]);const x=p.useMemo(()=>{if(t.trim())return l;if(s==="frequent")return c.map(y=>({id:y,native:y,name:"",keywords:[]}));const m=je.categories.find(y=>y.id===s);return m?m.emojis.map(y=>{const w=je.emojis[y];return{id:w.id,native:w.skins[0].native,name:w.name,keywords:w.keywords}}):[]},[t,s,c,l]),v=m=>{e(m),u(y=>{const w=y.filter(_=>_!==m),S=[m,...w].slice(0,20);return typeof window<"u"&&localStorage.setItem("emoji-frequent",JSON.stringify(S)),S})},I=m=>{if(t.trim())return"Results";const y=h.find(w=>w.id===m);return y?y.name:m.charAt(0).toUpperCase()+m.slice(1)};return o.jsxs(a.Stack,{gap:0,style:{height:n,width:"100%"},children:[o.jsx(a.Box,{p:"sm",pb:"xs",children:o.jsxs(a.Stack,{gap:"xs",children:[o.jsx(a.TextInput,{placeholder:"Search emojis...",value:t,onChange:m=>r(m.target.value),leftSection:o.jsx(C.IconSearch,{size:16,strokeWidth:2.5}),fw:500,size:"sm",radius:"md",styles:{input:{backgroundColor:"var(--mantine-color-gray-0)",color:"var(--mantine-color-gray-9)"}}}),o.jsx(a.Text,{size:"sm",c:"var(--mantine-color-gray-6)",ta:"left",fw:500,children:I(s)})]})}),o.jsx(a.Box,{style:{flex:1,overflow:"hidden"},children:o.jsx(a.ScrollArea,{h:"100%",type:"hover",offsetScrollbars:!1,children:o.jsx(a.Box,{style:{display:"grid",gridTemplateColumns:"repeat(9, 1fr)",gap:"0px",padding:"0px 12px 12px 12px"},children:d?o.jsx(a.Text,{size:"sm",c:"dimmed",ta:"center",py:"xl",style:{gridColumn:"1 / -1"},children:"Searching..."}):x.length>0?x.map(m=>o.jsx(a.Tooltip,{label:m.name||m.id,position:"top",withArrow:!0,openDelay:300,withinPortal:!0,zIndex:1e3,color:"dark",children:o.jsx(a.Button,{variant:"subtle",size:"sm",p:0,onClick:()=>v(m.native),style:{width:"40px",height:"40px",fontSize:"22px",border:"none",backgroundColor:"transparent",borderRadius:"var(--mantine-radius-md)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:m.native})},m.id)):o.jsx(a.Text,{size:"sm",c:"dimmed",ta:"center",py:"xl",style:{gridColumn:"1 / -1"},children:"No emojis found"})})})}),o.jsx(a.Box,{px:"sm",py:"xs",style:{borderTop:"1px solid var(--mantine-color-gray-3)"},children:o.jsx(a.Flex,{gap:"0px",justify:"center",wrap:"wrap",children:h.map(m=>o.jsx(a.Tooltip,{label:m.name,position:"top",withArrow:!0,openDelay:500,withinPortal:!0,zIndex:1e3,color:"dark",children:o.jsx(a.Box,{onClick:()=>{i(m.id),r("")},style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer","&:hover":{backgroundColor:"var(--mantine-color-gray-0)"},backgroundColor:s===m.id?"var(--mantine-color-gray-0)":"transparent",color:s===m.id?"var(--mantine-color-blue-6)":"var(--mantine-color-gray-6)",transition:"all 0.1s ease"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:m.icon})},m.id))})})]})},ct=["IconUser","IconUserCircle","IconUserCheck","IconUserX","IconUserPlus","IconUserMinus","IconUserEdit","IconUserCog","IconUserShield","IconUserStar","IconUserSearch","IconUserQuestion","IconUserOff","IconUsers","IconUserBolt","IconUserCode","IconUserDollar","IconUserExclamation","IconUserFilled","IconUserHexagon","IconUserKey","IconUserPause","IconUserPin","IconUserPlay","IconUserScan","IconUserShare","IconUserSquare","IconUserUp","IconUserVoice","IconUserWrench"],lt=["IconBriefcase","IconBuilding","IconBuildingStore","IconBuildingBank","IconBuildingWarehouse","IconBuildingSkyscraper","IconBuildingBridge","IconBuildingCar","IconBuildingFactory","IconBuildingHospital","IconBuildingMonument","IconBuildingPavilon","IconBuildingTunnel","IconBuildingWindmill","IconChartBar","IconChartLine","IconChartPie","IconChartDots","IconChartArea","IconChartArcs","IconChartCandle","IconChartDonut","IconChartRadar","IconTrendingUp","IconTrendingDown","IconTarget","IconFlag","IconTrophy","IconAward","IconMedal","IconCertificate","IconBadge","IconCrown","IconStar","IconStarFilled","IconStarHalf","IconStarOff","IconFileText","IconFile","IconFileAlert","IconFileAnalytics","IconFileBarcode","IconFileBroken","IconFileCertificate","IconFileChart","IconFileCheck","IconFileCode","IconFileDatabase","IconFileDollar","IconFileDownload","IconFileEuro","IconFileExport","IconFileFunction","IconFileImport","IconFileInfo","IconFileInvoice","IconFileLambda","IconFileLike","IconFileMinus","IconFileMusic","IconFileOff","IconFilePencil","IconFilePhone","IconFilePlus","IconFileReport","IconFileRss","IconFileScissors","IconFileSearch","IconFileSettings","IconFileShredder","IconFileSignal","IconFileSpreadsheet","IconFileStar","IconFileSymlink","IconFileTime","IconFileType","IconFileTypography","IconFileUnknown","IconFileUpload","IconFileVector","IconFileX","IconFileZip","IconFolder","IconFolderOpen","IconFolderPlus","IconFolderMinus","IconFolderX","IconFolderCheck","IconFolderCog","IconFolderDown","IconFolderHeart","IconFolderOff","IconFolderPause","IconFolderPin","IconFolderQuestion","IconFolderSearch","IconFolderShare","IconFolderStar","IconFolderUp","IconFolderWrench","IconArchive","IconArchiveOff","IconBox","IconBoxMultiple","IconBoxOff","IconBoxPadding","IconBoxSeam","IconBriefcaseOff","IconClipboard","IconClipboardCheck","IconClipboardCopy","IconClipboardData","IconClipboardHeart","IconClipboardList","IconClipboardOff","IconClipboardPaste","IconClipboardText","IconClipboardTypography","IconClipboardX","IconCopy","IconCut","IconPaste","IconDuplicate","IconEdit","IconEditCircle","IconEditCircleOff"],dt=["IconDeviceDesktop","IconDeviceLaptop","IconDeviceMobile","IconDeviceTablet","IconDeviceWatch","IconDeviceTv","IconDeviceGamepad","IconDeviceAirpods","IconDeviceImac","IconDeviceIpad","IconDeviceIphone","IconDeviceMacbook","IconDeviceNintendo","IconDevicePlaystation","IconDeviceXbox","IconCode","IconTerminal","IconDatabase","IconServer","IconWifi","IconBluetooth","IconCpu","IconKeyboard","IconMouse","IconCamera","IconVideo","IconMicrophone","IconSpeaker","IconHeadphones","IconPrinter","IconScanner","IconRouter","IconModem","IconAntenna","IconSatellite","IconRadar","IconRadar2","IconBroadcast","IconBroadcastOff","IconRadio","IconRadioactive","IconRadioactiveOff","IconSignal","IconSignal4G","IconSignal5G","IconSignalOff","IconBattery","IconBattery1","IconBattery2","IconBattery3","IconBattery4","IconBatteryOff","IconBatteryCharging","IconBatteryAutomotive","IconBatteryEco","IconBatteryFilled","IconPlug","IconPlugConnected","IconPlugConnectedX","IconPlugOff","IconPlugX","IconPower","IconPowerOff","IconOutlet","IconCable","IconCableOff","IconCircuitAmmeter","IconCircuitBattery","IconCircuitBulb","IconCircuitCapacitor","IconCircuitCell","IconCircuitCellPlus","IconCircuitChangeover","IconCircuitDiode","IconCircuitDiodeZener","IconCircuitGround","IconCircuitGroundDigital","IconCircuitInductor","IconCircuitMotor","IconCircuitPushbutton","IconCircuitResistor","IconCircuitSwitchClosed","IconCircuitSwitchOpen","IconCircuitVoltmeter","IconCpu2","IconCpuOff","IconMemory","IconMemoryCard","IconMemoryStick","IconHardDrive","IconHardDrive2","IconDisk","IconDiskOff","IconCd","IconCdOff","IconDvd","IconDvdOff","IconFloppyDisk","IconFloppyDiskOff","IconUsb","IconUsbOff","IconSdCard","IconSdCardOff","IconCloud","IconCloudComputing","IconCloudDataConnection","IconCloudDownload","IconCloudLock","IconCloudOff","IconCloudRain","IconCloudSnow","IconCloudStorm","IconCloudUpload","IconCloudCheck","IconCloudCode","IconCloudCog","IconCloudDollar","IconCloudDown","IconCloudExclamation","IconCloudHeart","IconCloudMinus","IconCloudPause","IconCloudPin","IconCloudPlus","IconCloudQuestion","IconCloudSearch","IconCloudShare","IconCloudStar","IconCloudUp","IconCloudX"],ut=["IconMoodSmile","IconMoodHappy","IconMoodWink","IconMoodSad","IconMoodConfused","IconMoodAnnoyed","IconMoodAngry","IconMoodCry","IconMoodTongue","IconMoodKiss","IconMoodHeart","IconMoodLove","IconMoodEmpty","IconMoodNervous","IconMoodSuprised","IconMoodSilence","IconMoodSick","IconMoodTongueWink","IconMoodTongueWink2","IconMoodWink2","IconHeart","IconHeartFilled","IconHeartBroken","IconHeartHandshake","IconHeartMinus","IconHeartOff","IconHeartPlus","IconHeartRateMonitor","IconThumbUp","IconThumbDown","IconSmile","IconFrown","IconMeh","IconLaugh","IconWink","IconKiss","IconTongue","IconGrin","IconSmirk"],ft=["IconTrees","IconLeaf","IconFlower","IconPlant","IconSun","IconMoon","IconStar","IconCloud","IconCloudRain","IconCloudSnow","IconSnowflake","IconDroplet","IconFlame","IconMountain","IconTree","IconPineTree","IconBug","IconButterfly","IconFish","IconBird","IconCat","IconDog","IconRabbit","IconPaw","IconPawprint","IconFeather","IconSeeding","IconSeedingOff","IconPlant2","IconPlantOff","IconLeafOff","IconFlower2","IconFlowerOff","IconTreesOff","IconTreeOff","IconPineTreeOff","IconPalmTree","IconPalmTreeOff","IconSunOff","IconSunHigh","IconSunLow","IconMoonOff","IconMoonStars","IconMoon2","IconMoonFilled","IconStars","IconStarsOff","IconStarFilled","IconStarHalf","IconStarOff","IconCloudOff","IconCloudStorm","IconCloudFog","IconCloudWind","IconSnowflakeOff","IconDropletOff","IconDropletFilled","IconDropletHalf","IconDropletHalf2","IconDropletHalfFilled","IconFlameOff","IconFire","IconFireExtinguisher","IconMountainOff","IconMountain2","IconHills","IconHillsOff","IconValley","IconValleyOff","IconBugOff","IconButterflyOff","IconBee","IconBeeOff","IconSpider","IconSpiderOff","IconAnt","IconAntOff","IconLadybug","IconLadybugOff","IconGrasshopper","IconGrasshopperOff","IconCricket","IconCricketOff","IconFishOff","IconFishBone","IconFishBoneOff","IconShark","IconSharkOff","IconWhale","IconWhaleOff","IconDolphin","IconDolphinOff","IconOctopus","IconOctopusOff","IconSeahorse","IconSeahorseOff","IconBirdOff","IconEagle","IconEagleOff","IconOwl","IconOwlOff","IconParrot","IconParrotOff","IconPeacock","IconPeacockOff","IconPenguin","IconPenguinOff","IconSwan","IconSwanOff","IconCatOff","IconDogOff","IconRabbitOff","IconFeatherOff","IconWing","IconWingOff","IconEgg","IconEggOff","IconEggCracked","IconEggCrackedOff","IconEggFilled","IconEggFilledOff","IconEggFried","IconEggFriedOff","IconNest","IconNestOff","IconNestEggs","IconNestEggsOff"],ht=["IconCircle","IconSquare","IconTriangle","IconDiamond","IconHexagon","IconPentagon","IconOctagon","IconCross","IconPlus","IconMinus","IconCheck","IconX","IconArrowUp","IconArrowDown","IconArrowLeft","IconArrowRight","IconArrowUpLeft","IconArrowUpRight","IconArrowDownLeft","IconArrowDownRight","IconArrowLeftUp","IconArrowLeftDown","IconArrowRightUp","IconArrowRightDown","IconPlay","IconPause","IconStop","IconRecord","IconSkipBack","IconSkipForward","IconRewind","IconFastForward","IconCircleDot","IconCircleFilled","IconCircleHalf","IconCircleHalf2","IconCircleHalfFilled","IconCircleOff","IconCircleX","IconSquareDot","IconSquareFilled","IconSquareHalf","IconSquareHalfFilled","IconSquareOff","IconSquareRounded","IconSquareRoundedDot","IconSquareRoundedFilled","IconSquareRoundedHalf","IconSquareRoundedHalfFilled","IconSquareRoundedOff","IconSquareRoundedX","IconSquareX","IconTriangleFilled","IconTriangleInverted","IconTriangleInvertedFilled","IconTriangleOff","IconTriangleSquare","IconTriangleSquareCircle","IconDiamondFilled","IconDiamondOff","IconHexagonFilled","IconHexagonOff","IconPentagonFilled","IconPentagonOff","IconOctagonFilled","IconOctagonOff","IconCrossOff","IconPlusMinus","IconMinusMinus","IconCheckbox","IconCheckboxOff","IconChecks","IconXbox","IconXboxOff","IconYinYang","IconYinYangOff","IconYoga","IconYogaOff","IconZodiac","IconZodiacOff","IconZoom","IconZoomCancel","IconZoomCode","IconZoomExclamation","IconZoomFilled","IconZoomIn","IconZoomInArea","IconZoomInAreaFilled","IconZoomInFilled","IconZoomMoney","IconZoomPan","IconZoomQuestion","IconZoomReplace","IconZoomReset","IconZoomScan","IconZoomScanFilled","IconZoomX"],pt=["IconEdit","IconDelete","IconSave","IconOpen","IconClose","IconAdd","IconRemove","IconSearch","IconFilter","IconSort","IconRefresh","IconReload","IconUndo","IconRedo","IconCut","IconCopy","IconPaste","IconDuplicate","IconMove","IconRotate","IconFlip","IconResize","IconScale","IconCrop","IconTransform","IconWrench","IconHammer","IconScrewdriver","IconTool","IconTools","IconSaw","IconDrill","IconDrillOff","IconAxe","IconAxeOff","IconPickaxe","IconPickaxeOff","IconShovel","IconShovelOff","IconRake","IconRakeOff","IconHoe","IconHoeOff","IconScythe","IconScytheOff","IconPitchfork","IconPitchforkOff","IconFork","IconForkOff","IconKnife","IconKnifeOff","IconSword","IconSwordOff","IconDagger","IconDaggerOff","IconSpear","IconSpearOff","IconBow","IconBowOff","IconArrow","IconArrowOff","IconCrossbow","IconCrossbowOff","IconGun","IconGunOff","IconPistol","IconPistolOff","IconRifle","IconRifleOff","IconShotgun","IconShotgunOff","IconBomb","IconBombOff","IconGrenade","IconGrenadeOff","IconDynamite","IconDynamiteOff","IconMine","IconMineOff","IconTorpedo","IconTorpedoOff","IconMissile","IconMissileOff","IconRocket","IconRocketOff","IconBazooka","IconBazookaOff","IconCannon","IconCannonOff","IconTank","IconTankOff","IconHelicopter","IconHelicopterOff","IconPlane","IconPlaneOff","IconJet","IconJetOff","IconSatellite","IconSatelliteOff","IconSpace","IconSpaceOff","IconGalaxy","IconGalaxyOff","IconPlanet","IconPlanetOff","IconEarth","IconEarthOff","IconMoon","IconMoonOff","IconSun","IconSunOff","IconStar","IconStarOff","IconAsteroid","IconAsteroidOff","IconComet","IconCometOff","IconMeteor","IconMeteorOff","IconUfo","IconUfoOff","IconAlien","IconAlienOff","IconRobot","IconRobotOff","IconAndroid","IconAndroidOff","IconIos","IconIosOff","IconWindows","IconWindowsOff","IconLinux","IconLinuxOff","IconMac","IconMacOff","IconUbuntu","IconUbuntuOff","IconDebian","IconDebianOff","IconRedhat","IconRedhatOff","IconCentos","IconCentosOff","IconFedora","IconFedoraOff","IconSuse","IconSuseOff","IconArch","IconArchOff","IconGentoo","IconGentooOff","IconSlackware","IconSlackwareOff","IconMint","IconMintOff","IconKali","IconKaliOff","IconParrot","IconParrotOff","IconBacktrack","IconBacktrackOff","IconBlackarch","IconBlackarchOff","IconPentoo","IconPentooOff","IconMatriux","IconMatriuxOff","IconNodezero","IconNodezeroOff","IconBugtraq","IconBugtraqOff","IconCyborg","IconCyborgOff","IconDefensive","IconDefensiveOff","IconDracos","IconDracosOff","IconFembuntu","IconFembuntuOff","IconGnacktrack","IconGnacktrackOff","IconHackintosh","IconHackintoshOff","IconHak5","IconHak5Off","IconHavij","IconHavijOff","IconJackal","IconJackalOff","IconKnoppix","IconKnoppixOff","IconKodachi","IconKodachiOff","IconLion","IconLionOff","IconMandriva","IconMandrivaOff","IconMobily","IconMobilyOff","IconMuslim","IconMuslimOff","IconNetrunner","IconNetrunnerOff","IconPardus","IconPardusOff","IconQubes","IconQubesOff","IconSabayon","IconSabayonOff","IconScientific","IconScientificOff","IconSemplice","IconSempliceOff","IconSiduction","IconSiductionOff","IconSlax","IconSlaxOff","IconSli","IconSliOff","IconTails","IconTailsOff","IconVector","IconVectorOff","IconVoid","IconVoidOff","IconWhonix","IconWhonixOff","IconZorin","IconZorinOff","IconAlpine","IconAlpineOff","IconElementary","IconElementaryOff","IconManjaro","IconManjaroOff","IconOpenbsd","IconOpenbsdOff","IconOpenSuse","IconOpenSuseOff","IconPop","IconPopOff","IconSolus","IconSolusOff"],gt=["IconMessage","IconMessageCircle","IconMessageDots","IconMessagePlus","IconMessageReport","IconMessageShare","IconMessageText","IconMessages","IconMessagesOff","IconMail","IconMailOpened","IconMailFast","IconMailOff","IconMailPause","IconMailPin","IconMailPlus","IconMailQuestion","IconMailSearch","IconMailShare","IconMailStar","IconMailUp","IconMailX","IconPhone","IconPhoneCall","IconPhoneIncoming","IconPhoneOff","IconPhoneOutgoing","IconPhonePause","IconPhonePlus","IconPhoneX","IconVideo","IconVideoOff","IconVideoPlus","IconCamera","IconCameraOff","IconCameraPlus","IconMicrophone","IconMicrophoneOff","IconMicrophone2","IconMicrophone2Off","IconHeadphones","IconHeadphonesOff","IconSpeaker","IconSpeakerOff","IconBroadcast","IconBroadcastOff","IconRadio","IconRadioactive","IconRadioactiveOff","IconAntenna","IconAntennaBars1","IconAntennaBars2","IconAntennaBars3","IconAntennaBars4","IconAntennaBars5","IconAntennaOff","IconSatellite","IconSatelliteOff","IconWifi","IconWifi0","IconWifi1","IconWifi2","IconWifiOff","IconBluetooth","IconBluetoothConnected","IconBluetoothOff","IconBluetoothX","IconShare","IconShareOff","IconShare2","IconShare3","IconAt","IconHash","IconLink","IconLinkOff","IconExternalLink","IconExternalLinkOff","IconSend","IconSendOff","IconSend2","IconReceipt","IconReceiptOff","IconReceipt2","IconReceiptRefund","IconReceiptTax","IconReceiptEuro","IconReceiptDollar","IconReceiptPound","IconReceiptYen","IconReceiptYuan","IconReceiptWon","IconReceiptRupee","IconReceiptBaht","IconReceiptLira","IconReceiptRuble","IconReceiptShekel","IconReceiptTaka","IconReceiptHryvnia","IconReceiptKrone","IconReceiptKrona","IconReceiptZloty","IconReceiptForint","IconReceiptLeu","IconReceiptLev","IconReceiptKuna","IconReceiptDinar","IconReceiptDirham","IconReceiptRial","IconReceiptRiyal","IconReceiptAfghani","IconReceiptAriary","IconReceiptCedi","IconReceiptDalasi","IconReceiptFranc","IconReceiptGourde","IconReceiptKina","IconReceiptKip","IconReceiptKwacha","IconReceiptKwanza","IconReceiptLari","IconReceiptLek","IconReceiptLilangeni","IconReceiptLoti","IconReceiptManat","IconReceiptMetical","IconReceiptNaira","IconReceiptPeso","IconReceiptPula","IconReceiptRand","IconReceiptRupiah","IconReceiptShilling","IconReceiptSom","IconReceiptSomoni","IconReceiptTenge","IconReceiptVatu","IconReceiptWon","IconReceiptXof","IconReceiptYuan","IconReceiptZloty"];[...ct,...lt,...dt,...ut,...ft,...ht,...pt,...gt];const pe=[{id:"recent",name:"Recently Used",icons:[],isDynamic:!0},{id:"user",name:"User & Profile",icons:ct},{id:"business",name:"Business & Work",icons:lt},{id:"tech",name:"Technology",icons:dt},{id:"expressions",name:"Expressions",icons:ut},{id:"nature",name:"Nature & Animals",icons:ft},{id:"shapes",name:"Shapes & Symbols",icons:ht},{id:"actions",name:"Actions & Tools",icons:pt},{id:"communication",name:"Communication",icons:gt}],Jo={recent:o.jsx(C.IconClock,{size:20,strokeWidth:2.5}),user:o.jsx(C.IconUser,{size:20,strokeWidth:2.5}),business:o.jsx(C.IconBriefcase,{size:20,strokeWidth:2.5}),tech:o.jsx(C.IconDeviceDesktop,{size:20,strokeWidth:2.5}),expressions:o.jsx(C.IconMoodSmile,{size:20,strokeWidth:2.5}),nature:o.jsx(C.IconTrees,{size:20,strokeWidth:2.5}),shapes:o.jsx(C.IconCircle,{size:20,strokeWidth:2.5}),actions:o.jsx(C.IconTool,{size:20,strokeWidth:2.5}),communication:o.jsx(C.IconMessage,{size:20,strokeWidth:2.5})},er=({selectedCategory:e,onCategoryChange:n})=>o.jsx(a.Flex,{gap:"0px",justify:"center",wrap:"wrap",children:pe.map(t=>{const r=Jo[t.id];return o.jsx(a.Tooltip,{label:t.name,position:"top",withArrow:!0,openDelay:500,withinPortal:!0,zIndex:1e3,color:"dark",children:o.jsx(a.Box,{onClick:()=>n(t.id),style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",backgroundColor:e===t.id?"var(--mantine-color-gray-0)":"transparent",color:e===t.id?"var(--mantine-color-blue-6)":"var(--mantine-color-gray-6)",transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor=e===t.id?"var(--mantine-color-gray-0)":"transparent"},children:r})},t.id)})}),mt=p.memo(({onIconSelect:e,height:n=358})=>{var m,y;const[t,r]=p.useState(""),[s,i]=p.useState("recent"),[c,u]=p.useState(!1),[l,f]=p.useState([]);p.useLayoutEffect(()=>{if(typeof window<"u"){const w=localStorage.getItem("avatar-icon-recent");if(w)try{f(JSON.parse(w))}catch(S){console.warn("Error parsing recent icons from localStorage:",S)}}},[]);const d=p.useMemo(()=>pe.filter(w=>w.id!=="recent"&&!("isDynamic"in w)).flatMap(w=>w.icons),[]),g=p.useMemo(()=>{if(s==="recent"){const S=new Set(d);return l.filter(_=>S.has(_))}const w=pe.find(S=>S.id===s);return(w==null?void 0:w.icons)||[]},[s,l,d]),h=p.useCallback((w,S)=>{if(!w.trim())return S;const _=w.toLowerCase().trim(),$=_.split(/\s+/);return S.filter(D=>{const k=D.replace(/^Icon/,"").split(/(?=[A-Z])/).map(R=>R.toLowerCase().trim()).filter(R=>R.length>0);return!!(k.some(R=>$.some(L=>R===L))||_.length>2&&k.some(R=>$.some(L=>R.startsWith(L)))||_.length<=2&&k.some(R=>$.some(L=>R.includes(L)))||$.length>1&&$.every(R=>k.some(L=>L===R||L.startsWith(R))))})},[]),x=p.useMemo(()=>t.trim()?h(t,d):g,[t,g,d,h]),v=p.useCallback(w=>{d.includes(w)&&f(_=>{const $=[w,..._.filter(D=>D!==w)].slice(0,20);return typeof window<"u"&&localStorage.setItem("avatar-icon-recent",JSON.stringify($)),$}),e(w)},[e,d]),I=p.useCallback(w=>{s!==w&&(r(""),i(w),requestAnimationFrame(()=>{u(!0),setTimeout(()=>u(!1),100)}))},[s]);return o.jsxs(a.Stack,{gap:0,style:{height:n,width:"100%"},children:[o.jsx(a.Box,{p:"sm",pb:"xs",children:o.jsxs(a.Stack,{gap:"xs",children:[o.jsx(a.TextInput,{placeholder:t.trim()?"Search all icons...":`Search in ${(m=pe.find(w=>w.id===s))==null?void 0:m.name}...`,value:t,onChange:w=>r(w.target.value),leftSection:o.jsx(C.IconSearch,{size:16}),fw:500,size:"sm",radius:"md",styles:{input:{backgroundColor:"var(--mantine-color-gray-0)",color:"var(--mantine-color-gray-9)"}}}),o.jsx(a.Text,{size:"sm",c:"var(--mantine-color-gray-6)",ta:"left",fw:500,children:t.trim()?"Results":(y=pe.find(w=>w.id===s))==null?void 0:y.name})]})}),o.jsx(a.Box,{style:{flex:1,overflow:"hidden"},children:o.jsx(a.ScrollArea,{h:"100%",type:"hover",children:o.jsx(a.Box,{style:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",padding:"0 12px 12px 12px",opacity:c?.7:1,transition:"opacity 0.05s ease"},children:x.map(w=>o.jsx(jn,{iconName:w,onClick:()=>v(w),size:20},t.trim()?`search-${w}`:`${s}-${w}`))},`${s}-${t}`)})}),o.jsx(a.Box,{px:"sm",py:"xs",style:{borderTop:"1px solid var(--mantine-color-gray-3)"},children:o.jsx(er,{selectedCategory:s,onCategoryChange:I})})]})});mt.displayName="IconGrid";const nr=({previewImage:e,fileInputRef:n,selectedEmoji:t,size:r,loading:s,onFileInputClick:i,onImageChange:c,onImageAccept:u,onClearImagePreview:l})=>o.jsx(a.Box,{p:"sm",style:{width:"384px"},children:o.jsxs(a.Stack,{gap:"md",align:"center",children:[e||t?o.jsxs(a.Box,{children:[o.jsx(a.Text,{size:"sm",fw:500,mb:"xs",children:"Preview"}),o.jsx(a.Avatar,{src:e,radius:"md",style:{width:`${ie(r)}px !important`,height:`${ie(r)}px !important`,minWidth:`${ie(r)}px`,minHeight:`${ie(r)}px`,maxWidth:`${ie(r)}px`,maxHeight:`${ie(r)}px`,border:"1px solid var(--mantine-color-gray-4)",objectFit:"cover",boxSizing:"border-box"},children:t})]}):o.jsx(a.Button,{variant:"subtle",bg:"gray.0",styles:{root:{height:"64px"}},leftSection:o.jsx(C.IconPhoto,{size:20}),onClick:i,loading:s,disabled:s,fullWidth:!0,children:"Choose Image"}),e||t?o.jsx(a.Button,{variant:"outline",leftSection:o.jsx(C.IconPhoto,{size:16}),onClick:i,loading:s,disabled:s,fullWidth:!0,children:e||t?"Change Image":"Choose Image"}):null,o.jsx("input",{ref:n,type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",onChange:f=>{var d;return c(((d=f.target.files)==null?void 0:d[0])||null)},style:{display:"none"},disabled:s}),(e||t)&&o.jsxs(a.Group,{gap:"sm",w:"100%",children:[o.jsx(a.Button,{variant:"outline",color:"gray",onClick:l,fullWidth:!0,children:"Back"}),o.jsx(a.Button,{color:"blue",onClick:u,loading:s,disabled:s,fullWidth:!0,children:"Accept"})]}),o.jsx(a.Text,{size:"xs",c:"var(--mantine-color-gray-6)",ta:"center",children:"Supported formats: JPG, PNG, GIF, WebP"})]})}),tr=({onEmojiSelect:e})=>o.jsx(Ko,{onEmojiSelect:e,height:358}),or=({onIconSelect:e})=>o.jsx(mt,{onIconSelect:e,height:358}),rr=({previewImage:e,selectedEmoji:n,size:t,loading:r,onFileInputClick:s,onImageChange:i,onImageAccept:c,onClearImagePreview:u,fileInputRef:l})=>o.jsx(nr,{previewImage:e,fileInputRef:l,selectedEmoji:n,size:t,loading:r,onFileInputClick:s,onImageChange:i,onImageAccept:c,onClearImagePreview:u}),ir=()=>o.jsx(a.Box,{style:{width:400,height:358,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsxs(a.Stack,{align:"center",gap:"sm",children:[o.jsx(a.Loader,{size:"sm"}),o.jsx(a.Text,{size:"sm",c:"gray.6",children:"Loading avatar options..."})]})}),sr=({opened:e,onOpen:n,onClose:t,avatar:r,onAvatarSelect:s,onRemove:i,onEmojiSelect:c,onImageSelect:u,onIconSelect:l,size:f="lg",loading:d=!1,placeholder:g,showPlaceholder:h=!0,position:x="bottom-start",withinPortal:v=!0,zIndex:I=1e3})=>{const m=p.useRef(null),y=p.useRef(null),w=p.useRef(null),{selectedTab:S,tabHovered:_,previewImage:$,selectedEmoji:D,selectedIcon:z,selectedFile:k,handleTabChange:R,handleTabHover:L,handleImagePreview:T,handleImageAccept:B,handleEmojiSelect:H,handleIconSelect:ee,clearImagePreview:ne,resetState:U}=ao({onAvatarSelect:s,onEmojiSelect:c,onImageSelect:u,onIconSelect:l});co({opened:e,onClose:t,popoverRef:y}),p.useEffect(()=>{e||U()},[e,U]);const ce=q=>{console.log("Emoji clicked:",q),H(q),t()},fe=q=>{console.log("Icon clicked:",q),ee(q),t()},he=q=>{q&&T(q)},F=()=>{k?(B(),t()):(D||z)&&t()},le=()=>{m.current&&m.current.click()},j=()=>{ne()},O=()=>{console.log("Avatar removed"),i==null||i(),t()},P=()=>!!r,A=()=>d?o.jsx(_e,{size:f,loading:!0}):o.jsx(ae,{avatar:r,size:f,placeholder:g,showPlaceholder:h,editable:!0,onClick:()=>{!d&&!e&&n()}}),Q=o.jsx(tr,{onEmojiSelect:ce}),re=o.jsx(or,{onIconSelect:fe}),Ie=o.jsx(rr,{previewImage:$,selectedEmoji:D,size:f,loading:d,onFileInputClick:le,onImageChange:he,onImageAccept:F,onClearImagePreview:j,fileInputRef:m}),ve=o.jsx(a.Box,{children:o.jsx(lo,{selectedTab:S,tabHovered:_,onTabChange:R,onTabHover:L,onRemove:O,hasAvatar:P(),children:S==="emoji"?Q:S==="icons"?re:Ie})});return o.jsx("div",{style:{position:"relative",display:"inline-block"},children:o.jsxs(a.Popover,{opened:e,onClose:()=>{console.log("Popover onClose called"),t()},position:x,withinPortal:v,withArrow:!0,shadow:"md",radius:"md",closeOnClickOutside:!1,closeOnEscape:!1,offset:8,transitionProps:{transition:"fade",duration:150},children:[o.jsx(a.Popover.Target,{children:o.jsx("div",{ref:w,style:{position:"relative"},children:A()})}),o.jsx(a.Popover.Dropdown,{ref:y,p:0,style:{width:"auto",overflow:"hidden",zIndex:I},children:o.jsx(p.Suspense,{fallback:o.jsx(ir,{}),children:ve})})]})})},ar=e=>{if(!e||typeof e!="string")return!1;const n=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return e.length<5||e.length>254?!1:n.test(e.trim())},cr=e=>{const n=[];return e.forEach(t=>{ar(t)||n.push({email:t,error:"Please enter a valid email address"})}),{isValid:n.length===0,errors:n}},lr=e=>{const n=[],t=new Set;return e.forEach(r=>{const s=r.toLowerCase().trim();t.has(s)?n.push({email:r,error:"This email has already been added"}):t.add(s)}),n},dr=e=>{const n=cr(e),t=lr(e),r=[...n.errors,...t];return{isValid:r.length===0,errors:r}},ur=({value:e,onChange:n,onInputChange:t,suggestedUsers:r=[],tagDisplayMap:s={}})=>{const[i,c]=p.useState(""),[u,l]=p.useState([]),f=p.useRef(null),d=e.map(I=>{if(s[I])return s[I];const m=r.find(y=>y.email===I);return m&&m.name?m.name:I});p.useEffect(()=>{t&&t(i)},[i,t]),p.useEffect(()=>{if(e.length>0){const I=dr(e);l(I.errors)}else l([])},[e]),p.useEffect(()=>{const I=f.current;if(!I)return;let m;const y=w=>{const _=w.target.value||"";clearTimeout(m),m=setTimeout(()=>{c(_)},150)};return I.addEventListener("input",y),()=>{I.removeEventListener("input",y),clearTimeout(m)}},[]);const g=p.useCallback(I=>{const m=r.map(w=>({name:w.name||w.email,email:w.email})),y=I.map(w=>{const S=m.find(_=>_.name.toLowerCase()===w.toLowerCase());return S?S.email:w}).filter(w=>w.includes("@")?!0:!m.some(_=>{const $=_.name.toLowerCase(),D=w.toLowerCase();return $.startsWith(D)&&D!==$}));n(y),c("")},[n,r]),h=p.useCallback(()=>{f.current&&(f.current.value="",c(""))},[]),x=u.length===0&&e.length>0,v=p.useCallback((I,m,y)=>{I&&e.length>0&&m&&(I(e,m,y),c(""))},[e]);return{inputText:i,tagsInputRef:f,displayValue:d,validationErrors:u,isValid:x,handleEmailChange:g,clearInput:h,handleInvite:v}},fr=({onInvite:e,onUpdateRole:n,onRemoveUser:t,invitedUsers:r=[],suggestedUsers:s=[],roleOptions:i=[]})=>{const[c,u]=p.useState([]),[l,f]=p.useState([]),[d,g]=p.useState(""),[h,x]=p.useState({}),v=i.length>0?i[0].value:void 0,[I,m]=p.useState(v);p.useEffect(()=>{i.length>0&&!I&&m(i[0].value)},[i.length,I]),p.useEffect(()=>{const T=s.filter(B=>c.includes(B.email)).map(B=>B.id);f(B=>B.filter(H=>T.includes(H)))},[c,s.length]);const[y,w]=p.useState("invite"),[S,_]=p.useState(null),$=(T,B,H)=>{e&&e(T,B,H),u([]),g("")},D=(T,B)=>{n&&n(T,B)},z=T=>{t&&t(T)},k=T=>{f(B=>B.includes(T)?B.filter(H=>H!==T):[...B,T])},R=T=>{c.includes(T.email)||(u([...c,T.email]),x(B=>({...B,[T.email]:T.name||T.email})),l.includes(T.id)||f([...l,T.id]),g(""))},L=d.trim()?s.filter(T=>{var H;const B=d.toLowerCase();return T.email.toLowerCase().includes(B)||((H=T.name)==null?void 0:H.toLowerCase().includes(B))}):[];return{emails:c,setEmails:u,selectedUsers:l,setSelectedUsers:f,inputText:d,setInputText:g,tagDisplayMap:h,setTagDisplayMap:x,selectedRole:I,setSelectedRole:m,selectedTab:y,setSelectedTab:w,tabHovered:S,setTabHovered:_,filteredUsers:L,handleInvite:$,handleUpdateRole:D,handleRemoveUser:z,handleToggleUser:k,handleAddSuggestedUser:R}},hr=p.forwardRef(({value:e,onChange:n,placeholder:t="Add one or more emails",onInvite:r,roleOptions:s=[],selectedRole:i,onRoleChange:c,onInputChange:u,suggestedUsers:l=[],tagDisplayMap:f={}},d)=>{const[g,h]=p.useState("Hello, I would like to invite you to join my workspace"),{tagsInputRef:x,displayValue:v,validationErrors:I,isValid:m,handleEmailChange:y,clearInput:w,handleInvite:S}=ur({value:e,onChange:n,onInputChange:u,suggestedUsers:l,tagDisplayMap:f}),_=()=>{S(r,i,g),h("")};p.useImperativeHandle(d,()=>({clearInput:w}),[w]);const $=v.length>0,D=c&&s.length>0,z=I.length>0;return o.jsxs(a.Stack,{gap:"md",children:[o.jsxs(a.Box,{children:[o.jsx(a.Box,{style:{maxHeight:"120px",overflowY:"auto",overflowX:"hidden",paddingRight:"8px",marginRight:"-8px"},children:o.jsx(a.TagsInput,{ref:x,value:v,onChange:y,placeholder:$?"":t,radius:"md",rightSection:D?o.jsx(a.Box,{style:{position:"absolute",right:"8px",top:"17px",transform:"translateY(-50%)",height:"24px",display:"flex",alignItems:"center"},children:o.jsx(Te,{value:i||"",onChange:k=>c(k),data:s,placeholder:"Select role",defaultOption:s[s.length-1],disabledOptions:["owner"]})}):null,rightSectionProps:{style:{width:D?"120px":"0px",position:"absolute",height:"32px",right:"8px"}},styles:{input:{paddingRight:D?"130px":"12px",minHeight:"36px",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px",borderRadius:"var(--mantine-radius-md)",border:z?"2px solid var(--mantine-color-red-6)":"2px solid var(--mantine-color-blue-7)",backgroundColor:"var(--mantine-color-gray-0)"},pillsList:{height:"24px !important",borderRadius:"var(--mantine-radius-md) !important"},pill:{height:"24px !important",borderRadius:"var(--mantine-radius-md) !important",backgroundColor:z?"var(--mantine-color-red-1) !important":"var(--mantine-color-orange-1) !important",color:z?"var(--mantine-color-red-7) !important":"var(--mantine-color-gray-7) !important",fontSize:"var(--mantine-font-size-sm)"}}})}),z&&o.jsx(a.Stack,{gap:"xs",mt:"xs",children:I.map((k,R)=>o.jsxs(a.Text,{size:"xs",c:"red",children:[k.email,": ",k.error]},R))})]}),$&&o.jsxs(a.Stack,{gap:"sm",children:[o.jsx(a.Textarea,{size:"sm",value:g,onChange:k=>h(k.currentTarget.value),minRows:2,maxRows:4,radius:"md"}),o.jsx(a.Button,{variant:"filled",color:"blue",onClick:_,fullWidth:!0,radius:"md",disabled:!m,children:"Send invitations"})]})]})}),pr=e=>{switch(e){case"member":return"green";case"invited":return"orange";case"declined":return"red";case"revoked":return"red";case"expired":return"red";default:return"gray"}},gr=e=>{switch(e){case"member":return"Member";case"invited":return"Invited";case"declined":return"Declined";case"revoked":return"Revoked";case"expired":return"Expired";default:return"Unknown"}},mr=e=>{if(e){if(typeof e=="object"&&"type"in e)return e;if(typeof e=="string")return{type:"image",value:e}}},qe=({user:e,isSelected:n=!1,onToggle:t,onUpdateRole:r,onRemoveUser:s,roleOptions:i=[],variant:c="invited",onClick:u})=>{var m;const l=((m=e.name)==null?void 0:m.trim())||e.email,f=()=>{t&&t(e.id)},d=y=>{if(r){const w=y;r(e.id,w)}},g=c==="suggested"||c==="read-only",h=c==="invited"&&i.length>0,[x,v]=p.useState(!1),I=()=>{u==null||u()};return o.jsxs(a.Group,{justify:"space-between",align:"center",wrap:"nowrap",w:"100%",style:{cursor:"pointer",borderRadius:"var(--mantine-radius-md)",padding:"6px"},onClick:I,bg:x?"var(--mantine-color-gray-0)":"transparent",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[o.jsxs(a.Group,{gap:"sm",w:"100%",align:"flex-start",wrap:"nowrap",children:[o.jsx(ae,{avatar:mr(e.avatar),size:"md",placeholder:l,showPlaceholder:!0}),o.jsxs(a.Stack,{gap:0,w:"100%",justify:"flex-start",align:"flex-start",children:[o.jsxs(a.Group,{gap:"sm",align:"flex-start",wrap:"nowrap",children:[o.jsxs(a.Group,{gap:"sm",align:"flex-start",wrap:"nowrap",children:[o.jsx(a.Text,{size:"sm",fw:500,lineClamp:1,mb:-2,children:l}),e.isCurrentUser&&o.jsx(a.Badge,{size:"xs",variant:"light",color:"gray",radius:"sm",children:"Owner"})]}),e.status!=="member"&&o.jsx(a.Badge,{size:"xs",variant:"light",color:pr(e.status),radius:"sm",children:gr(e.status)})]}),o.jsx(a.Text,{size:"xs",c:"dimmed",lineClamp:1,children:e.email})]})]}),o.jsxs(a.Group,{gap:"sm",align:"center",children:[g&&c!=="read-only"&&o.jsx(a.Radio,{checked:n,onChange:f,size:"sm",onClick:y=>y.stopPropagation(),pr:4}),h&&!e.isCurrentUser&&o.jsx(Te,{value:e.role,onChange:d,data:i,placeholder:"Select role",defaultOption:i.find(y=>y.value===e.role),withRemove:!0,onRemove:()=>s==null?void 0:s(e.id)})]})]})},xt=({opened:e,onClose:n,onInvite:t,onUpdateRole:r,onRemoveUser:s,invitedUsers:i=[],children:c,roleOptions:u=[],suggestedUsers:l=[]})=>{const f=p.useRef(null),{emails:d,setEmails:g,selectedUsers:h,inputText:x,setInputText:v,tagDisplayMap:I,selectedRole:m,setSelectedRole:y,selectedTab:w,setSelectedTab:S,tabHovered:_,setTabHovered:$,filteredUsers:D,handleInvite:z,handleUpdateRole:k,handleRemoveUser:R,handleToggleUser:L,handleAddSuggestedUser:T}=fr({onInvite:t,onUpdateRole:r,onRemoveUser:s,invitedUsers:i,suggestedUsers:l,roleOptions:u}),B=U=>{T(U),f.current&&f.current.clearInput()},H=o.jsxs(o.Fragment,{children:[o.jsx(hr,{ref:f,value:d,onChange:g,onInvite:z,roleOptions:u,selectedRole:m,onRoleChange:y,onInputChange:v,suggestedUsers:l,tagDisplayMap:I}),o.jsx(a.Space,{h:"sm"}),o.jsx(a.ScrollArea,{mah:200,type:"auto",style:{overflow:"visible"},children:o.jsx(a.Box,{children:i.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(a.Text,{size:"sm",fw:500,children:"Already members"}),o.jsx(a.Space,{h:"sm"}),o.jsx(a.Stack,{gap:"sm",children:i.map(U=>o.jsx(qe,{user:U,isSelected:h.includes(U.id),onToggle:L,onUpdateRole:k,onRemoveUser:R,roleOptions:u,variant:"invited"},U.id))})]})})}),D.length>0&&o.jsx(a.ScrollArea,{pt:"sm",mah:200,type:"auto",style:{overflow:"visible"},children:o.jsx(a.Box,{children:D.length>0?o.jsxs(o.Fragment,{children:[o.jsxs(a.Text,{size:"sm",fw:500,children:["Suggested ",x.trim()&&`(filtered by "${x}")`]}),o.jsx(a.Space,{h:"sm"}),o.jsx(a.Stack,{gap:"sm",children:D.map(U=>o.jsx(qe,{user:U,isSelected:h.includes(U.id),onToggle:L,onUpdateRole:k,onRemoveUser:R,roleOptions:u,variant:"suggested",onClick:()=>B(U)},U.id))})]}):null})})]}),ee=o.jsx(o.Fragment,{children:o.jsxs(a.Stack,{gap:"md",p:"sm",children:[o.jsxs(a.Stack,{gap:4,align:"center",children:[o.jsx(a.Text,{size:"sm",fw:500,ta:"center",children:"Publish to the web"}),o.jsx(a.Text,{size:"sm",fw:500,color:"var(--mantine-color-gray-6)",ta:"center",children:"Anyone with the link can view this page"})]}),o.jsx(a.Button,{variant:"filled",size:"xs",radius:"md",fw:500,fz:"var(--mantine-font-size-sm)",ta:"center",children:"Publish"})]})}),ne=o.jsx(a.Box,{style:{width:"400px",maxHeight:"600px",overflow:"visible"},children:o.jsx(a.Stack,{gap:"lg",children:o.jsxs(a.Tabs,{color:"black",defaultValue:"invite",styles:{tab:{backgroundColor:"transparent"}},children:[o.jsxs(a.Tabs.List,{px:"var(--mantine-spacing-sm)",pt:"xs",children:[o.jsx(a.Tabs.Tab,{value:"invite",p:0,pb:6,onClick:()=>{S("invite")},onMouseEnter:()=>$("invite"),onMouseLeave:()=>$(null),style:{backgroundColor:"transparent"},children:o.jsx(a.Box,{style:{borderRadius:"var(--mantine-radius-md)",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",border:"none",backgroundColor:_==="invite"?"var(--mantine-color-gray-1)":"transparent",color:w==="invite"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:"Invite"})}),o.jsx(a.Tabs.Tab,{value:"publish",p:0,pb:6,onClick:()=>{S("publish")},onMouseEnter:()=>$("publish"),onMouseLeave:()=>$(null),style:{backgroundColor:"transparent"},children:o.jsx(a.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:_==="publish"?"var(--mantine-color-gray-1)":"transparent",color:w==="publish"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:"Publish"})})]}),o.jsx(a.Tabs.Panel,{value:"invite",children:o.jsx(a.Box,{p:"sm",children:H})}),o.jsx(a.Tabs.Panel,{value:"publish",children:o.jsx(a.Box,{p:"sm",children:ee})})]})})});return o.jsx(me,{trigger:c,menuItems:[],opened:e,onClose:n,styles:{dropdown:{padding:"0",borderRadius:"var(--mantine-radius-md)"}},children:ne})},xr=({onInvite:e,onUpdateRole:n,onRemoveUser:t,invitedUsers:r,currentUser:s,roleOptions:i,suggestedUsers:c,label:u="Share"})=>{const[l,f]=p.useState(!1),d=()=>f(!1),g=o.jsx(zn,{label:u,onClick:()=>f(!0),isActive:l});return o.jsx(xt,{opened:l,onClose:d,onInvite:e,onUpdateRole:n,onRemoveUser:t,invitedUsers:r,currentUser:s,roleOptions:i,suggestedUsers:c,children:g})},Ir=(e,n="es")=>{const t=new Date,r=typeof e=="string"?new Date(e):e,s=Math.floor((t.getTime()-r.getTime())/1e3),i={es:{now:"ahora",seconds:"segundos",second:"segundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",days:"días",day:"día",weeks:"semanas",week:"semana",months:"meses",month:"mes",years:"años",year:"año",ago:"hace"},en:{now:"now",seconds:"seconds",second:"second",minutes:"minutes",minute:"minute",hours:"hours",hour:"hour",days:"days",day:"day",weeks:"weeks",week:"week",months:"months",month:"month",years:"years",year:"year",ago:"ago"}},c=i[n]||i.en;if(s<5)return c.now;if(s<60)return n==="es"?`${c.ago} ${s} ${s===1?c.second:c.seconds}`:`${s} ${s===1?c.second:c.seconds} ${c.ago}`;const u=Math.floor(s/60);if(u<60)return n==="es"?`${c.ago} ${u} ${u===1?c.minute:c.minutes}`:`${u} ${u===1?c.minute:c.minutes} ${c.ago}`;const l=Math.floor(u/60);if(l<24)return n==="es"?`${c.ago} ${l} ${l===1?c.hour:c.hours}`:`${l} ${l===1?c.hour:c.hours} ${c.ago}`;const f=Math.floor(l/24);if(f<7)return n==="es"?`${c.ago} ${f} ${f===1?c.day:c.days}`:`${f} ${f===1?c.day:c.days} ${c.ago}`;const d=Math.floor(f/7);if(d<4)return n==="es"?`${c.ago} ${d} ${d===1?c.week:c.weeks}`:`${d} ${d===1?c.week:c.weeks} ${c.ago}`;const g=Math.floor(f/30);if(g<12)return n==="es"?`${c.ago} ${g} ${g===1?c.month:c.months}`:`${g} ${g===1?c.month:c.months} ${c.ago}`;const h=Math.floor(f/365);return n==="es"?`${c.ago} ${h} ${h===1?c.year:c.years}`:`${h} ${h===1?c.year:c.years} ${c.ago}`},vr=(e,n="es")=>{const t=typeof e=="string"?new Date(e):e,r={es:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},i=(r[n]||r.en)[t.getMonth()],c=t.getDate();return n==="es"?`${c} ${i}`:`${i} ${c}`},br=e=>{const n=typeof e=="string"?new Date(e):e,t=new Date;return n.toDateString()===t.toDateString()},yr=e=>{const n=typeof e=="string"?new Date(e):e,t=new Date;return t.setDate(t.getDate()-1),n.toDateString()===t.toDateString()},wr=(e,n="es")=>br(e)?n==="es"?"Hoy":"Today":yr(e)?n==="es"?"Ayer":"Yesterday":Ir(e,n),kr=({notification:e,message:n,markAsRead:t,archiveNotification:r,children:s,actions:i})=>{var d,g,h,x,v;const c=new Date().getTime()-new Date(e.timestamp).getTime()<6048e5?wr(e.timestamp,"en"):vr(e.timestamp,"en"),[u,l]=p.useState(!1),f=o.jsxs(a.Group,{bg:"var(--mantine-color-gray-1)",p:4,style:{borderRadius:"var(--mantine-radius-md)"},w:"auto",wrap:"nowrap",gap:0,children:[!e.isRead&&o.jsx(W,{onClick:()=>t(e.id),icon:C.IconCheck}),!e.isArchived&&o.jsx(W,{onClick:()=>r(e.id),icon:C.IconArchive})]});return o.jsxs(a.Box,{p:"sm",bg:u?"var(--mantine-color-gray-0)":"white",style:{cursor:"pointer",borderTop:"1px solid var(--mantine-color-gray-2)"},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[o.jsxs(a.Group,{justify:"space-between",align:"flex-start",gap:"sm",wrap:"nowrap",style:{margin:0},children:[(d=e.metadata)!=null&&d.avatar_url?o.jsx(a.Avatar,{name:(g=e.metadata)==null?void 0:g.fullname,size:"sm",radius:"md",src:(h=e.metadata)==null?void 0:h.avatar_url}):o.jsx(On,{size:"xs",showText:!1,radius:"xs"}),o.jsxs(a.Stack,{gap:"xs",justify:"flex-start",w:"100%",children:[o.jsx(a.Box,{fz:"sm",m:0,style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden",textOverflow:"ellipsis",minHeight:"unset",height:"auto",whiteSpace:"normal",wordBreak:"break-word"},children:n}),o.jsxs(a.Text,{size:"xs",c:"dimmed",fw:500,style:{whiteSpace:"nowrap"},children:[e.category?((x=e.category)==null?void 0:x.charAt(0).toUpperCase())+((v=e.category)==null?void 0:v.slice(1)):""," ","• ",c]})]}),u?f:!e.isRead&&o.jsx(a.Indicator,{color:"var(--mantine-color-blue-6)",size:10,position:"top-end"})]}),s,i&&o.jsx(a.Group,{justify:"flex-start",align:"flex-start",gap:"xs",wrap:"nowrap",pl:36,pt:8,children:i})]})},Cr=(e,n,t,r,s)=>{const[i,c]=p.useState(!1),u=p.useRef(null),l=p.useRef(null),f=p.useRef(null);p.useEffect(()=>{c(e)},[e]);const d=p.useCallback(h=>{h[0].isIntersecting&&r&&!s&&t&&t()},[r,s,t]),g=p.useCallback(()=>{if(!(!u.current||!e||!n||!t)){l.current&&(l.current.disconnect(),l.current=null);try{const h=new IntersectionObserver(d,{threshold:.1,rootMargin:"50px"});h.observe(u.current),l.current=h}catch(h){console.error("Failed to setup intersection observer:",h)}}},[e,n,t,d]);return p.useEffect(()=>{if(f.current&&(clearTimeout(f.current),f.current=null),!e||!n||!t){l.current&&(l.current.disconnect(),l.current=null);return}if(!u.current){f.current=setTimeout(()=>g(),50);return}return g(),()=>{f.current&&(clearTimeout(f.current),f.current=null),l.current&&(l.current.disconnect(),l.current=null)}},[e,n,t,g]),p.useEffect(()=>()=>{f.current&&clearTimeout(f.current),l.current&&l.current.disconnect()},[]),{isActive:i,loadMoreRef:u}},jr=({notifications:e,isLoading:n=!1,isLoadingMore:t=!1,hasMore:r=!1,unreadCount:s=0,markAllAsRead:i,archiveAllNotifications:c,markAsRead:u,archiveNotification:l,loadMore:f,onFilterChange:d,currentFilter:g="all",customRenderer:h,opened:x=!1,onOpen:v=()=>{},onClose:I=()=>{},enableInfiniteScroll:m=!0})=>{const y=[{children:"Mark all as read",leftSection:o.jsx(C.IconChecklist,{size:16}),onClick:()=>i()},{children:"Archive all",leftSection:o.jsx(C.IconArchive,{size:16}),onClick:()=>c()}],w=[{children:"All",leftSection:o.jsx(C.IconChecklist,{size:16}),onClick:()=>d==null?void 0:d("all"),active:g==="all"},{children:"Unread",leftSection:o.jsx(C.IconChecklist,{size:16}),onClick:()=>d==null?void 0:d("unread"),active:g==="unread"},{children:"Archived",leftSection:o.jsx(C.IconArchive,{size:16}),onClick:()=>d==null?void 0:d("archived"),active:g==="archived"}],S=D=>h&&D.category&&["welcome","upgrade"].includes(D.category)?h(D,u,l):o.jsx(kr,{notification:D,markAsRead:u,archiveNotification:l,message:D.message,actions:D.actions},D.id),{isActive:_,loadMoreRef:$}=Cr(x,m,f||(()=>{}),r,t);return o.jsxs(o.Fragment,{children:[o.jsx(Tn,{isActive:_,icon:o.jsx(C.IconBell,{strokeWidth:2,color:"var(--mantine-color-gray-7)"}),onClick:()=>{x?I():v()},disabled:!1,variant:"subtle",color:"gray",fullWidth:!0,style:{borderRadius:"var(--mantine-radius-md)",cursor:"pointer"},label:"Inbox",indicator:s>0?s>99?"99+":s:void 0}),o.jsxs(a.Drawer,{opened:x,onClose:I,position:"left",size:400,style:{position:"relative",left:300,zIndex:0,borderLeft:"1px solid var(--mantine-color-gray-2)"},withCloseButton:!1,padding:0,withOverlay:!0,closeOnClickOutside:!0,closeOnEscape:!0,overlayProps:{backgroundOpacity:0,blur:0},children:[o.jsx(a.FocusTrap.InitialFocus,{}),o.jsxs(a.Box,{p:0,h:"100%",style:{display:"flex",flexDirection:"column"},children:[o.jsx(a.Box,{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"var(--mantine-color-white)"},children:o.jsxs(a.Group,{justify:"space-between",align:"center",gap:"xs",style:{borderRadius:"var(--mantine-radius-md)"},px:"sm",py:"md",children:[o.jsx(a.Text,{size:"sm",fw:500,children:"Inbox"}),o.jsxs(a.Group,{gap:"xs",children:[o.jsx(me,{position:"bottom-end",menuItems:w,trigger:o.jsx(W,{icon:C.IconFilter})}),o.jsx(me,{position:"bottom-end",menuItems:y,trigger:o.jsx(W,{onClick:()=>{},icon:C.IconDots,changeIconOnHover:!0,iconHovered:C.IconDots})})]})]})}),o.jsxs(a.Box,{style:{flex:1,overflow:"auto"},children:[n&&e.length===0?o.jsx(a.Stack,{gap:0,w:"100%",h:"100%",justify:"center",align:"center",py:"xl",children:o.jsx(a.Loader,{})}):e.length>0?o.jsx(a.Stack,{gap:0,children:e.map(D=>S(D))}):o.jsxs(a.Stack,{gap:0,w:"100%",h:"100%",justify:"center",align:"center",py:"xl",children:[o.jsx(C.IconInbox,{size:24,color:"var(--mantine-color-gray-6)"}),o.jsx(a.Text,{size:"sm",fw:500,c:"dimmed",ta:"center",mt:"sm",children:"No new updates"})]}),o.jsx(a.Box,{ref:$,style:{padding:"16px",display:m?"flex":"none",justifyContent:"center",alignItems:"center",minHeight:"60px"},children:t&&o.jsxs(a.Group,{display:"flex",ta:"center",gap:"xs",children:[o.jsx(a.Loader,{size:"sm",color:"gray.5"}),o.jsx(a.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more ..."})]})}),t&&!m&&o.jsxs(a.Group,{display:"flex",ta:"center",gap:"xs",children:[o.jsx(a.Loader,{size:"sm",color:"gray.5"}),o.jsx(a.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more ..."})]}),!m&&r&&f&&o.jsx(a.Button,{color:"var(--mantine-color-gray-3)",variant:"subtle",onClick:f,loading:t,disabled:t,style:{alignSelf:"center"},children:t?"Loading...":"Load More"})]})]})]})]})},_r=({header:e,body:n,footer:t,withBorder:r=!0,position:s="left",bg:i="var(--mantine-color-gray-0)"})=>{const[c,u]=p.useState(!1),l=()=>{if(!r)return{};const f="var(--mantine-color-gray-3)",d="1px";return s==="left"?{borderRight:`${d} solid ${f}`}:s==="right"?{borderLeft:`${d} solid ${f}`}:{}};return o.jsxs(a.Stack,{gap:"sm",h:"100%",p:"sm",bg:i,style:l(),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[e&&o.jsx(a.Box,{children:typeof e=="function"?e({hovered:c}):e}),n&&o.jsx(a.Box,{style:{flex:1,minHeight:0,width:"100%",overflow:"hidden"},children:typeof n=="function"?n({hovered:c}):n}),t&&o.jsx(a.Box,{children:typeof t=="function"?t({hovered:c}):t})]})},It=p.createContext(void 0),Sr=({children:e})=>{const[n,{open:t,close:r}]=zt.useDisclosure(!1),s={openedNotificationSidebar:n,openNotificationSidebar:t,closeNotificationSidebar:r};return o.jsx(It.Provider,{value:s,children:e})},Mr=()=>{const e=p.useContext(It);if(e===void 0)throw new Error("useNavbar must be used within an NavbarProvider");return e},vt=({workspace:e,currentUserId:n,currentWorkspaceId:t,onClick:r})=>{const s=t===e.id,i=n&&e.ownerId===n;return o.jsxs(a.Box,{onClick:r,style:{display:"flex",alignItems:"center",padding:"6px",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",gap:"8px",width:"100%",boxSizing:"border-box"},onMouseEnter:c=>{c.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)"},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent"},children:[o.jsx(ae,{size:"xs",avatar:typeof e.avatar=="string"?{type:"image",value:e.avatar}:e.avatar,placeholder:e.name,showPlaceholder:!0,style:{flexShrink:0}}),o.jsx(a.Text,{size:"sm",fw:500,c:"gray.9",truncate:!0,style:{flex:1,minWidth:0},children:e.name}),o.jsxs(a.Box,{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0,paddingLeft:"8px"},children:[s&&o.jsx(C.IconCheck,{size:16,color:"var(--mantine-color-blue-6)"}),i&&o.jsx(a.Badge,{size:"xs",variant:"light",color:"yellow",radius:"sm",children:"Owner"})]})]})},$r="_menuItem_3gic2_1",zr="_workspaceButton_3gic2_14",Or="_workspaceText_3gic2_24",Dr="_scrollWrapper_3gic2_30",He={menuItem:$r,workspaceButton:zr,workspaceText:Or,scrollWrapper:Dr},Tr=({workspaces:e=[],currentWorkspace:n,currentUserId:t,isLoading:r=!1,error:s=null,onWorkspaceSelect:i,onCreateWorkspace:c,emptyMessage:u="No workspaces found",loadingMessage:l="Loading workspaces...",errorMessage:f="Failed to load workspaces",className:d,onCloseSidebar:g,sidebarHovered:h=!1,children:x,menuItems:v})=>{const[I,m]=p.useState(!1),[y,w]=p.useState(""),S=p.useMemo(()=>y?e.filter(z=>{var k;return z.name.toLowerCase().includes(y.toLowerCase())||((k=z.ownerEmail)==null?void 0:k.toLowerCase().includes(y.toLowerCase()))}):e,[e,y]),_=z=>{i==null||i(z.id),m(!1),w("")};if(r)return o.jsxs(a.Group,{gap:"xs",children:[o.jsx(a.Loader,{size:"sm"}),o.jsx(a.Text,{size:"sm",c:"dimmed",children:l})]});if(s)return o.jsx(a.Alert,{color:"red",title:"Error",children:f});const[$,D]=p.useState(h);return e.length===0&&!r&&!s?o.jsx(a.Box,{children:o.jsx(a.Text,{size:"sm",c:"dimmed",children:u})}):o.jsxs(a.Menu,{opened:I,onOpen:()=>m(!0),onClose:()=>m(!1),position:"bottom-start",styles:{dropdown:{width:"350px",overflow:"hidden"}},withinPortal:!0,children:[o.jsx(a.Menu.Target,{children:o.jsx(a.Box,{w:"100%",onClick:()=>m(!I),style:{padding:"6px",display:"flex",alignItems:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer"},className:`${He.workspaceButton} ${d||""}`,bg:$||I?"var(--mantine-color-gray-1)":"transparent",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:o.jsx(a.Group,{gap:"xs",wrap:"nowrap",style:{width:"100%",overflow:"hidden"},children:n?o.jsxs(o.Fragment,{children:[o.jsx(ae,{size:"xs",avatar:typeof n.avatar=="string"?{type:"image",value:n.avatar}:n.avatar,placeholder:n.name,showPlaceholder:!0,style:{flexShrink:0}}),o.jsx(a.Text,{size:"sm",fw:500,c:"gray.9",truncate:!0,style:{flex:1,minWidth:0},children:n.name}),o.jsxs(a.Group,{gap:4,wrap:"nowrap",style:{flexShrink:0},children:[o.jsx(a.ActionIcon,{radius:"md",size:"md",color:"gray",variant:"subtle",onClick:()=>m(!I),children:o.jsx(C.IconChevronDown,{size:20,strokeWidth:2,color:"var(--mantine-color-gray-7)"})}),($||h)&&o.jsx(W,{icon:C.IconChevronsLeft,size:"md",color:"gray",variant:"subtle",onClick:()=>{g==null||g()}})]})]}):o.jsx(a.Text,{size:"sm",c:"dimmed",children:"Select workspace"})})})}),o.jsx(a.Menu.Dropdown,{style:{borderRadius:"var(--mantine-radius-md)"},p:0,children:o.jsxs(a.Stack,{gap:0,children:[x,o.jsx(a.Menu.Divider,{style:{margin:"1px 0px"}}),o.jsx(a.Stack,{gap:0,px:4,children:S.length===0?o.jsx(a.Menu.Item,{disabled:!0,children:o.jsx(a.Text,{size:"sm",c:"dimmed",children:u})}):o.jsxs(o.Fragment,{children:[o.jsxs(a.Group,{justify:"space-between",align:"center",p:4,children:[o.jsx(a.Text,{size:"xs",c:"dimmed",fw:500,p:4,truncate:!0,children:"Workspaces"}),c&&o.jsx(a.Anchor,{onClick:()=>{c(),m(!1)},size:"xs",underline:"never",fw:500,p:4,truncate:!0,style:{display:"flex",alignItems:"center",gap:"4px"},children:"Add"})]}),o.jsx("div",{className:He.scrollWrapper,children:o.jsx(a.ScrollArea,{mah:150,scrollbarSize:6,scrollHideDelay:0,children:o.jsx(a.Stack,{gap:0,mb:6,children:S.map(z=>o.jsx(a.Box,{onClick:()=>_(z),className:He.menuItem,style:{padding:0,borderRadius:"var(--mantine-radius-md)",cursor:"pointer",overflow:"hidden"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},children:o.jsx(vt,{workspace:z,currentUserId:t,currentWorkspaceId:n==null?void 0:n.id,onClick:()=>_(z)})},z.id))})})})]})}),v&&o.jsx(a.Menu.Divider,{style:{margin:"1px 0px"}}),v&&o.jsx(a.Box,{p:4,children:v==null?void 0:v.map(z=>o.jsx(a.MenuItem,{onClick:z.onClick,leftSection:z.icon,children:z.label,color:z.color,"data-danger":z.color,fw:500,style:{height:"40px",borderRadius:"var(--mantine-radius-md)",padding:"6px"}},z.label))})]})})]})},Rr=({opened:e,onClose:n,children:t,...r})=>o.jsxs(a.Modal,{withCloseButton:!1,opened:e,onClose:n,size:"70%",centered:!0,overlayProps:{backgroundOpacity:.55},styles:{content:{minHeight:"100%"}},padding:"md",...r,children:[o.jsxs(a.Group,{justify:"space-between",wrap:"nowrap",children:[o.jsx(a.Group,{justify:"space-between",wrap:"nowrap",gap:"xs",children:o.jsx(W,{icon:C.IconMaximize,size:"md",onClick:()=>{}})}),o.jsxs(a.Group,{justify:"space-between",gap:"xs",children:[o.jsx(W,{icon:C.IconStar,size:"md",onClick:()=>{}}),o.jsx(W,{icon:C.IconDots,size:"md",onClick:()=>{}})]})]}),t]}),Er=({opened:e,onClose:n,content:t,position:r="right",size:s="xl"})=>o.jsxs(a.Drawer,{opened:e,onClose:n,position:r,size:s,padding:"md",withCloseButton:!1,children:[o.jsxs(a.Group,{justify:"space-between",wrap:"nowrap",children:[o.jsxs(a.Group,{justify:"space-between",wrap:"nowrap",gap:"xs",children:[o.jsx(W,{icon:C.IconChevronsRight,size:"md",onClick:n}),o.jsx(W,{icon:C.IconMaximize,size:"md",onClick:()=>{}})]}),o.jsxs(a.Group,{justify:"space-between",gap:"xs",children:[o.jsx(W,{icon:C.IconStar,size:"md",onClick:()=>{}}),o.jsx(W,{icon:C.IconDots,size:"md",onClick:()=>{}})]})]}),t]}),Br=({children:e})=>o.jsx(a.Box,{style:{minHeight:"100vh",width:"100%",maxWidth:"100%",margin:"0 auto"},id:"full-page",children:e}),bt=a.createTheme({primaryColor:"blue",fontFamily:"Inter, system-ui, Avenir, Helvetica, Arial, sans-serif",fontFamilyMonospace:"Monaco, Courier, monospace",headings:{fontFamily:"Inter, system-ui, Avenir, Helvetica, Arial, sans-serif"},colors:{},components:{}});function Pr({children:e,theme:n}){return o.jsxs(a.MantineProvider,{theme:n||bt,children:[o.jsx(Ot.Notifications,{}),o.jsx(Dt.ModalsProvider,{children:o.jsx(Tt.DatesProvider,{settings:{firstDayOfWeek:0},children:e})})]})}exports.ActionButton=W;exports.AvatarSelector=sr;exports.BoxAvatar=ae;exports.CenterPeek=Rr;exports.EmojiAvatar=Cn;exports.ExpandableSearch=Dn;exports.FilterDropdown=Vt;exports.FullPage=Br;exports.GenericTable=En;exports.IconAvatar=Sn;exports.ImageAvatar=Mn;exports.InvitedUserCard=qe;exports.Logo=On;exports.Menu=me;exports.NavButton=Tn;exports.NavLink=Qt;exports.Navbar=_r;exports.NavbarProvider=Sr;exports.NotificationSidebar=jr;exports.PlaceholderAvatar=_e;exports.PopoverItem=Rn;exports.PopoverSelector=Te;exports.ShareButton=xr;exports.ShareMenu=xt;exports.SidePeek=Er;exports.TextButton=zn;exports.ThemeProvider=Pr;exports.WorkspaceSelector=Tr;exports.WorkspaceSelectorItem=vt;exports.getInitialsFromName=$n;exports.theme=bt;exports.useNavbar=Mr;
|
|
18
|
+
`})]})},ue=({activeFilters:o,onFiltersChange:r,availableFilters:t,size:s="md",filterButtonDropdownPosition:a="bottom-end"})=>{const c=n.useCombobox({onDropdownClose:()=>c.resetSelectedOption(),onDropdownOpen:()=>c.updateSelectedOptionIndex("active")}),[i,u]=l.useState(!1),d=o.length>0,f=x=>{if(x==="remove-filters")r([]);else{const g=t==null?void 0:t.find(v=>v.value===x);if(g){const v={id:`${g.value}-${Date.now()}`,filterOption:g};r([...o,v])}}c.closeDropdown()},I=(t||[]).filter(x=>!o.some(g=>g.filterOption.value===x.value)),m={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"},b=(()=>{switch(s){case"sm":return{height:"32px",width:"32px",iconSize:20};case"md":return{height:"32px",width:"32px",iconSize:20};default:return{height:"32px",width:"32px",iconSize:20}}})(),j=e.jsx(n.Box,{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:d||i?"var(--mantine-color-gray-0)":"transparent",color:"var(--mantine-color-gray-6)",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",transition:"all 0.2s ease",...b},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:()=>c.toggleDropdown(),children:e.jsx(w.IconFilter,{size:20,stroke:2.3})});return e.jsxs(n.Combobox,{store:c,onOptionSubmit:f,withinPortal:!1,offset:4,position:a,children:[e.jsx(n.Combobox.Target,{children:d?e.jsx(n.Indicator,{offset:2,position:"top-end",color:"var(--mantine-color-yellow-7)",children:j}):j}),e.jsx(n.Combobox.Dropdown,{styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",width:"auto",minWidth:"160px"}},children:e.jsxs(n.Combobox.Options,{children:[I.map(x=>e.jsx(n.Combobox.Option,{value:x.value,style:{...m},children:e.jsxs(n.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.icon,x.label]})},x.value)),d&&e.jsx(n.Combobox.Option,{value:"remove-filters",style:{borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",fontWeight:"500",color:"var(--mantine-color-red-6)"},children:e.jsxs(n.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(w.IconFilterOff,{size:16,stroke:2}),"Remove filters"]})})]})})]})},pn=({filterTag:o,onUpdate:r,onRemove:t,options:s=[],filterTagDropdownPosition:a="bottom-start"})=>{var h;const c=n.useCombobox({onDropdownClose:()=>c.resetSelectedOption(),onDropdownOpen:()=>c.updateSelectedOptionIndex("active")}),i=!!o.selectedOption,u=i?`${o.filterOption.label}: ${(h=o.selectedOption)==null?void 0:h.label}`:o.filterOption.label,d=s&&s.length>0?s:[{value:"option-a",label:"TagFilterOptionA"},{value:"option-b",label:"TagFilterOptionB"},{value:"option-c",label:"TagFilterOptionC"}],f=b=>{if(b==="remove")t();else{const j=d.find(x=>x.value===b);j&&r({...o,selectedOption:j})}c.closeDropdown()},I={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"},m={display:"inline-flex",alignItems:"center",gap:"4px",backgroundColor:i?"var(--mantine-color-blue-0)":"var(--mantine-color-gray-0)",color:i?"var(--mantine-color-blue-7)":"var(--mantine-color-gray-6)",borderRadius:"var(--mantine-radius-xl)",cursor:"pointer",transition:"all 0.2s ease",height:"32px",fontSize:"var(--mantine-font-size-sm)",padding:"0 12px"};return e.jsxs(n.Combobox,{store:c,onOptionSubmit:f,withinPortal:!1,offset:4,position:a,middlewares:{flip:!1,shift:!0},children:[e.jsx(n.Combobox.Target,{children:e.jsxs(n.Box,{style:{...m},onClick:()=>c.toggleDropdown(),fw:500,pl:"sm",children:[e.jsxs(n.Box,{style:{display:"flex",alignItems:"center",gap:"4px"},children:[o.filterOption.icon,u]}),e.jsx(w.IconChevronDown,{size:16,strokeWidth:2,color:"var(--mantine-color-gray-5)"})]})}),e.jsx(n.Combobox.Dropdown,{styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",minWidth:"150px"}},children:e.jsxs(n.Combobox.Options,{children:[d.map(b=>{var j;return e.jsx(n.Combobox.Option,{value:b.value,active:((j=o.selectedOption)==null?void 0:j.value)===b.value,style:{...I},children:b.label},b.value)}),e.jsx(n.Combobox.Option,{value:"remove",style:{borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",fontWeight:"500",color:"var(--mantine-color-red-6)"},children:"Or remove filter"})]})})]})},hn=({activeFilters:o,onFiltersChange:r,availableFilters:t,addFilterButtonDropdownPosition:s="bottom-start"})=>{const a=n.useCombobox({onDropdownClose:()=>a.resetSelectedOption(),onDropdownOpen:()=>a.updateSelectedOptionIndex("active")}),[c,i]=l.useState(!1),u=h=>{const b=t==null?void 0:t.find(j=>j.value===h);if(b){const j={id:`${b.value}-${Date.now()}`,filterOption:b};r([...o,j])}a.closeDropdown()},d=(t||[]).filter(h=>!o.some(b=>b.filterOption.value===h.value)),f={display:"inline-flex",alignItems:"center",backgroundColor:c?"var(--mantine-color-gray-0)":"transparent",borderRadius:"var(--mantine-radius-xl)",cursor:"pointer",transition:"all 0.2s ease",border:"1px solid transparent",height:"32px",fontSize:"var(--mantine-font-size-sm)",padding:"0 12px"},I={dropdown:{borderRadius:"var(--mantine-radius-md)",border:"1px solid var(--mantine-color-gray-2)",boxShadow:"var(--mantine-shadow-md)",padding:"4px",width:"auto",minWidth:"120px"}},m={borderRadius:"var(--mantine-radius-md)",fontSize:"var(--mantine-font-size-sm)",color:"var(--mantine-color-gray-7)",fontWeight:"500"};return e.jsxs(n.Combobox,{store:a,onOptionSubmit:u,withinPortal:!1,offset:4,position:s,children:[e.jsx(n.Combobox.Target,{children:e.jsx(n.Box,{style:{...f},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>a.toggleDropdown(),children:e.jsx(n.Box,{style:{fontWeight:"500",color:"var(--mantine-color-blue-6)"},children:"Add filter"})})}),e.jsx(n.Combobox.Dropdown,{styles:{...I},children:e.jsx(n.Combobox.Options,{children:d.map(h=>e.jsx(n.Combobox.Option,{value:h.value,style:{...m},children:e.jsxs(n.Box,{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h.icon,h.label]})},h.value))})})]})},fe=({activeFilters:o,onFiltersChange:r,availableFilters:t,size:s="sm",getFilterOptions:a,filterTagDropdownPosition:c="bottom-start"})=>{const i=f=>{const I=(o||[]).map(m=>m.id===f.id?f:m);r(I)},u=f=>{const I=(o||[]).filter(m=>m.id!==f);r(I)},d=(t||[]).filter(f=>!o.some(I=>I.filterOption.value===f.value));return!o||o.length===0?null:e.jsx("div",{style:{width:"100%"},children:e.jsxs(n.Group,{gap:"sm",align:"center",wrap:"wrap",children:[(o||[]).map(f=>{const I=a?a(f.filterOption.value)||[]:[];return e.jsx(pn,{filterTag:f,onUpdate:i,onRemove:()=>u(f.id),size:s,options:I,filterTagDropdownPosition:c},f.id)}),d.length>0&&e.jsx(hn,{activeFilters:o,onFiltersChange:r,availableFilters:d,size:s})]})})},gn=({activeFilters:o,onFiltersChange:r,availableFilters:t,size:s="md",getFilterOptions:a,filterTagDropdownPosition:c="bottom-start"})=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsx(ue,{activeFilters:o,onFiltersChange:r,availableFilters:t,size:s}),e.jsx(fe,{activeFilters:o,onFiltersChange:r,availableFilters:t,size:"sm",getFilterOptions:a,filterTagDropdownPosition:c})]}),xn=Object.assign(gn,{Button:ue,Filters:fe}),mn=({children:o,danger:r,active:t,...s})=>e.jsx(n.MenuItem,{...s,style:{borderRadius:"8px",color:t?"var(--mantine-color-blue-7)":r?"var(--mantine-color-red-9)":"var(--mantine-color-gray-9)",backgroundColor:t?"var(--mantine-color-blue-0)":"transparent",...s.style},children:o}),ne=({trigger:o,menuItems:r,children:t,...s})=>{const a=l.useRef(null),[c,i]=l.useState(0);return l.useEffect(()=>{a.current&&i(a.current.offsetWidth)},[o]),e.jsxs(n.Menu,{...s,children:[e.jsx(n.Menu.Target,{children:e.jsx("div",{ref:a,onClick:u=>u.stopPropagation(),style:{cursor:"pointer",outline:"none",boxShadow:"none",display:"flex",alignItems:"center"},children:o})}),e.jsxs(n.Menu.Dropdown,{styles:{dropdown:{cursor:"pointer",borderRadius:"8px",minWidth:`${c}px`}},children:[t,r==null?void 0:r.map((u,d)=>e.jsx(mn,{...u},d))]})]})},Ie=({label:o,icon:r,onClick:t,color:s="gray",disabled:a=!1,"aria-label":c,indicator:i,fullWidth:u,isActive:d=!1,...f})=>{const[I,m]=l.useState(!1),h=()=>{a||t==null||t()};return e.jsx(n.Box,{style:{cursor:a?"not-allowed":"pointer",borderRadius:"var(--mantine-radius-md)"},variant:"transparent",justify:"flex-start",display:"flex",color:s,radius:"md",w:u?"100%":"auto",px:6,h:40,onMouseEnter:()=>!a&&m(!0),onMouseLeave:()=>m(!1),onClick:h,bg:I||d?"gray.1":"transparent","aria-label":c||`${o} navigation button`,...f,children:e.jsxs(n.Group,{w:"100%",wrap:"nowrap",gap:8,justify:"left",align:"center",children:[r,e.jsx(n.Text,{ta:"left",size:"sm",fw:500,c:I?"gray.8":"gray.7",truncate:!0,style:{flex:1,opacity:a?.5:1},children:o}),i&&e.jsx(n.Box,{style:{cursor:"pointer",backgroundColor:"var(--mantine-color-red-7)",color:"var(--mantine-color-white)",borderRadius:"var(--mantine-radius-lg)",padding:"0px 4px",fontSize:"12px",fontWeight:600,height:"20px",minWidth:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:i})]})})},yn=({label:o,rightLabel:r,children:t,onAddChild:s,onMenuAction:a,menuItems:c,color:i="gray",defaultText:u="No items",level:d=0,disabled:f=!1,noChild:I=!1,isActive:m=!1,showAvatar:h=!1,avatar:b,placeholder:j,onClick:x,"aria-label":g,...v})=>{const[y,C]=l.useState(!1),[k,O]=l.useState(!1),[z,M]=l.useState(!1),p=l.Children.count(t)>0,R=z?w.IconChevronDown:w.IconChevronRight,E=!I&&p&&(h?k:!0),D=l.useCallback(F=>{f||(console.log("NavLink clicked",{hasChildren:p,noChild:I,isExpanded:y}),p&&!I&&(console.log("Toggling expansion"),C(!y)),x==null||x())},[x,f,p,I,y]),B=l.useCallback(F=>{F.stopPropagation(),!f&&(s==null||s())},[s,f]),L=l.useCallback(()=>{f||(p&&!I&&C(!y),x==null||x())},[f,p,I,y,x]),Q=l.useCallback(()=>{f||s==null||s()},[s,f]),V=l.useCallback(F=>{f||a==null||a(F)},[a,f,o]),U=l.useCallback(()=>p?l.Children.map(t,F=>l.isValidElement(F)?l.cloneElement(F,{...F.props,level:d+1}):F):null,[t,p,d]),Y=(c==null?void 0:c.map(F=>({children:e.jsxs(n.Group,{gap:"xs",wrap:"nowrap",children:[F.icon&&e.jsx(F.icon,{size:16}),e.jsx(n.Text,{size:"sm",children:F.label})]}),onClick:()=>V(F.action)})))||[],K=[{children:e.jsxs(n.Group,{gap:"xs",wrap:"nowrap",children:[e.jsx(w.IconPlus,{size:16}),e.jsx(n.Text,{size:"sm",children:"Add child"})]}),onClick:B}],J=Y.length>0?Y:K;return e.jsxs(n.Stack,{gap:0,children:[e.jsx(n.Box,{style:{cursor:f?"not-allowed":"pointer",borderRadius:"8px"},variant:"transparent",justify:"space-between",display:"flex",color:i,size:"md",radius:"md",w:"100%",px:6,h:40,onMouseEnter:()=>!f&&O(!0),onMouseLeave:()=>O(!1),onClick:D,bg:m||k?"var(--mantine-color-gray-1)":"transparent","aria-expanded":y,"aria-label":g||`${o} navigation link`,...v,children:e.jsxs(n.Group,{w:"100%",wrap:"nowrap",gap:8,onClick:D,style:{paddingLeft:I&&!E?`${(d+1)*16}px`:d>0?`${d*16}px`:"0px"},children:[E?e.jsx(H,{icon:R,size:"md",color:i,onClick:L,disabled:f,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),"aria-label":p?`${y?"Collapse":"Expand"} ${o}`:void 0}):h?e.jsx(Z,{size:"xs",avatar:b,showPlaceholder:!0,placeholder:j}):null,e.jsx(n.Text,{size:"sm",fw:500,c:m?"black":k?"gray.9":"gray.8",truncate:!0,w:"100%",style:{opacity:f?.5:1},children:o}),e.jsxs(n.Group,{gap:"xs",align:"center",children:[r&&e.jsx(n.Text,{size:"xs",c:"dimmed",children:r}),k&&!f&&e.jsxs(n.Group,{gap:4,wrap:"nowrap",children:[s&&e.jsx(H,{icon:w.IconPlus,onClick:Q,"aria-label":`Add child to ${o}`}),(c&&c.length>0||s)&&e.jsx("div",{onClick:F=>F.stopPropagation(),children:e.jsx(ne,{menuItems:J,trigger:e.jsx(H,{icon:w.IconDots,"aria-label":`More options for ${o}`,size:"md"}),position:"bottom-end",shadow:"md"})})]})]})]})}),y&&!I&&e.jsx(n.Stack,{gap:0,style:{width:"100%"},children:p?U():e.jsx(n.Box,{style:{marginLeft:d>0?`${d*16}px`:"0px"},children:e.jsx(n.Text,{size:"sm",c:"dimmed",ta:"left",p:"sm",fw:500,children:u})})})]})},vn="200px",jn="4px 8px",bn=40,wn="var(--mantine-radius-md)",Sn=16,Oe=({item:o,withAvatars:r,disabled:t=!1,onClick:s,selected:a=!1})=>{const[c,i]=l.useState(!1);return e.jsx(n.Box,{onMouseEnter:()=>!t&&i(!0),onMouseLeave:()=>!t&&i(!1),onClick:u=>{u.preventDefault(),u.stopPropagation(),t||s==null||s(o.value)},onMouseDown:u=>{u.stopPropagation()},style:{minWidth:vn,backgroundColor:t?"transparent":c?"var(--mantine-color-gray-1)":"transparent",cursor:t?"default":"pointer",borderRadius:wn,padding:jn,transition:"background-color 0.2s ease",opacity:t?.5:1},children:e.jsxs(n.Group,{gap:"sm",wrap:"nowrap",align:"flex-start",style:{alignItems:"center"},h:bn,children:[r&&o.avatar&&e.jsx("img",{src:o.avatar,alt:o.label,style:{width:"24px",height:"24px",borderRadius:"var(--mantine-radius-sm)",objectFit:"cover"}}),e.jsxs(n.Stack,{gap:0,style:{flex:1},children:[e.jsx(n.Text,{size:"sm",fw:500,lh:-1,c:t?"var(--mantine-color-gray-5)":"var(--mantine-color-gray-9)",children:o.label}),e.jsx(n.Text,{size:"xs",c:t?"var(--mantine-color-gray-4)":"dimmed",children:o.description})]}),a&&e.jsx(w.IconCheck,{size:Sn,color:"var(--mantine-color-gray-9)"})]})})},Cn="bottom-end",kn=1e4,Mn="24px",On="0 8px",Tn="6px",ge="var(--mantine-radius-md)",zn="46px",ce=({value:o,onChange:r,data:t,withRemove:s=!1,withAvatars:a=!1,onRemove:c,disabledOptions:i=[],disabled:u=!1,defaultOption:d,popoverStyles:f,dropdownStyles:I,triggerStyles:m,textStyles:h})=>{const[b,j]=l.useState(!1),x=(t||[]).find(p=>p.value===o)||d,[g,v]=l.useState(!1),[y,C]=l.useState(!1),[k,O]=l.useState(!1),z=s?e.jsx(n.Group,{p:"sm",onClick:p=>{p.stopPropagation(),c==null||c(o)},style:{cursor:"pointer",height:zn,display:"flex",alignItems:"center",borderRadius:ge,backgroundColor:y?"var(--mantine-color-red-0)":"transparent",transition:"background-color 0.2s ease"},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:e.jsx(n.Text,{size:"sm",c:"var(--mantine-color-red-6)",fw:500,children:"Remove user"})}):null,M=e.jsxs(n.Box,{onMouseEnter:()=>!u&&v(!0),onMouseLeave:()=>!u&&v(!1),onClick:()=>{u||(j(!0),O(!0))},style:{height:Mn,cursor:u?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",borderRadius:ge,backgroundColor:u?"transparent":g||k?"var(--mantine-color-gray-1)":"transparent",transition:"background-color 0.2s ease",padding:On,gap:Tn,width:"auto",opacity:u?.6:1,...m},children:[e.jsx(n.Text,{size:"sm",fw:h!=null&&h.fontWeight?void 0:500,c:u?"var(--mantine-color-gray-4)":"var(--mantine-color-gray-6)",style:{color:u?"var(--mantine-color-gray-4)":"var(--mantine-color-gray-6)",lineHeight:"24px",whiteSpace:"nowrap",...h},children:(x==null?void 0:x.label)||"Select option"}),e.jsx(w.IconChevronDown,{size:16,style:{color:u?"var(--mantine-color-gray-3)":"var(--mantine-color-gray-6)"}})]});return e.jsxs(n.Popover,{opened:b,onChange:p=>{j(p),p||O(!1)},position:Cn,shadow:"md",withinPortal:!0,zIndex:kn,styles:f,children:[e.jsx(n.Popover.Target,{children:M}),e.jsx(n.Popover.Dropdown,{onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),styles:{dropdown:{borderRadius:"var(--mantine-radius-md)",padding:"4px",...I}},children:e.jsxs(n.Stack,{gap:0,onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:[(t||[]).map(p=>{const R=i.includes(p.value),E=p.value===o;return e.jsx(Oe,{item:p,withAvatars:a,disabled:R,selected:E,onClick:D=>{r==null||r(D),j(!1),O(!1)}},p.value)}),z]})})]})},Dn=(o,r,t,s)=>{const a=l.useRef(null),c=l.useRef(null),i=l.useCallback(d=>{d[0].isIntersecting&&t&&!s&&r&&r()},[t,s,r]),u=l.useCallback(()=>{if(!(!a.current||!o||!r)){c.current&&(c.current.disconnect(),c.current=null);try{const d=new IntersectionObserver(i,{threshold:.1,rootMargin:"50px"});d.observe(a.current),c.current=d}catch(d){console.error("Failed to setup intersection observer:",d)}}},[o,r,i]);return l.useEffect(()=>(u(),()=>{c.current&&(c.current.disconnect(),c.current=null)}),[u]),l.useEffect(()=>()=>{c.current&&(c.current.disconnect(),c.current=null)},[]),{loadMoreRef:a}},Te=({tableName:o,data:r,columns:t,onAddItem:s,addItemComponent:a,addItemLabel:c="Add item",loading:i=!1,emptyMessage:u="No data found",searchPlaceholder:d="Search...",enableAutoFilters:f=!0,customFilters:I=[],onCustomFilter:m,onSort:h,sortColumn:b,sortDirection:j,onSearch:x,onRowClick:g,size:v="md",striped:y=!1,highlightOnHover:C=!0,enableInfiniteScroll:k=!1,isLoadingMore:O=!1,hasMore:z=!1,onLoadMore:M})=>{const[p,R]=l.useState(""),[E,D]=l.useState([]),{loadMoreRef:B}=Dn(k,M||(()=>{}),z,O),L=l.useMemo(()=>[...f?t.filter(T=>T.type==="select"&&T.options).map(T=>({value:T.key,label:T.label})):[],...I],[t,f,I]),Q=l.useMemo(()=>{let S=r||[];if(p){const T=p.toLowerCase();S=S.filter(P=>t.some(A=>{if(!A.searchable)return!1;const W=P[A.key];return W==null?!1:String(W).toLowerCase().includes(T)}))}return E.forEach(T=>{if(T.filterTag.selectedOption){const P=t.find(A=>A.key===T.filterTag.filterOption.value);P&&(S=S.filter(A=>{var q;const W=A[P.key];return String(W)===((q=T.filterTag.selectedOption)==null?void 0:q.value)}))}}),S},[r,p,E,t]),V=S=>{R(S),x==null||x(S)},U=S=>{const T=t.find(A=>A.key===S);if(!(T!=null&&T.sortable))return;const P=b===S&&j==="asc"?"desc":"asc";h==null||h(S,P)},Y=S=>{const T=t.find(P=>P.key===S);return(T==null?void 0:T.type)==="select"&&T.options?T.options.map(P=>({value:P.value,label:P.label})):(T==null?void 0:T.type)==="badge"?[...new Set(r.map(A=>A[T.key]).filter(Boolean))].map(A=>({value:String(A),label:String(A).charAt(0).toUpperCase()+String(A).slice(1)})):T?[...new Set(r.map(A=>A[T.key]).filter(Boolean))].map(A=>({value:String(A),label:String(A).charAt(0).toUpperCase()+String(A).slice(1)})):[]},K=(S,T)=>{var A,W,q,te,re;const P=T[S.key];switch(S.type){case"text":return e.jsx(n.Text,{size:"sm",c:P?void 0:"dimmed",children:P||"—"});case"date":if(!P)return e.jsx(n.Text,{size:"sm",c:"dimmed",children:"—"});const N=new Date(P),Qe=S.format?N.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}):N.toLocaleDateString();return e.jsx(n.Text,{size:"sm",c:"dimmed",children:Qe});case"select":return S.options?e.jsx(ce,{value:P,data:S.options,placeholder:S.label,onChange:$=>{var se;return(se=S.onSelectChange)==null?void 0:se.call(S,$,T)},disabled:(A=S.disabled)==null?void 0:A.call(S,T)}):e.jsx(n.Text,{size:"sm",c:"dimmed",children:"—"});case"badge":const Ve=((W=S.badgeColors)==null?void 0:W[P])||"gray";return e.jsx(n.Badge,{color:Ve,variant:"light",size:"sm",radius:"md",fw:600,children:P||"Unknown"});case"avatar":const qe=((q=S.fallbackText)==null?void 0:q.call(S,T))||String(P).charAt(0).toUpperCase();return e.jsx(Z,{avatar:P,size:"xs",placeholder:qe,showPlaceholder:!0});case"custom":return((te=S.render)==null?void 0:te.call(S,P,T))||e.jsx(n.Text,{size:"sm",c:"dimmed",children:"—"});case"actions":return(re=S.actions)!=null&&re.length?e.jsxs(n.Menu,{shadow:"md",width:200,position:"bottom-end",styles:{dropdown:{borderRadius:"var(--mantine-radius-md)"}},children:[e.jsx(n.Menu.Target,{children:e.jsx(n.ActionIcon,{variant:"subtle",size:"md",color:"gray",radius:"md",children:e.jsx(w.IconDots,{size:16})})}),e.jsx(n.Menu.Dropdown,{children:S.actions.map(($,se)=>{var pe;return e.jsx(n.Menu.Item,{color:$.color,leftSection:$.icon,disabled:(pe=$.disabled)==null?void 0:pe.call($,T),onClick:()=>$.onClick(T),styles:{item:{borderRadius:"var(--mantine-radius-md)"}},children:$.label},se)})})]}):null;default:return e.jsx(n.Text,{size:"sm",c:"dimmed",children:"—"})}},J=S=>{var T;return(T=t.find(P=>P.key===S))!=null&&T.sortable?b===S?j==="asc"?e.jsx(w.IconChevronUp,{size:14}):e.jsx(w.IconChevronDown,{size:14}):e.jsx(w.IconChevronUp,{size:14,style:{opacity:.3}}):null},X=(()=>{switch(v){case"sm":return{buttonSize:"xs",textSize:"sm"};case"lg":return{buttonSize:"md",textSize:"md"};default:return{buttonSize:"sm",textSize:"sm"}}})();return e.jsxs(n.Box,{pos:"relative",children:[e.jsx(n.LoadingOverlay,{visible:i}),e.jsxs(n.Stack,{gap:"sm",w:"100%",children:[e.jsxs(n.Group,{gap:"sm",wrap:"nowrap",justify:"space-between",children:[e.jsx(n.Text,{fw:600,c:"var(--mantine-color-gray-8)",children:o}),e.jsxs(n.Group,{gap:"xs",wrap:"nowrap",children:[e.jsxs(n.Group,{gap:4,wrap:"nowrap",children:[e.jsx(Me,{placeholder:d,value:p,onChange:V,onSearch:V,expandDirection:"right",size:X.buttonSize}),L.length>0&&e.jsx(ue,{activeFilters:E.map(S=>S.filterTag),onFiltersChange:S=>{D(S.map(T=>({filterTag:T,onUpdate:()=>{},onRemove:()=>{}}))),m==null||m(S)},availableFilters:L,size:X.buttonSize})]}),s&&e.jsx(n.Button,{size:"compact-md",h:32,style:{fontSize:`var(--mantine-font-size-${X.textSize})`,border:"none"},radius:"md",onClick:s,children:c})]})]}),L.length>0&&e.jsx(fe,{activeFilters:E.map(S=>S.filterTag),onFiltersChange:S=>{D(S.map(T=>({filterTag:T,onUpdate:()=>{},onRemove:()=>{}}))),m==null||m(S)},availableFilters:L,size:"md",getFilterOptions:Y})]}),a,e.jsxs(n.Table,{striped:y,highlightOnHover:C,highlightOnHoverColor:"var(--mantine-color-gray-0)",mt:"xs",children:[e.jsx(n.Table.Thead,{children:e.jsx(n.Table.Tr,{children:t.map(S=>e.jsx(n.Table.Th,{c:"var(--mantine-color-gray-6)",style:{width:S.width,textAlign:S.align||"left",cursor:S.sortable?"pointer":"default"},onClick:()=>S.sortable&&U(S.key),children:e.jsxs(n.Group,{gap:"xs",wrap:"nowrap",children:[S.icon&&e.jsx(n.Box,{style:{display:"flex",alignItems:"center"},children:S.icon}),e.jsx(n.Text,{size:X.textSize,fw:500,children:S.label}),J(S.key)]})},String(S.key)))})}),e.jsx(n.Table.Tbody,{children:Q.length===0?e.jsx(n.Table.Tr,{children:e.jsx(n.Table.Td,{colSpan:t.length,ta:"center",py:"xl",children:e.jsx(n.Text,{c:"dimmed",children:u})})}):Q.map((S,T)=>e.jsx(n.Table.Tr,{style:{cursor:g?"pointer":"default"},onClick:()=>g==null?void 0:g(S),children:t.map(P=>e.jsx(n.Table.Td,{style:{textAlign:P.align||"left"},children:K(P,S)},String(P.key)))},S.id||T))})]}),k&&e.jsx(n.Box,{ref:B,style:{padding:"16px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60px"},children:O&&e.jsxs(n.Group,{display:"flex",ta:"center",gap:"xs",children:[e.jsx(n.Loader,{size:"sm",color:"gray.5"}),e.jsx(n.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more..."})]})})]})};Object.assign(Te,{});const Rn=({onAvatarSelect:o,onEmojiSelect:r,onImageSelect:t,onIconSelect:s}={})=>{const[a,c]=l.useState("emoji"),[i,u]=l.useState(null),[d,f]=l.useState(null),[I,m]=l.useState(null),[h,b]=l.useState(null),[j,x]=l.useState(null),g=l.useCallback(p=>{c(p)},[]),v=l.useCallback(p=>{u(p)},[]),y=l.useCallback(p=>{x(p);const R=new FileReader;R.onload=E=>{var B;const D=(B=E.target)==null?void 0:B.result;f(D)},R.readAsDataURL(p)},[]),C=l.useCallback(p=>{m(p),f(null),x(null),b(null),o==null||o({type:"emoji",value:p}),r==null||r(p)},[o,r]),k=l.useCallback(p=>{b(p),f(null),x(null),m(null),o==null||o({type:"icon",value:p}),s==null||s(p)},[o,s]),O=l.useCallback(()=>{if(j&&d){const p=URL.createObjectURL(j);o==null||o({type:"image",value:p}),t==null||t(j)}},[j,d,o,t]),z=l.useCallback(()=>{f(null),x(null),m(null),b(null)},[]),M=l.useCallback(()=>{f(null),m(null),b(null),x(null),c("emoji"),u(null)},[]);return{selectedTab:a,tabHovered:i,previewImage:d,selectedEmoji:I,selectedIcon:h,selectedFile:j,handleTabChange:g,handleTabHover:v,handleImagePreview:y,handleImageAccept:O,handleEmojiSelect:C,handleIconSelect:k,clearImagePreview:z,resetState:M}},Bn=({opened:o,onClose:r,popoverRef:t})=>{const s=l.useCallback(c=>{o&&t.current&&!t.current.contains(c.target)&&(console.log("Click outside detected, closing popover"),r())},[o,r,t]),a=l.useCallback(c=>{c.key==="Escape"&&o&&(console.log("Escape key pressed, closing popover"),r())},[o,r]);return l.useEffect(()=>{if(o)return document.addEventListener("mousedown",s),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",a)}},[o,s,a]),{handleClickOutside:s,handleEscape:a}},Pn=({selectedTab:o,tabHovered:r,onTabChange:t,onTabHover:s,onRemove:a,hasAvatar:c=!1,children:i})=>{const[u,d]=l.useState(!1);return e.jsxs(n.Tabs,{color:"black",value:o,styles:{tab:{backgroundColor:"transparent"}},children:[e.jsxs(n.Tabs.List,{px:"var(--mantine-spacing-sm)",pt:"xs",w:"100%",children:[e.jsx(n.Tabs.Tab,{value:"emoji",p:0,pb:"xs",onClick:()=>t("emoji"),onMouseEnter:()=>s("emoji"),onMouseLeave:()=>s(null),style:{backgroundColor:"transparent"},children:e.jsx(n.Box,{style:{borderRadius:"var(--mantine-radius-md)",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",border:"none",backgroundColor:r==="emoji"?"var(--mantine-color-gray-1)":"transparent",color:o==="emoji"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:e.jsx(n.Group,{gap:4,children:"Emoji"})})}),e.jsx(n.Tabs.Tab,{value:"icons",p:0,pb:"xs",onClick:()=>t("icons"),onMouseEnter:()=>s("icons"),onMouseLeave:()=>s(null),style:{backgroundColor:"transparent"},children:e.jsx(n.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:r==="icons"?"var(--mantine-color-gray-1)":"transparent",color:o==="icons"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:e.jsx(n.Group,{gap:4,children:"Icons"})})}),e.jsx(n.Tabs.Tab,{value:"image",p:0,pb:"xs",onClick:()=>t("image"),onMouseEnter:()=>s("image"),onMouseLeave:()=>s(null),style:{backgroundColor:"transparent"},children:e.jsx(n.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:r==="image"?"var(--mantine-color-gray-1)":"transparent",color:o==="image"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:e.jsx(n.Group,{gap:4,children:"Image"})})}),a&&c&&e.jsx(n.Group,{justify:"flex-end",display:"flex",flex:1,pb:"xs",children:e.jsx(n.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:u?"var(--mantine-color-red-0)":"transparent",color:u?"var(--mantine-color-red-6)":"var(--mantine-color-gray-6)",cursor:"pointer",transition:"all 0.1s ease"},fw:500,fz:"var(--mantine-font-size-sm)",onClick:a,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:"Remove"})})]}),e.jsx(n.Tabs.Panel,{value:"emoji",children:o==="emoji"?i:null}),e.jsx(n.Tabs.Panel,{value:"icons",children:o==="icons"?i:null}),e.jsx(n.Tabs.Panel,{value:"image",children:o==="image"?i:null})]})};let xe=!1;xe||(me.init({data:ae}),xe=!0);const En=()=>{const o=[{id:"frequent",name:"Frequently Used",icon:e.jsx(w.IconClock,{size:20,strokeWidth:2.5})}];return ae.categories.forEach(r=>{if(r.emojis&&r.emojis.length>0){let t=e.jsx(w.IconMoodSmile,{size:20,strokeWidth:2}),s=r.name;switch(r.id){case"people":t=e.jsx(w.IconMoodSmile,{size:20,strokeWidth:2}),s="Smileys & People";break;case"nature":t=e.jsx(w.IconTrees,{size:20,strokeWidth:2}),s="Animals & Nature";break;case"foods":t=e.jsx(w.IconApple,{size:20,strokeWidth:2}),s="Food & Drink";break;case"activity":t=e.jsx(w.IconBallBasketball,{size:20,strokeWidth:2}),s="Activities";break;case"travel":t=e.jsx(w.IconPlane,{size:20,strokeWidth:2}),s="Travel & Places";break;case"places":t=e.jsx(w.IconPlane,{size:20,strokeWidth:2}),s="Travel & Places";break;case"objects":t=e.jsx(w.IconBulb,{size:20,strokeWidth:2}),s="Objects";break;case"symbols":t=e.jsx(w.IconHeart,{size:20,strokeWidth:2}),s="Symbols";break;case"flags":t=e.jsx(w.IconFlag,{size:20,strokeWidth:2}),s="Flags";break;case"frequent":return;default:t=e.jsx(w.IconMoodSmile,{size:20,strokeWidth:2}),s=`Category: ${r.id}`;break}o.push({id:r.id,name:s,icon:t})}}),o},An=({onEmojiSelect:o,height:r=200})=>{const[t,s]=l.useState(""),[a,c]=l.useState("people"),[i,u]=l.useState(()=>{if(typeof window<"u"){const g=localStorage.getItem("emoji-frequent");return g?JSON.parse(g):[]}return[]}),[d,f]=l.useState([]),[I,m]=l.useState(!1),h=En();l.useEffect(()=>{t.trim()?(m(!0),me.SearchIndex.search(t).then(g=>{f(g.map(v=>({id:v.id,native:v.skins[0].native,name:v.name,keywords:v.keywords}))),m(!1)})):f([])},[t]);const b=l.useMemo(()=>{if(t.trim())return d;if(a==="frequent")return i.map(v=>({id:v,native:v,name:"",keywords:[]}));const g=ae.categories.find(v=>v.id===a);return g?g.emojis.map(v=>{const y=ae.emojis[v];return{id:y.id,native:y.skins[0].native,name:y.name,keywords:y.keywords}}):[]},[t,a,i,d]),j=g=>{o(g),u(v=>{const y=v.filter(k=>k!==g),C=[g,...y].slice(0,20);return typeof window<"u"&&localStorage.setItem("emoji-frequent",JSON.stringify(C)),C})},x=g=>{if(t.trim())return"Results";const v=h.find(y=>y.id===g);return v?v.name:g.charAt(0).toUpperCase()+g.slice(1)};return e.jsxs(n.Stack,{gap:0,style:{height:r,width:"100%"},children:[e.jsx(n.Box,{p:"sm",pb:"xs",children:e.jsxs(n.Stack,{gap:"xs",children:[e.jsx(n.TextInput,{placeholder:"Search emojis...",value:t,onChange:g=>s(g.target.value),leftSection:e.jsx(w.IconSearch,{size:16,strokeWidth:2.5}),fw:500,size:"sm",radius:"md",styles:{input:{backgroundColor:"var(--mantine-color-gray-0)",color:"var(--mantine-color-gray-9)"}}}),e.jsx(n.Text,{size:"sm",c:"var(--mantine-color-gray-6)",ta:"left",fw:500,children:x(a)})]})}),e.jsx(n.Box,{style:{flex:1,overflow:"hidden"},children:e.jsx(n.ScrollArea,{h:"100%",type:"hover",offsetScrollbars:!1,children:e.jsx(n.Box,{style:{display:"grid",gridTemplateColumns:"repeat(9, 1fr)",gap:"0px",padding:"0px 12px 12px 12px"},children:I?e.jsx(n.Text,{size:"sm",c:"dimmed",ta:"center",py:"xl",style:{gridColumn:"1 / -1"},children:"Searching..."}):b.length>0?b.map(g=>e.jsx(n.Tooltip,{label:g.name||g.id,position:"top",withArrow:!0,openDelay:300,withinPortal:!0,zIndex:1e3,color:"dark",children:e.jsx(n.Button,{variant:"subtle",size:"sm",p:0,onClick:()=>j(g.native),style:{width:"40px",height:"40px",fontSize:"22px",border:"none",backgroundColor:"transparent",borderRadius:"var(--mantine-radius-md)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:g.native})},g.id)):e.jsx(n.Text,{size:"sm",c:"dimmed",ta:"center",py:"xl",style:{gridColumn:"1 / -1"},children:"No emojis found"})})})}),e.jsx(n.Box,{px:"sm",py:"xs",style:{borderTop:"1px solid var(--mantine-color-gray-3)"},children:e.jsx(n.Flex,{gap:"0px",justify:"center",wrap:"wrap",children:h.map(g=>e.jsx(n.Tooltip,{label:g.name,position:"top",withArrow:!0,openDelay:500,withinPortal:!0,zIndex:1e3,color:"dark",children:e.jsx(n.Box,{onClick:()=>{c(g.id),s("")},style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer","&:hover":{backgroundColor:"var(--mantine-color-gray-0)"},backgroundColor:a===g.id?"var(--mantine-color-gray-0)":"transparent",color:a===g.id?"var(--mantine-color-blue-6)":"var(--mantine-color-gray-6)",transition:"all 0.1s ease"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:g.icon})},g.id))})})]})},ze=["IconUser","IconUserCircle","IconUserCheck","IconUserX","IconUserPlus","IconUserMinus","IconUserEdit","IconUserCog","IconUserShield","IconUserStar","IconUserSearch","IconUserQuestion","IconUserOff","IconUsers","IconUserBolt","IconUserCode","IconUserDollar","IconUserExclamation","IconUserFilled","IconUserHexagon","IconUserKey","IconUserPause","IconUserPin","IconUserPlay","IconUserScan","IconUserShare","IconUserSquare","IconUserUp","IconUserVoice","IconUserWrench"],De=["IconBriefcase","IconBuilding","IconBuildingStore","IconBuildingBank","IconBuildingWarehouse","IconBuildingSkyscraper","IconBuildingBridge","IconBuildingCar","IconBuildingFactory","IconBuildingHospital","IconBuildingMonument","IconBuildingPavilon","IconBuildingTunnel","IconBuildingWindmill","IconChartBar","IconChartLine","IconChartPie","IconChartDots","IconChartArea","IconChartArcs","IconChartCandle","IconChartDonut","IconChartRadar","IconTrendingUp","IconTrendingDown","IconTarget","IconFlag","IconTrophy","IconAward","IconMedal","IconCertificate","IconBadge","IconCrown","IconStar","IconStarFilled","IconStarHalf","IconStarOff","IconFileText","IconFile","IconFileAlert","IconFileAnalytics","IconFileBarcode","IconFileBroken","IconFileCertificate","IconFileChart","IconFileCheck","IconFileCode","IconFileDatabase","IconFileDollar","IconFileDownload","IconFileEuro","IconFileExport","IconFileFunction","IconFileImport","IconFileInfo","IconFileInvoice","IconFileLambda","IconFileLike","IconFileMinus","IconFileMusic","IconFileOff","IconFilePencil","IconFilePhone","IconFilePlus","IconFileReport","IconFileRss","IconFileScissors","IconFileSearch","IconFileSettings","IconFileShredder","IconFileSignal","IconFileSpreadsheet","IconFileStar","IconFileSymlink","IconFileTime","IconFileType","IconFileTypography","IconFileUnknown","IconFileUpload","IconFileVector","IconFileX","IconFileZip","IconFolder","IconFolderOpen","IconFolderPlus","IconFolderMinus","IconFolderX","IconFolderCheck","IconFolderCog","IconFolderDown","IconFolderHeart","IconFolderOff","IconFolderPause","IconFolderPin","IconFolderQuestion","IconFolderSearch","IconFolderShare","IconFolderStar","IconFolderUp","IconFolderWrench","IconArchive","IconArchiveOff","IconBox","IconBoxMultiple","IconBoxOff","IconBoxPadding","IconBoxSeam","IconBriefcaseOff","IconClipboard","IconClipboardCheck","IconClipboardCopy","IconClipboardData","IconClipboardHeart","IconClipboardList","IconClipboardOff","IconClipboardPaste","IconClipboardText","IconClipboardTypography","IconClipboardX","IconCopy","IconCut","IconPaste","IconDuplicate","IconEdit","IconEditCircle","IconEditCircleOff"],Re=["IconDeviceDesktop","IconDeviceLaptop","IconDeviceMobile","IconDeviceTablet","IconDeviceWatch","IconDeviceTv","IconDeviceGamepad","IconDeviceAirpods","IconDeviceImac","IconDeviceIpad","IconDeviceIphone","IconDeviceMacbook","IconDeviceNintendo","IconDevicePlaystation","IconDeviceXbox","IconCode","IconTerminal","IconDatabase","IconServer","IconWifi","IconBluetooth","IconCpu","IconKeyboard","IconMouse","IconCamera","IconVideo","IconMicrophone","IconSpeaker","IconHeadphones","IconPrinter","IconScanner","IconRouter","IconModem","IconAntenna","IconSatellite","IconRadar","IconRadar2","IconBroadcast","IconBroadcastOff","IconRadio","IconRadioactive","IconRadioactiveOff","IconSignal","IconSignal4G","IconSignal5G","IconSignalOff","IconBattery","IconBattery1","IconBattery2","IconBattery3","IconBattery4","IconBatteryOff","IconBatteryCharging","IconBatteryAutomotive","IconBatteryEco","IconBatteryFilled","IconPlug","IconPlugConnected","IconPlugConnectedX","IconPlugOff","IconPlugX","IconPower","IconPowerOff","IconOutlet","IconCable","IconCableOff","IconCircuitAmmeter","IconCircuitBattery","IconCircuitBulb","IconCircuitCapacitor","IconCircuitCell","IconCircuitCellPlus","IconCircuitChangeover","IconCircuitDiode","IconCircuitDiodeZener","IconCircuitGround","IconCircuitGroundDigital","IconCircuitInductor","IconCircuitMotor","IconCircuitPushbutton","IconCircuitResistor","IconCircuitSwitchClosed","IconCircuitSwitchOpen","IconCircuitVoltmeter","IconCpu2","IconCpuOff","IconMemory","IconMemoryCard","IconMemoryStick","IconHardDrive","IconHardDrive2","IconDisk","IconDiskOff","IconCd","IconCdOff","IconDvd","IconDvdOff","IconFloppyDisk","IconFloppyDiskOff","IconUsb","IconUsbOff","IconSdCard","IconSdCardOff","IconCloud","IconCloudComputing","IconCloudDataConnection","IconCloudDownload","IconCloudLock","IconCloudOff","IconCloudRain","IconCloudSnow","IconCloudStorm","IconCloudUpload","IconCloudCheck","IconCloudCode","IconCloudCog","IconCloudDollar","IconCloudDown","IconCloudExclamation","IconCloudHeart","IconCloudMinus","IconCloudPause","IconCloudPin","IconCloudPlus","IconCloudQuestion","IconCloudSearch","IconCloudShare","IconCloudStar","IconCloudUp","IconCloudX"],Be=["IconMoodSmile","IconMoodHappy","IconMoodWink","IconMoodSad","IconMoodConfused","IconMoodAnnoyed","IconMoodAngry","IconMoodCry","IconMoodTongue","IconMoodKiss","IconMoodHeart","IconMoodLove","IconMoodEmpty","IconMoodNervous","IconMoodSuprised","IconMoodSilence","IconMoodSick","IconMoodTongueWink","IconMoodTongueWink2","IconMoodWink2","IconHeart","IconHeartFilled","IconHeartBroken","IconHeartHandshake","IconHeartMinus","IconHeartOff","IconHeartPlus","IconHeartRateMonitor","IconThumbUp","IconThumbDown","IconSmile","IconFrown","IconMeh","IconLaugh","IconWink","IconKiss","IconTongue","IconGrin","IconSmirk"],Pe=["IconTrees","IconLeaf","IconFlower","IconPlant","IconSun","IconMoon","IconStar","IconCloud","IconCloudRain","IconCloudSnow","IconSnowflake","IconDroplet","IconFlame","IconMountain","IconTree","IconPineTree","IconBug","IconButterfly","IconFish","IconBird","IconCat","IconDog","IconRabbit","IconPaw","IconPawprint","IconFeather","IconSeeding","IconSeedingOff","IconPlant2","IconPlantOff","IconLeafOff","IconFlower2","IconFlowerOff","IconTreesOff","IconTreeOff","IconPineTreeOff","IconPalmTree","IconPalmTreeOff","IconSunOff","IconSunHigh","IconSunLow","IconMoonOff","IconMoonStars","IconMoon2","IconMoonFilled","IconStars","IconStarsOff","IconStarFilled","IconStarHalf","IconStarOff","IconCloudOff","IconCloudStorm","IconCloudFog","IconCloudWind","IconSnowflakeOff","IconDropletOff","IconDropletFilled","IconDropletHalf","IconDropletHalf2","IconDropletHalfFilled","IconFlameOff","IconFire","IconFireExtinguisher","IconMountainOff","IconMountain2","IconHills","IconHillsOff","IconValley","IconValleyOff","IconBugOff","IconButterflyOff","IconBee","IconBeeOff","IconSpider","IconSpiderOff","IconAnt","IconAntOff","IconLadybug","IconLadybugOff","IconGrasshopper","IconGrasshopperOff","IconCricket","IconCricketOff","IconFishOff","IconFishBone","IconFishBoneOff","IconShark","IconSharkOff","IconWhale","IconWhaleOff","IconDolphin","IconDolphinOff","IconOctopus","IconOctopusOff","IconSeahorse","IconSeahorseOff","IconBirdOff","IconEagle","IconEagleOff","IconOwl","IconOwlOff","IconParrot","IconParrotOff","IconPeacock","IconPeacockOff","IconPenguin","IconPenguinOff","IconSwan","IconSwanOff","IconCatOff","IconDogOff","IconRabbitOff","IconFeatherOff","IconWing","IconWingOff","IconEgg","IconEggOff","IconEggCracked","IconEggCrackedOff","IconEggFilled","IconEggFilledOff","IconEggFried","IconEggFriedOff","IconNest","IconNestOff","IconNestEggs","IconNestEggsOff"],Ee=["IconCircle","IconSquare","IconTriangle","IconDiamond","IconHexagon","IconPentagon","IconOctagon","IconCross","IconPlus","IconMinus","IconCheck","IconX","IconArrowUp","IconArrowDown","IconArrowLeft","IconArrowRight","IconArrowUpLeft","IconArrowUpRight","IconArrowDownLeft","IconArrowDownRight","IconArrowLeftUp","IconArrowLeftDown","IconArrowRightUp","IconArrowRightDown","IconPlay","IconPause","IconStop","IconRecord","IconSkipBack","IconSkipForward","IconRewind","IconFastForward","IconCircleDot","IconCircleFilled","IconCircleHalf","IconCircleHalf2","IconCircleHalfFilled","IconCircleOff","IconCircleX","IconSquareDot","IconSquareFilled","IconSquareHalf","IconSquareHalfFilled","IconSquareOff","IconSquareRounded","IconSquareRoundedDot","IconSquareRoundedFilled","IconSquareRoundedHalf","IconSquareRoundedHalfFilled","IconSquareRoundedOff","IconSquareRoundedX","IconSquareX","IconTriangleFilled","IconTriangleInverted","IconTriangleInvertedFilled","IconTriangleOff","IconTriangleSquare","IconTriangleSquareCircle","IconDiamondFilled","IconDiamondOff","IconHexagonFilled","IconHexagonOff","IconPentagonFilled","IconPentagonOff","IconOctagonFilled","IconOctagonOff","IconCrossOff","IconPlusMinus","IconMinusMinus","IconCheckbox","IconCheckboxOff","IconChecks","IconXbox","IconXboxOff","IconYinYang","IconYinYangOff","IconYoga","IconYogaOff","IconZodiac","IconZodiacOff","IconZoom","IconZoomCancel","IconZoomCode","IconZoomExclamation","IconZoomFilled","IconZoomIn","IconZoomInArea","IconZoomInAreaFilled","IconZoomInFilled","IconZoomMoney","IconZoomPan","IconZoomQuestion","IconZoomReplace","IconZoomReset","IconZoomScan","IconZoomScanFilled","IconZoomX"],Ae=["IconEdit","IconDelete","IconSave","IconOpen","IconClose","IconAdd","IconRemove","IconSearch","IconFilter","IconSort","IconRefresh","IconReload","IconUndo","IconRedo","IconCut","IconCopy","IconPaste","IconDuplicate","IconMove","IconRotate","IconFlip","IconResize","IconScale","IconCrop","IconTransform","IconWrench","IconHammer","IconScrewdriver","IconTool","IconTools","IconSaw","IconDrill","IconDrillOff","IconAxe","IconAxeOff","IconPickaxe","IconPickaxeOff","IconShovel","IconShovelOff","IconRake","IconRakeOff","IconHoe","IconHoeOff","IconScythe","IconScytheOff","IconPitchfork","IconPitchforkOff","IconFork","IconForkOff","IconKnife","IconKnifeOff","IconSword","IconSwordOff","IconDagger","IconDaggerOff","IconSpear","IconSpearOff","IconBow","IconBowOff","IconArrow","IconArrowOff","IconCrossbow","IconCrossbowOff","IconGun","IconGunOff","IconPistol","IconPistolOff","IconRifle","IconRifleOff","IconShotgun","IconShotgunOff","IconBomb","IconBombOff","IconGrenade","IconGrenadeOff","IconDynamite","IconDynamiteOff","IconMine","IconMineOff","IconTorpedo","IconTorpedoOff","IconMissile","IconMissileOff","IconRocket","IconRocketOff","IconBazooka","IconBazookaOff","IconCannon","IconCannonOff","IconTank","IconTankOff","IconHelicopter","IconHelicopterOff","IconPlane","IconPlaneOff","IconJet","IconJetOff","IconSatellite","IconSatelliteOff","IconSpace","IconSpaceOff","IconGalaxy","IconGalaxyOff","IconPlanet","IconPlanetOff","IconEarth","IconEarthOff","IconMoon","IconMoonOff","IconSun","IconSunOff","IconStar","IconStarOff","IconAsteroid","IconAsteroidOff","IconComet","IconCometOff","IconMeteor","IconMeteorOff","IconUfo","IconUfoOff","IconAlien","IconAlienOff","IconRobot","IconRobotOff","IconAndroid","IconAndroidOff","IconIos","IconIosOff","IconWindows","IconWindowsOff","IconLinux","IconLinuxOff","IconMac","IconMacOff","IconUbuntu","IconUbuntuOff","IconDebian","IconDebianOff","IconRedhat","IconRedhatOff","IconCentos","IconCentosOff","IconFedora","IconFedoraOff","IconSuse","IconSuseOff","IconArch","IconArchOff","IconGentoo","IconGentooOff","IconSlackware","IconSlackwareOff","IconMint","IconMintOff","IconKali","IconKaliOff","IconParrot","IconParrotOff","IconBacktrack","IconBacktrackOff","IconBlackarch","IconBlackarchOff","IconPentoo","IconPentooOff","IconMatriux","IconMatriuxOff","IconNodezero","IconNodezeroOff","IconBugtraq","IconBugtraqOff","IconCyborg","IconCyborgOff","IconDefensive","IconDefensiveOff","IconDracos","IconDracosOff","IconFembuntu","IconFembuntuOff","IconGnacktrack","IconGnacktrackOff","IconHackintosh","IconHackintoshOff","IconHak5","IconHak5Off","IconHavij","IconHavijOff","IconJackal","IconJackalOff","IconKnoppix","IconKnoppixOff","IconKodachi","IconKodachiOff","IconLion","IconLionOff","IconMandriva","IconMandrivaOff","IconMobily","IconMobilyOff","IconMuslim","IconMuslimOff","IconNetrunner","IconNetrunnerOff","IconPardus","IconPardusOff","IconQubes","IconQubesOff","IconSabayon","IconSabayonOff","IconScientific","IconScientificOff","IconSemplice","IconSempliceOff","IconSiduction","IconSiductionOff","IconSlax","IconSlaxOff","IconSli","IconSliOff","IconTails","IconTailsOff","IconVector","IconVectorOff","IconVoid","IconVoidOff","IconWhonix","IconWhonixOff","IconZorin","IconZorinOff","IconAlpine","IconAlpineOff","IconElementary","IconElementaryOff","IconManjaro","IconManjaroOff","IconOpenbsd","IconOpenbsdOff","IconOpenSuse","IconOpenSuseOff","IconPop","IconPopOff","IconSolus","IconSolusOff"],Le=["IconMessage","IconMessageCircle","IconMessageDots","IconMessagePlus","IconMessageReport","IconMessageShare","IconMessageText","IconMessages","IconMessagesOff","IconMail","IconMailOpened","IconMailFast","IconMailOff","IconMailPause","IconMailPin","IconMailPlus","IconMailQuestion","IconMailSearch","IconMailShare","IconMailStar","IconMailUp","IconMailX","IconPhone","IconPhoneCall","IconPhoneIncoming","IconPhoneOff","IconPhoneOutgoing","IconPhonePause","IconPhonePlus","IconPhoneX","IconVideo","IconVideoOff","IconVideoPlus","IconCamera","IconCameraOff","IconCameraPlus","IconMicrophone","IconMicrophoneOff","IconMicrophone2","IconMicrophone2Off","IconHeadphones","IconHeadphonesOff","IconSpeaker","IconSpeakerOff","IconBroadcast","IconBroadcastOff","IconRadio","IconRadioactive","IconRadioactiveOff","IconAntenna","IconAntennaBars1","IconAntennaBars2","IconAntennaBars3","IconAntennaBars4","IconAntennaBars5","IconAntennaOff","IconSatellite","IconSatelliteOff","IconWifi","IconWifi0","IconWifi1","IconWifi2","IconWifiOff","IconBluetooth","IconBluetoothConnected","IconBluetoothOff","IconBluetoothX","IconShare","IconShareOff","IconShare2","IconShare3","IconAt","IconHash","IconLink","IconLinkOff","IconExternalLink","IconExternalLinkOff","IconSend","IconSendOff","IconSend2","IconReceipt","IconReceiptOff","IconReceipt2","IconReceiptRefund","IconReceiptTax","IconReceiptEuro","IconReceiptDollar","IconReceiptPound","IconReceiptYen","IconReceiptYuan","IconReceiptWon","IconReceiptRupee","IconReceiptBaht","IconReceiptLira","IconReceiptRuble","IconReceiptShekel","IconReceiptTaka","IconReceiptHryvnia","IconReceiptKrone","IconReceiptKrona","IconReceiptZloty","IconReceiptForint","IconReceiptLeu","IconReceiptLev","IconReceiptKuna","IconReceiptDinar","IconReceiptDirham","IconReceiptRial","IconReceiptRiyal","IconReceiptAfghani","IconReceiptAriary","IconReceiptCedi","IconReceiptDalasi","IconReceiptFranc","IconReceiptGourde","IconReceiptKina","IconReceiptKip","IconReceiptKwacha","IconReceiptKwanza","IconReceiptLari","IconReceiptLek","IconReceiptLilangeni","IconReceiptLoti","IconReceiptManat","IconReceiptMetical","IconReceiptNaira","IconReceiptPeso","IconReceiptPula","IconReceiptRand","IconReceiptRupiah","IconReceiptShilling","IconReceiptSom","IconReceiptSomoni","IconReceiptTenge","IconReceiptVatu","IconReceiptWon","IconReceiptXof","IconReceiptYuan","IconReceiptZloty"];[...ze,...De,...Re,...Be,...Pe,...Ee,...Ae,...Le];const ee=[{id:"recent",name:"Recently Used",icons:[],isDynamic:!0},{id:"user",name:"User & Profile",icons:ze},{id:"business",name:"Business & Work",icons:De},{id:"tech",name:"Technology",icons:Re},{id:"expressions",name:"Expressions",icons:Be},{id:"nature",name:"Nature & Animals",icons:Pe},{id:"shapes",name:"Shapes & Symbols",icons:Ee},{id:"actions",name:"Actions & Tools",icons:Ae},{id:"communication",name:"Communication",icons:Le}],Ln={recent:e.jsx(w.IconClock,{size:20,strokeWidth:2.5}),user:e.jsx(w.IconUser,{size:20,strokeWidth:2.5}),business:e.jsx(w.IconBriefcase,{size:20,strokeWidth:2.5}),tech:e.jsx(w.IconDeviceDesktop,{size:20,strokeWidth:2.5}),expressions:e.jsx(w.IconMoodSmile,{size:20,strokeWidth:2.5}),nature:e.jsx(w.IconTrees,{size:20,strokeWidth:2.5}),shapes:e.jsx(w.IconCircle,{size:20,strokeWidth:2.5}),actions:e.jsx(w.IconTool,{size:20,strokeWidth:2.5}),communication:e.jsx(w.IconMessage,{size:20,strokeWidth:2.5})},Fn=({selectedCategory:o,onCategoryChange:r})=>e.jsx(n.Flex,{gap:"0px",justify:"center",wrap:"wrap",children:ee.map(t=>{const s=Ln[t.id];return e.jsx(n.Tooltip,{label:t.name,position:"top",withArrow:!0,openDelay:500,withinPortal:!0,zIndex:1e3,color:"dark",children:e.jsx(n.Box,{onClick:()=>r(t.id),style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",backgroundColor:o===t.id?"var(--mantine-color-gray-0)":"transparent",color:o===t.id?"var(--mantine-color-blue-6)":"var(--mantine-color-gray-6)",transition:"all 0.2s ease"},onMouseEnter:a=>{a.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=o===t.id?"var(--mantine-color-gray-0)":"transparent"},children:s})},t.id)})}),Fe=l.memo(({onIconSelect:o,height:r=358})=>{var g,v;const[t,s]=l.useState(""),[a,c]=l.useState("recent"),[i,u]=l.useState(!1),[d,f]=l.useState([]);l.useLayoutEffect(()=>{if(typeof window<"u"){const y=localStorage.getItem("avatar-icon-recent");if(y)try{f(JSON.parse(y))}catch(C){console.warn("Error parsing recent icons from localStorage:",C)}}},[]);const I=l.useMemo(()=>ee.filter(y=>y.id!=="recent"&&!("isDynamic"in y)).flatMap(y=>y.icons),[]),m=l.useMemo(()=>{if(a==="recent"){const C=new Set(I);return d.filter(k=>C.has(k))}const y=ee.find(C=>C.id===a);return(y==null?void 0:y.icons)||[]},[a,d,I]),h=l.useCallback((y,C)=>{if(!y.trim())return C;const k=y.toLowerCase().trim(),O=k.split(/\s+/);return C.filter(z=>{const p=z.replace(/^Icon/,"").split(/(?=[A-Z])/).map(R=>R.toLowerCase().trim()).filter(R=>R.length>0);return!!(p.some(R=>O.some(E=>R===E))||k.length>2&&p.some(R=>O.some(E=>R.startsWith(E)))||k.length<=2&&p.some(R=>O.some(E=>R.includes(E)))||O.length>1&&O.every(R=>p.some(E=>E===R||E.startsWith(R))))})},[]),b=l.useMemo(()=>t.trim()?h(t,I):m,[t,m,I,h]),j=l.useCallback(y=>{I.includes(y)&&f(k=>{const O=[y,...k.filter(z=>z!==y)].slice(0,20);return typeof window<"u"&&localStorage.setItem("avatar-icon-recent",JSON.stringify(O)),O}),o(y)},[o,I]),x=l.useCallback(y=>{a!==y&&(s(""),c(y),requestAnimationFrame(()=>{u(!0),setTimeout(()=>u(!1),100)}))},[a]);return e.jsxs(n.Stack,{gap:0,style:{height:r,width:"100%"},children:[e.jsx(n.Box,{p:"sm",pb:"xs",children:e.jsxs(n.Stack,{gap:"xs",children:[e.jsx(n.TextInput,{placeholder:t.trim()?"Search all icons...":`Search in ${(g=ee.find(y=>y.id===a))==null?void 0:g.name}...`,value:t,onChange:y=>s(y.target.value),leftSection:e.jsx(w.IconSearch,{size:16}),fw:500,size:"sm",radius:"md",styles:{input:{backgroundColor:"var(--mantine-color-gray-0)",color:"var(--mantine-color-gray-9)"}}}),e.jsx(n.Text,{size:"sm",c:"var(--mantine-color-gray-6)",ta:"left",fw:500,children:t.trim()?"Results":(v=ee.find(y=>y.id===a))==null?void 0:v.name})]})}),e.jsx(n.Box,{style:{flex:1,overflow:"hidden"},children:e.jsx(n.ScrollArea,{h:"100%",type:"hover",children:e.jsx(n.Box,{style:{display:"grid",gridTemplateColumns:"repeat(8, 1fr)",gap:"4px",padding:"0 12px 12px 12px",opacity:i?.7:1,transition:"opacity 0.05s ease"},children:b.map(y=>e.jsx(ve,{iconName:y,onClick:()=>j(y),size:20},t.trim()?`search-${y}`:`${a}-${y}`))},`${a}-${t}`)})}),e.jsx(n.Box,{px:"sm",py:"xs",style:{borderTop:"1px solid var(--mantine-color-gray-3)"},children:e.jsx(Fn,{selectedCategory:a,onCategoryChange:x})})]})});Fe.displayName="IconGrid";const Hn=({previewImage:o,fileInputRef:r,selectedEmoji:t,size:s,loading:a,onFileInputClick:c,onImageChange:i,onImageAccept:u,onClearImagePreview:d})=>e.jsx(n.Box,{p:"sm",style:{width:"384px"},children:e.jsxs(n.Stack,{gap:"md",align:"center",children:[o||t?e.jsxs(n.Box,{children:[e.jsx(n.Text,{size:"sm",fw:500,mb:"xs",children:"Preview"}),e.jsx(n.Avatar,{src:o,radius:"md",style:{width:`${_(s)}px !important`,height:`${_(s)}px !important`,minWidth:`${_(s)}px`,minHeight:`${_(s)}px`,maxWidth:`${_(s)}px`,maxHeight:`${_(s)}px`,border:"1px solid var(--mantine-color-gray-4)",objectFit:"cover",boxSizing:"border-box"},children:t})]}):e.jsx(n.Button,{variant:"subtle",bg:"gray.0",styles:{root:{height:"64px"}},leftSection:e.jsx(w.IconPhoto,{size:20}),onClick:c,loading:a,disabled:a,fullWidth:!0,children:"Choose Image"}),o||t?e.jsx(n.Button,{variant:"outline",leftSection:e.jsx(w.IconPhoto,{size:16}),onClick:c,loading:a,disabled:a,fullWidth:!0,children:o||t?"Change Image":"Choose Image"}):null,e.jsx("input",{ref:r,type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",onChange:f=>{var I;return i(((I=f.target.files)==null?void 0:I[0])||null)},style:{display:"none"},disabled:a}),(o||t)&&e.jsxs(n.Group,{gap:"sm",w:"100%",children:[e.jsx(n.Button,{variant:"outline",color:"gray",onClick:d,fullWidth:!0,children:"Back"}),e.jsx(n.Button,{color:"blue",onClick:u,loading:a,disabled:a,fullWidth:!0,children:"Accept"})]}),e.jsx(n.Text,{size:"xs",c:"var(--mantine-color-gray-6)",ta:"center",children:"Supported formats: JPG, PNG, GIF, WebP"})]})}),Un=({onEmojiSelect:o})=>e.jsx(An,{onEmojiSelect:o,height:358}),Nn=({onIconSelect:o})=>e.jsx(Fe,{onIconSelect:o,height:358}),Wn=({previewImage:o,selectedEmoji:r,size:t,loading:s,onFileInputClick:a,onImageChange:c,onImageAccept:i,onClearImagePreview:u,fileInputRef:d})=>e.jsx(Hn,{previewImage:o,fileInputRef:d,selectedEmoji:r,size:t,loading:s,onFileInputClick:a,onImageChange:c,onImageAccept:i,onClearImagePreview:u}),$n=()=>e.jsx(n.Box,{style:{width:400,height:358,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs(n.Stack,{align:"center",gap:"sm",children:[e.jsx(n.Loader,{size:"sm"}),e.jsx(n.Text,{size:"sm",c:"gray.6",children:"Loading avatar options..."})]})}),Gn=({opened:o,onOpen:r,onClose:t,avatar:s,onAvatarSelect:a,onRemove:c,onEmojiSelect:i,onImageSelect:u,onIconSelect:d,size:f="lg",loading:I=!1,placeholder:m,showPlaceholder:h=!0,position:b="bottom-start",withinPortal:j=!0,zIndex:x=1e3})=>{const g=l.useRef(null),v=l.useRef(null),y=l.useRef(null),{selectedTab:C,tabHovered:k,previewImage:O,selectedEmoji:z,selectedIcon:M,selectedFile:p,handleTabChange:R,handleTabHover:E,handleImagePreview:D,handleImageAccept:B,handleEmojiSelect:L,handleIconSelect:Q,clearImagePreview:V,resetState:U}=Rn({onAvatarSelect:a,onEmojiSelect:i,onImageSelect:u,onIconSelect:d});Bn({opened:o,onClose:t,popoverRef:v}),l.useEffect(()=>{o||U()},[o,U]);const Y=N=>{console.log("Emoji clicked:",N),L(N),t()},K=N=>{console.log("Icon clicked:",N),Q(N),t()},J=N=>{N&&D(N)},F=()=>{p?(B(),t()):(z||M)&&t()},X=()=>{g.current&&g.current.click()},S=()=>{V()},T=()=>{console.log("Avatar removed"),c==null||c(),t()},P=()=>!!s,A=()=>I?e.jsx(ie,{size:f,loading:!0}):e.jsx(Z,{avatar:s,size:f,placeholder:m,showPlaceholder:h,editable:!0,onClick:()=>{!I&&!o&&r()}}),W=e.jsx(Un,{onEmojiSelect:Y}),q=e.jsx(Nn,{onIconSelect:K}),te=e.jsx(Wn,{previewImage:O,selectedEmoji:z,size:f,loading:I,onFileInputClick:X,onImageChange:J,onImageAccept:F,onClearImagePreview:S,fileInputRef:g}),re=e.jsx(n.Box,{children:e.jsx(Pn,{selectedTab:C,tabHovered:k,onTabChange:R,onTabHover:E,onRemove:T,hasAvatar:P(),children:C==="emoji"?W:C==="icons"?q:te})});return e.jsx("div",{style:{position:"relative",display:"inline-block"},children:e.jsxs(n.Popover,{opened:o,onClose:()=>{console.log("Popover onClose called"),t()},position:b,withinPortal:j,withArrow:!0,shadow:"md",radius:"md",closeOnClickOutside:!1,closeOnEscape:!1,offset:8,transitionProps:{transition:"fade",duration:150},children:[e.jsx(n.Popover.Target,{children:e.jsx("div",{ref:y,style:{position:"relative"},children:A()})}),e.jsx(n.Popover.Dropdown,{ref:v,p:0,style:{width:"auto",overflow:"hidden",zIndex:x},children:e.jsx(l.Suspense,{fallback:e.jsx($n,{}),children:re})})]})})},Qn=o=>{if(!o||typeof o!="string")return!1;const r=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return o.length<5||o.length>254?!1:r.test(o.trim())},Vn=o=>{const r=[];return o.forEach(t=>{Qn(t)||r.push({email:t,error:"Please enter a valid email address"})}),{isValid:r.length===0,errors:r}},qn=o=>{const r=[],t=new Set;return o.forEach(s=>{const a=s.toLowerCase().trim();t.has(a)?r.push({email:s,error:"This email has already been added"}):t.add(a)}),r},_n=o=>{const r=Vn(o),t=qn(o),s=[...r.errors,...t];return{isValid:s.length===0,errors:s}},Zn=({value:o,onChange:r,onInputChange:t,suggestedUsers:s=[],tagDisplayMap:a={}})=>{const[c,i]=l.useState(""),[u,d]=l.useState([]),f=l.useRef(null),I=o.map(x=>{if(a[x])return a[x];const g=s.find(v=>v.email===x);return g&&g.name?g.name:x});l.useEffect(()=>{t&&t(c)},[c,t]),l.useEffect(()=>{if(o.length>0){const x=_n(o);d(x.errors)}else d([])},[o]),l.useEffect(()=>{const x=f.current;if(!x)return;let g;const v=y=>{const k=y.target.value||"";clearTimeout(g),g=setTimeout(()=>{i(k)},150)};return x.addEventListener("input",v),()=>{x.removeEventListener("input",v),clearTimeout(g)}},[]);const m=l.useCallback(x=>{const g=s.map(y=>({name:y.name||y.email,email:y.email})),v=x.map(y=>{const C=g.find(k=>k.name.toLowerCase()===y.toLowerCase());return C?C.email:y}).filter(y=>y.includes("@")?!0:!g.some(k=>{const O=k.name.toLowerCase(),z=y.toLowerCase();return O.startsWith(z)&&z!==O}));r(v),i("")},[r,s]),h=l.useCallback(()=>{f.current&&(f.current.value="",i(""))},[]),b=u.length===0&&o.length>0,j=l.useCallback((x,g,v)=>{x&&o.length>0&&g&&(x(o,g,v),i(""))},[o]);return{inputText:c,tagsInputRef:f,displayValue:I,validationErrors:u,isValid:b,handleEmailChange:m,clearInput:h,handleInvite:j}},He=({onInvite:o,onUpdateRole:r,onRemoveUser:t,invitedUsers:s=[],suggestedUsers:a=[],roleOptions:c=[]})=>{const[i,u]=l.useState([]),[d,f]=l.useState([]),[I,m]=l.useState(""),[h,b]=l.useState({}),j=c.length>0?c[0].value:void 0,[x,g]=l.useState(j);l.useEffect(()=>{c.length>0&&!x&&g(c[0].value)},[c.length,x]),l.useEffect(()=>{const D=a.filter(B=>i.includes(B.email)).map(B=>B.id);f(B=>B.filter(L=>D.includes(L)))},[i,a.length]);const[v,y]=l.useState("invite"),[C,k]=l.useState(null),O=(D,B,L)=>{o&&o(D,B,L),u([]),m("")},z=(D,B)=>{r&&r(D,B)},M=D=>{t&&t(D)},p=D=>{f(B=>B.includes(D)?B.filter(L=>L!==D):[...B,D])},R=D=>{i.includes(D.email)||(u([...i,D.email]),b(B=>({...B,[D.email]:D.name||D.email})),d.includes(D.id)||f([...d,D.id]),m(""))},E=I.trim()?a.filter(D=>{var L;const B=I.toLowerCase();return D.email.toLowerCase().includes(B)||((L=D.name)==null?void 0:L.toLowerCase().includes(B))}):[];return{emails:i,setEmails:u,selectedUsers:d,setSelectedUsers:f,inputText:I,setInputText:m,tagDisplayMap:h,setTagDisplayMap:b,selectedRole:x,setSelectedRole:g,selectedTab:v,setSelectedTab:y,tabHovered:C,setTabHovered:k,filteredUsers:E,handleInvite:O,handleUpdateRole:z,handleRemoveUser:M,handleToggleUser:p,handleAddSuggestedUser:R}},Ue=l.forwardRef(({value:o,onChange:r,placeholder:t="Add one or more emails",onInvite:s,roleOptions:a=[],selectedRole:c,onRoleChange:i,onInputChange:u,suggestedUsers:d=[],tagDisplayMap:f={}},I)=>{const[m,h]=l.useState("Hello, I would like to invite you to join my workspace"),{tagsInputRef:b,displayValue:j,validationErrors:x,isValid:g,handleEmailChange:v,clearInput:y,handleInvite:C}=Zn({value:o,onChange:r,onInputChange:u,suggestedUsers:d,tagDisplayMap:f}),k=()=>{C(s,c,m),h("")};l.useImperativeHandle(I,()=>({clearInput:y}),[y]);const O=j.length>0,z=i&&a.length>0,M=x.length>0;return e.jsxs(n.Stack,{gap:"md",children:[e.jsxs(n.Box,{children:[e.jsx(n.Box,{style:{maxHeight:"120px",overflowY:"auto",overflowX:"hidden",paddingRight:"8px",marginRight:"-8px"},children:e.jsx(n.TagsInput,{ref:b,value:j,onChange:v,placeholder:O?"":t,radius:"md",rightSection:z?e.jsx(n.Box,{style:{position:"absolute",right:"8px",top:"17px",transform:"translateY(-50%)",height:"24px",display:"flex",alignItems:"center"},children:e.jsx(ce,{value:c||"",onChange:p=>i(p),data:a,placeholder:"Select role",defaultOption:a[a.length-1],disabledOptions:["owner"]})}):null,rightSectionProps:{style:{width:z?"120px":"0px",position:"absolute",height:"32px",right:"8px"}},styles:{input:{paddingRight:z?"130px":"12px",minHeight:"36px",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px",borderRadius:"var(--mantine-radius-md)",border:M?"2px solid var(--mantine-color-red-6)":"2px solid var(--mantine-color-blue-7)",backgroundColor:"var(--mantine-color-gray-0)"},pillsList:{height:"24px !important",borderRadius:"var(--mantine-radius-md) !important"},pill:{height:"24px !important",borderRadius:"var(--mantine-radius-md) !important",backgroundColor:M?"var(--mantine-color-red-1) !important":"var(--mantine-color-orange-1) !important",color:M?"var(--mantine-color-red-7) !important":"var(--mantine-color-gray-7) !important",fontSize:"var(--mantine-font-size-sm)"}}})}),M&&e.jsx(n.Stack,{gap:"xs",mt:"xs",children:x.map((p,R)=>e.jsxs(n.Text,{size:"xs",c:"red",children:[p.email,": ",p.error]},R))})]}),O&&e.jsxs(n.Stack,{gap:"sm",children:[e.jsx(n.Textarea,{size:"sm",value:m,onChange:p=>h(p.currentTarget.value),minRows:2,maxRows:4,radius:"md"}),e.jsx(n.Button,{variant:"filled",color:"blue",onClick:k,fullWidth:!0,radius:"md",disabled:!g,children:"Send invitations"})]})]})}),Yn=o=>{switch(o){case"member":return"green";case"invited":return"orange";case"declined":return"red";case"revoked":return"red";case"expired":return"red";default:return"gray"}},Xn=o=>{switch(o){case"member":return"Member";case"invited":return"Invited";case"declined":return"Declined";case"revoked":return"Revoked";case"expired":return"Expired";default:return"Unknown"}},Kn=o=>{if(o){if(typeof o=="object"&&"type"in o)return o;if(typeof o=="string")return{type:"image",value:o}}},oe=({user:o,isSelected:r=!1,onToggle:t,onUpdateRole:s,onRemoveUser:a,roleOptions:c=[],variant:i="invited",onClick:u})=>{var g;const d=((g=o.name)==null?void 0:g.trim())||o.email,f=()=>{t&&t(o.id)},I=v=>{if(s){const y=v;s(o.id,y)}},m=i==="suggested"||i==="read-only",h=i==="invited"&&c.length>0,[b,j]=l.useState(!1),x=()=>{u==null||u()};return e.jsxs(n.Group,{justify:"space-between",align:"center",wrap:"nowrap",w:"100%",style:{cursor:"pointer",borderRadius:"var(--mantine-radius-md)",padding:"6px"},onClick:x,bg:b?"var(--mantine-color-gray-0)":"transparent",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[e.jsxs(n.Group,{gap:"sm",w:"100%",align:"flex-start",wrap:"nowrap",children:[e.jsx(Z,{avatar:Kn(o.avatar),size:"md",placeholder:d,showPlaceholder:!0}),e.jsxs(n.Stack,{gap:0,w:"100%",justify:"flex-start",align:"flex-start",children:[e.jsxs(n.Group,{gap:"sm",align:"flex-start",wrap:"nowrap",children:[e.jsxs(n.Group,{gap:"sm",align:"flex-start",wrap:"nowrap",children:[e.jsx(n.Text,{size:"sm",fw:500,lineClamp:1,mb:-2,children:d}),o.isCurrentUser&&e.jsx(n.Badge,{size:"xs",variant:"light",color:"gray",radius:"sm",children:"Owner"})]}),o.status!=="member"&&e.jsx(n.Badge,{size:"xs",variant:"light",color:Yn(o.status),radius:"sm",children:Xn(o.status)})]}),e.jsx(n.Text,{size:"xs",c:"dimmed",lineClamp:1,children:o.email})]})]}),e.jsxs(n.Group,{gap:"sm",align:"center",children:[m&&i!=="read-only"&&e.jsx(n.Radio,{checked:r,onChange:f,size:"sm",onClick:v=>v.stopPropagation(),pr:4}),h&&!o.isCurrentUser&&e.jsx(ce,{value:o.role,onChange:I,data:c,placeholder:"Select role",defaultOption:c.find(v=>v.value===o.role),withRemove:!0,onRemove:()=>a==null?void 0:a(o.id)})]})]})},Ne=({opened:o,onClose:r,onInvite:t,onUpdateRole:s,onRemoveUser:a,invitedUsers:c=[],children:i,roleOptions:u=[],suggestedUsers:d=[]})=>{const f=l.useRef(null),{emails:I,setEmails:m,selectedUsers:h,inputText:b,setInputText:j,tagDisplayMap:x,selectedRole:g,setSelectedRole:v,selectedTab:y,setSelectedTab:C,tabHovered:k,setTabHovered:O,filteredUsers:z,handleInvite:M,handleUpdateRole:p,handleRemoveUser:R,handleToggleUser:E,handleAddSuggestedUser:D}=He({onInvite:t,onUpdateRole:s,onRemoveUser:a,invitedUsers:c,suggestedUsers:d,roleOptions:u}),B=U=>{D(U),f.current&&f.current.clearInput()},L=e.jsxs(e.Fragment,{children:[e.jsx(Ue,{ref:f,value:I,onChange:m,onInvite:M,roleOptions:u,selectedRole:g,onRoleChange:v,onInputChange:j,suggestedUsers:d,tagDisplayMap:x}),e.jsx(n.Space,{h:"sm"}),e.jsx(n.ScrollArea,{mah:200,type:"auto",style:{overflow:"visible"},children:e.jsx(n.Box,{children:c.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{size:"sm",fw:500,children:"Already members"}),e.jsx(n.Space,{h:"sm"}),e.jsx(n.Stack,{gap:"sm",children:c.map(U=>e.jsx(oe,{user:U,isSelected:h.includes(U.id),onToggle:E,onUpdateRole:p,onRemoveUser:R,roleOptions:u,variant:"invited"},U.id))})]})})}),z.length>0&&e.jsx(n.ScrollArea,{pt:"sm",mah:200,type:"auto",style:{overflow:"visible"},children:e.jsx(n.Box,{children:z.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(n.Text,{size:"sm",fw:500,children:["Suggested ",b.trim()&&`(filtered by "${b}")`]}),e.jsx(n.Space,{h:"sm"}),e.jsx(n.Stack,{gap:"sm",children:z.map(U=>e.jsx(oe,{user:U,isSelected:h.includes(U.id),onToggle:E,onUpdateRole:p,onRemoveUser:R,roleOptions:u,variant:"suggested",onClick:()=>B(U)},U.id))})]}):null})})]}),Q=e.jsx(e.Fragment,{children:e.jsxs(n.Stack,{gap:"md",p:"sm",children:[e.jsxs(n.Stack,{gap:4,align:"center",children:[e.jsx(n.Text,{size:"sm",fw:500,ta:"center",children:"Publish to the web"}),e.jsx(n.Text,{size:"sm",fw:500,color:"var(--mantine-color-gray-6)",ta:"center",children:"Anyone with the link can view this page"})]}),e.jsx(n.Button,{variant:"filled",size:"xs",radius:"md",fw:500,fz:"var(--mantine-font-size-sm)",ta:"center",children:"Publish"})]})}),V=e.jsx(n.Box,{style:{width:"400px",maxHeight:"600px",overflow:"visible"},children:e.jsx(n.Stack,{gap:"lg",children:e.jsxs(n.Tabs,{color:"black",defaultValue:"invite",styles:{tab:{backgroundColor:"transparent"}},children:[e.jsxs(n.Tabs.List,{px:"var(--mantine-spacing-sm)",pt:"xs",children:[e.jsx(n.Tabs.Tab,{value:"invite",p:0,pb:6,onClick:()=>{C("invite")},onMouseEnter:()=>O("invite"),onMouseLeave:()=>O(null),style:{backgroundColor:"transparent"},children:e.jsx(n.Box,{style:{borderRadius:"var(--mantine-radius-md)",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",border:"none",backgroundColor:k==="invite"?"var(--mantine-color-gray-1)":"transparent",color:y==="invite"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:"Invite"})}),e.jsx(n.Tabs.Tab,{value:"publish",p:0,pb:6,onClick:()=>{C("publish")},onMouseEnter:()=>O("publish"),onMouseLeave:()=>O(null),style:{backgroundColor:"transparent"},children:e.jsx(n.Box,{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 8px",borderRadius:"var(--mantine-radius-md)",border:"none",backgroundColor:k==="publish"?"var(--mantine-color-gray-1)":"transparent",color:y==="publish"?"var(--mantine-color-gray-9)":"var(--mantine-color-gray-6)",cursor:"pointer"},fw:500,fz:"var(--mantine-font-size-sm)",children:"Publish"})})]}),e.jsx(n.Tabs.Panel,{value:"invite",children:e.jsx(n.Box,{p:"sm",children:L})}),e.jsx(n.Tabs.Panel,{value:"publish",children:e.jsx(n.Box,{p:"sm",children:Q})})]})})});return e.jsx(ne,{trigger:i,menuItems:[],opened:o,onClose:r,styles:{dropdown:{padding:"0",borderRadius:"var(--mantine-radius-md)"}},children:V})},Jn=({onInvite:o,onUpdateRole:r,onRemoveUser:t,invitedUsers:s,currentUser:a,roleOptions:c,suggestedUsers:i,label:u="Share"})=>{const[d,f]=l.useState(!1),I=()=>f(!1),m=e.jsx(Ce,{label:u,onClick:()=>f(!0),isActive:d});return e.jsx(Ne,{opened:d,onClose:I,onInvite:o,onUpdateRole:r,onRemoveUser:t,invitedUsers:s,currentUser:a,roleOptions:c,suggestedUsers:i,children:m})},eo=({opened:o,onClose:r,onInvite:t,onUpdateRole:s,onRemoveUser:a,invitedUsers:c=[],roleOptions:i=[],suggestedUsers:u=[]})=>{const d=l.useRef(null),{emails:f,setEmails:I,selectedUsers:m,inputText:h,setInputText:b,tagDisplayMap:j,selectedRole:x,setSelectedRole:g,filteredUsers:v,handleInvite:y,handleUpdateRole:C,handleRemoveUser:k,handleToggleUser:O,handleAddSuggestedUser:z}=He({onInvite:t,onUpdateRole:s,onRemoveUser:a,invitedUsers:c,suggestedUsers:u,roleOptions:i}),M=p=>{z(p),d.current&&d.current.clearInput()};return e.jsx(n.Modal,{opened:o,onClose:r,size:"md",withCloseButton:!1,radius:"md",centered:!0,closeOnClickOutside:!1,closeOnEscape:!0,trapFocus:!1,zIndex:300,children:e.jsxs(n.Stack,{gap:"lg",children:[e.jsxs(n.Group,{justify:"space-between",wrap:"nowrap",children:[e.jsx(n.Text,{size:"md",fw:500,c:"var(--mantine-color-gray-8)",children:"Share"}),e.jsx(H,{icon:w.IconX,size:"md",onClick:r,color:"var(--mantine-color-gray-8)"})]}),e.jsx(Ue,{ref:d,value:f,onChange:I,onInvite:y,roleOptions:i,selectedRole:x,onRoleChange:g,onInputChange:b,suggestedUsers:u,tagDisplayMap:j}),c.length>0&&e.jsxs(n.Box,{children:[e.jsx(n.Text,{size:"sm",fw:500,children:"Already members"}),e.jsx(n.Space,{h:"sm"}),e.jsx(n.Box,{style:{maxHeight:"200px",minHeight:"60px",overflowY:"auto",overflowX:"hidden",paddingRight:"8px",marginRight:"-8px"},children:e.jsx(n.Stack,{gap:"sm",children:c.map(p=>e.jsx(oe,{user:p,isSelected:m.includes(p.id),onToggle:O,onUpdateRole:C,onRemoveUser:k,roleOptions:i,variant:"invited"},p.id))})})]}),v.length>0&&e.jsxs(n.Box,{children:[e.jsxs(n.Text,{size:"sm",fw:500,children:["Suggested ",h.trim()&&`(filtered by "${h}")`]}),e.jsx(n.Space,{h:"sm"}),e.jsx(n.Box,{style:{maxHeight:"200px",minHeight:"60px",overflowY:"auto",overflowX:"hidden",paddingRight:"8px",marginRight:"-8px"},children:e.jsx(n.Stack,{gap:"sm",children:v.map(p=>e.jsx(oe,{user:p,isSelected:m.includes(p.id),onToggle:O,onUpdateRole:C,onRemoveUser:k,roleOptions:i,variant:"suggested",onClick:()=>M(p)},p.id))})})]})]})})},no=({opened:o,onClose:r,options:t=[],onSave:s,onCancel:a,groups:c=[],styles:i})=>{const[u,d]=l.useState("");l.useEffect(()=>{o&&t.length>0?d(t[0].id):o||d("")},[o,t]);const f=()=>{s&&s(),r()},I=()=>{a&&a(),r()},m=()=>{r()},h=t.find(b=>b.id===u);return e.jsxs(n.Modal,{opened:o,onClose:m,size:"90%",centered:!0,closeOnClickOutside:!0,closeOnEscape:!0,withCloseButton:!1,p:"none",styles:{body:{...i==null?void 0:i.body,padding:0,height:"80vh"}},radius:"md",children:[e.jsx(n.FocusTrap.InitialFocus,{}),e.jsxs(n.Box,{style:{display:"flex",height:"100%",...i==null?void 0:i.body},children:[e.jsx(n.Box,{style:{width:"240px",backgroundColor:"var(--mantine-color-gray-0)"},children:e.jsx(n.ScrollArea,{h:"100%",children:e.jsx(n.Stack,{gap:0,p:"sm",children:c.map(b=>e.jsx(n.Box,{mb:"md",children:e.jsxs(l.Fragment,{children:[e.jsx(n.Text,{size:"xs",fw:600,c:"dimmed",m:4,children:b}),t.filter(j=>j.group===b).map(j=>e.jsx(Ie,{label:j.label,icon:j.icon,onClick:()=>d(j.id),isActive:u===j.id},j.id))]},b)}))})})}),e.jsxs(n.Box,{style:{flex:1,display:"flex",flexDirection:"column"},children:[h?e.jsxs(e.Fragment,{children:[e.jsx(n.Box,{p:"md",children:e.jsx(n.Group,{gap:"md",wrap:"nowrap",children:e.jsxs(n.Stack,{gap:4,children:[e.jsx(n.Text,{size:"md",fw:600,children:h.alternateLabel||h.label}),h.description&&e.jsx(n.Text,{size:"sm",c:"var(--mantine-color-gray-6)",children:h.description})]})})}),e.jsx(n.ScrollArea,{style:{flex:1},children:e.jsx(n.Box,{px:"md",children:h.content})})]}):e.jsx(n.Box,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:e.jsx(n.Text,{c:"var(--mantine-color-gray-6)",size:"lg",children:"Select an option from the sidebar"})}),(h==null?void 0:h.saveButton)&&e.jsx(n.Box,{p:"md",children:e.jsxs(n.Group,{justify:"flex-end",gap:"md",children:[e.jsx(n.Button,{variant:"subtle",onClick:I,color:"gray",children:"Cancel"}),e.jsx(n.Button,{onClick:f,color:"blue",children:"Save Changes"})]})})]})]})]})},oo=(o,r="es")=>{const t=new Date,s=typeof o=="string"?new Date(o):o,a=Math.floor((t.getTime()-s.getTime())/1e3),c={es:{now:"ahora",seconds:"segundos",second:"segundo",minutes:"minutos",minute:"minuto",hours:"horas",hour:"hora",days:"días",day:"día",weeks:"semanas",week:"semana",months:"meses",month:"mes",years:"años",year:"año",ago:"hace"},en:{now:"now",seconds:"seconds",second:"second",minutes:"minutes",minute:"minute",hours:"hours",hour:"hour",days:"days",day:"day",weeks:"weeks",week:"week",months:"months",month:"month",years:"years",year:"year",ago:"ago"}},i=c[r]||c.en;if(a<5)return i.now;if(a<60)return r==="es"?`${i.ago} ${a} ${a===1?i.second:i.seconds}`:`${a} ${a===1?i.second:i.seconds} ${i.ago}`;const u=Math.floor(a/60);if(u<60)return r==="es"?`${i.ago} ${u} ${u===1?i.minute:i.minutes}`:`${u} ${u===1?i.minute:i.minutes} ${i.ago}`;const d=Math.floor(u/60);if(d<24)return r==="es"?`${i.ago} ${d} ${d===1?i.hour:i.hours}`:`${d} ${d===1?i.hour:i.hours} ${i.ago}`;const f=Math.floor(d/24);if(f<7)return r==="es"?`${i.ago} ${f} ${f===1?i.day:i.days}`:`${f} ${f===1?i.day:i.days} ${i.ago}`;const I=Math.floor(f/7);if(I<4)return r==="es"?`${i.ago} ${I} ${I===1?i.week:i.weeks}`:`${I} ${I===1?i.week:i.weeks} ${i.ago}`;const m=Math.floor(f/30);if(m<12)return r==="es"?`${i.ago} ${m} ${m===1?i.month:i.months}`:`${m} ${m===1?i.month:i.months} ${i.ago}`;const h=Math.floor(f/365);return r==="es"?`${i.ago} ${h} ${h===1?i.year:i.years}`:`${h} ${h===1?i.year:i.years} ${i.ago}`},to=(o,r="es")=>{const t=typeof o=="string"?new Date(o):o,s={es:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},c=(s[r]||s.en)[t.getMonth()],i=t.getDate();return r==="es"?`${i} ${c}`:`${c} ${i}`},ro=o=>{const r=typeof o=="string"?new Date(o):o,t=new Date;return r.toDateString()===t.toDateString()},so=o=>{const r=typeof o=="string"?new Date(o):o,t=new Date;return t.setDate(t.getDate()-1),r.toDateString()===t.toDateString()},ao=(o,r="es")=>ro(o)?r==="es"?"Hoy":"Today":so(o)?r==="es"?"Ayer":"Yesterday":oo(o,r),io=({notification:o,message:r,markAsRead:t,archiveNotification:s,children:a,actions:c})=>{var I,m,h,b,j;const i=new Date().getTime()-new Date(o.timestamp).getTime()<6048e5?ao(o.timestamp,"en"):to(o.timestamp,"en"),[u,d]=l.useState(!1),f=e.jsxs(n.Group,{bg:"var(--mantine-color-gray-1)",p:4,style:{borderRadius:"var(--mantine-radius-md)"},w:"auto",wrap:"nowrap",gap:0,children:[!o.isRead&&e.jsx(H,{onClick:()=>t(o.id),icon:w.IconCheck}),!o.isArchived&&e.jsx(H,{onClick:()=>s(o.id),icon:w.IconArchive})]});return e.jsxs(n.Box,{p:"sm",bg:u?"var(--mantine-color-gray-0)":"white",style:{cursor:"pointer",borderTop:"1px solid var(--mantine-color-gray-2)"},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[e.jsxs(n.Group,{justify:"space-between",align:"flex-start",gap:"sm",wrap:"nowrap",style:{margin:0},children:[(I=o.metadata)!=null&&I.avatar_url?e.jsx(n.Avatar,{name:(m=o.metadata)==null?void 0:m.fullname,size:"sm",radius:"md",src:(h=o.metadata)==null?void 0:h.avatar_url}):e.jsx(ke,{size:"xs",showText:!1,radius:"xs"}),e.jsxs(n.Stack,{gap:"xs",justify:"flex-start",w:"100%",children:[e.jsx(n.Box,{fz:"sm",m:0,style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden",textOverflow:"ellipsis",minHeight:"unset",height:"auto",whiteSpace:"normal",wordBreak:"break-word"},children:r}),e.jsxs(n.Text,{size:"xs",c:"dimmed",fw:500,style:{whiteSpace:"nowrap"},children:[o.category?((b=o.category)==null?void 0:b.charAt(0).toUpperCase())+((j=o.category)==null?void 0:j.slice(1)):""," ","• ",i]})]}),u?f:!o.isRead&&e.jsx(n.Indicator,{color:"var(--mantine-color-blue-6)",size:10,position:"top-end"})]}),a,c&&e.jsx(n.Group,{justify:"flex-start",align:"flex-start",gap:"xs",wrap:"nowrap",pl:36,pt:8,children:c})]})},co=(o,r,t,s,a)=>{const[c,i]=l.useState(!1),u=l.useRef(null),d=l.useRef(null),f=l.useRef(null);l.useEffect(()=>{i(o)},[o]);const I=l.useCallback(h=>{h[0].isIntersecting&&s&&!a&&t&&t()},[s,a,t]),m=l.useCallback(()=>{if(!(!u.current||!o||!r||!t)){d.current&&(d.current.disconnect(),d.current=null);try{const h=new IntersectionObserver(I,{threshold:.1,rootMargin:"50px"});h.observe(u.current),d.current=h}catch(h){console.error("Failed to setup intersection observer:",h)}}},[o,r,t,I]);return l.useEffect(()=>{if(f.current&&(clearTimeout(f.current),f.current=null),!o||!r||!t){d.current&&(d.current.disconnect(),d.current=null);return}if(!u.current){f.current=setTimeout(()=>m(),50);return}return m(),()=>{f.current&&(clearTimeout(f.current),f.current=null),d.current&&(d.current.disconnect(),d.current=null)}},[o,r,t,m]),l.useEffect(()=>()=>{f.current&&clearTimeout(f.current),d.current&&d.current.disconnect()},[]),{isActive:c,loadMoreRef:u}},lo=({notifications:o,isLoading:r=!1,isLoadingMore:t=!1,hasMore:s=!1,unreadCount:a=0,markAllAsRead:c,archiveAllNotifications:i,markAsRead:u,archiveNotification:d,loadMore:f,onFilterChange:I,currentFilter:m="all",customRenderer:h,opened:b=!1,onOpen:j=()=>{},onClose:x=()=>{},enableInfiniteScroll:g=!0})=>{const v=[{children:"Mark all as read",leftSection:e.jsx(w.IconChecklist,{size:16}),onClick:()=>c()},{children:"Archive all",leftSection:e.jsx(w.IconArchive,{size:16}),onClick:()=>i()}],y=[{children:"All",leftSection:e.jsx(w.IconChecklist,{size:16}),onClick:()=>I==null?void 0:I("all"),active:m==="all"},{children:"Unread",leftSection:e.jsx(w.IconChecklist,{size:16}),onClick:()=>I==null?void 0:I("unread"),active:m==="unread"},{children:"Archived",leftSection:e.jsx(w.IconArchive,{size:16}),onClick:()=>I==null?void 0:I("archived"),active:m==="archived"}],C=z=>h&&z.category&&["welcome","upgrade"].includes(z.category)?h(z,u,d):e.jsx(io,{notification:z,markAsRead:u,archiveNotification:d,message:z.message,actions:z.actions},z.id),{isActive:k,loadMoreRef:O}=co(b,g,f||(()=>{}),s,t);return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{isActive:k,icon:e.jsx(w.IconBell,{strokeWidth:2,color:"var(--mantine-color-gray-7)"}),onClick:()=>{b?x():j()},disabled:!1,variant:"subtle",color:"gray",fullWidth:!0,style:{borderRadius:"var(--mantine-radius-md)",cursor:"pointer"},label:"Inbox",indicator:a>0?a>99?"99+":a:void 0}),e.jsxs(n.Drawer,{opened:b,onClose:x,position:"left",size:400,style:{position:"relative",left:300,zIndex:0,borderLeft:"1px solid var(--mantine-color-gray-2)"},withCloseButton:!1,padding:0,withOverlay:!0,closeOnClickOutside:!0,closeOnEscape:!0,overlayProps:{backgroundOpacity:0,blur:0},children:[e.jsx(n.FocusTrap.InitialFocus,{}),e.jsxs(n.Box,{p:0,h:"100%",style:{display:"flex",flexDirection:"column"},children:[e.jsx(n.Box,{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"var(--mantine-color-white)"},children:e.jsxs(n.Group,{justify:"space-between",align:"center",gap:"xs",style:{borderRadius:"var(--mantine-radius-md)"},px:"sm",py:"md",children:[e.jsx(n.Text,{size:"sm",fw:500,children:"Inbox"}),e.jsxs(n.Group,{gap:"xs",children:[e.jsx(ne,{position:"bottom-end",menuItems:y,trigger:e.jsx(H,{icon:w.IconFilter})}),e.jsx(ne,{position:"bottom-end",menuItems:v,trigger:e.jsx(H,{onClick:()=>{},icon:w.IconDots,changeIconOnHover:!0,iconHovered:w.IconDots})})]})]})}),e.jsxs(n.Box,{style:{flex:1,overflow:"auto"},children:[r&&o.length===0?e.jsx(n.Stack,{gap:0,w:"100%",h:"100%",justify:"center",align:"center",py:"xl",children:e.jsx(n.Loader,{})}):o.length>0?e.jsx(n.Stack,{gap:0,children:o.map(z=>C(z))}):e.jsxs(n.Stack,{gap:0,w:"100%",h:"100%",justify:"center",align:"center",py:"xl",children:[e.jsx(w.IconInbox,{size:24,color:"var(--mantine-color-gray-6)"}),e.jsx(n.Text,{size:"sm",fw:500,c:"dimmed",ta:"center",mt:"sm",children:"No new updates"})]}),e.jsx(n.Box,{ref:O,style:{padding:"16px",display:g?"flex":"none",justifyContent:"center",alignItems:"center",minHeight:"60px"},children:t&&e.jsxs(n.Group,{display:"flex",ta:"center",gap:"xs",children:[e.jsx(n.Loader,{size:"sm",color:"gray.5"}),e.jsx(n.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more ..."})]})}),t&&!g&&e.jsxs(n.Group,{display:"flex",ta:"center",gap:"xs",children:[e.jsx(n.Loader,{size:"sm",color:"gray.5"}),e.jsx(n.Text,{size:"sm",c:"dimmed",fw:500,children:"Loading more ..."})]}),!g&&s&&f&&e.jsx(n.Button,{color:"var(--mantine-color-gray-3)",variant:"subtle",onClick:f,loading:t,disabled:t,style:{alignSelf:"center"},children:t?"Loading...":"Load More"})]})]})]})]})},uo=({header:o,body:r,footer:t,withBorder:s=!0,position:a="left",bg:c="var(--mantine-color-gray-0)"})=>{const[i,u]=l.useState(!1),d=()=>{if(!s)return{};const f="var(--mantine-color-gray-3)",I="1px";return a==="left"?{borderRight:`${I} solid ${f}`}:a==="right"?{borderLeft:`${I} solid ${f}`}:{}};return e.jsxs(n.Stack,{gap:"sm",h:"100%",p:"sm",bg:c,style:d(),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[o&&e.jsx(n.Box,{children:typeof o=="function"?o({hovered:i}):o}),r&&e.jsx(n.Box,{style:{flex:1,minHeight:0,width:"100%",overflow:"hidden"},children:typeof r=="function"?r({hovered:i}):r}),t&&e.jsx(n.Box,{children:typeof t=="function"?t({hovered:i}):t})]})},We=l.createContext(void 0),fo=({children:o})=>{const[r,{open:t,close:s}]=en.useDisclosure(!1),a={openedNotificationSidebar:r,openNotificationSidebar:t,closeNotificationSidebar:s};return e.jsx(We.Provider,{value:a,children:o})},Io=()=>{const o=l.useContext(We);if(o===void 0)throw new Error("useNavbar must be used within an NavbarProvider");return o},$e=({workspace:o,currentUserId:r,currentWorkspaceId:t,onClick:s})=>{const a=t===o.id,c=r&&o.ownerId===r;return e.jsxs(n.Box,{onClick:s,style:{display:"flex",alignItems:"center",padding:"6px",borderRadius:"var(--mantine-radius-md)",cursor:"pointer",gap:"8px",width:"100%",boxSizing:"border-box"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)"},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(Z,{size:"xs",avatar:typeof o.avatar=="string"?{type:"image",value:o.avatar}:o.avatar,placeholder:o.name,showPlaceholder:!0,style:{flexShrink:0}}),e.jsx(n.Text,{size:"sm",fw:500,c:"gray.9",truncate:!0,style:{flex:1,minWidth:0},children:o.name}),e.jsxs(n.Box,{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0,paddingLeft:"8px"},children:[a&&e.jsx(w.IconCheck,{size:16,color:"var(--mantine-color-blue-6)"}),c&&e.jsx(n.Badge,{size:"xs",variant:"light",color:"yellow",radius:"sm",children:"Owner"})]})]})},po="_menuItem_3gic2_1",ho="_workspaceButton_3gic2_14",go="_workspaceText_3gic2_24",xo="_scrollWrapper_3gic2_30",de={menuItem:po,workspaceButton:ho,workspaceText:go,scrollWrapper:xo},mo=({workspaces:o=[],currentWorkspace:r,currentUserId:t,isLoading:s=!1,error:a=null,onWorkspaceSelect:c,onCreateWorkspace:i,emptyMessage:u="No workspaces found",loadingMessage:d="Loading workspaces...",errorMessage:f="Failed to load workspaces",className:I,onCloseSidebar:m,sidebarHovered:h=!1,children:b,menuItems:j})=>{const[x,g]=l.useState(!1),[v,y]=l.useState(""),C=l.useMemo(()=>v?o.filter(M=>{var p;return M.name.toLowerCase().includes(v.toLowerCase())||((p=M.ownerEmail)==null?void 0:p.toLowerCase().includes(v.toLowerCase()))}):o,[o,v]),k=M=>{c==null||c(M.id),g(!1),y("")};if(s)return e.jsxs(n.Group,{gap:"xs",children:[e.jsx(n.Loader,{size:"sm"}),e.jsx(n.Text,{size:"sm",c:"dimmed",children:d})]});if(a)return e.jsx(n.Alert,{color:"red",title:"Error",children:f});const[O,z]=l.useState(h);return o.length===0&&!s&&!a?e.jsx(n.Box,{children:e.jsx(n.Text,{size:"sm",c:"dimmed",children:u})}):e.jsxs(n.Menu,{opened:x,onOpen:()=>g(!0),onClose:()=>g(!1),position:"bottom-start",styles:{dropdown:{width:"350px",overflow:"hidden"}},withinPortal:!0,children:[e.jsx(n.Menu.Target,{children:e.jsx(n.Box,{w:"100%",onClick:()=>g(!x),style:{padding:"6px",display:"flex",alignItems:"center",borderRadius:"var(--mantine-radius-md)",cursor:"pointer"},className:`${de.workspaceButton} ${I||""}`,bg:O||x?"var(--mantine-color-gray-1)":"transparent",onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:e.jsx(n.Group,{gap:"xs",wrap:"nowrap",style:{width:"100%",overflow:"hidden"},children:r?e.jsxs(e.Fragment,{children:[e.jsx(Z,{size:"xs",avatar:typeof r.avatar=="string"?{type:"image",value:r.avatar}:r.avatar,placeholder:r.name,showPlaceholder:!0,style:{flexShrink:0}}),e.jsx(n.Text,{size:"sm",fw:500,c:"gray.9",truncate:!0,style:{flex:1,minWidth:0},children:r.name}),e.jsxs(n.Group,{gap:4,wrap:"nowrap",style:{flexShrink:0},children:[e.jsx(n.ActionIcon,{radius:"md",size:"md",color:"gray",variant:"subtle",onClick:()=>g(!x),children:e.jsx(w.IconChevronDown,{size:20,strokeWidth:2,color:"var(--mantine-color-gray-7)"})}),(O||h)&&e.jsx(H,{icon:w.IconChevronsLeft,size:"md",color:"gray",variant:"subtle",onClick:()=>{m==null||m()}})]})]}):e.jsx(n.Text,{size:"sm",c:"dimmed",children:"Select workspace"})})})}),e.jsx(n.Menu.Dropdown,{style:{borderRadius:"var(--mantine-radius-md)"},p:0,children:e.jsxs(n.Stack,{gap:0,children:[b,e.jsx(n.Menu.Divider,{style:{margin:"1px 0px"}}),e.jsx(n.Stack,{gap:0,px:4,children:C.length===0?e.jsx(n.Menu.Item,{disabled:!0,children:e.jsx(n.Text,{size:"sm",c:"dimmed",children:u})}):e.jsxs(e.Fragment,{children:[e.jsxs(n.Group,{justify:"space-between",align:"center",p:4,children:[e.jsx(n.Text,{size:"xs",c:"dimmed",fw:500,p:4,truncate:!0,children:"Workspaces"}),i&&e.jsx(n.Anchor,{onClick:()=>{i(),g(!1)},size:"xs",underline:"never",fw:500,p:4,truncate:!0,style:{display:"flex",alignItems:"center",gap:"4px"},children:"Add"})]}),e.jsx("div",{className:de.scrollWrapper,children:e.jsx(n.ScrollArea,{mah:150,scrollbarSize:6,scrollHideDelay:0,children:e.jsx(n.Stack,{gap:0,mb:6,children:C.map(M=>e.jsx(n.Box,{onClick:()=>k(M),className:de.menuItem,style:{padding:0,borderRadius:"var(--mantine-radius-md)",cursor:"pointer",overflow:"hidden"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},children:e.jsx($e,{workspace:M,currentUserId:t,currentWorkspaceId:r==null?void 0:r.id,onClick:()=>k(M)})},M.id))})})})]})}),j&&e.jsx(n.Menu.Divider,{style:{margin:"1px 0px"}}),j&&e.jsx(n.Box,{p:4,children:j==null?void 0:j.map(M=>e.jsx(n.MenuItem,{onClick:M.onClick,leftSection:M.icon,children:M.label,color:M.color,"data-danger":M.color,fw:500,style:{height:"40px",borderRadius:"var(--mantine-radius-md)",padding:"6px"}},M.label))})]})})]})},yo=({opened:o,onClose:r,children:t,...s})=>e.jsxs(n.Modal,{withCloseButton:!1,opened:o,onClose:r,size:"70%",centered:!0,overlayProps:{backgroundOpacity:.55},styles:{content:{minHeight:"100%"}},padding:"md",...s,children:[e.jsxs(n.Group,{justify:"space-between",wrap:"nowrap",children:[e.jsx(n.Group,{justify:"space-between",wrap:"nowrap",gap:"xs",children:e.jsx(H,{icon:w.IconMaximize,size:"md",onClick:()=>{}})}),e.jsxs(n.Group,{justify:"space-between",gap:"xs",children:[e.jsx(H,{icon:w.IconStar,size:"md",onClick:()=>{}}),e.jsx(H,{icon:w.IconDots,size:"md",onClick:()=>{}})]})]}),t]}),vo=({opened:o,onClose:r,content:t,position:s="right",size:a="xl"})=>e.jsxs(n.Drawer,{opened:o,onClose:r,position:s,size:a,padding:"md",withCloseButton:!1,children:[e.jsxs(n.Group,{justify:"space-between",wrap:"nowrap",children:[e.jsxs(n.Group,{justify:"space-between",wrap:"nowrap",gap:"xs",children:[e.jsx(H,{icon:w.IconChevronsRight,size:"md",onClick:r}),e.jsx(H,{icon:w.IconMaximize,size:"md",onClick:()=>{}})]}),e.jsxs(n.Group,{justify:"space-between",gap:"xs",children:[e.jsx(H,{icon:w.IconStar,size:"md",onClick:()=>{}}),e.jsx(H,{icon:w.IconDots,size:"md",onClick:()=>{}})]})]}),t]}),jo=({children:o})=>e.jsx(n.Box,{style:{minHeight:"100vh",width:"100%",maxWidth:"100%",margin:"0 auto"},id:"full-page",children:o}),Ge=n.createTheme({primaryColor:"blue",fontFamily:"Inter, system-ui, Avenir, Helvetica, Arial, sans-serif",fontFamilyMonospace:"Monaco, Courier, monospace",headings:{fontFamily:"Inter, system-ui, Avenir, Helvetica, Arial, sans-serif"},colors:{},components:{}});function bo({children:o,theme:r}){return e.jsxs(n.MantineProvider,{theme:r||Ge,children:[e.jsx(nn.Notifications,{}),e.jsx(on.ModalsProvider,{children:e.jsx(tn.DatesProvider,{settings:{firstDayOfWeek:0},children:o})})]})}exports.ActionButton=H;exports.AvatarSelector=Gn;exports.BoxAvatar=Z;exports.CenterPeek=yo;exports.EmojiAvatar=ye;exports.ExpandableSearch=Me;exports.FilterDropdown=xn;exports.FullPage=jo;exports.GenericTable=Te;exports.IconAvatar=be;exports.ImageAvatar=we;exports.InvitedUserCard=oe;exports.Logo=ke;exports.Menu=ne;exports.ModalSettings=no;exports.NavButton=Ie;exports.NavLink=yn;exports.Navbar=uo;exports.NavbarProvider=fo;exports.NotificationSidebar=lo;exports.PlaceholderAvatar=ie;exports.PopoverItem=Oe;exports.PopoverSelector=ce;exports.ShareButton=Jn;exports.ShareMenu=Ne;exports.ShareModal=eo;exports.SidePeek=vo;exports.TextButton=Ce;exports.ThemeProvider=bo;exports.WorkspaceSelector=mo;exports.WorkspaceSelectorItem=$e;exports.getInitialsFromName=Se;exports.theme=Ge;exports.useNavbar=Io;
|