@krit-llc/krit-ui 0.0.78 → 0.0.79

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.
@@ -98,7 +98,7 @@
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const Q1=On("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),J1=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_2378_50984)"},c.createElement("path",{d:"M9.17162 7.75736L7.7574 9.17157L10.5858 12L7.7574 14.8284L9.17162 16.2426L12 13.4142L14.8285 16.2426L16.2427 14.8284L13.4143 12L16.2427 9.17157L14.8285 7.75736L12 10.5858L9.17162 7.75736ZM4.92898 4.92893C1.02575 8.83216 1.02575 15.1678 4.92898 19.0711C8.83221 22.9743 15.1679 22.9743 19.0711 19.0711C22.9743 15.1678 22.9743 8.83216 19.0711 4.92893C15.1679 1.0257 8.83221 1.0257 4.92898 4.92893ZM17.6569 17.6569C14.5386 20.7752 9.46153 20.7752 6.34319 17.6569C3.22485 14.5385 3.22485 9.46149 6.34319 6.34315C9.46153 3.22481 14.5386 3.22481 17.6569 6.34315C20.7752 9.46149 20.7752 14.5385 17.6569 17.6569Z",fill:"currentColor"})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_2378_50984"},c.createElement("rect",{width:24,height:24,fill:"white"})))),tw={...{expand:"Expand",empty:"Empty",confirmAction:"Confirm action",warning:"Warning",maxNChars:"Max charts",cancellation:"Cancel",displayBy:"Display by",selected:"Selected",all:"All",of:"of",selectDate:"Select date",search:"Search...",notFound:"Not found",networkError:"Network error",refetch:"Refetch",attachFile:"Attach file",errorOccurred:"Error occurred",noMediaFiles:"No media files",networkErrorDescription:"Network error description",confirmDeleteMedia:"Are you sure you want to delete the file?",delete:"Delete",imageSizeLimitMB:"Image size limit",audioSizeLimitMB:"Audio size limit",pdfSizeLimitMB:"PDF size limit",videoSizeLimitMB:"Video size limit",maxSizeOfFilesMB:"Max size of files",mb:"Mb",apply:"Apply",showAll:"Show all",chooseAll:"Choose all",withoutSort:"Without sort",listView:"List view",tableView:"Table view"},sorting:"Sorting",direction:"Direction",ascending:"Ascending",descending:"Descending",filterContains:"Contains",filterEquals:"Equals",filterIn:"In list",filterNotIn:"Not in list",filterBetween:"Between",filterIsNull:"Is empty",filterIsNotNull:"Is not empty",filterOperator:"Operator",filterValue:"Value",filterValues:"Values",filterFrom:"From",filterTo:"To",filterAnd:"AND",filterAddCondition:"Add condition",filterRemoveCondition:"Remove condition",filterRemoveValue:"Remove value",filterOnePerLine:"One value per line",filterInvalid:"Check the values, range and selection limit",filterLoading:"Loading…",filterLoadMore:"Load more",filterRetry:"Retry",filterReset:"Clear filter",filterTitle:"Filter",sortReset:"Clear sorting"},r5={theme:"system",setTheme:()=>null,toggleTheme:()=>null,translations:tw},ea=k.createContext(r5);function nw({children:e,defaultTheme:n="system",storageKey:t="app-ui-theme",themeVersion:r="Krit",...o}){const[a,s]=k.useState(()=>localStorage.getItem(t)||n);k.useEffect(()=>{const l=window.document.documentElement;Array.from(l.classList).filter(f=>f.startsWith("light")||f.startsWith("dark")).forEach(f=>l.classList.remove(f));const d=a==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;a==="system"&&s(d),l.classList.add(d),r&&l.classList.add(`${d}${r}`)},[a,r]);const i={theme:a,setTheme:l=>{localStorage.setItem(t,l),s(l)},toggleTheme:()=>{const l=a==="light"?"dark":"light";i.setTheme(l)},translations:{...r5.translations,...o.translations}};return u.jsx(ea.Provider,{...o,value:i,children:e})}const ot=()=>{const e=k.useContext(ea);return{t:t=>{var r;return e.translations?((r=e.translations)==null?void 0:r[t])===void 0?(console.warn(`KRIT-UI: Translation for key ${t} not found`),t):e.translations[t]:(console.warn("KRIT-UI: Translations not found"),t)}}},Dr=({style:e,className:n})=>u.jsx("div",{style:e,className:P("h-full w-full flex items-center justify-center",n),children:u.jsx(Tr,{className:"h-8 w-8 animate-spin text-foreground-theme"})}),ta=({className:e,textSize:n="base",isLoading:t,isError:r,center:o,inline:a,onRefetch:s})=>{const{t:i}=ot();return!t&&!r?null:u.jsxs("div",{className:P("flex gap-2 text-base select-none",`text-${n}`,o&&"items-center",a?"ml-2 inline-flex":"mt-3 flex-col",e),children:[t&&u.jsx(Dr,{className:n==="base"?"w-7":"w-5"}),r&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-icon",children:i("networkError")}),s&&u.jsx("span",{className:"text-primary cursor-pointer",onClick:s,children:i("refetch")})]})]})},yo=c.forwardRef(({triggerClassName:e,clearable:n,borderless:t,isLoading:r,isError:o,error:a,readOnly:s,autoSelectSingleOption:i,renderValue:l=w=>w.label,renderOption:d=w=>w.label,onRefetch:f,onChange:h,onValueChange:g,onClick:C,onOpenChange:v,...p},m)=>{const[w,y]=c.useState(p.value||""),b=c.useRef(!1),S=c.useCallback(E=>{var M;p.options.length&&(y(E),g?g(E):h==null||h(E,((M=p.options.find(L=>L.value===E))==null?void 0:M.label)||""))},[p.options,g,h]);return c.useEffect(()=>{y(p.value||"")},[p.value]),c.useEffect(()=>{if(i&&p.options.length===1&&!w&&!b.current){const E=p.options[0];S(E.value),b.current=!0}},[i,p.options,w,S]),u.jsxs(Gd,{...p,value:w,onValueChange:S,onOpenChange:C||v,children:[u.jsxs(ra,{ref:m,className:P(t&&"bg-background-secondary border-line-primary text-base",a?"border-line-error focus-visible:border-line-error":"",s&&"cursor-not-allowed pointer-events-none opacity-95",e),children:[u.jsx(na,{placeholder:p.placeholder,children:l(p.options.find(E=>E.value===w)??{label:"",value:""})}),n&&w?u.jsx("div",{className:P("flex items-center justify-center w-6 h-6 shrink-0 cursor-pointer ml-auto pointer-events-auto z-10",s&&"cursor-not-allowed pointer-events-none opacity-95"),onMouseDown:E=>{E.stopPropagation(),E.preventDefault(),s||(b.current=!0,S==null||S(""))},onClick:E=>{E.stopPropagation(),E.preventDefault(),s||(b.current=!0,S==null||S(""))},children:u.jsx(J1,{className:"w-6 h-6 text-icon-fade-contrast pointer-events-none"})}):u.jsx(Ov,{asChild:!0,children:u.jsx(pr,{className:"min-h-6 min-w-6 text-icon-fade-contrast ml-auto"})})]}),u.jsxs(oa,{className:P(r&&"min-h-16",o&&"min-h-20"),children:[u.jsx(ta,{isLoading:r,isError:o,textSize:"sm",center:!0,onRefetch:f}),p.options.length>100?u.jsx(Jd,{height:384,itemCount:p.options.length,itemSize:36,width:"100%",children:({index:E,style:M})=>u.jsx(bo,{value:p.options[E].value,disabled:p.options[E].disabled,style:M,children:d(p.options[E])})}):p.options.map(E=>u.jsx(bo,{value:E.value,disabled:E.disabled,children:d(E)},E.value))]})]})});yo.displayName="Select";const na=c.forwardRef(({className:e,...n},t)=>u.jsx(Iv,{ref:t,className:P("text-sm text-foreground-primary font-normal",e),...n}));na.displayName="SelectValue";const ra=c.forwardRef(({className:e,children:n,...t},r)=>u.jsx(Pv,{ref:r,className:P("relative flex h-9 w-full items-center gap-1 rounded-lg border border-line-primary bg-[transparent] px-3 py-2 text-sm font-normal tracking-[0.1px] truncate leading-5 text-left text-foreground ring-offset-background transition-colors duration-300 ease-in-out data-[placeholder]:text-foreground-secondary hover:bg-background-contrast-fade/20 focus:outline-none focus:border-line-focused disabled:cursor-not-allowed disabled:opacity-50 [&>span]:pr-3 [&>span]:truncate [&>span]:mr-auto",e),...t,children:n}));ra.displayName="SelectTrigger";const oa=c.forwardRef(({className:e,children:n,position:t="popper",...r},o)=>u.jsx(Tv,{children:u.jsx(Dv,{ref:o,className:P("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-line-primary bg-background text-popover-foreground shadow-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:t,...r,children:u.jsx(_v,{className:P("py-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})}));oa.displayName="SelectContent";const o5=c.forwardRef(({className:e,...n},t)=>u.jsx(Vv,{ref:t,className:P("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...n}));o5.displayName="SelectLabel";const bo=c.forwardRef(({className:e,children:n,...t},r)=>u.jsxs(Hv,{ref:r,className:P("relative flex w-full cursor-default select-none items-center py-2 pl-3 pr-8 text-sm outline-none data-[highlighted]:bg-background-theme-fade data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&[data-state=checked]>span:first-child]:pr-2",e),...t,children:[u.jsx(Av,{asChild:!0,children:u.jsx("span",{className:"truncate block",title:typeof n=="string"?n:void 0,children:n})}),u.jsx("span",{className:"absolute right-4 flex h-3.5 w-3.5 items-center justify-center text-foreground-secondary",children:u.jsx(Fv,{children:u.jsx(pi,{className:"h-4 w-4"})})})]}));bo.displayName="SelectItem";const a5=c.forwardRef(({className:e,...n},t)=>u.jsx($v,{ref:t,className:P("-mx-1 my-1 h-px bg-muted",e),...n}));a5.displayName="SelectSeparator";const rw=e=>{if(!e)return;const{day_today:n,day_selected:t,day_range_start:r,day_range_end:o,day_range_middle:a,day_outside:s,day_disabled:i,day_hidden:l,...d}=e;return{...d,...n&&{today:P(d.today,n)},...t&&{selected:P(d.selected,t)},...r&&{range_start:P(d.range_start,r)},...o&&{range_end:P(d.range_end,o)},...a&&{range_middle:P(d.range_middle,a)},...s&&{outside:P(d.outside,s)},...i&&{disabled:P(d.disabled,i)},...l&&{hidden:P(d.hidden,l)}}};function aa({className:e,classNames:n,showOutsideDays:t=!0,...r}){const o=rw(n);return u.jsx(Dp,{showOutsideDays:t,captionLayout:"dropdown",navLayout:"around",startMonth:new Date(new Date().getFullYear()-6,0),endMonth:new Date(new Date().getFullYear()+6,11),className:P("relative w-fit p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"relative",dropdowns:"flex items-center justify-center gap-2 text-[15px] capitalize font-medium max-w-[calc(100%-3.5rem)] mx-auto",months_dropdown:"flex [&>select:focus-visible]:outline-none [&>select]:capitalize",years_dropdown:"flex [&>select:focus-visible]:outline-none",month_caption:"relative flex h-7 w-full items-center justify-center",caption_label:"hidden",button_previous:P(xn({variant:"fade-contrast-outlined"}),"absolute left-0 top-0 z-30 h-7 w-7 shrink-0 bg-[transparent] border-none text-primary p-0 hover:bg-[transparent] hover:text-primary/80"),button_next:P(xn({variant:"fade-contrast-outlined"}),"absolute right-0 top-0 z-30 h-7 w-7 shrink-0 bg-[transparent] border-none text-primary p-0 hover:bg-[transparent] hover:text-primary/80"),month_grid:"mt-4 w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-foreground-secondary rounded-md w-9 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:P("h-9 w-9 p-0 text-center relative focus-within:relative focus-within:z-20","[&.day-range-start]:rounded-l-md [&.day-range-end]:rounded-r-md","[&.day-range-middle]:bg-background-tertiary","[&.day-range-start_button]:rounded-md [&.day-range-end_button]:rounded-md"),day_button:P(xn({variant:"fade-contrast-transparent"}),"h-9 w-9 p-0 text-sm font-normal transition-all hover:bg-background-success-fade hover:text-foreground","[td[aria-selected=true]_&]:opacity-100"),range_start:"day-range-start rounded-l-md [&_button]:!rounded-md [&_button]:!bg-background-theme [&_button]:!text-foreground-on-contrast [&_button]:!opacity-100 [&_button]:hover:!bg-background-theme/80",range_end:"day-range-end rounded-r-md [&_button]:!rounded-md [&_button]:!bg-background-theme [&_button]:!text-foreground-on-contrast [&_button]:!opacity-100 [&_button]:hover:!bg-background-theme/80",selected:"[&:not(.day-range-middle)_button]:bg-background-theme [&:not(.day-range-middle)_button]:text-foreground-on-contrast [&:not(.day-range-middle)_button]:hover:bg-background-theme/80 [&:not(.day-range-middle)_button]:hover:text-foreground-on-contrast [&:not(.day-range-middle)_button]:focus:bg-background-theme [&:not(.day-range-middle)_button]:focus:text-foreground-on-contrast",today:"day-today !font-bold [&_button]:!font-bold [&:not(.day-range-start):not(.day-range-end)_button]:bg-background-tertiary [&:not(.day-range-start):not(.day-range-end)_button]:text-foreground-theme [&:not(.day-range-start):not(.day-range-end)_button]:hover:bg-background-tertiary [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:!bg-background-theme [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:!text-foreground-on-contrast [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:hover:!bg-background-theme/80",outside:"day-outside [&_button]:text-foreground-secondary [&_button]:opacity-50 [&_button]:hover:text-foreground/90 [&[aria-selected=true]_button]:!opacity-100 [&[aria-selected=true]_button]:!text-foreground-on-contrast",disabled:"[&_button]:text-foreground-secondary [&_button]:opacity-50",range_middle:"day-range-middle bg-background-tertiary [&_button]:!bg-transparent [&_button]:!font-normal [&_button]:text-foreground [&_button]:rounded-none [&_button]:hover:!bg-transparent [&_button]:hover:text-foreground",hidden:"invisible",...o},components:{Chevron:({orientation:a})=>a==="left"?u.jsx(Rd,{}):u.jsx(jd,{}),Dropdown:({options:a,...s})=>{var i;return u.jsxs(Gd,{name:s.name,value:(i=s.value)==null?void 0:i.toString(),onValueChange:l=>{var d;return(d=s.onChange)==null?void 0:d.call(s,{target:{value:l}})},children:[u.jsx(ra,{className:P(s.className,"w-auto shrink-0 overflow-visible text-clip bg-[transparent] border-none shadow-none p-0 gap-0 h-auto hover:bg-[transparent] focus:border-none focus-visible:border-none data-[state=open]:bg-[transparent] capitalize font-bold [&>svg]:ml-1 [&>span]:pr-1 [&>span]:overflow-visible [&>span]:text-clip"),children:u.jsx(na,{placeholder:s["aria-label"]})}),u.jsx(oa,{children:a==null?void 0:a.map(l=>u.jsx(bo,{value:l.value.toString(),disabled:l.disabled,children:l.label},l.value))})]})}},...r})}aa.displayName="Calendar";const Kn=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"currentColor"})),Ci=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M6 19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V9C18 7.9 17.1 7 16 7H8C6.9 7 6 7.9 6 9V19ZM18 4H15.5L14.79 3.29C14.61 3.11 14.35 3 14.09 3H9.91C9.65 3 9.39 3.11 9.21 3.29L8.5 4H6C5.45 4 5 4.45 5 5C5 5.55 5.45 6 6 6H18C18.55 6 19 5.55 19 5C19 4.45 18.55 4 18 4Z",fill:"currentColor"})),s5=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.43597 5.18404C3 6.03969 3 7.15979 3 9.4V14.6C3 16.8402 3 17.9603 3.43597 18.816C3.81947 19.5686 4.43139 20.1805 5.18404 20.564C6.03969 21 7.15979 21 9.4 21H14.6C16.8402 21 17.9603 21 18.816 20.564C19.5686 20.1805 20.1805 19.5686 20.564 18.816C21 17.9603 21 16.8402 21 14.6V10.151C21 9.1726 21 8.68342 20.8895 8.22307C20.7915 7.81493 20.6299 7.42475 20.4106 7.06686C20.1632 6.6632 19.8173 6.3173 19.1255 5.6255L18.3745 4.87452C17.6827 4.18271 17.3368 3.83681 16.9331 3.58944C16.5753 3.37012 16.1851 3.20851 15.7769 3.11052C15.3166 3 14.8274 3 13.849 3H9.4C7.15979 3 6.03969 3 5.18404 3.43597C4.43139 3.81947 3.81947 4.43139 3.43597 5.18404ZM5 9.4V14.6C5 15.7531 5.00156 16.4977 5.04785 17.0643C5.09225 17.6077 5.1676 17.8091 5.21799 17.908C5.40973 18.2843 5.71569 18.5903 6.09202 18.782C6.19091 18.8324 6.39235 18.9078 6.93567 18.9521C6.95686 18.9539 6.9783 18.9555 7 18.9572V15C7 13.3431 8.34315 12 10 12H14C15.6569 12 17 13.3431 17 15V18.9572C17.0217 18.9555 17.0431 18.9539 17.0643 18.9521C17.6077 18.9078 17.8091 18.8324 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8324 17.8091 18.9078 17.6077 18.9521 17.0643C18.9984 16.4977 19 15.7531 19 14.6V10.151C19 9.07741 18.9871 8.8666 18.9447 8.68996C18.8957 8.48589 18.8149 8.2908 18.7053 8.11186C18.6104 7.95697 18.4704 7.79882 17.7113 7.0397L16.9603 6.28873C16.2012 5.52961 16.043 5.38963 15.8881 5.29472C15.7092 5.18506 15.5141 5.10425 15.31 5.05526C15.2345 5.03713 15.1528 5.0244 15 5.01577V7C15 8.10457 14.1046 9 13 9H9C7.89543 9 7 8.10457 7 7V5.04285L6.93567 5.04785C6.39235 5.09225 6.19091 5.1676 6.09202 5.21799C5.71569 5.40973 5.40973 5.71569 5.21799 6.09202C5.1676 6.19091 5.09225 6.39235 5.04785 6.93567C5.00156 7.50235 5 8.24689 5 9.4ZM15 18.9999V15C15 14.4477 14.5523 14 14 14H10C9.44771 14 9 14.4477 9 15V18.9999C9.12765 19 9.26085 19 9.4 19H14.6C14.7391 19 14.8723 19 15 18.9999ZM13 5V7H9V5.00014L13 5Z",fill:"currentColor"}));function ow(e,n){return c.useReducer((t,r)=>n[t][r]??t,e)}var qe=e=>{const{present:n,children:t}=e,r=aw(n),o=typeof t=="function"?t({present:r.isPresent}):c.Children.only(t),a=ye(r.ref,sw(o));return typeof t=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};qe.displayName="Presence";function aw(e){const[n,t]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,l]=ow(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const d=sa(r.current);a.current=i==="mounted"?d:"none"},[i]),tt(()=>{const d=r.current,f=o.current;if(f!==e){const g=a.current,C=sa(d);e?l("MOUNT"):C==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(f&&g!==C?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),tt(()=>{if(n){let d;const f=n.ownerDocument.defaultView??window,h=C=>{const p=sa(r.current).includes(CSS.escape(C.animationName));if(C.target===n&&p&&(l("ANIMATION_END"),!o.current)){const m=n.style.animationFillMode;n.style.animationFillMode="forwards",d=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=m)})}},g=C=>{C.target===n&&(a.current=sa(r.current))};return n.addEventListener("animationstart",g),n.addEventListener("animationcancel",h),n.addEventListener("animationend",h),()=>{f.clearTimeout(d),n.removeEventListener("animationstart",g),n.removeEventListener("animationcancel",h),n.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(d=>{r.current=d?getComputedStyle(d):null,t(d)},[])}}function sa(e){return(e==null?void 0:e.animationName)||"none"}function sw(e){var r,o;let n=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var ia="Checkbox",[iw]=it(ia),[lw,mi]=iw(ia);function cw(e){const{__scopeCheckbox:n,checked:t,children:r,defaultChecked:o,disabled:a,form:s,name:i,onCheckedChange:l,required:d,value:f="on",internal_do_not_use_render:h}=e,[g,C]=wt({prop:t,defaultProp:o??!1,onChange:l,caller:ia}),[v,p]=c.useState(null),[m,w]=c.useState(null),y=c.useRef(!1),b=v?!!s||!!v.closest("form"):!0,S={checked:g,disabled:a,setChecked:C,control:v,setControl:p,name:i,form:s,value:f,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:Tn(o)?!1:o,isFormControl:b,bubbleInput:m,setBubbleInput:w};return u.jsx(lw,{scope:n,...S,children:uw(h)?h(S):r})}var i5="CheckboxTrigger",l5=c.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:t,...r},o)=>{const{control:a,value:s,disabled:i,checked:l,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:g,isFormControl:C,bubbleInput:v}=mi(i5,e),p=ye(o,f),m=c.useRef(l);return c.useEffect(()=>{const w=a==null?void 0:a.form;if(w){const y=()=>h(m.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[a,h]),u.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":Tn(l)?"mixed":l,"aria-required":d,"data-state":h5(l),"data-disabled":i?"":void 0,disabled:i,value:s,...r,ref:p,onKeyDown:ee(n,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:ee(t,w=>{h(y=>Tn(y)?!0:!y),v&&C&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})});l5.displayName=i5;var vi=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:l,onCheckedChange:d,form:f,...h}=e;return u.jsx(cw,{__scopeCheckbox:t,checked:o,defaultChecked:a,disabled:i,required:s,onCheckedChange:d,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:g})=>u.jsxs(u.Fragment,{children:[u.jsx(l5,{...h,ref:n,__scopeCheckbox:t}),g&&u.jsx(f5,{__scopeCheckbox:t})]})})});vi.displayName=ia;var c5="CheckboxIndicator",u5=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,forceMount:r,...o}=e,a=mi(c5,t);return u.jsx(qe,{present:r||Tn(a.checked)||a.checked===!0,children:u.jsx(ie.span,{"data-state":h5(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...e.style}})})});u5.displayName=c5;var d5="CheckboxBubbleInput",f5=c.forwardRef(({__scopeCheckbox:e,...n},t)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:i,disabled:l,name:d,value:f,form:h,bubbleInput:g,setBubbleInput:C}=mi(d5,e),v=ye(t,C),p=H1(a),m=D1(r);c.useEffect(()=>{const y=g;if(!y)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,M=!o.current;if(p!==a&&E){const L=new Event("click",{bubbles:M});y.indeterminate=Tn(a),E.call(y,Tn(a)?!1:a),y.dispatchEvent(L)}},[g,p,a,o]);const w=c.useRef(Tn(a)?!1:a);return u.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??w.current,required:i,disabled:l,name:d,value:f,form:h,...n,tabIndex:-1,ref:v,style:{...n.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});f5.displayName=d5;function uw(e){return typeof e=="function"}function Tn(e){return e==="indeterminate"}function h5(e){return Tn(e)?"indeterminate":e?"checked":"unchecked"}const Dn=c.forwardRef(({className:e,...n},t)=>u.jsxs("span",{className:"flex items-center space-x-1",children:[u.jsx(vi,{ref:t,className:P("peer h-[14px] w-[14px] shrink-0 rounded-sm border border-line-theme ring-offset-background transition-colors hover:border-line-theme/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-background-theme data-[state=checked]:text-foreground-on-contrast data-[state=checked]:hover:bg-background-theme/80",e),...n,children:u.jsx(u5,{className:P("flex items-center justify-center text-current"),children:u.jsx(pi,{className:"h-2.5 w-2.5 text-foreground-on-contrast",strokeWidth:2})})}),n.children&&u.jsx("label",{htmlFor:n.id,className:"text-sm leading-none cursor-default peer-disabled:cursor-not-allowed peer-disabled:opacity-70 hover:opacity-90",children:n.children})]}));Dn.displayName=vi.displayName;const dw=c.forwardRef((e,n)=>u.jsxs(u.Fragment,{children:[u.jsx(Dn,{ref:n,...e}),u.jsx("label",{className:P("text-primary font-medium text-base -ml-1",e.disabled?"cursor-default opacity-50 pointer-events-none":"cursor-pointer"),onClick:()=>{var t;return(t=e.onCheckedChange)==null?void 0:t.call(e,!e.checked)},children:e.children})]})),wi=({className:e})=>u.jsx("span",{className:P("text-neutral-400 text-opacity-75 text-[19px] mb-[1px]",e),children:"•"}),g5=c.forwardRef(({className:e,showArrow:n,checked:t,onSelect:r,onClick:o,...a},s)=>u.jsxs("div",{ref:s,className:P("flex flex-col gap-1 px-5 py-3 relative rounded-lg border border-line-primary transition duration-100 ease-in-out",o&&"cursor-pointer",t&&"ring-[3px] ring-primary bg-background-primary-selected border-b-line-secondary",e),onClick:t?()=>r==null?void 0:r(!1):o,...a,children:[a.children,u.jsx("div",{className:"text-foreground/50 absolute top-1/2 right-5 transform -translate-y-1/2",children:n&&u.jsx(Kn,{})})]}));g5.displayName="Card";const p5=c.forwardRef(({className:e,children:n,checked:t,right:r,onSelect:o,...a},s)=>u.jsx("div",{ref:s,className:P("flex flex-col space-y-1.5 pb-1 text-sm font-normal",e),...a,children:u.jsxs("div",{className:"flex items-center gap-2",children:[o&&u.jsx(Dn,{checked:t,onClick:i=>i.stopPropagation(),onCheckedChange:i=>o(!!i)}),u.jsxs("div",{className:"w-full flex justify-between items-center",children:[u.jsx("div",{className:"flex gap-3 text-foreground/50 items-center",children:c.Children.toArray(n).filter(Boolean).map((i,l)=>u.jsx(c.Fragment,{children:i},l))}),u.jsx("div",{children:r})]})]})}));p5.displayName="CardHeader";const C5=c.forwardRef(({className:e,leftOffset:n=!1,children:t,...r},o)=>u.jsx("h3",{ref:o,className:P("pr-10 text-sm flex gap-2 font-normal leading-6",n&&"ml-8",e),...r,children:u.jsx("div",{className:"w-full flex justify-between items-center",children:u.jsx("div",{className:"w-full break-words inline-block",children:t})})}));C5.displayName="CardTitle";const m5=c.forwardRef(({className:e,leftOffset:n,showArrow:t,children:r,...o},a)=>u.jsx("div",{ref:a,className:P("pr-10 pt-0 text-sm font-normal text-foreground/60",n&&"ml-8",e),...o,children:u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"w-full",children:r}),u.jsx("div",{className:"text-foreground/50",children:t&&u.jsx(Kn,{})})]})}));m5.displayName="CardDescription";const v5=c.forwardRef(({className:e,leftOffset:n,children:t,...r},o)=>u.jsx("div",{ref:o,className:P("pt-0 text-sm font-normal",n&&"ml-8",e),...r,children:u.jsx("div",{className:"flex justify-between items-center",children:u.jsx("div",{children:t})})}));v5.displayName="CardContent";const w5=c.forwardRef(({className:e,leftOffset:n,children:t,...r},o)=>u.jsx("div",{ref:o,className:P("flex items-center pt-1 pb-3",n&&"ml-8",e),...r,children:u.jsx("div",{className:"flex gap-3 text-sm text-foreground-secondary items-center",children:c.Children.toArray(t).filter(Boolean).map((a,s,i)=>u.jsxs(c.Fragment,{children:[a,i.length-1!==s&&u.jsx(wi,{})]},s))})}));w5.displayName="CardFooter";const fw=({onSave:e,onRemove:n})=>{const[t,r]=c.useState(!1),[o,a]=c.useState(!1),s=async l=>{r(!0);try{await(e==null?void 0:e(l))}finally{r(!1)}},i=async l=>{a(!0);try{await(n==null?void 0:n(l))}finally{a(!1)}};return u.jsxs("div",{className:"absolute right-1 top-1 flex gap-3",children:[e&&u.jsx(s5,{className:P("w-6 h-6 text-primary",t?"opacity-20 pointer-events-none":"cursor-pointer"),onClick:s}),n&&u.jsx(Ci,{className:P("w-6 h-6 text-foreground-error",o?"opacity-20 pointer-events-none":"cursor-pointer"),onClick:i})]})},y5=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 3.42859C12.4734 3.42859 12.8571 3.81234 12.8571 4.28573V11.1429H19.7143C20.1877 11.1429 20.5714 11.5266 20.5714 12C20.5714 12.4734 20.1877 12.8572 19.7143 12.8572H12.8571V19.7143C12.8571 20.1877 12.4734 20.5714 12 20.5714C11.5266 20.5714 11.1428 20.1877 11.1428 19.7143V12.8572H4.2857C3.81231 12.8572 3.42856 12.4734 3.42856 12C3.42856 11.5266 3.81231 11.1429 4.2857 11.1429H11.1428V4.28573C11.1428 3.81234 11.5266 3.42859 12 3.42859Z",fill:"currentColor"})),yi=e=>c.createElement("svg",{width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 10.8017L6.64018 15.2682C6.2159 15.6218 5.58534 15.5645 5.23177 15.1402C4.87821 14.7159 4.93553 14.0853 5.35981 13.7318L11.3598 8.73178C11.7307 8.42274 12.2693 8.42274 12.6402 8.73178L18.6402 13.7318C19.0645 14.0853 19.1218 14.7159 18.7682 15.1402C18.4147 15.5645 17.7841 15.6218 17.3598 15.2682L12 10.8017Z",fill:"currentColor"}));var la="Collapsible",[hw]=it(la),[gw,bi]=hw(la),b5=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:r,defaultOpen:o,disabled:a,onOpenChange:s,...i}=e,[l,d]=wt({prop:r,defaultProp:o??!1,onChange:s,caller:la});return u.jsx(gw,{scope:t,disabled:a,contentId:Ye(),open:l,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),children:u.jsx(ie.div,{"data-state":Si(l),"data-disabled":a?"":void 0,...i,ref:n})})});b5.displayName=la;var x5="CollapsibleTrigger",S5=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,...r}=e,o=bi(x5,t);return u.jsx(ie.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Si(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:n,onClick:ee(e.onClick,o.onOpenToggle)})});S5.displayName=x5;var xi="CollapsibleContent",M5=c.forwardRef((e,n)=>{const{forceMount:t,...r}=e,o=bi(xi,e.__scopeCollapsible);return u.jsx(qe,{present:t||o.open,children:({present:a})=>u.jsx(pw,{...r,ref:n,present:a})})});M5.displayName=xi;var pw=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:r,children:o,...a}=e,s=bi(xi,t),[i,l]=c.useState(r),d=c.useRef(null),f=ye(n,d),h=c.useRef(0),g=h.current,C=c.useRef(0),v=C.current,p=s.open||i,m=c.useRef(p),w=c.useRef(void 0);return c.useEffect(()=>{const y=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(y)},[]),tt(()=>{const y=d.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();h.current=b.height,C.current=b.width,m.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),l(r)}},[s.open,r]),u.jsx(ie.div,{"data-state":Si(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:p&&o})});function Si(e){return e?"open":"closed"}var Cw=b5;const E5=Cw,L5=S5,N5=M5,mw=e=>{const{title:n,icon:t,defaultExpanded:r,showExpanderButton:o,expandOnAdd:a=!0,count:s,placeholder:i,right:l,children:d,isLoading:f,isError:h,onRefetch:g,onAdd:C}=e,{t:v}=ot(),[p,m]=k.useState(r??!1);return k.useEffect(()=>{r!==void 0&&m(r)},[r]),u.jsxs(E5,{open:h||p,onOpenChange:m,children:[u.jsxs("div",{className:"flex justify-between text-base w-full",children:[t&&u.jsx("span",{className:"text-primary",children:t}),u.jsx("span",{children:n}),s?u.jsx("div",{className:"h-6 px-2 rounded-full bg-icon-tertiary flex justify-center items-center text-background text-[15px] font-medium pb-[1px]",children:u.jsx("span",{children:s})}):null,u.jsx(L5,{className:"focus:outline-none",children:f?u.jsx(Dr,{className:"w-[25px] h-[25px]"}):u.jsx(yi,{className:P("text-icon-tertiary cursor-pointer transition-transform duration-300",{"rotate-180":!p})})}),u.jsxs("div",{className:"ml-auto flex gap-2",children:[l,u.jsx("div",{className:"text-primary cursor-pointer",children:C&&u.jsx(y5,{onClick:()=>{C==null||C(),a&&m(!0)}})})]})]}),o&&!p&&u.jsxs("div",{className:"w-full flex bg-background-secondary/80 cursor-pointer rounded-lg items-center justify-center gap-1 text-muted-foreground font-medium py-1 mt-4 transition-colors hover:bg-background-secondary/70",onClick:()=>m(!0),children:[u.jsx("span",{children:v("expand")}),u.jsx(yi,{className:P("rotate-180")})]}),u.jsxs(N5,{children:[u.jsx(ta,{isError:h,onRefetch:g}),!h&&!f&&!s&&u.jsx("div",{className:"p-6 flex justify-center text-secondary-foreground tracking-[0.1px] select-none",children:i||v("empty")}),!!s&&u.jsx("div",{className:"flex flex-col gap-3 mt-3",children:d})]})]})};var k5=1,vw=.9,ww=.8,yw=.17,Mi=.1,Ei=.999,bw=.9999,xw=.99,Sw=/[\\\/_+.#"@\[\(\{&]/,Mw=/[\\\/_+.#"@\[\(\{&]/g,Ew=/[\s-]/,P5=/[\s-]/g;function Li(e,n,t,r,o,a,s){if(a===n.length)return o===e.length?k5:xw;var i=`${o},${a}`;if(s[i]!==void 0)return s[i];for(var l=r.charAt(a),d=t.indexOf(l,o),f=0,h,g,C,v;d>=0;)h=Li(e,n,t,r,d+1,a+1,s),h>f&&(d===o?h*=k5:Sw.test(e.charAt(d-1))?(h*=ww,C=e.slice(o,d-1).match(Mw),C&&o>0&&(h*=Math.pow(Ei,C.length))):Ew.test(e.charAt(d-1))?(h*=vw,v=e.slice(o,d-1).match(P5),v&&o>0&&(h*=Math.pow(Ei,v.length))):(h*=yw,o>0&&(h*=Math.pow(Ei,d-o))),e.charAt(d)!==n.charAt(a)&&(h*=bw)),(h<Mi&&t.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&t.charAt(d-1)!==r.charAt(a))&&(g=Li(e,n,t,r,d+1,a+2,s),g*Mi>h&&(h=g*Mi)),h>f&&(f=h),d=t.indexOf(l,d+1);return s[i]=f,f}function I5(e){return e.toLowerCase().replace(P5," ")}function Lw(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,Li(e,n,I5(e),I5(n),0,0,{})}var ca="Dialog",[O5]=it(ca),[Nw,Vt]=O5(ca),T5=e=>{const{__scopeDialog:n,children:t,open:r,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=c.useRef(null),l=c.useRef(null),[d,f]=wt({prop:r,defaultProp:o??!1,onChange:a,caller:ca});return u.jsx(Nw,{scope:n,triggerRef:i,contentRef:l,contentId:Ye(),titleId:Ye(),descriptionId:Ye(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(h=>!h),[f]),modal:s,children:t})};T5.displayName=ca;var D5="DialogTrigger",_5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(D5,t),a=ye(n,o.triggerRef);return u.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Pi(o.open),...r,ref:a,onClick:ee(e.onClick,o.onOpenToggle)})});_5.displayName=D5;var Ni="DialogPortal",[kw,V5]=O5(Ni,{forceMount:void 0}),H5=e=>{const{__scopeDialog:n,forceMount:t,children:r,container:o}=e,a=Vt(Ni,n);return u.jsx(kw,{scope:n,forceMount:t,children:c.Children.map(r,s=>u.jsx(qe,{present:t||a.open,children:u.jsx(kn,{asChild:!0,container:o,children:s})}))})};H5.displayName=Ni;var ua="DialogOverlay",A5=c.forwardRef((e,n)=>{const t=V5(ua,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,a=Vt(ua,e.__scopeDialog);return a.modal?u.jsx(qe,{present:r||a.open,children:u.jsx(Iw,{...o,ref:n})}):null});A5.displayName=ua;var Pw=bn("DialogOverlay.RemoveScroll"),Iw=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(ua,t);return u.jsx(vo,{as:Pw,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(ie.div,{"data-state":Pi(o.open),...r,ref:n,style:{pointerEvents:"auto",...r.style}})})}),Qn="DialogContent",F5=c.forwardRef((e,n)=>{const t=V5(Qn,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,a=Vt(Qn,e.__scopeDialog);return u.jsx(qe,{present:r||a.open,children:a.modal?u.jsx(Ow,{...o,ref:n}):u.jsx(Tw,{...o,ref:n})})});F5.displayName=Qn;var Ow=c.forwardRef((e,n)=>{const t=Vt(Qn,e.__scopeDialog),r=c.useRef(null),o=ye(n,t.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return z1(a)},[]),u.jsx($5,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=t.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,a=>a.preventDefault())})}),Tw=c.forwardRef((e,n)=>{const t=Vt(Qn,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return u.jsx($5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=t.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=t.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),$5=c.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=Vt(Qn,t),l=c.useRef(null),d=ye(n,l);return x1(),u.jsxs(u.Fragment,{children:[u.jsx(ho,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:u.jsx(jn,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Pi(i.open),...s,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Dw,{titleId:i.titleId}),u.jsx(Vw,{contentRef:l,descriptionId:i.descriptionId})]})]})}),ki="DialogTitle",z5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(ki,t);return u.jsx(ie.h2,{id:o.titleId,...r,ref:n})});z5.displayName=ki;var Z5="DialogDescription",B5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(Z5,t);return u.jsx(ie.p,{id:o.descriptionId,...r,ref:n})});B5.displayName=Z5;var W5="DialogClose",G5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(W5,t);return u.jsx(ie.button,{type:"button",...r,ref:n,onClick:ee(e.onClick,()=>o.onOpenChange(!1))})});G5.displayName=W5;function Pi(e){return e?"open":"closed"}var R5="DialogTitleWarning",[TT,j5]=_p(R5,{contentName:Qn,titleName:ki,docsSlug:"dialog"}),Dw=({titleId:e})=>{const n=j5(R5),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
101
+ */const Q1=On("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),J1=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_2378_50984)"},c.createElement("path",{d:"M9.17162 7.75736L7.7574 9.17157L10.5858 12L7.7574 14.8284L9.17162 16.2426L12 13.4142L14.8285 16.2426L16.2427 14.8284L13.4143 12L16.2427 9.17157L14.8285 7.75736L12 10.5858L9.17162 7.75736ZM4.92898 4.92893C1.02575 8.83216 1.02575 15.1678 4.92898 19.0711C8.83221 22.9743 15.1679 22.9743 19.0711 19.0711C22.9743 15.1678 22.9743 8.83216 19.0711 4.92893C15.1679 1.0257 8.83221 1.0257 4.92898 4.92893ZM17.6569 17.6569C14.5386 20.7752 9.46153 20.7752 6.34319 17.6569C3.22485 14.5385 3.22485 9.46149 6.34319 6.34315C9.46153 3.22481 14.5386 3.22481 17.6569 6.34315C20.7752 9.46149 20.7752 14.5385 17.6569 17.6569Z",fill:"currentColor"})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_2378_50984"},c.createElement("rect",{width:24,height:24,fill:"white"})))),tw={...{expand:"Expand",empty:"Empty",confirmAction:"Confirm action",warning:"Warning",maxNChars:"Max charts",cancellation:"Cancel",displayBy:"Display by",selected:"Selected",all:"All",of:"of",selectDate:"Select date",search:"Search...",notFound:"Not found",networkError:"Network error",refetch:"Refetch",attachFile:"Attach file",errorOccurred:"Error occurred",noMediaFiles:"No media files",networkErrorDescription:"Network error description",confirmDeleteMedia:"Are you sure you want to delete the file?",delete:"Delete",imageSizeLimitMB:"Image size limit",audioSizeLimitMB:"Audio size limit",pdfSizeLimitMB:"PDF size limit",videoSizeLimitMB:"Video size limit",maxSizeOfFilesMB:"Max size of files",mb:"Mb",apply:"Apply",showAll:"Show all",chooseAll:"Choose all",withoutSort:"Without sort",listView:"List view",tableView:"Table view"},sorting:"Sorting",direction:"Direction",ascending:"Ascending",descending:"Descending",filterContains:"Contains",filterEquals:"Equals",filterIn:"In list",filterNotIn:"Not in list",filterBetween:"Between",filterIsNull:"Is empty",filterIsNotNull:"Is not empty",filterOperator:"Operator",filterValue:"Value",filterValues:"Values",filterFrom:"From",filterTo:"To",filterAnd:"AND",filterAddCondition:"Add condition",filterRemoveCondition:"Remove condition",filterRemoveValue:"Remove value",filterOnePerLine:"One value per line",filterInvalid:"Check the values, range and selection limit",filterLoading:"Loading…",filterLoadMore:"Load more",filterRetry:"Retry",filterReset:"Clear filter",filterTitle:"Filter",sortReset:"Clear sorting"},r5={theme:"system",setTheme:()=>null,toggleTheme:()=>null,translations:tw},ea=k.createContext(r5);function nw({children:e,defaultTheme:n="system",storageKey:t="app-ui-theme",themeVersion:r="Krit",...o}){const[a,s]=k.useState(()=>localStorage.getItem(t)||n);k.useEffect(()=>{const l=window.document.documentElement;Array.from(l.classList).filter(f=>f.startsWith("light")||f.startsWith("dark")).forEach(f=>l.classList.remove(f));const d=a==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;a==="system"&&s(d),l.classList.add(d),r&&l.classList.add(`${d}${r}`)},[a,r]);const i={theme:a,setTheme:l=>{localStorage.setItem(t,l),s(l)},toggleTheme:()=>{const l=a==="light"?"dark":"light";i.setTheme(l)},translations:{...r5.translations,...o.translations}};return u.jsx(ea.Provider,{...o,value:i,children:e})}const ot=()=>{const e=k.useContext(ea);return{t:t=>{var r;return e.translations?((r=e.translations)==null?void 0:r[t])===void 0?(console.warn(`KRIT-UI: Translation for key ${t} not found`),t):e.translations[t]:(console.warn("KRIT-UI: Translations not found"),t)}}},Dr=({style:e,className:n})=>u.jsx("div",{style:e,className:P("h-full w-full flex items-center justify-center",n),children:u.jsx(Tr,{className:"h-8 w-8 animate-spin text-foreground-theme"})}),ta=({className:e,textSize:n="base",isLoading:t,isError:r,center:o,inline:a,onRefetch:s})=>{const{t:i}=ot();return!t&&!r?null:u.jsxs("div",{className:P("flex gap-2 text-base select-none",`text-${n}`,o&&"items-center",a?"ml-2 inline-flex":"mt-3 flex-col",e),children:[t&&u.jsx(Dr,{className:n==="base"?"w-7":"w-5"}),r&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-icon",children:i("networkError")}),s&&u.jsx("span",{className:"text-primary cursor-pointer",onClick:s,children:i("refetch")})]})]})},yo=c.forwardRef(({triggerClassName:e,clearable:n,borderless:t,isLoading:r,isError:o,error:a,readOnly:s,autoSelectSingleOption:i,renderValue:l=w=>w.label,renderOption:d=w=>w.label,onRefetch:f,onChange:h,onValueChange:g,onClick:C,onOpenChange:v,...p},m)=>{const[w,y]=c.useState(p.value||""),b=c.useRef(!1),S=c.useCallback(E=>{var M;p.options.length&&(y(E),g?g(E):h==null||h(E,((M=p.options.find(L=>L.value===E))==null?void 0:M.label)||""))},[p.options,g,h]);return c.useEffect(()=>{y(p.value||"")},[p.value]),c.useEffect(()=>{if(i&&p.options.length===1&&!w&&!b.current){const E=p.options[0];S(E.value),b.current=!0}},[i,p.options,w,S]),u.jsxs(Gd,{...p,value:w,onValueChange:S,onOpenChange:C||v,children:[u.jsxs(ra,{ref:m,className:P(t&&"bg-background-secondary border-line-primary text-base",a?"border-line-error focus-visible:border-line-error":"",s&&"cursor-not-allowed pointer-events-none opacity-95",e),children:[u.jsx(na,{placeholder:p.placeholder,children:l(p.options.find(E=>E.value===w)??{label:"",value:""})}),n&&w?u.jsx("div",{className:P("flex items-center justify-center w-6 h-6 shrink-0 cursor-pointer ml-auto pointer-events-auto z-10",s&&"cursor-not-allowed pointer-events-none opacity-95"),onMouseDown:E=>{E.stopPropagation(),E.preventDefault(),s||(b.current=!0,S==null||S(""))},onClick:E=>{E.stopPropagation(),E.preventDefault(),s||(b.current=!0,S==null||S(""))},children:u.jsx(J1,{className:"w-6 h-6 text-icon-fade-contrast pointer-events-none"})}):u.jsx(Ov,{asChild:!0,children:u.jsx(pr,{className:"min-h-6 min-w-6 text-icon-fade-contrast ml-auto"})})]}),u.jsxs(oa,{className:P(r&&"min-h-16",o&&"min-h-20"),children:[u.jsx(ta,{isLoading:r,isError:o,textSize:"sm",center:!0,onRefetch:f}),p.options.length>100?u.jsx(Jd,{height:384,itemCount:p.options.length,itemSize:36,width:"100%",children:({index:E,style:M})=>u.jsx(bo,{value:p.options[E].value,disabled:p.options[E].disabled,style:M,children:d(p.options[E])})}):p.options.map(E=>u.jsx(bo,{value:E.value,disabled:E.disabled,children:d(E)},E.value))]})]})});yo.displayName="Select";const na=c.forwardRef(({className:e,...n},t)=>u.jsx(Iv,{ref:t,className:P("text-sm text-foreground-primary font-normal",e),...n}));na.displayName="SelectValue";const ra=c.forwardRef(({className:e,children:n,...t},r)=>u.jsx(Pv,{ref:r,className:P("relative flex h-9 w-full items-center gap-1 rounded-lg border border-line-primary bg-[transparent] px-3 py-2 text-sm font-normal tracking-[0.1px] truncate leading-5 text-left text-foreground ring-offset-background transition-colors duration-300 ease-in-out data-[placeholder]:text-foreground-secondary hover:bg-background-contrast-fade/20 focus:outline-none focus:border-line-focused disabled:cursor-not-allowed disabled:opacity-50 [&>span]:pr-3 [&>span]:truncate [&>span]:mr-auto",e),...t,children:n}));ra.displayName="SelectTrigger";const oa=c.forwardRef(({className:e,children:n,position:t="popper",...r},o)=>u.jsx(Tv,{children:u.jsx(Dv,{ref:o,className:P("relative z-50 min-w-[8rem] overflow-hidden rounded-lg border border-line-primary bg-background text-popover-foreground shadow-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"?"max-h-[min(24rem,var(--radix-select-content-available-height))]":"max-h-96",e),position:t,sideOffset:4,...r,children:u.jsx(_v,{className:P("py-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})}));oa.displayName="SelectContent";const o5=c.forwardRef(({className:e,...n},t)=>u.jsx(Vv,{ref:t,className:P("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...n}));o5.displayName="SelectLabel";const bo=c.forwardRef(({className:e,children:n,...t},r)=>u.jsxs(Hv,{ref:r,className:P("relative flex w-full cursor-default select-none items-center py-2 pl-3 pr-8 text-sm outline-none data-[highlighted]:bg-background-theme-fade data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&[data-state=checked]>span:first-child]:pr-2",e),...t,children:[u.jsx(Av,{asChild:!0,children:u.jsx("span",{className:"truncate block",title:typeof n=="string"?n:void 0,children:n})}),u.jsx("span",{className:"absolute right-4 flex h-3.5 w-3.5 items-center justify-center text-foreground-secondary",children:u.jsx(Fv,{children:u.jsx(pi,{className:"h-4 w-4"})})})]}));bo.displayName="SelectItem";const a5=c.forwardRef(({className:e,...n},t)=>u.jsx($v,{ref:t,className:P("-mx-1 my-1 h-px bg-muted",e),...n}));a5.displayName="SelectSeparator";const rw=e=>{if(!e)return;const{day_today:n,day_selected:t,day_range_start:r,day_range_end:o,day_range_middle:a,day_outside:s,day_disabled:i,day_hidden:l,...d}=e;return{...d,...n&&{today:P(d.today,n)},...t&&{selected:P(d.selected,t)},...r&&{range_start:P(d.range_start,r)},...o&&{range_end:P(d.range_end,o)},...a&&{range_middle:P(d.range_middle,a)},...s&&{outside:P(d.outside,s)},...i&&{disabled:P(d.disabled,i)},...l&&{hidden:P(d.hidden,l)}}};function aa({className:e,classNames:n,showOutsideDays:t=!0,...r}){const o=rw(n);return u.jsx(Dp,{showOutsideDays:t,captionLayout:"dropdown",navLayout:"around",startMonth:new Date(new Date().getFullYear()-6,0),endMonth:new Date(new Date().getFullYear()+6,11),className:P("relative w-fit p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"relative",dropdowns:"flex items-center justify-center gap-2 text-[15px] capitalize font-medium max-w-[calc(100%-3.5rem)] mx-auto",months_dropdown:"flex [&>select:focus-visible]:outline-none [&>select]:capitalize",years_dropdown:"flex [&>select:focus-visible]:outline-none",month_caption:"relative flex h-7 w-full items-center justify-center",caption_label:"hidden",button_previous:P(xn({variant:"fade-contrast-outlined"}),"absolute left-0 top-0 z-30 h-7 w-7 shrink-0 bg-[transparent] border-none text-primary p-0 hover:bg-[transparent] hover:text-primary/80"),button_next:P(xn({variant:"fade-contrast-outlined"}),"absolute right-0 top-0 z-30 h-7 w-7 shrink-0 bg-[transparent] border-none text-primary p-0 hover:bg-[transparent] hover:text-primary/80"),month_grid:"mt-4 w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-foreground-secondary rounded-md w-9 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:P("h-9 w-9 p-0 text-center relative focus-within:relative focus-within:z-20","[&.day-range-start]:rounded-l-md [&.day-range-end]:rounded-r-md","[&.day-range-middle]:bg-background-tertiary","[&.day-range-start_button]:rounded-md [&.day-range-end_button]:rounded-md"),day_button:P(xn({variant:"fade-contrast-transparent"}),"h-9 w-9 p-0 text-sm font-normal transition-all hover:bg-background-success-fade hover:text-foreground","[td[aria-selected=true]_&]:opacity-100"),range_start:"day-range-start rounded-l-md [&_button]:!rounded-md [&_button]:!bg-background-theme [&_button]:!text-foreground-on-contrast [&_button]:!opacity-100 [&_button]:hover:!bg-background-theme/80",range_end:"day-range-end rounded-r-md [&_button]:!rounded-md [&_button]:!bg-background-theme [&_button]:!text-foreground-on-contrast [&_button]:!opacity-100 [&_button]:hover:!bg-background-theme/80",selected:"[&:not(.day-range-middle)_button]:bg-background-theme [&:not(.day-range-middle)_button]:text-foreground-on-contrast [&:not(.day-range-middle)_button]:hover:bg-background-theme/80 [&:not(.day-range-middle)_button]:hover:text-foreground-on-contrast [&:not(.day-range-middle)_button]:focus:bg-background-theme [&:not(.day-range-middle)_button]:focus:text-foreground-on-contrast",today:"day-today !font-bold [&_button]:!font-bold [&:not(.day-range-start):not(.day-range-end)_button]:bg-background-tertiary [&:not(.day-range-start):not(.day-range-end)_button]:text-foreground-theme [&:not(.day-range-start):not(.day-range-end)_button]:hover:bg-background-tertiary [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:!bg-background-theme [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:!text-foreground-on-contrast [&[aria-selected=true]:not(.day-range-start):not(.day-range-end):not(.day-range-middle)_button]:hover:!bg-background-theme/80",outside:"day-outside [&_button]:text-foreground-secondary [&_button]:opacity-50 [&_button]:hover:text-foreground/90 [&[aria-selected=true]_button]:!opacity-100 [&[aria-selected=true]_button]:!text-foreground-on-contrast",disabled:"[&_button]:text-foreground-secondary [&_button]:opacity-50",range_middle:"day-range-middle bg-background-tertiary [&_button]:!bg-transparent [&_button]:!font-normal [&_button]:text-foreground [&_button]:rounded-none [&_button]:hover:!bg-transparent [&_button]:hover:text-foreground",hidden:"invisible",...o},components:{Chevron:({orientation:a})=>a==="left"?u.jsx(Rd,{}):u.jsx(jd,{}),Dropdown:({options:a,...s})=>{var i;return u.jsxs(Gd,{name:s.name,value:(i=s.value)==null?void 0:i.toString(),onValueChange:l=>{var d;return(d=s.onChange)==null?void 0:d.call(s,{target:{value:l}})},children:[u.jsx(ra,{className:P(s.className,"w-auto shrink-0 overflow-visible text-clip bg-[transparent] border-none shadow-none p-0 gap-0 h-auto hover:bg-[transparent] focus:border-none focus-visible:border-none data-[state=open]:bg-[transparent] capitalize font-bold [&>svg]:ml-1 [&>span]:pr-1 [&>span]:overflow-visible [&>span]:text-clip"),children:u.jsx(na,{placeholder:s["aria-label"]})}),u.jsx(oa,{children:a==null?void 0:a.map(l=>u.jsx(bo,{value:l.value.toString(),disabled:l.disabled,children:l.label},l.value))})]})}},...r})}aa.displayName="Calendar";const Kn=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"currentColor"})),Ci=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M6 19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V9C18 7.9 17.1 7 16 7H8C6.9 7 6 7.9 6 9V19ZM18 4H15.5L14.79 3.29C14.61 3.11 14.35 3 14.09 3H9.91C9.65 3 9.39 3.11 9.21 3.29L8.5 4H6C5.45 4 5 4.45 5 5C5 5.55 5.45 6 6 6H18C18.55 6 19 5.55 19 5C19 4.45 18.55 4 18 4Z",fill:"currentColor"})),s5=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.43597 5.18404C3 6.03969 3 7.15979 3 9.4V14.6C3 16.8402 3 17.9603 3.43597 18.816C3.81947 19.5686 4.43139 20.1805 5.18404 20.564C6.03969 21 7.15979 21 9.4 21H14.6C16.8402 21 17.9603 21 18.816 20.564C19.5686 20.1805 20.1805 19.5686 20.564 18.816C21 17.9603 21 16.8402 21 14.6V10.151C21 9.1726 21 8.68342 20.8895 8.22307C20.7915 7.81493 20.6299 7.42475 20.4106 7.06686C20.1632 6.6632 19.8173 6.3173 19.1255 5.6255L18.3745 4.87452C17.6827 4.18271 17.3368 3.83681 16.9331 3.58944C16.5753 3.37012 16.1851 3.20851 15.7769 3.11052C15.3166 3 14.8274 3 13.849 3H9.4C7.15979 3 6.03969 3 5.18404 3.43597C4.43139 3.81947 3.81947 4.43139 3.43597 5.18404ZM5 9.4V14.6C5 15.7531 5.00156 16.4977 5.04785 17.0643C5.09225 17.6077 5.1676 17.8091 5.21799 17.908C5.40973 18.2843 5.71569 18.5903 6.09202 18.782C6.19091 18.8324 6.39235 18.9078 6.93567 18.9521C6.95686 18.9539 6.9783 18.9555 7 18.9572V15C7 13.3431 8.34315 12 10 12H14C15.6569 12 17 13.3431 17 15V18.9572C17.0217 18.9555 17.0431 18.9539 17.0643 18.9521C17.6077 18.9078 17.8091 18.8324 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8324 17.8091 18.9078 17.6077 18.9521 17.0643C18.9984 16.4977 19 15.7531 19 14.6V10.151C19 9.07741 18.9871 8.8666 18.9447 8.68996C18.8957 8.48589 18.8149 8.2908 18.7053 8.11186C18.6104 7.95697 18.4704 7.79882 17.7113 7.0397L16.9603 6.28873C16.2012 5.52961 16.043 5.38963 15.8881 5.29472C15.7092 5.18506 15.5141 5.10425 15.31 5.05526C15.2345 5.03713 15.1528 5.0244 15 5.01577V7C15 8.10457 14.1046 9 13 9H9C7.89543 9 7 8.10457 7 7V5.04285L6.93567 5.04785C6.39235 5.09225 6.19091 5.1676 6.09202 5.21799C5.71569 5.40973 5.40973 5.71569 5.21799 6.09202C5.1676 6.19091 5.09225 6.39235 5.04785 6.93567C5.00156 7.50235 5 8.24689 5 9.4ZM15 18.9999V15C15 14.4477 14.5523 14 14 14H10C9.44771 14 9 14.4477 9 15V18.9999C9.12765 19 9.26085 19 9.4 19H14.6C14.7391 19 14.8723 19 15 18.9999ZM13 5V7H9V5.00014L13 5Z",fill:"currentColor"}));function ow(e,n){return c.useReducer((t,r)=>n[t][r]??t,e)}var qe=e=>{const{present:n,children:t}=e,r=aw(n),o=typeof t=="function"?t({present:r.isPresent}):c.Children.only(t),a=ye(r.ref,sw(o));return typeof t=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};qe.displayName="Presence";function aw(e){const[n,t]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,l]=ow(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const d=sa(r.current);a.current=i==="mounted"?d:"none"},[i]),tt(()=>{const d=r.current,f=o.current;if(f!==e){const g=a.current,C=sa(d);e?l("MOUNT"):C==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(f&&g!==C?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),tt(()=>{if(n){let d;const f=n.ownerDocument.defaultView??window,h=C=>{const p=sa(r.current).includes(CSS.escape(C.animationName));if(C.target===n&&p&&(l("ANIMATION_END"),!o.current)){const m=n.style.animationFillMode;n.style.animationFillMode="forwards",d=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=m)})}},g=C=>{C.target===n&&(a.current=sa(r.current))};return n.addEventListener("animationstart",g),n.addEventListener("animationcancel",h),n.addEventListener("animationend",h),()=>{f.clearTimeout(d),n.removeEventListener("animationstart",g),n.removeEventListener("animationcancel",h),n.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(d=>{r.current=d?getComputedStyle(d):null,t(d)},[])}}function sa(e){return(e==null?void 0:e.animationName)||"none"}function sw(e){var r,o;let n=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var ia="Checkbox",[iw]=it(ia),[lw,mi]=iw(ia);function cw(e){const{__scopeCheckbox:n,checked:t,children:r,defaultChecked:o,disabled:a,form:s,name:i,onCheckedChange:l,required:d,value:f="on",internal_do_not_use_render:h}=e,[g,C]=wt({prop:t,defaultProp:o??!1,onChange:l,caller:ia}),[v,p]=c.useState(null),[m,w]=c.useState(null),y=c.useRef(!1),b=v?!!s||!!v.closest("form"):!0,S={checked:g,disabled:a,setChecked:C,control:v,setControl:p,name:i,form:s,value:f,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:Tn(o)?!1:o,isFormControl:b,bubbleInput:m,setBubbleInput:w};return u.jsx(lw,{scope:n,...S,children:uw(h)?h(S):r})}var i5="CheckboxTrigger",l5=c.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:t,...r},o)=>{const{control:a,value:s,disabled:i,checked:l,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:g,isFormControl:C,bubbleInput:v}=mi(i5,e),p=ye(o,f),m=c.useRef(l);return c.useEffect(()=>{const w=a==null?void 0:a.form;if(w){const y=()=>h(m.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[a,h]),u.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":Tn(l)?"mixed":l,"aria-required":d,"data-state":h5(l),"data-disabled":i?"":void 0,disabled:i,value:s,...r,ref:p,onKeyDown:ee(n,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:ee(t,w=>{h(y=>Tn(y)?!0:!y),v&&C&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})});l5.displayName=i5;var vi=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,name:r,checked:o,defaultChecked:a,required:s,disabled:i,value:l,onCheckedChange:d,form:f,...h}=e;return u.jsx(cw,{__scopeCheckbox:t,checked:o,defaultChecked:a,disabled:i,required:s,onCheckedChange:d,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:g})=>u.jsxs(u.Fragment,{children:[u.jsx(l5,{...h,ref:n,__scopeCheckbox:t}),g&&u.jsx(f5,{__scopeCheckbox:t})]})})});vi.displayName=ia;var c5="CheckboxIndicator",u5=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,forceMount:r,...o}=e,a=mi(c5,t);return u.jsx(qe,{present:r||Tn(a.checked)||a.checked===!0,children:u.jsx(ie.span,{"data-state":h5(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...e.style}})})});u5.displayName=c5;var d5="CheckboxBubbleInput",f5=c.forwardRef(({__scopeCheckbox:e,...n},t)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:i,disabled:l,name:d,value:f,form:h,bubbleInput:g,setBubbleInput:C}=mi(d5,e),v=ye(t,C),p=H1(a),m=D1(r);c.useEffect(()=>{const y=g;if(!y)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,M=!o.current;if(p!==a&&E){const L=new Event("click",{bubbles:M});y.indeterminate=Tn(a),E.call(y,Tn(a)?!1:a),y.dispatchEvent(L)}},[g,p,a,o]);const w=c.useRef(Tn(a)?!1:a);return u.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??w.current,required:i,disabled:l,name:d,value:f,form:h,...n,tabIndex:-1,ref:v,style:{...n.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});f5.displayName=d5;function uw(e){return typeof e=="function"}function Tn(e){return e==="indeterminate"}function h5(e){return Tn(e)?"indeterminate":e?"checked":"unchecked"}const Dn=c.forwardRef(({className:e,...n},t)=>u.jsxs("span",{className:"flex items-center space-x-1",children:[u.jsx(vi,{ref:t,className:P("peer h-[14px] w-[14px] shrink-0 rounded-sm border border-line-theme ring-offset-background transition-colors hover:border-line-theme/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-background-theme data-[state=checked]:text-foreground-on-contrast data-[state=checked]:hover:bg-background-theme/80",e),...n,children:u.jsx(u5,{className:P("flex items-center justify-center text-current"),children:u.jsx(pi,{className:"h-2.5 w-2.5 text-foreground-on-contrast",strokeWidth:2})})}),n.children&&u.jsx("label",{htmlFor:n.id,className:"text-sm leading-none cursor-default peer-disabled:cursor-not-allowed peer-disabled:opacity-70 hover:opacity-90",children:n.children})]}));Dn.displayName=vi.displayName;const dw=c.forwardRef((e,n)=>u.jsxs(u.Fragment,{children:[u.jsx(Dn,{ref:n,...e}),u.jsx("label",{className:P("text-primary font-medium text-base -ml-1",e.disabled?"cursor-default opacity-50 pointer-events-none":"cursor-pointer"),onClick:()=>{var t;return(t=e.onCheckedChange)==null?void 0:t.call(e,!e.checked)},children:e.children})]})),wi=({className:e})=>u.jsx("span",{className:P("text-neutral-400 text-opacity-75 text-[19px] mb-[1px]",e),children:"•"}),g5=c.forwardRef(({className:e,showArrow:n,checked:t,onSelect:r,onClick:o,...a},s)=>u.jsxs("div",{ref:s,className:P("flex flex-col gap-1 px-5 py-3 relative rounded-lg border border-line-primary transition duration-100 ease-in-out",o&&"cursor-pointer",t&&"ring-[3px] ring-primary bg-background-primary-selected border-b-line-secondary",e),onClick:t?()=>r==null?void 0:r(!1):o,...a,children:[a.children,u.jsx("div",{className:"text-foreground/50 absolute top-1/2 right-5 transform -translate-y-1/2",children:n&&u.jsx(Kn,{})})]}));g5.displayName="Card";const p5=c.forwardRef(({className:e,children:n,checked:t,right:r,onSelect:o,...a},s)=>u.jsx("div",{ref:s,className:P("flex flex-col space-y-1.5 pb-1 text-sm font-normal",e),...a,children:u.jsxs("div",{className:"flex items-center gap-2",children:[o&&u.jsx(Dn,{checked:t,onClick:i=>i.stopPropagation(),onCheckedChange:i=>o(!!i)}),u.jsxs("div",{className:"w-full flex justify-between items-center",children:[u.jsx("div",{className:"flex gap-3 text-foreground/50 items-center",children:c.Children.toArray(n).filter(Boolean).map((i,l)=>u.jsx(c.Fragment,{children:i},l))}),u.jsx("div",{children:r})]})]})}));p5.displayName="CardHeader";const C5=c.forwardRef(({className:e,leftOffset:n=!1,children:t,...r},o)=>u.jsx("h3",{ref:o,className:P("pr-10 text-sm flex gap-2 font-normal leading-6",n&&"ml-8",e),...r,children:u.jsx("div",{className:"w-full flex justify-between items-center",children:u.jsx("div",{className:"w-full break-words inline-block",children:t})})}));C5.displayName="CardTitle";const m5=c.forwardRef(({className:e,leftOffset:n,showArrow:t,children:r,...o},a)=>u.jsx("div",{ref:a,className:P("pr-10 pt-0 text-sm font-normal text-foreground/60",n&&"ml-8",e),...o,children:u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"w-full",children:r}),u.jsx("div",{className:"text-foreground/50",children:t&&u.jsx(Kn,{})})]})}));m5.displayName="CardDescription";const v5=c.forwardRef(({className:e,leftOffset:n,children:t,...r},o)=>u.jsx("div",{ref:o,className:P("pt-0 text-sm font-normal",n&&"ml-8",e),...r,children:u.jsx("div",{className:"flex justify-between items-center",children:u.jsx("div",{children:t})})}));v5.displayName="CardContent";const w5=c.forwardRef(({className:e,leftOffset:n,children:t,...r},o)=>u.jsx("div",{ref:o,className:P("flex items-center pt-1 pb-3",n&&"ml-8",e),...r,children:u.jsx("div",{className:"flex gap-3 text-sm text-foreground-secondary items-center",children:c.Children.toArray(t).filter(Boolean).map((a,s,i)=>u.jsxs(c.Fragment,{children:[a,i.length-1!==s&&u.jsx(wi,{})]},s))})}));w5.displayName="CardFooter";const fw=({onSave:e,onRemove:n})=>{const[t,r]=c.useState(!1),[o,a]=c.useState(!1),s=async l=>{r(!0);try{await(e==null?void 0:e(l))}finally{r(!1)}},i=async l=>{a(!0);try{await(n==null?void 0:n(l))}finally{a(!1)}};return u.jsxs("div",{className:"absolute right-1 top-1 flex gap-3",children:[e&&u.jsx(s5,{className:P("w-6 h-6 text-primary",t?"opacity-20 pointer-events-none":"cursor-pointer"),onClick:s}),n&&u.jsx(Ci,{className:P("w-6 h-6 text-foreground-error",o?"opacity-20 pointer-events-none":"cursor-pointer"),onClick:i})]})},y5=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 3.42859C12.4734 3.42859 12.8571 3.81234 12.8571 4.28573V11.1429H19.7143C20.1877 11.1429 20.5714 11.5266 20.5714 12C20.5714 12.4734 20.1877 12.8572 19.7143 12.8572H12.8571V19.7143C12.8571 20.1877 12.4734 20.5714 12 20.5714C11.5266 20.5714 11.1428 20.1877 11.1428 19.7143V12.8572H4.2857C3.81231 12.8572 3.42856 12.4734 3.42856 12C3.42856 11.5266 3.81231 11.1429 4.2857 11.1429H11.1428V4.28573C11.1428 3.81234 11.5266 3.42859 12 3.42859Z",fill:"currentColor"})),yi=e=>c.createElement("svg",{width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 10.8017L6.64018 15.2682C6.2159 15.6218 5.58534 15.5645 5.23177 15.1402C4.87821 14.7159 4.93553 14.0853 5.35981 13.7318L11.3598 8.73178C11.7307 8.42274 12.2693 8.42274 12.6402 8.73178L18.6402 13.7318C19.0645 14.0853 19.1218 14.7159 18.7682 15.1402C18.4147 15.5645 17.7841 15.6218 17.3598 15.2682L12 10.8017Z",fill:"currentColor"}));var la="Collapsible",[hw]=it(la),[gw,bi]=hw(la),b5=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:r,defaultOpen:o,disabled:a,onOpenChange:s,...i}=e,[l,d]=wt({prop:r,defaultProp:o??!1,onChange:s,caller:la});return u.jsx(gw,{scope:t,disabled:a,contentId:Ye(),open:l,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),children:u.jsx(ie.div,{"data-state":Si(l),"data-disabled":a?"":void 0,...i,ref:n})})});b5.displayName=la;var x5="CollapsibleTrigger",S5=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,...r}=e,o=bi(x5,t);return u.jsx(ie.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Si(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:n,onClick:ee(e.onClick,o.onOpenToggle)})});S5.displayName=x5;var xi="CollapsibleContent",M5=c.forwardRef((e,n)=>{const{forceMount:t,...r}=e,o=bi(xi,e.__scopeCollapsible);return u.jsx(qe,{present:t||o.open,children:({present:a})=>u.jsx(pw,{...r,ref:n,present:a})})});M5.displayName=xi;var pw=c.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:r,children:o,...a}=e,s=bi(xi,t),[i,l]=c.useState(r),d=c.useRef(null),f=ye(n,d),h=c.useRef(0),g=h.current,C=c.useRef(0),v=C.current,p=s.open||i,m=c.useRef(p),w=c.useRef(void 0);return c.useEffect(()=>{const y=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(y)},[]),tt(()=>{const y=d.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();h.current=b.height,C.current=b.width,m.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),l(r)}},[s.open,r]),u.jsx(ie.div,{"data-state":Si(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...a,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:p&&o})});function Si(e){return e?"open":"closed"}var Cw=b5;const E5=Cw,L5=S5,N5=M5,mw=e=>{const{title:n,icon:t,defaultExpanded:r,showExpanderButton:o,expandOnAdd:a=!0,count:s,placeholder:i,right:l,children:d,isLoading:f,isError:h,onRefetch:g,onAdd:C}=e,{t:v}=ot(),[p,m]=k.useState(r??!1);return k.useEffect(()=>{r!==void 0&&m(r)},[r]),u.jsxs(E5,{open:h||p,onOpenChange:m,children:[u.jsxs("div",{className:"flex justify-between text-base w-full",children:[t&&u.jsx("span",{className:"text-primary",children:t}),u.jsx("span",{children:n}),s?u.jsx("div",{className:"h-6 px-2 rounded-full bg-icon-tertiary flex justify-center items-center text-background text-[15px] font-medium pb-[1px]",children:u.jsx("span",{children:s})}):null,u.jsx(L5,{className:"focus:outline-none",children:f?u.jsx(Dr,{className:"w-[25px] h-[25px]"}):u.jsx(yi,{className:P("text-icon-tertiary cursor-pointer transition-transform duration-300",{"rotate-180":!p})})}),u.jsxs("div",{className:"ml-auto flex gap-2",children:[l,u.jsx("div",{className:"text-primary cursor-pointer",children:C&&u.jsx(y5,{onClick:()=>{C==null||C(),a&&m(!0)}})})]})]}),o&&!p&&u.jsxs("div",{className:"w-full flex bg-background-secondary/80 cursor-pointer rounded-lg items-center justify-center gap-1 text-muted-foreground font-medium py-1 mt-4 transition-colors hover:bg-background-secondary/70",onClick:()=>m(!0),children:[u.jsx("span",{children:v("expand")}),u.jsx(yi,{className:P("rotate-180")})]}),u.jsxs(N5,{children:[u.jsx(ta,{isError:h,onRefetch:g}),!h&&!f&&!s&&u.jsx("div",{className:"p-6 flex justify-center text-secondary-foreground tracking-[0.1px] select-none",children:i||v("empty")}),!!s&&u.jsx("div",{className:"flex flex-col gap-3 mt-3",children:d})]})]})};var k5=1,vw=.9,ww=.8,yw=.17,Mi=.1,Ei=.999,bw=.9999,xw=.99,Sw=/[\\\/_+.#"@\[\(\{&]/,Mw=/[\\\/_+.#"@\[\(\{&]/g,Ew=/[\s-]/,P5=/[\s-]/g;function Li(e,n,t,r,o,a,s){if(a===n.length)return o===e.length?k5:xw;var i=`${o},${a}`;if(s[i]!==void 0)return s[i];for(var l=r.charAt(a),d=t.indexOf(l,o),f=0,h,g,C,v;d>=0;)h=Li(e,n,t,r,d+1,a+1,s),h>f&&(d===o?h*=k5:Sw.test(e.charAt(d-1))?(h*=ww,C=e.slice(o,d-1).match(Mw),C&&o>0&&(h*=Math.pow(Ei,C.length))):Ew.test(e.charAt(d-1))?(h*=vw,v=e.slice(o,d-1).match(P5),v&&o>0&&(h*=Math.pow(Ei,v.length))):(h*=yw,o>0&&(h*=Math.pow(Ei,d-o))),e.charAt(d)!==n.charAt(a)&&(h*=bw)),(h<Mi&&t.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&t.charAt(d-1)!==r.charAt(a))&&(g=Li(e,n,t,r,d+1,a+2,s),g*Mi>h&&(h=g*Mi)),h>f&&(f=h),d=t.indexOf(l,d+1);return s[i]=f,f}function I5(e){return e.toLowerCase().replace(P5," ")}function Lw(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,Li(e,n,I5(e),I5(n),0,0,{})}var ca="Dialog",[O5]=it(ca),[Nw,Vt]=O5(ca),T5=e=>{const{__scopeDialog:n,children:t,open:r,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=c.useRef(null),l=c.useRef(null),[d,f]=wt({prop:r,defaultProp:o??!1,onChange:a,caller:ca});return u.jsx(Nw,{scope:n,triggerRef:i,contentRef:l,contentId:Ye(),titleId:Ye(),descriptionId:Ye(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(h=>!h),[f]),modal:s,children:t})};T5.displayName=ca;var D5="DialogTrigger",_5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(D5,t),a=ye(n,o.triggerRef);return u.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Pi(o.open),...r,ref:a,onClick:ee(e.onClick,o.onOpenToggle)})});_5.displayName=D5;var Ni="DialogPortal",[kw,V5]=O5(Ni,{forceMount:void 0}),H5=e=>{const{__scopeDialog:n,forceMount:t,children:r,container:o}=e,a=Vt(Ni,n);return u.jsx(kw,{scope:n,forceMount:t,children:c.Children.map(r,s=>u.jsx(qe,{present:t||a.open,children:u.jsx(kn,{asChild:!0,container:o,children:s})}))})};H5.displayName=Ni;var ua="DialogOverlay",A5=c.forwardRef((e,n)=>{const t=V5(ua,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,a=Vt(ua,e.__scopeDialog);return a.modal?u.jsx(qe,{present:r||a.open,children:u.jsx(Iw,{...o,ref:n})}):null});A5.displayName=ua;var Pw=bn("DialogOverlay.RemoveScroll"),Iw=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(ua,t);return u.jsx(vo,{as:Pw,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(ie.div,{"data-state":Pi(o.open),...r,ref:n,style:{pointerEvents:"auto",...r.style}})})}),Qn="DialogContent",F5=c.forwardRef((e,n)=>{const t=V5(Qn,e.__scopeDialog),{forceMount:r=t.forceMount,...o}=e,a=Vt(Qn,e.__scopeDialog);return u.jsx(qe,{present:r||a.open,children:a.modal?u.jsx(Ow,{...o,ref:n}):u.jsx(Tw,{...o,ref:n})})});F5.displayName=Qn;var Ow=c.forwardRef((e,n)=>{const t=Vt(Qn,e.__scopeDialog),r=c.useRef(null),o=ye(n,t.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return z1(a)},[]),u.jsx($5,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=t.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,a=>a.preventDefault())})}),Tw=c.forwardRef((e,n)=>{const t=Vt(Qn,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return u.jsx($5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(i=t.triggerRef.current)==null||i.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((d=t.triggerRef.current)==null?void 0:d.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),$5=c.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=Vt(Qn,t),l=c.useRef(null),d=ye(n,l);return x1(),u.jsxs(u.Fragment,{children:[u.jsx(ho,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:u.jsx(jn,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Pi(i.open),...s,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Dw,{titleId:i.titleId}),u.jsx(Vw,{contentRef:l,descriptionId:i.descriptionId})]})]})}),ki="DialogTitle",z5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(ki,t);return u.jsx(ie.h2,{id:o.titleId,...r,ref:n})});z5.displayName=ki;var Z5="DialogDescription",B5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(Z5,t);return u.jsx(ie.p,{id:o.descriptionId,...r,ref:n})});B5.displayName=Z5;var W5="DialogClose",G5=c.forwardRef((e,n)=>{const{__scopeDialog:t,...r}=e,o=Vt(W5,t);return u.jsx(ie.button,{type:"button",...r,ref:n,onClick:ee(e.onClick,()=>o.onOpenChange(!1))})});G5.displayName=W5;function Pi(e){return e?"open":"closed"}var R5="DialogTitleWarning",[TT,j5]=_p(R5,{contentName:Qn,titleName:ki,docsSlug:"dialog"}),Dw=({titleId:e})=>{const n=j5(R5),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
102
102
 
103
103
  If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
104
104