@kingsimba/nc-ui 0.1.19 → 0.1.21
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.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +17 -7
- package/dist/index.js +1020 -1012
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var Xe=Object.defineProperty;var Je=(e,t,r)=>t in e?Xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var G=(e,t,r)=>Je(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),H=require("./GeneratedIcons-CGjL38ny.cjs"),d=require("react"),ce=require("react-dom"),q=require("react-i18next"),Qe=require("i18next"),Ze=require("./clsx-C11secjj.cjs");function me({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function O({variant:e="default",block:t,size:r="default",className:s,disabled:o,textSelectable:i,loading:l,onClick:c,children:u,...f}){const h=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",o||l?"nc-disabled":"",i?"nc-text-selectable":"",l?"nc-loading":"",s??""].filter(Boolean).join(" "),g=a=>{if(!l){if(i){const p=window.getSelection();if(p&&p.toString().length>0)return}c==null||c(a)}};return n.jsxs("button",{className:h,disabled:o||l,onClick:g,...f,children:[l&&n.jsx(me,{size:"small",className:"nc-button-spinner",color:e!=="default"&&e!=="ghost"?"white":void 0}),u]})}const et={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function tt({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:l,className:c="",style:u}){const f=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${c}`.trim(),style:u,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:f}),l&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:l,children:n.jsx(H.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(O,{size:"small",variant:s.variant??et[r],onClick:o,children:s.text})})]})}function nt({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0));let i;s?o<.1?i="var(--nc-danger)":o<.2?i="var(--nc-warning)":i="var(--nc-success)":i=r?"#ffffff":"#000000";const l=r?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.2)",c=24,u=14,f=2,h=0,g=12,a=0,p=0,w=0,b=c,v=u,k=v-a*2,m=b-a*2,j=Math.max(1,Math.min(4,v/4)),x=o===0?0:.05+o*.95,S=c+f+g,M=20,A=.65,$=Math.max(u,M*A),y=c+f+1,E=(u-M*A)/2;return n.jsxs("svg",{className:"nc-battery",width:S,height:$,viewBox:`0 0 ${S} ${$}`,role:"img","aria-label":`Battery ${o===0?"-":Math.round(o*100)+"%"} ${t}`,children:[n.jsxs("defs",{children:[n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:m*x,height:k,fill:"white"})}),n.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[n.jsx("rect",{x:"0",y:"0",width:S,height:$,fill:"white"}),n.jsx("text",{x:p+b/2,y:u-3,fontSize:11,fontWeight:"bold",fill:"black",textAnchor:"middle",children:o===0?"-":Math.round(o*100)})]})]}),n.jsxs("g",{mask:`url(#nc-battery-text-mask-${o})`,children:[n.jsx("rect",{x:p,y:w,rx:j,ry:j,width:b,height:v,fill:l}),n.jsx("rect",{x:p+a,y:w+a,width:m,height:k,fill:i,rx:j,ry:j,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("rect",{x:c+h,y:u*.26,width:f,height:u*.48,rx:.8,ry:.8,fill:o===1?i:l}),t==="charging"?n.jsx("g",{transform:`translate(${y}, ${E}) scale(${A})`,fill:i,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function rt({value:e,onChange:t,options:r,disabled:s,labels:o,size:i="default"}){return n.jsx("div",{className:`nc-button-group ${i==="small"?"nc-small":""}`,children:r.map((l,c)=>n.jsx("button",{className:`nc-button-group-item ${e===l?"nc-active":""} ${c<r.length-1?"nc-has-border":""}`,onClick:()=>!s&&t(l),disabled:s,children:o&&o[l]?o[l]:l},l))})}function st({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ot({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:l,className:c=""}){const u=o==="small";return n.jsxs("label",{className:`nc-checkbox-label ${u?"nc-small":""} ${r?"nc-disabled":""} ${c}`.trim(),style:l,onClick:f=>{r||(f.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${u?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:f=>{r||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&n.jsx(st,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function it({option:e,onChange:t,selected:r,highlighted:s,small:o}){const i=d.useRef(null),{t:l}=q.useTranslation();return d.useEffect(()=>{s&&i.current&&i.current.scrollIntoView({block:"nearest"})},[s]),n.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":r,style:{cursor:"pointer",background:s?"rgba(59,130,246,0.18)":r?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",l("common.default"),")"]})]})}function ct({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:l,highlightedIndex:c=-1}){const[u,f]=d.useState({top:0,left:0,width:0}),[h,g]=d.useState(o),{t:a}=q.useTranslation();if(d.useEffect(()=>{if(e&&i.current){const w=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const v=window.innerHeight-w.bottom,k=w.top;v<320&&k>v&&(b="top")}g(b),f({top:b==="top"?w.top-4:w.bottom+4,left:w.left,width:w.width})}},[e,i,o]),!e)return null;const p=n.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:h==="top"?void 0:u.top,bottom:h==="top"?window.innerHeight-u.top:void 0,left:u.left,width:u.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${l?"nc-small":""}`,children:a("common.noResults")}):t.map((w,b)=>n.jsx(it,{option:w,onChange:r,selected:w.value===s,highlighted:b===c,small:l},w.value))});return ce.createPortal(p,document.body)}function at({onClick:e,small:t}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:r=>r.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function lt({open:e,onClick:t,small:r}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${r?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:s=>s.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function dt({value:e,onChange:t,placeholder:r="Select…",options:s,disabled:o,label:i,clearable:l=!0,allowTyping:c=!1,placement:u="bottom",size:f="default",style:h,className:g}){const[a,p]=d.useState(!1),[w,b]=d.useState(""),[v,k]=d.useState(-1),m=d.useRef(null),j=d.useRef(null),x=f==="small",{t:S}=q.useTranslation(),M=d.useMemo(()=>{const I=w.toLowerCase();return c?s.filter(T=>T.label.toLowerCase().includes(I)):s},[s,w,c]);d.useEffect(()=>{a&&k(-1)},[a,M]),d.useEffect(()=>{if(!l&&!e&&s.length>0&&t){const I=s.find(T=>T.default)||s[0];t(I.value)}},[l,e,s,t]),d.useEffect(()=>{function I(T){var B;T.target instanceof Node&&m.current&&((B=m.current.parentElement)!=null&&B.contains(T.target)||p(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const A=s.find(I=>I.value===e),$=A&&l,y=!o&&!$,E=!(a&&c)&&!!A,N=(I,T=!1)=>{var B;t==null||t(I),p(!1),b(""),T&&((B=m.current)==null||B.blur())},C=()=>{t==null||t(void 0),b(""),p(!1)},P=I=>{if(!a){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(p(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),k(T=>{const B=T+1;return B>=M.length?0:B});break;case"ArrowUp":I.preventDefault(),k(T=>{const B=T-1;return B<0?M.length-1:B});break;case"Enter":I.preventDefault(),v>=0&&v<M.length&&N(M[v].value,!0);break;case"Escape":I.preventDefault(),p(!1),b("");break}};return n.jsxs("div",{className:`nc-combo-container ${g||""}`.trim(),style:{position:"relative",...h},children:[i&&n.jsx("span",{className:`nc-label ${x?"nc-small":""}`,children:i}),n.jsxs("div",{ref:j,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||c&&I.target===m.current||(p(T=>(!T&&c&&A&&b(A.label),!T)),c&&!a&&setTimeout(()=>{var T,B;(T=m.current)==null||T.focus(),(B=m.current)==null||B.select()},0))},children:[n.jsx("input",{ref:m,className:`nc-input ${x?"nc-small":""}`,placeholder:r,onFocus:()=>{var I;!o&&c&&(p(!0),A&&(b(A.label),setTimeout(()=>{var T;return(T=m.current)==null?void 0:T.select()},0))),c||(I=m.current)==null||I.blur()},onChange:I=>c&&b(I.target.value),onKeyDown:P,value:a&&c?w:(A==null?void 0:A.label)||"",readOnly:o||!c,style:{width:"100%",paddingRight:y||$?x?32:44:12,caretColor:c?void 0:"transparent",cursor:c?void 0:"pointer",userSelect:c?void 0:"none",color:E?"transparent":"var(--nc-text)"}}),E&&n.jsxs("div",{"aria-hidden":!0,style:{position:"absolute",left:x?8:12,right:y||$?x?12:24:x?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[n.jsx("span",{className:`nc-combo-overlay-text ${x?"nc-small":""}`,children:A==null?void 0:A.label}),(A==null?void 0:A.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${x?"nc-small":""}`,children:["(",S("common.default"),")"]})]}),$&&n.jsx(at,{onClick:C,small:x}),y&&n.jsx(lt,{open:a,onClick:()=>p(I=>!I),small:x})]}),n.jsx(ct,{isOpen:a,options:M,onSelect:N,selectedValue:e,placement:u,anchorRef:j,small:x,highlightedIndex:v})]})}function ut({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const l=s==="small"?14:s==="large"?20:18,c=t?"Refreshing...":"Refresh",u=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??c,"aria-label":i??u,"data-size":s,children:n.jsx(H.RefreshIcon,{size:l,className:t?"nc-spinning":""})})}function ge({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(H.CloseIcon,{size:i})})}function pt({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(H.EditIcon,{size:i})})}function ft({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(H.TrashIcon,{size:i})})}function ht({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function mt({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const l=d.useRef(null),[c,u]=d.useState({top:0,left:0}),f=o||(s==null?void 0:s.current);if(d.useEffect(()=>{if(!e||!f||!l.current)return;const a=f.getBoundingClientRect(),p=l.current.getBoundingClientRect(),w=window.innerHeight,b=window.innerWidth,v=a.bottom+8,k=v+p.height<=w-8;let m=i;(!k&&i==="down"||i==="up"&&k)&&(m="up");let j;m==="down"?j=v:j=a.top-p.height-8;let x=a.left;x+p.width>b-8&&(x=a.right-p.width),u({top:Math.max(8,j),left:Math.max(8,x)})},[e,f,i]),d.useEffect(()=>{if(!e)return;const a=w=>{l.current&&!l.current.contains(w.target)&&f&&!f.contains(w.target)&&t()},p=w=>{w.key==="Escape"&&t()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",p)}},[e,t,f]),!e)return null;const h=a=>{a.type!=="separator"&&!a.disabled&&a.onClick&&(a.onClick(),t())},g=r.some(a=>a.icon);return ce.createPortal(n.jsx("div",{ref:l,className:"nc-context-menu",style:{position:"fixed",top:`${c.top}px`,left:`${c.left}px`,zIndex:1e4},role:"menu",children:r.map(a=>{if(a.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},a.id);const p=["nc-context-menu-item",a.variant&&a.variant!=="default"?`nc-${a.variant}`:"",a.disabled?"nc-disabled":"",g&&!a.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:p,onClick:()=>h(a),disabled:a.disabled,role:"menuitem",children:[a.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:a.icon}),n.jsx("span",{className:"nc-context-menu-label",children:a.label})]},a.id)})}),document.body)}const Te=d.createContext(null);function Pe(){const e=d.useContext(Te);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function U({children:e,onClick:t,...r}){const{close:s}=Pe(),{t:o}=q.useTranslation(),i=l=>{t==null||t(l),s()};return n.jsx(O,{onClick:i,...r,children:e??o("common.close")})}function gt({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:l,onOk:c,onSave:u,onDelete:f,onCancel:h,onConnect:g,closeOnOverlay:a=!0,primaryDisabled:p=!1,fullScreen:w=!1,hideTitleBar:b=!1,className:v="",onContentHeightChange:k}){const m=d.useRef(null),j=d.useRef(null),{t:x}=q.useTranslation(),S={close:t},M=y=>{a&&y.target===y.currentTarget&&t()};if(d.useEffect(()=>{e&&m.current&&m.current.focus()},[e]),d.useEffect(()=>{if(!k||!j.current)return;const y=new ResizeObserver(E=>{for(const N of E){const C=N.contentRect.height;k(C)}});return y.observe(j.current),()=>{y.disconnect()}},[k]),!e)return null;const A=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(O,{variant:"primary",onClick:c??t,disabled:p,children:x("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(O,{variant:"primary",onClick:c??t,disabled:p,children:x("common.ok")}),n.jsx(U,{onClick:h,children:x("common.cancel")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(O,{variant:"primary",onClick:u,disabled:p,children:x("common.save")}),n.jsx(U,{onClick:h,children:x("common.cancel")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(O,{variant:"danger",onClick:f,disabled:p,children:x("common.delete")}),n.jsx(U,{onClick:h,children:x("common.cancel")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(O,{variant:"primary",onClick:g,disabled:p,children:x("common.connect")}),n.jsx(U,{onClick:h,children:x("common.cancel")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(U,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(U,{variant:"primary",children:x("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:l});case"none":return null;default:return null}},$=n.jsx(Te.Provider,{value:S,children:n.jsx("div",{className:`nc-dialog-overlay${w?" nc-fullscreen":""}`,onClick:M,children:n.jsxs("div",{ref:m,className:`nc-dialog-container ${v}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":b?void 0:"nc-dialog-title",children:[!b&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(ge,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:j,className:"nc-dialog-content",children:s}),A()]})})});return w?ce.createPortal($,document.body):$}function bt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function xt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(H.EyeHiddenIcon,{size:o}):n.jsx(H.ViewIcon,{size:o})})}function vt({value:e,defaultValue:t="",onChange:r,onEnter:s,onClear:o,placeholder:i,disabled:l,label:c,clearable:u=!0,type:f="text",className:h="",size:g="default",style:a,showPasswordToggle:p=!1,multiline:w=!1,rows:b=3,validator:v,showErrorMessage:k=!0}){const m=d.useRef(null),j=d.useRef(null),[x,S]=d.useState(!1),[M,A]=d.useState(!1),$=e!==void 0,[y,E]=d.useState(t),N=$?e:y,C=v?v(N):null,P=!!C,I=f==="password",T=I&&p&&!l&&!w,B=u&&N&&!l&&M,Q=g==="small"?32:44;let V=12;B&&T?V=Q*2:(B||T)&&(V=Q);const _=()=>{var Z,re;$||E(""),r==null||r(""),o==null||o(),w?(Z=j.current)==null||Z.focus():(re=m.current)==null||re.focus()},ne=Z=>{Z.key==="Enter"&&!w&&(s==null||s())},L=Z=>{const re=Z.target.value;$||E(re),r==null||r(re)},ke=()=>{A(!0)},Ne=()=>{A(!1)},Se=`nc-input ${g==="small"?"nc-small ":""} ${P?"nc-error ":""}${h}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...a},children:[c&&n.jsx("span",{className:"nc-label",children:c}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:w?"flex-start":"center"},children:[w?n.jsx("textarea",{ref:j,className:Se,placeholder:i,value:N,onChange:L,onKeyDown:ne,onFocus:ke,onBlur:Ne,readOnly:l,"aria-disabled":l,tabIndex:l?-1:void 0,rows:b,style:{width:"100%",paddingRight:V}}):n.jsx("input",{ref:m,type:I&&x?"text":f,className:Se,placeholder:i,value:N,onChange:L,onKeyDown:ne,onFocus:ke,onBlur:Ne,readOnly:l,"aria-disabled":l,tabIndex:l?-1:void 0,style:{width:"100%",paddingRight:V}}),B&&n.jsx(bt,{onClick:_,size:g,rightOffset:T?Q+4:4}),T&&n.jsx(xt,{visible:x,onClick:()=>S(!x),size:g})]}),P&&k&&n.jsx("span",{className:"nc-error-message",children:C})]})}function wt({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,l]=d.useState(!1),c=u=>{if(t){if(s){const f=window.getSelection();if(f&&f.toString().length>0)return}t(u)}};return n.jsx("div",{onClick:c,onMouseDown:()=>t&&l(!0),onMouseUp:()=>l(!1),onMouseLeave:()=>l(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1},children:e})})}function yt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function jt({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,l]=d.useState(!1),[c,u]=d.useState(""),f=d.useRef(null),h=d.useMemo(()=>r.filter(a=>a.label.toLowerCase().includes(c.toLowerCase())),[r,c]);d.useEffect(()=>{function a(p){!(p.target instanceof Node)||!f.current||f.current.contains(p.target)||l(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]);const g=a=>{e.includes(a)?t(e.filter(p=>p!==a)):t([...e,a])};return n.jsxs("div",{ref:f,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(a=>{const p=r.find(w=>w.value===a);return p?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[p.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>g(a),"aria-label":`Remove ${p.label}`,children:"✕"})]},a):null}),n.jsx("input",{className:"nc-input",value:c,onChange:a=>u(a.target.value),onFocus:()=>l(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[h.map(a=>{const p=e.includes(a.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>g(a.value),children:[n.jsx("span",{children:a.label}),n.jsx("span",{children:p?"✔️":""})]},a.value)}),h.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function ae(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function ie(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function Ce(e){if(!e)return"";const t=ie(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Ae(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function kt({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:l="default"}){const[c,u]=d.useState(!1),[f,h]=d.useState(""),[g,a]=d.useState(""),[p,w]=d.useState({top:0,left:0,width:0,right:void 0}),b=d.useRef(null),v=d.useRef(null);d.useEffect(()=>{if(c&&b.current){const N=b.current.getBoundingClientRect(),P=Math.max(N.width,400);window.innerWidth-N.left<P&&N.right>=P?w({top:N.bottom+4,left:0,right:window.innerWidth-N.right,width:P}):w({top:N.bottom+4,left:N.left,right:void 0,width:P})}},[c]),d.useEffect(()=>{if(!c)return;const N=C=>{b.current&&!b.current.contains(C.target)&&v.current&&!v.current.contains(C.target)&&u(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[c]);const k=()=>{h(e||Ae()),a(t||Ae()),u(!0)},m=()=>{u(!1)},j=()=>{const N=ae(f),C=ae(g);if(N||C)return;const P=ie(f),I=ie(g);P&&I&&(r==null||r(P,I)),u(!1)},x=e&&t?`${Ce(e)} - ${Ce(t)}`:"Select month range",S=ae(f),M=ae(g),A=ie(f),$=ie(g),y=A&&$&&A>$,E=c?ce.createPortal(n.jsx("div",{ref:v,className:"nc-month-range-picker-popup",style:{position:"fixed",top:p.top,...p.right!==void 0?{right:p.right}:{left:p.left},width:p.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${S?"nc-error":""}`,value:f,onChange:N=>h(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),S&&n.jsx("div",{className:"nc-month-error-text",children:S})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${M?"nc-error":""}`,value:g,onChange:N=>a(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),M&&n.jsx("div",{className:"nc-month-error-text",children:M})]})]}),y&&!S&&!M&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(O,{variant:"primary",onClick:j,disabled:!f||!g||!!S||!!M||!!y,children:"Apply"}),n.jsx(O,{variant:"ghost",onClick:m,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${l==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${l==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:b,className:`nc-month-range-picker-input${l==="small"?" nc-small":""}`,onClick:k,disabled:i,children:x}),E]})}function Nt({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:l,size:c="default"}){const u=c==="small",f=()=>{const a=e-o;r!==void 0&&a<r||t(parseFloat(a.toFixed(10)))},h=()=>{const a=e+o;s!==void 0&&a>s||t(parseFloat(a.toFixed(10)))},g=a=>{const p=parseFloat(a.target.value);isNaN(p)||r!==void 0&&p<r||s!==void 0&&p>s||t(p)};return n.jsxs("div",{className:`nc-col nc-number-input-col ${u?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${u?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${u?"nc-small":""}`,children:[n.jsx("input",{className:`nc-input nc-number-input ${u?"nc-small":""}`,type:"number",value:e,onChange:g,min:r,max:s,step:o,disabled:l}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${u?"nc-small":""}`,onClick:f,disabled:l||r!==void 0&&e<=r,children:"−"}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${u?"nc-small":""}`,onClick:h,disabled:l||s!==void 0&&e>=s,children:"+"})]})]})}function St({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:l,showValue:c=!0,formatValue:u=h=>h.toString(),width:f=200}){const h=a=>{const p=parseFloat(a.target.value);t(p)},g=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:h,min:r,max:s,step:o,disabled:l,style:{width:f,"--nc-slider-percentage":`${g}%`}}),c&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:u(e)})]})]})}const Ct=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function ze({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function At({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=d.Children.toArray(t).filter(c=>d.isValidElement(c)&&(c.type===ze||c.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(c=>{const u=c.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${u?"nc-active":""}`,style:{display:u?void 0:"none"},"aria-hidden":!u,children:c},c.props.tab)})});const l=i.find(c=>c.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:l})}function Rt({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:l,multiline:c,orientation:u="horizontal",style:f}){const h=d.useRef(null),[g,a]=d.useState(!1),[p,w]=d.useState(!1),b=u==="verticalLeft"||u==="verticalRight",v=d.useRef(!1),k=d.useRef(0),m=d.useRef(0),j=d.useRef(!1);d.useEffect(()=>{const y=()=>{if(h.current)if(b){const{scrollTop:N,scrollHeight:C,clientHeight:P}=h.current;a(N>1),w(N<C-P-1)}else{const{scrollLeft:N,scrollWidth:C,clientWidth:P}=h.current;a(N>1),w(N<C-P-1)}},E=h.current;if(E)return y(),E.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{E.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e,b]);const x=y=>{h.current&&(v.current=!0,j.current=!1,k.current=b?y.clientY:y.clientX,m.current=b?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},S=y=>{if(!v.current||!h.current)return;const E=b?y.clientY:y.clientX,N=k.current-E;Math.abs(N)>3&&(j.current=!0),b?h.current.scrollTop=m.current+N:h.current.scrollLeft=m.current+N},M=()=>{h.current&&(v.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},A=()=>{M()};d.useEffect(()=>{const y=h.current;if(!y||b)return;const E=N=>{N.deltaY!==0&&(N.preventDefault(),y.scrollLeft+=N.deltaY*.3)};return y.addEventListener("wheel",E,{passive:!1}),()=>{y.removeEventListener("wheel",E)}},[b]);const $=y=>{j.current||r(y)};return n.jsxs("div",{className:`nc-tab-container ${b?`nc-vertical nc-${u}`:""} ${i||""}`,style:f,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[g&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-top":"nc-left"}`,children:b?n.jsx(Ct,{size:16}):n.jsx(H.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${c?"nc-multiline":""}`,onMouseDown:x,onMouseMove:S,onMouseUp:M,onMouseLeave:A,style:{cursor:"grab"},children:e.map(y=>{const E=typeof y=="string"?y:y.id,N=typeof y=="string"?y:y.label,C=s&&!(o!=null&&o.includes(E));return n.jsxs("div",{className:`nc-tab-item ${t===E?"nc-active":""} ${C?"nc-closable":""}`,onClick:()=>$(E),role:"button",tabIndex:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&r(E)},children:[n.jsx("span",{className:"nc-tab-label",children:b?N:typeof N=="string"?N.toUpperCase():N}),C&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof N=="string"?N:E}`,onClick:P=>{P.stopPropagation(),s(E)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.stopPropagation(),s(E))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},E)})}),p&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-bottom":"nc-right"}`,children:b?n.jsx(H.ChevronDownIcon,{size:16}):n.jsx(H.ChevronRightIcon,{size:16})})]}),l&&n.jsx("div",{className:"nc-tab-toolbar",children:l})]})}function It({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Re=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Mt(e,t){const s=e.slice(0,t).split(`
|
|
2
|
-
`),o=s.length,l=s[o-1].split(" "),
|
|
3
|
-
`),i=Math.max(1,Math.min(t,o.length));let l=0;for(let g=0;g<i-1;g++)l+=o[g].length+1;const u=o[i-1].split(" "),f=Math.max(1,Math.min(r,u.length));for(let g=0;g<f-1;g++)l+=u[g].length+1;const h=Math.max(1,Math.min(s,u[f-1].length+1));return l+=h-1,l}function
|
|
4
|
-
`),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const
|
|
5
|
-
`).length,[t]),
|
|
6
|
-
`).map((
|
|
7
|
-
`]},S)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${l?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[l&&v(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:g,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:k(t)})}),n.jsx("textarea",{ref:h,className:"nc-csv-textarea-input",value:t,onChange:m=>{r(m.target.value),requestAnimationFrame(p)},onScroll:w,onSelect:p,onKeyUp:p,onClick:p,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let X={notifications:[]};const pe=new Set,Ie=new Map;function fe(){const e=X.notifications.slice();for(const t of Array.from(pe))try{t(e)}catch{}}function Pt(e){pe.add(e);try{e(X.notifications.slice())}catch{}return()=>{pe.delete(e)}}function zt(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return X.notifications=[i,...X.notifications],fe(),i.duration&&i.duration>0&&setTimeout(()=>{Be(t)},i.duration),t}function Be(e){const t=X.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,fe();const r=window.setTimeout(()=>{X.notifications=X.notifications.filter(s=>s.id!==e),fe(),Ie.delete(e)},300);Ie.set(e,r)}function Le({notification:e}){const{t}=q.useTranslation(),r=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},s=()=>{Be(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[n.jsx("div",{className:"nc-notification-title",children:r()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:s,children:n.jsx(H.CloseIcon,{size:16})})]})})}function Bt(){const[e,t]=d.useState([]),[r,s]=d.useState(new Map),[o,i]=d.useState(new Set),l=d.useRef(null),c=d.useRef([]);return d.useEffect(()=>Pt(f=>{const h=new Set(c.current.map(a=>a.id)),g=f.filter(a=>!h.has(a.id)).map(a=>a.id);g.length>0?(t(f),i(new Set(g)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(f),c.current=f}),[]),d.useEffect(()=>{if(!l.current)return;const u=new Map;let f=0;const h=l.current.children;e.forEach((g,a)=>{if(u.set(g.id,f),h[a]){const p=h[a].offsetHeight;g.isRemoving||(f+=p+12)}}),s(u)},[e]),n.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:n.jsx("div",{ref:l,style:{pointerEvents:"auto",position:"relative"},children:e.map(u=>{const f=o.has(u.id),h=u.isRemoving,g=r.get(u.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:f?"translateY(-120px)":`translateY(${g}px)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?0:1,width:"100%"},children:n.jsx(Le,{notification:u})},u.id)})})})}function De(e){return zt(e)}const Lt={show:e=>De(e)};function Dt(e){const t=Qe.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const l of i)if(l.type==="attributes"&&l.attributeName==="lang"){const c=document.documentElement.lang||"en";t.changeLanguage(c)}}).observe(document.documentElement,{attributes:!0}),t}class Ht{constructor(){G(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const J=new Ht,Me="nc-ui-app-state";class Ot{constructor(){G(this,"state");G(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Me);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Me,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const W=new Ot;class Wt{constructor(){G(this,"apps",[]);G(this,"activeAppId",null);G(this,"listeners",new Set);G(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!J.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(l=>l.appId===t);if(o)return s||(this.setActiveApp(t),W._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,W._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,W._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),W._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?J.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const D=new Wt,be=d.createContext(null);function He(){const e=d.useContext(be);if(!e)throw new Error("useApp must be used inside an App");return e}function Ft({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Oe({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(Ft,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(ge,{onClick:t,"aria-label":"Close application"})]})]})}class Vt extends d.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function xe({appId:e,isActive:t,onClose:r}){const{t:s}=q.useTranslation(),o=J.get(e),[i,l]=d.useState(""),[c,u]=d.useState(null),[f,h]=d.useState(null),[g,a]=d.useState(!1),[p,w]=d.useState(!1);d.useEffect(()=>{o!=null&&o.titleKey&&l(s(o.titleKey))},[o,s]);const b=d.useCallback(y=>{l(y)},[]),v=d.useCallback(y=>{u(()=>y)},[]),k=d.useCallback(()=>{u(null)},[]),m=d.useCallback(y=>{h(y)},[]),j=d.useCallback(()=>{h(null)},[]),x=d.useCallback(y=>{a(y)},[]),S=d.useCallback(y=>{w(y)},[]),M=d.useMemo(()=>({setTitle:b,setBackHandler:v,clearBackHandler:k,setToolbar:m,clearToolbar:j,setHideBackButton:x,setHideTitleBar:S,close:r}),[b,v,k,m,j,x,S,r]);if(!o)return null;const A=o.component,$=!o.hideTitleBar&&!p;return n.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[$&&n.jsx(Oe,{title:i,onClose:r,onBack:c??void 0,toolbar:f,hideBackButton:g}),n.jsx("div",{className:$?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-secondary)",position:"relative"},children:n.jsx(be.Provider,{value:M,children:n.jsx(Vt,{appId:e,children:n.jsx(d.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:n.jsx(me,{})}),children:n.jsx(A,{})})})})})]})}const le=768,de=1024,We={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Fe=d.createContext(We);function Gt({children:e}){const[t,r]=d.useState(()=>{if(typeof window>"u")return We;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<le,isTablet:s>=le&&s<de,isDesktop:s>=de,width:s,height:o}});return d.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<le,isTablet:o>=le&&o<de,isDesktop:o>=de,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(Fe.Provider,{value:t,children:e})}function ve(){return d.useContext(Fe)}const we="-",Yt=e=>{const t=qt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{const c=l.split(we);return c[0]===""&&c.length!==1&&c.shift(),Ve(c,t)||Kt(l)},getConflictingClassGroupIds:(l,c)=>{const u=r[l]||[];return c&&s[l]?[...u,...s[l]]:u}}},Ve=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?Ve(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(we);return(l=t.validators.find(({validator:c})=>c(i)))==null?void 0:l.classGroupId},Ee=/^\[(.+)\]$/,Kt=e=>{if(Ee.test(e)){const t=Ee.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},qt=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return Ut(Object.entries(e.classGroups),r).forEach(([i,l])=>{he(l,s,i,t)}),s},he=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:$e(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(_t(o)){he(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,l])=>{he(l,$e(t,i),r,s)})})},$e=(e,t)=>{let r=e;return t.split(we).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},_t=e=>e.isThemeGetter,Ut=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,c])=>[t+l,c])):i);return[r,o]}):e,Xt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=s.get(i))!==void 0)return o(i,l),l},set(i,l){r.has(i)?r.set(i,l):o(i,l)}}},Ge="!",Jt=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,l=c=>{const u=[];let f=0,h=0,g;for(let v=0;v<c.length;v++){let k=c[v];if(f===0){if(k===o&&(s||c.slice(v,v+i)===t)){u.push(c.slice(h,v)),h=v+i;continue}if(k==="/"){g=v;continue}}k==="["?f++:k==="]"&&f--}const a=u.length===0?c:c.substring(h),p=a.startsWith(Ge),w=p?a.substring(1):a,b=g&&g>h?g-h:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:b}};return r?c=>r({className:c,parseClassName:l}):l},Qt=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},Zt=e=>({cache:Xt(e.cacheSize),parseClassName:Jt(e),...Yt(e)}),en=/\s+/,tn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],l=e.trim().split(en);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{modifiers:h,hasImportantModifier:g,baseClassName:a,maybePostfixModifierPosition:p}=r(f);let w=!!p,b=s(w?a.substring(0,p):a);if(!b){if(!w){c=f+(c.length>0?" "+c:c);continue}if(b=s(a),!b){c=f+(c.length>0?" "+c:c);continue}w=!1}const v=Qt(h).join(":"),k=g?v+Ge:v,m=k+b;if(i.includes(m))continue;i.push(m);const j=o(b,w);for(let x=0;x<j.length;++x){const S=j[x];i.push(k+S)}c=f+(c.length>0?" "+c:c)}return c};function nn(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ye(t))&&(s&&(s+=" "),s+=r);return s}const Ye=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=Ye(e[s]))&&(r&&(r+=" "),r+=t);return r};function rn(e,...t){let r,s,o,i=l;function l(u){const f=t.reduce((h,g)=>g(h),e());return r=Zt(f),s=r.cache.get,o=r.cache.set,i=c,c(u)}function c(u){const f=s(u);if(f)return f;const h=tn(u,r);return o(u,h),h}return function(){return i(nn.apply(null,arguments))}}const z=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ke=/^\[(?:([a-z-]+):)?(.+)\]$/i,sn=/^\d+\/\d+$/,on=new Set(["px","full","screen"]),cn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,an=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ln=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,un=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,F=e=>ee(e)||on.has(e)||sn.test(e),Y=e=>te(e,"length",vn),ee=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>te(e,"number",ee),se=e=>!!e&&Number.isInteger(Number(e)),pn=e=>e.endsWith("%")&&ee(e.slice(0,-1)),R=e=>Ke.test(e),K=e=>cn.test(e),fn=new Set(["length","size","percentage"]),hn=e=>te(e,fn,qe),mn=e=>te(e,"position",qe),gn=new Set(["image","url"]),bn=e=>te(e,gn,yn),xn=e=>te(e,"",wn),oe=()=>!0,te=(e,t,r)=>{const s=Ke.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},vn=e=>an.test(e)&&!ln.test(e),qe=()=>!1,wn=e=>dn.test(e),yn=e=>un.test(e),jn=()=>{const e=z("colors"),t=z("spacing"),r=z("blur"),s=z("brightness"),o=z("borderColor"),i=z("borderRadius"),l=z("borderSpacing"),c=z("borderWidth"),u=z("contrast"),f=z("grayscale"),h=z("hueRotate"),g=z("invert"),a=z("gap"),p=z("gradientColorStops"),w=z("gradientColorStopPositions"),b=z("inset"),v=z("margin"),k=z("opacity"),m=z("padding"),j=z("saturate"),x=z("scale"),S=z("sepia"),M=z("skew"),A=z("space"),$=z("translate"),y=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",R,t],C=()=>[R,t],P=()=>["",F,Y],I=()=>["auto",ee,R],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",R],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[ee,R];return{cacheSize:500,separator:":",theme:{colors:[oe],spacing:[F,Y],blur:["none","",K,R],brightness:L(),borderColor:[e],borderRadius:["none","","full",K,R],borderSpacing:C(),borderWidth:P(),contrast:L(),grayscale:_(),hueRotate:L(),invert:_(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[pn,Y],inset:N(),margin:N(),opacity:L(),padding:C(),saturate:L(),scale:L(),sepia:_(),skew:L(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[K]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...T(),R]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:y()}],"overscroll-x":[{"overscroll-x":y()}],"overscroll-y":[{"overscroll-y":y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",se,R]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",se,R]}],"grid-cols":[{"grid-cols":[oe]}],"col-start-end":[{col:["auto",{span:["full",se,R]},R]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[oe]}],"row-start-end":[{row:["auto",{span:[se,R]},R]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[a]}],"gap-x":[{"gap-x":[a]}],"gap-y":[{"gap-y":[a]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[K]},K]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",K,Y]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",ee,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",F,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",F,Y]}],"underline-offset":[{"underline-offset":["auto",F,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),mn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:B()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[F,R]}],"outline-w":[{outline:[F,Y]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[F,Y]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",K,xn]}],"shadow-color":[{shadow:[oe]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",K,R]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[j]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[se,R]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[F,Y,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},kn=rn(jn);function _e(...e){return kn(Ze.clsx(e))}function Nn({autoWidth:e=!0,className:t,style:r}){const[s,o]=d.useState(()=>W.getActiveAppId()),[i,l]=d.useState(()=>D.getRunningApps()),{isMobile:c}=ve();d.useEffect(()=>{const v=W.subscribe("activeAppId",k=>{o(k)});return()=>{v()}},[]),d.useEffect(()=>D.subscribe(()=>{l(D.getRunningApps())}),[]),d.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const m=W.getActiveAppId();m&&!D.isRunning(m)&&D.launchApp(m)}},[]);const u=v=>{D.closeApp(v)},f=s?J.get(s):null,g=(f==null?void 0:f.width)??400,a=s!==null,b={...{overflow:"hidden",display:a?"flex":"none",flexDirection:"column",flexShrink:0,...e&&a?{width:c?"100%":g}:{}},...r};return n.jsx("div",{className:_e("nc-app-panel",t),style:b,children:i.map(v=>n.jsx(xe,{appId:v.appId,isActive:s===v.appId,onClose:()=>u(v.appId)},v.appId))})}function Sn({pinnedAppIds:e,className:t=""}){const{isMobile:r}=ve(),[s,o]=d.useState(()=>W.getActiveAppId()),[i,l]=d.useState(()=>D.getRunningApps());d.useEffect(()=>{const a=W.subscribe("activeAppId",p=>{o(p)});return()=>{a()}},[]),d.useEffect(()=>D.subscribe(()=>{l(D.getRunningApps())}),[]);const c=a=>{s===a?D.setActiveApp(null):D.launchApp(a)},u=e.map(a=>J.get(a)).filter(a=>!!a),f=i.filter(a=>!e.includes(a.appId)).map(a=>({running:a,def:J.get(a.appId)})).filter(a=>!!a.def),h=a=>i.some(p=>p.appId===a),g=r?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${r?"nc-mobile":"nc-desktop"} ${t}`,children:[u.map(a=>{const p=a.icon,w=s===a.id,b=h(a.id);return n.jsxs("button",{className:`nc-app-taskbar-button ${w?"nc-active":""} ${b?"nc-running":""}`,onClick:()=>c(a.id),title:a.titleKey||a.id,children:[n.jsx(p,{size:g}),b&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},a.id)}),f.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),f.map(({running:a,def:p})=>{const w=p.icon,b=s===a.appId;return n.jsxs("button",{className:`nc-app-taskbar-button ${b?"nc-active":""} nc-running`,onClick:()=>c(a.appId),title:p.titleKey||p.id,children:[n.jsx(w,{size:g}),n.jsx("span",{className:"nc-app-taskbar-indicator"})]},a.appId)})]})}function Cn({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const l=u=>{s&&u.target===u.currentTarget&&r()};if(!t)return null;const c=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:l,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:u=>u.stopPropagation(),children:n.jsx(xe,{appId:e,isActive:!0,onClose:r})})});return ce.createPortal(c,document.body)}const ye=d.createContext(null),Ue=d.createContext(null);function An(){const e=d.useContext(ye);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function Rn(){const e=d.useContext(Ue);if(!e)throw new Error("useNavView must be used within NavStack");return e}const je=d.createContext(null);function In({rootView:e,children:t}){const{t:r}=q.useTranslation(),s=He(),[o,i]=d.useState([e]),[l,c]=d.useState([null]),u=d.useCallback((x,S)=>{c(M=>{const A=[...M];return A[x]=S,A})},[]),f=d.useCallback(x=>{c(S=>{const M=[...S];return M[x]=null,M})},[]),h=d.useCallback(x=>{i(S=>[...S,x]),c(S=>[...S,null])},[]),g=d.useCallback(()=>{i(x=>x.length<=1?x:x.slice(0,-1)),c(x=>x.slice(0,-1))},[]),a=d.useCallback(()=>{i([e]),c([null])},[e]),p=o.length,w=p>1,b=o.length-1,v=o[o.length-1],k=v!=null&&v.titleKey?r(v.titleKey):(v==null?void 0:v.title)??"";d.useEffect(()=>{s.setTitle(k)},[k,s]),d.useEffect(()=>{w?s.setBackHandler(g):s.clearBackHandler()},[w,g,s]),d.useEffect(()=>{const x=l[l.length-1];x?s.setToolbar(x):s.clearToolbar()},[l,s]);const m={push:h,pop:g,reset:a,depth:p,canGoBack:w,currentTitle:k},j={stack:o,toolbarStack:l,updateToolbar:u,clearToolbarAt:f,topIndex:b};return n.jsx(ye.Provider,{value:m,children:n.jsx(je.Provider,{value:j,children:t})})}function Mn({index:e,children:t}){const r=d.useContext(je);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,l=d.useCallback(f=>{e===i&&s(e,f)},[e,i,s]),c=d.useCallback(()=>{e===i&&o(e)},[e,i,o]),u={setToolbar:l,clearToolbar:c};return n.jsx(Ue.Provider,{value:u,children:t})}function En(){const e=d.useContext(ye),t=d.useContext(je);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(Mn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=me;exports.Alert=tt;exports.AppContainer=xe;exports.AppContext=be;exports.AppDialog=Cn;exports.AppPanel=Nn;exports.AppTaskbar=Sn;exports.AppTitleBar=Oe;exports.Battery=nt;exports.Button=O;exports.ButtonGroup=rt;exports.Checkbox=ot;exports.CloseButton=ge;exports.ComboBox=dt;exports.ContextMenu=mt;exports.CsvTextArea=Tt;exports.Dialog=gt;exports.DialogClose=U;exports.EditButton=pt;exports.Hyperlink=ht;exports.Input=vt;exports.ListGroup=yt;exports.ListGroupItem=wt;exports.MonthRangePicker=kt;exports.MultiSelect=jt;exports.NavStackContainer=En;exports.NavStackProvider=In;exports.Notification=Le;exports.NotificationContainer=Bt;exports.NumberInput=Nt;exports.RefreshButton=ut;exports.Slider=St;exports.TabPanel=ze;exports.TabPanels=At;exports.Tabs=Rt;exports.Toggle=It;exports.TrashButton=ft;exports.ViewportProvider=Gt;exports.appRegistry=J;exports.appStateStore=W;exports.cn=_e;exports.createAppI18nFactory=Dt;exports.notificationManager=Lt;exports.runningAppsStore=D;exports.showNotification=De;exports.useApp=He;exports.useDialog=Pe;exports.useNavStack=An;exports.useNavView=Rn;exports.useViewport=ve;
|
|
1
|
+
"use strict";var Ze=Object.defineProperty;var et=(e,t,r)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Y=(e,t,r)=>et(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),W=require("./GeneratedIcons-CGjL38ny.cjs"),d=require("react"),ie=require("react-dom"),_=require("react-i18next"),tt=require("i18next"),nt=require("./clsx-C11secjj.cjs");function me({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function F({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:l,loading:a,onClick:u,children:f,...h}){const g=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",s==="transparent"?"nc-transparent":"",i||a?"nc-disabled":"",l?"nc-text-selectable":"",a?"nc-loading":"",o??""].filter(Boolean).join(" "),c=p=>{if(!a){if(l){const v=window.getSelection();if(v&&v.toString().length>0)return}u==null||u(p)}};return n.jsxs("button",{className:g,disabled:i||a,onClick:c,...h,children:[a&&n.jsx(me,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),f]})}const rt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function st({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:l,className:a="",style:u}){const f=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${a}`.trim(),style:u,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:f}),l&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:l,children:n.jsx(W.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(F,{size:"small",variant:s.variant??rt[r],onClick:o,children:s.text})})]})}function ot({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0));let i;s?o<.1?i="var(--nc-danger)":o<.2?i="var(--nc-warning)":i="var(--nc-success)":i=r?"#ffffff":"#000000";const l=r?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.2)",a=24,u=14,f=2,h=0,g=12,c=0,p=0,v=0,m=a,b=u,N=b-c*2,x=m-c*2,y=Math.max(1,Math.min(4,b/4)),w=o===0?0:.05+o*.95,j=a+f+g,E=20,$=.65,R=Math.max(u,E*$),k=a+f+1,M=(u-E*$)/2;return n.jsxs("svg",{className:"nc-battery",width:j,height:R,viewBox:`0 0 ${j} ${R}`,role:"img","aria-label":`Battery ${o===0?"-":Math.round(o*100)+"%"} ${t}`,children:[n.jsxs("defs",{children:[n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:x*w,height:N,fill:"white"})}),n.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[n.jsx("rect",{x:"0",y:"0",width:j,height:R,fill:"white"}),n.jsx("text",{x:p+m/2,y:u-3,fontSize:11,fontWeight:"bold",fill:"black",textAnchor:"middle",children:o===0?"-":Math.round(o*100)})]})]}),n.jsxs("g",{mask:`url(#nc-battery-text-mask-${o})`,children:[n.jsx("rect",{x:p,y:v,rx:y,ry:y,width:m,height:b,fill:l}),n.jsx("rect",{x:p+c,y:v+c,width:x,height:N,fill:i,rx:y,ry:y,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("rect",{x:a+h,y:u*.26,width:f,height:u*.48,rx:.8,ry:.8,fill:o===1?i:l}),t==="charging"?n.jsx("g",{transform:`translate(${k}, ${M}) scale(${$})`,fill:i,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function it({value:e,onChange:t,options:r,disabled:s,size:o="default"}){return n.jsx("div",{className:`nc-button-group ${o==="small"?"nc-small":""}`,children:r.map((i,l)=>{const a=s||!!i.disabled;return n.jsx("button",{className:`nc-button-group-item ${e===i.key?"nc-active":""} ${l<r.length-1?"nc-has-border":""}`,onClick:()=>!a&&t(i.key),disabled:a,children:i.label},i.key)})})}function at({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ct({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:l,className:a=""}){const u=o==="small";return n.jsxs("label",{className:`nc-checkbox-label ${u?"nc-small":""} ${r?"nc-disabled":""} ${a}`.trim(),style:l,onClick:f=>{r||(f.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${u?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:f=>{r||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&n.jsx(at,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function lt({option:e,onChange:t,selected:r,highlighted:s,small:o}){const i=d.useRef(null),{t:l}=_.useTranslation();return d.useEffect(()=>{s&&i.current&&i.current.scrollIntoView({block:"nearest"})},[s]),n.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":r,style:{cursor:"pointer",background:s?"rgba(59,130,246,0.18)":r?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",l("common.default"),")"]})]})}function dt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:l,highlightedIndex:a=-1}){const[u,f]=d.useState({top:0,left:0,width:0}),[h,g]=d.useState(o),{t:c}=_.useTranslation();if(d.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let m=o;if(o==="bottom"){const b=window.innerHeight-v.bottom,N=v.top;b<320&&N>b&&(m="top")}g(m),f({top:m==="top"?v.top-4:v.bottom+4,left:v.left,width:v.width})}},[e,i,o]),!e)return null;const p=n.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:h==="top"?void 0:u.top,bottom:h==="top"?window.innerHeight-u.top:void 0,left:u.left,width:u.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${l?"nc-small":""}`,children:c("common.noResults")}):t.map((v,m)=>n.jsx(lt,{option:v,onChange:r,selected:v.value===s,highlighted:m===a,small:l},v.value))});return ie.createPortal(p,document.body)}function ut({onClick:e,small:t}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:r=>r.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function pt({open:e,onClick:t,small:r}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${r?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:s=>s.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function ft({value:e,onChange:t,placeholder:r="Select…",options:s,disabled:o,label:i,clearable:l=!0,allowTyping:a=!1,placement:u="bottom",size:f="default",appearance:h="default",style:g,className:c}){const[p,v]=d.useState(!1),[m,b]=d.useState(""),[N,x]=d.useState(-1),y=d.useRef(null),w=d.useRef(null),j=f==="small",{t:E}=_.useTranslation(),$=d.useMemo(()=>{const I=m.toLowerCase();return a?s.filter(T=>T.label.toLowerCase().includes(I)):s},[s,m,a]);d.useEffect(()=>{p&&x(-1)},[p,$]),d.useEffect(()=>{if(!l&&!e&&s.length>0&&t){const I=s.find(T=>T.default)||s[0];t(I.value)}},[l,e,s,t]),d.useEffect(()=>{function I(T){var B;T.target instanceof Node&&y.current&&((B=y.current.parentElement)!=null&&B.contains(T.target)||v(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const R=s.find(I=>I.value===e),k=R&&l,M=!o&&!k,S=!(p&&a)&&!!R,C=(I,T=!1)=>{var B;t==null||t(I),v(!1),b(""),T&&((B=y.current)==null||B.blur())},P=()=>{t==null||t(void 0),b(""),v(!1)},D=I=>{if(!p){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(v(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),x(T=>{const B=T+1;return B>=$.length?0:B});break;case"ArrowUp":I.preventDefault(),x(T=>{const B=T-1;return B<0?$.length-1:B});break;case"Enter":I.preventDefault(),N>=0&&N<$.length&&C($[N].value,!0);break;case"Escape":I.preventDefault(),v(!1),b("");break}};return n.jsxs("div",{className:`nc-combo-container ${h==="transparent"?"nc-transparent":""} ${c||""}`.trim(),style:{position:"relative",...g},children:[i&&n.jsx("span",{className:`nc-label ${j?"nc-small":""}`,children:i}),n.jsxs("div",{ref:w,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||a&&I.target===y.current||(v(T=>(!T&&a&&R&&b(R.label),!T)),a&&!p&&setTimeout(()=>{var T,B;(T=y.current)==null||T.focus(),(B=y.current)==null||B.select()},0))},children:[n.jsx("input",{ref:y,className:`nc-input ${j?"nc-small":""}`,placeholder:r,onFocus:()=>{var I;!o&&a&&(v(!0),R&&(b(R.label),setTimeout(()=>{var T;return(T=y.current)==null?void 0:T.select()},0))),a||(I=y.current)==null||I.blur()},onChange:I=>a&&b(I.target.value),onKeyDown:D,value:p&&a?m:(R==null?void 0:R.label)||"",readOnly:o||!a,style:{width:"100%",paddingRight:M||k?j?32:44:12,caretColor:a?void 0:"transparent",cursor:a?void 0:"pointer",userSelect:a?void 0:"none",color:S?"transparent":"var(--nc-text)"}}),S&&n.jsxs("div",{"aria-hidden":!0,style:{position:"absolute",left:j?8:12,right:M||k?j?12:24:j?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[n.jsx("span",{className:`nc-combo-overlay-text ${j?"nc-small":""}`,children:R==null?void 0:R.label}),(R==null?void 0:R.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${j?"nc-small":""}`,children:["(",E("common.default"),")"]})]}),k&&n.jsx(ut,{onClick:P,small:j}),M&&n.jsx(pt,{open:p,onClick:()=>v(I=>!I),small:j})]}),n.jsx(dt,{isOpen:p,options:$,onSelect:C,selectedValue:e,placement:u,anchorRef:w,small:j,highlightedIndex:N})]})}function ht({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const l=s==="small"?14:s==="large"?20:18,a=t?"Refreshing...":"Refresh",u=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??a,"aria-label":i??u,"data-size":s,children:n.jsx(W.RefreshIcon,{size:l,className:t?"nc-spinning":""})})}function ge({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(W.CloseIcon,{size:i})})}function mt({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(W.EditIcon,{size:i})})}function gt({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(W.TrashIcon,{size:i})})}function bt({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function xt({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const l=d.useRef(null),[a,u]=d.useState({top:0,left:0}),f=o||(s==null?void 0:s.current);if(d.useEffect(()=>{if(!e||!f||!l.current)return;const c=f.getBoundingClientRect(),p=l.current.getBoundingClientRect(),v=window.innerHeight,m=window.innerWidth,b=c.bottom+8,N=b+p.height<=v-8;let x=i;(!N&&i==="down"||i==="up"&&N)&&(x="up");let y;x==="down"?y=b:y=c.top-p.height-8;let w=c.left;w+p.width>m-8&&(w=c.right-p.width),u({top:Math.max(8,y),left:Math.max(8,w)})},[e,f,i]),d.useEffect(()=>{if(!e)return;const c=v=>{l.current&&!l.current.contains(v.target)&&f&&!f.contains(v.target)&&t()},p=v=>{v.key==="Escape"&&t()};return document.addEventListener("mousedown",c),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",p)}},[e,t,f]),!e)return null;const h=c=>{c.type!=="separator"&&!c.disabled&&c.onClick&&(c.onClick(),t())},g=r.some(c=>c.icon);return ie.createPortal(n.jsx("div",{ref:l,className:"nc-context-menu",style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`,zIndex:1e4},role:"menu",children:r.map(c=>{if(c.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},c.id);const p=["nc-context-menu-item",c.variant&&c.variant!=="default"?`nc-${c.variant}`:"",c.disabled?"nc-disabled":"",g&&!c.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:p,onClick:()=>h(c),disabled:c.disabled,role:"menuitem",children:[c.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:c.icon}),n.jsx("span",{className:"nc-context-menu-label",children:c.label})]},c.id)})}),document.body)}const ze=d.createContext(null);function Be(){const e=d.useContext(ze);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function X({children:e,onClick:t,...r}){const{close:s}=Be(),{t:o}=_.useTranslation(),i=l=>{t==null||t(l),s()};return n.jsx(F,{onClick:i,...r,children:e??o("common.close")})}function vt({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:l,onOk:a,onSave:u,onDelete:f,onCancel:h,onConnect:g,closeOnOverlay:c=!0,primaryDisabled:p=!1,fullScreen:v=!1,hideTitleBar:m=!1,className:b="",onContentHeightChange:N}){const x=d.useRef(null),y=d.useRef(null),{t:w}=_.useTranslation(),j={close:t},E=k=>{c&&k.target===k.currentTarget&&t()};if(d.useEffect(()=>{e&&x.current&&x.current.focus()},[e]),d.useEffect(()=>{if(!N||!y.current)return;const k=new ResizeObserver(M=>{for(const S of M){const C=S.contentRect.height;N(C)}});return k.observe(y.current),()=>{k.disconnect()}},[N]),!e)return null;const $=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(F,{variant:"primary",onClick:a??t,disabled:p,children:w("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(F,{variant:"primary",onClick:a??t,disabled:p,children:w("common.ok")}),n.jsx(X,{onClick:h,children:w("common.cancel")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(F,{variant:"primary",onClick:u,disabled:p,children:w("common.save")}),n.jsx(X,{onClick:h,children:w("common.cancel")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(F,{variant:"danger",onClick:f,disabled:p,children:w("common.delete")}),n.jsx(X,{onClick:h,children:w("common.cancel")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(F,{variant:"primary",onClick:g,disabled:p,children:w("common.connect")}),n.jsx(X,{onClick:h,children:w("common.cancel")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",children:w("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:l});case"none":return null;default:return null}},R=n.jsx(ze.Provider,{value:j,children:n.jsx("div",{className:`nc-dialog-overlay${v?" nc-fullscreen":""}`,onClick:E,children:n.jsxs("div",{ref:x,className:`nc-dialog-container ${b}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":m?void 0:"nc-dialog-title",children:[!m&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(ge,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:y,className:"nc-dialog-content",children:s}),$()]})})});return v?ie.createPortal(R,document.body):R}function wt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function yt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(W.EyeHiddenIcon,{size:o}):n.jsx(W.ViewIcon,{size:o})})}function jt({value:e,defaultValue:t="",onChange:r,onEnter:s,onClear:o,placeholder:i,disabled:l,label:a,clearable:u=!0,type:f="text",className:h="",size:g="default",style:c,leadingIcon:p,showPasswordToggle:v=!1,multiline:m=!1,rows:b=3,validator:N,showErrorMessage:x=!0}){const y=d.useRef(null),w=d.useRef(null),[j,E]=d.useState(!1),[$,R]=d.useState(!1),k=e!==void 0,[M,S]=d.useState(t),C=k?e:M,P=N?N(C):null,D=!!P,I=f==="password",T=I&&v&&!l&&!m,B=u&&C&&!l&&$,U=g==="small"?32:44;let O=12;B&&T?O=U*2:(B||T)&&(O=U);const L=p?g==="small"?28:34:void 0,Qe=()=>{var Z,ne;k||S(""),r==null||r(""),o==null||o(),m?(Z=w.current)==null||Z.focus():(ne=y.current)==null||ne.focus()},ke=Z=>{Z.key==="Enter"&&!m&&(s==null||s())},Ne=Z=>{const ne=Z.target.value;k||S(ne),r==null||r(ne)},Se=()=>{R(!0)},Ce=()=>{R(!1)},Ae=`nc-input ${g==="small"?"nc-small ":""} ${D?"nc-error ":""}${h}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...c},children:[a&&n.jsx("span",{className:"nc-label",children:a}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:m?"flex-start":"center"},children:[p&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:m?void 0:"100%",top:m?10:void 0},children:p}),m?n.jsx("textarea",{ref:w,className:Ae,placeholder:i,value:C,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:l,"aria-disabled":l,tabIndex:l?-1:void 0,rows:b,style:{width:"100%",paddingRight:O,...L!==void 0?{paddingLeft:L}:{}}}):n.jsx("input",{ref:y,type:I&&j?"text":f,className:Ae,placeholder:i,value:C,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:l,"aria-disabled":l,tabIndex:l?-1:void 0,style:{width:"100%",paddingRight:O,...L!==void 0?{paddingLeft:L}:{}}}),B&&n.jsx(wt,{onClick:Qe,size:g,rightOffset:T?U+4:4}),T&&n.jsx(yt,{visible:j,onClick:()=>E(!j),size:g})]}),D&&x&&n.jsx("span",{className:"nc-error-message",children:P})]})}function kt({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,l]=d.useState(!1),a=u=>{if(t){if(s){const f=window.getSelection();if(f&&f.toString().length>0)return}t(u)}};return n.jsx("div",{onClick:a,onMouseDown:()=>t&&l(!0),onMouseUp:()=>l(!1),onMouseLeave:()=>l(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1},children:e})})}function Nt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function St({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,l]=d.useState(!1),[a,u]=d.useState(""),f=d.useRef(null),h=d.useMemo(()=>r.filter(c=>c.label.toLowerCase().includes(a.toLowerCase())),[r,a]);d.useEffect(()=>{function c(p){!(p.target instanceof Node)||!f.current||f.current.contains(p.target)||l(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]);const g=c=>{e.includes(c)?t(e.filter(p=>p!==c)):t([...e,c])};return n.jsxs("div",{ref:f,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(c=>{const p=r.find(v=>v.value===c);return p?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[p.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>g(c),"aria-label":`Remove ${p.label}`,children:"✕"})]},c):null}),n.jsx("input",{className:"nc-input",value:a,onChange:c=>u(c.target.value),onFocus:()=>l(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[h.map(c=>{const p=e.includes(c.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>g(c.value),children:[n.jsx("span",{children:c.label}),n.jsx("span",{children:p?"✔️":""})]},c.value)}),h.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function ae(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function oe(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function Re(e){if(!e)return"";const t=oe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Ie(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Ct({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:l="default"}){const[a,u]=d.useState(!1),[f,h]=d.useState(""),[g,c]=d.useState(""),[p,v]=d.useState({top:0,left:0,width:0,right:void 0}),m=d.useRef(null),b=d.useRef(null);d.useEffect(()=>{if(a&&m.current){const S=m.current.getBoundingClientRect(),P=Math.max(S.width,400);window.innerWidth-S.left<P&&S.right>=P?v({top:S.bottom+4,left:0,right:window.innerWidth-S.right,width:P}):v({top:S.bottom+4,left:S.left,right:void 0,width:P})}},[a]),d.useEffect(()=>{if(!a)return;const S=C=>{m.current&&!m.current.contains(C.target)&&b.current&&!b.current.contains(C.target)&&u(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[a]);const N=()=>{h(e||Ie()),c(t||Ie()),u(!0)},x=()=>{u(!1)},y=()=>{const S=ae(f),C=ae(g);if(S||C)return;const P=oe(f),D=oe(g);P&&D&&(r==null||r(P,D)),u(!1)},w=e&&t?`${Re(e)} - ${Re(t)}`:"Select month range",j=ae(f),E=ae(g),$=oe(f),R=oe(g),k=$&&R&&$>R,M=a?ie.createPortal(n.jsx("div",{ref:b,className:"nc-month-range-picker-popup",style:{position:"fixed",top:p.top,...p.right!==void 0?{right:p.right}:{left:p.left},width:p.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${j?"nc-error":""}`,value:f,onChange:S=>h(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),j&&n.jsx("div",{className:"nc-month-error-text",children:j})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${E?"nc-error":""}`,value:g,onChange:S=>c(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),E&&n.jsx("div",{className:"nc-month-error-text",children:E})]})]}),k&&!j&&!E&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(F,{variant:"primary",onClick:y,disabled:!f||!g||!!j||!!E||!!k,children:"Apply"}),n.jsx(F,{variant:"ghost",onClick:x,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${l==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${l==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:m,className:`nc-month-range-picker-input${l==="small"?" nc-small":""}`,onClick:N,disabled:i,children:w}),M]})}function At({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:l,size:a="default"}){const u=a==="small",f=()=>{const c=e-o;r!==void 0&&c<r||t(parseFloat(c.toFixed(10)))},h=()=>{const c=e+o;s!==void 0&&c>s||t(parseFloat(c.toFixed(10)))},g=c=>{const p=parseFloat(c.target.value);isNaN(p)||r!==void 0&&p<r||s!==void 0&&p>s||t(p)};return n.jsxs("div",{className:`nc-col nc-number-input-col ${u?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${u?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${u?"nc-small":""}`,children:[n.jsx("input",{className:`nc-input nc-number-input ${u?"nc-small":""}`,type:"number",value:e,onChange:g,min:r,max:s,step:o,disabled:l}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${u?"nc-small":""}`,onClick:f,disabled:l||r!==void 0&&e<=r,children:"−"}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${u?"nc-small":""}`,onClick:h,disabled:l||s!==void 0&&e>=s,children:"+"})]})]})}function Rt({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:l,showValue:a=!0,formatValue:u=h=>h.toString(),width:f=200}){const h=c=>{const p=parseFloat(c.target.value);t(p)},g=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:h,min:r,max:s,step:o,disabled:l,style:{width:f,"--nc-slider-percentage":`${g}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:u(e)})]})]})}const It=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function Le({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Mt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=d.Children.toArray(t).filter(a=>d.isValidElement(a)&&(a.type===Le||a.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(a=>{const u=a.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${u?"nc-active":""}`,style:{display:u?void 0:"none"},"aria-hidden":!u,children:a},a.props.tab)})});const l=i.find(a=>a.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:l})}function Et({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:l,multiline:a,orientation:u="horizontal",style:f}){const h=d.useRef(null),[g,c]=d.useState(!1),[p,v]=d.useState(!1),m=u==="verticalLeft"||u==="verticalRight",b=d.useRef(!1),N=d.useRef(0),x=d.useRef(0),y=d.useRef(!1);d.useEffect(()=>{const k=()=>{if(h.current)if(m){const{scrollTop:S,scrollHeight:C,clientHeight:P}=h.current;c(S>1),v(S<C-P-1)}else{const{scrollLeft:S,scrollWidth:C,clientWidth:P}=h.current;c(S>1),v(S<C-P-1)}},M=h.current;if(M)return k(),M.addEventListener("scroll",k),window.addEventListener("resize",k),()=>{M.removeEventListener("scroll",k),window.removeEventListener("resize",k)}},[e,m]);const w=k=>{h.current&&(b.current=!0,y.current=!1,N.current=m?k.clientY:k.clientX,x.current=m?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},j=k=>{if(!b.current||!h.current)return;const M=m?k.clientY:k.clientX,S=N.current-M;Math.abs(S)>3&&(y.current=!0),m?h.current.scrollTop=x.current+S:h.current.scrollLeft=x.current+S},E=()=>{h.current&&(b.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},$=()=>{E()};d.useEffect(()=>{const k=h.current;if(!k||m)return;const M=S=>{S.deltaY!==0&&(S.preventDefault(),k.scrollLeft+=S.deltaY*.3)};return k.addEventListener("wheel",M,{passive:!1}),()=>{k.removeEventListener("wheel",M)}},[m]);const R=k=>{y.current||r(k)};return n.jsxs("div",{className:`nc-tab-container ${m?`nc-vertical nc-${u}`:""} ${i||""}`,style:f,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[g&&n.jsx("div",{className:`nc-tab-scroll-indicator ${m?"nc-top":"nc-left"}`,children:m?n.jsx(It,{size:16}):n.jsx(W.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:w,onMouseMove:j,onMouseUp:E,onMouseLeave:$,style:{cursor:"grab"},children:e.map(k=>{const M=typeof k=="string"?k:k.id,S=typeof k=="string"?k:k.label,C=s&&!(o!=null&&o.includes(M));return n.jsxs("div",{className:`nc-tab-item ${t===M?"nc-active":""} ${C?"nc-closable":""}`,onClick:()=>R(M),role:"button",tabIndex:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&r(M)},children:[n.jsx("span",{className:"nc-tab-label",children:m?S:typeof S=="string"?S.toUpperCase():S}),C&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof S=="string"?S:M}`,onClick:P=>{P.stopPropagation(),s(M)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.stopPropagation(),s(M))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M)})}),p&&n.jsx("div",{className:`nc-tab-scroll-indicator ${m?"nc-bottom":"nc-right"}`,children:m?n.jsx(W.ChevronDownIcon,{size:16}):n.jsx(W.ChevronRightIcon,{size:16})})]}),l&&n.jsx("div",{className:"nc-tab-toolbar",children:l})]})}function $t({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Me=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Tt(e,t){const s=e.slice(0,t).split(`
|
|
2
|
+
`),o=s.length,l=s[o-1].split(" "),a=l.length,u=l[a-1].length+1;return{line:o,column:a,character:u,offset:t}}function Pt(e,t,r,s){const o=e.split(`
|
|
3
|
+
`),i=Math.max(1,Math.min(t,o.length));let l=0;for(let g=0;g<i-1;g++)l+=o[g].length+1;const u=o[i-1].split(" "),f=Math.max(1,Math.min(r,u.length));for(let g=0;g<f-1;g++)l+=u[g].length+1;const h=Math.max(1,Math.min(s,u[f-1].length+1));return l+=h-1,l}function zt(e,t){const r=e.split(`
|
|
4
|
+
`),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const Bt=d.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:l=!1,onCursorChange:a,highlightLine:u},f){const h=d.useRef(null),g=d.useRef(null),c=d.useRef(null);d.useImperativeHandle(f,()=>({goToLine(x){const y=h.current;if(!y)return;const w=zt(t,x);y.focus(),y.setSelectionRange(w,w);const j=parseFloat(getComputedStyle(y).lineHeight)||18;y.scrollTop=(Math.max(1,x)-1)*j,v(),p()},goToPosition(x,y,w){const j=h.current;if(!j)return;const E=Pt(t,x,y,w);j.focus(),j.setSelectionRange(E,E);const $=parseFloat(getComputedStyle(j).lineHeight)||18;j.scrollTop=(Math.max(1,x)-1)*$,v(),p()}}),[t]);const p=d.useCallback(()=>{if(!a||!h.current)return;const x=Tt(t,h.current.selectionStart);a(x)},[a,t]),v=d.useCallback(()=>{const x=h.current;x&&(g.current&&(g.current.scrollTop=x.scrollTop,g.current.scrollLeft=x.scrollLeft),c.current&&(c.current.scrollTop=x.scrollTop))},[]);d.useEffect(()=>{if(u==null||u<1)return;const x=h.current;if(!x)return;const y=parseFloat(getComputedStyle(x).lineHeight)||18,w=(u-1)*y,j=w+y;(w<x.scrollTop||j>x.scrollTop+x.clientHeight)&&(x.scrollTop=w-x.clientHeight/2+y/2),v()},[u]);const m=d.useMemo(()=>t.split(`
|
|
5
|
+
`).length,[t]),b=()=>{const x=[];for(let y=1;y<=m;y++)x.push(n.jsx("div",{className:`nc-csv-line-number ${u===y?"nc-csv-highlight":""}`,children:y},y));return n.jsx("div",{className:"nc-csv-gutter",ref:c,children:x})},N=x=>x?x.split(`
|
|
6
|
+
`).map((w,j)=>{const E=w.split(" ");return n.jsxs("div",{className:`nc-csv-line ${u===j+1?"nc-csv-highlight":""}`,children:[E.map(($,R)=>n.jsxs("span",{children:[R>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Me[R%Me.length]},children:$})]},R)),w===""&&`
|
|
7
|
+
`]},j)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${l?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[l&&b(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:g,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:N(t)})}),n.jsx("textarea",{ref:h,className:"nc-csv-textarea-input",value:t,onChange:x=>{r(x.target.value),requestAnimationFrame(p)},onScroll:v,onSelect:p,onKeyUp:p,onClick:p,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let J={notifications:[]};const pe=new Set,Ee=new Map;function fe(){const e=J.notifications.slice();for(const t of Array.from(pe))try{t(e)}catch{}}function Lt(e){pe.add(e);try{e(J.notifications.slice())}catch{}return()=>{pe.delete(e)}}function Dt(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return J.notifications=[i,...J.notifications],fe(),i.duration&&i.duration>0&&setTimeout(()=>{De(t)},i.duration),t}function De(e){const t=J.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,fe();const r=window.setTimeout(()=>{J.notifications=J.notifications.filter(s=>s.id!==e),fe(),Ee.delete(e)},300);Ee.set(e,r)}function He({notification:e}){const{t}=_.useTranslation(),r=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},s=()=>{De(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[n.jsx("div",{className:"nc-notification-title",children:r()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:s,children:n.jsx(W.CloseIcon,{size:16})})]})})}function Ht(){const[e,t]=d.useState([]),[r,s]=d.useState(new Map),[o,i]=d.useState(new Set),l=d.useRef(null),a=d.useRef([]);return d.useEffect(()=>Lt(f=>{const h=new Set(a.current.map(c=>c.id)),g=f.filter(c=>!h.has(c.id)).map(c=>c.id);g.length>0?(t(f),i(new Set(g)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(f),a.current=f}),[]),d.useEffect(()=>{if(!l.current)return;const u=new Map;let f=0;const h=l.current.children;e.forEach((g,c)=>{if(u.set(g.id,f),h[c]){const p=h[c].offsetHeight;g.isRemoving||(f+=p+12)}}),s(u)},[e]),n.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:n.jsx("div",{ref:l,style:{pointerEvents:"auto",position:"relative"},children:e.map(u=>{const f=o.has(u.id),h=u.isRemoving,g=r.get(u.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:f?"translateY(-120px)":`translateY(${g}px)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?0:1,width:"100%"},children:n.jsx(He,{notification:u})},u.id)})})})}function We(e){return Dt(e)}const Wt={show:e=>We(e)};function Ot(e){const t=tt.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const l of i)if(l.type==="attributes"&&l.attributeName==="lang"){const a=document.documentElement.lang||"en";t.changeLanguage(a)}}).observe(document.documentElement,{attributes:!0}),t}class Ft{constructor(){Y(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const Q=new Ft,$e="nc-ui-app-state";class Vt{constructor(){Y(this,"state");Y(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem($e);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem($e,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const V=new Vt;class Gt{constructor(){Y(this,"apps",[]);Y(this,"activeAppId",null);Y(this,"listeners",new Set);Y(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!Q.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(l=>l.appId===t);if(o)return s||(this.setActiveApp(t),V._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,V._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,V._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),V._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?Q.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const H=new Gt,be=d.createContext(null);function Oe(){const e=d.useContext(be);if(!e)throw new Error("useApp must be used inside an App");return e}function Yt({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Fe({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(Yt,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(ge,{onClick:t,"aria-label":"Close application"})]})]})}class Kt extends d.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function xe({appId:e,isActive:t,onClose:r}){const{t:s}=_.useTranslation(),o=Q.get(e),[i,l]=d.useState(""),[a,u]=d.useState(null),[f,h]=d.useState(null),[g,c]=d.useState(!1),[p,v]=d.useState(!1);d.useEffect(()=>{o!=null&&o.titleKey&&l(s(o.titleKey))},[o,s]);const m=d.useCallback(k=>{l(k)},[]),b=d.useCallback(k=>{u(()=>k)},[]),N=d.useCallback(()=>{u(null)},[]),x=d.useCallback(k=>{h(k)},[]),y=d.useCallback(()=>{h(null)},[]),w=d.useCallback(k=>{c(k)},[]),j=d.useCallback(k=>{v(k)},[]),E=d.useMemo(()=>({setTitle:m,setBackHandler:b,clearBackHandler:N,setToolbar:x,clearToolbar:y,setHideBackButton:w,setHideTitleBar:j,close:r}),[m,b,N,x,y,w,j,r]);if(!o)return null;const $=o.component,R=!o.hideTitleBar&&!p;return n.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[R&&n.jsx(Fe,{title:i,onClose:r,onBack:a??void 0,toolbar:f,hideBackButton:g}),n.jsx("div",{className:R?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-secondary)",position:"relative"},children:n.jsx(be.Provider,{value:E,children:n.jsx(Kt,{appId:e,children:n.jsx(d.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:n.jsx(me,{})}),children:n.jsx($,{})})})})})]})}const ce=768,le=1024,Ve={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Ge=d.createContext(Ve);function qt({children:e}){const[t,r]=d.useState(()=>{if(typeof window>"u")return Ve;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ce,isTablet:s>=ce&&s<le,isDesktop:s>=le,width:s,height:o}});return d.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ce,isTablet:o>=ce&&o<le,isDesktop:o>=le,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(Ge.Provider,{value:t,children:e})}function ve(){return d.useContext(Ge)}const we="-",_t=e=>{const t=Xt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:l=>{const a=l.split(we);return a[0]===""&&a.length!==1&&a.shift(),Ye(a,t)||Ut(l)},getConflictingClassGroupIds:(l,a)=>{const u=r[l]||[];return a&&s[l]?[...u,...s[l]]:u}}},Ye=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?Ye(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(we);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},Te=/^\[(.+)\]$/,Ut=e=>{if(Te.test(e)){const t=Te.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xt=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return Qt(Object.entries(e.classGroups),r).forEach(([i,l])=>{he(l,s,i,t)}),s},he=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Pe(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(Jt(o)){he(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,l])=>{he(l,Pe(t,i),r,s)})})},Pe=(e,t)=>{let r=e;return t.split(we).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Jt=e=>e.isThemeGetter,Qt=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,o]}):e,Zt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=s.get(i))!==void 0)return o(i,l),l},set(i,l){r.has(i)?r.set(i,l):o(i,l)}}},Ke="!",en=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,l=a=>{const u=[];let f=0,h=0,g;for(let b=0;b<a.length;b++){let N=a[b];if(f===0){if(N===o&&(s||a.slice(b,b+i)===t)){u.push(a.slice(h,b)),h=b+i;continue}if(N==="/"){g=b;continue}}N==="["?f++:N==="]"&&f--}const c=u.length===0?a:a.substring(h),p=c.startsWith(Ke),v=p?c.substring(1):c,m=g&&g>h?g-h:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:m}};return r?a=>r({className:a,parseClassName:l}):l},tn=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},nn=e=>({cache:Zt(e.cacheSize),parseClassName:en(e),..._t(e)}),rn=/\s+/,sn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],l=e.trim().split(rn);let a="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{modifiers:h,hasImportantModifier:g,baseClassName:c,maybePostfixModifierPosition:p}=r(f);let v=!!p,m=s(v?c.substring(0,p):c);if(!m){if(!v){a=f+(a.length>0?" "+a:a);continue}if(m=s(c),!m){a=f+(a.length>0?" "+a:a);continue}v=!1}const b=tn(h).join(":"),N=g?b+Ke:b,x=N+m;if(i.includes(x))continue;i.push(x);const y=o(m,v);for(let w=0;w<y.length;++w){const j=y[w];i.push(N+j)}a=f+(a.length>0?" "+a:a)}return a};function on(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=qe(t))&&(s&&(s+=" "),s+=r);return s}const qe=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=qe(e[s]))&&(r&&(r+=" "),r+=t);return r};function an(e,...t){let r,s,o,i=l;function l(u){const f=t.reduce((h,g)=>g(h),e());return r=nn(f),s=r.cache.get,o=r.cache.set,i=a,a(u)}function a(u){const f=s(u);if(f)return f;const h=sn(u,r);return o(u,h),h}return function(){return i(on.apply(null,arguments))}}const z=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},_e=/^\[(?:([a-z-]+):)?(.+)\]$/i,cn=/^\d+\/\d+$/,ln=new Set(["px","full","screen"]),dn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,un=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>ee(e)||ln.has(e)||cn.test(e),K=e=>te(e,"length",jn),ee=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>te(e,"number",ee),re=e=>!!e&&Number.isInteger(Number(e)),mn=e=>e.endsWith("%")&&ee(e.slice(0,-1)),A=e=>_e.test(e),q=e=>dn.test(e),gn=new Set(["length","size","percentage"]),bn=e=>te(e,gn,Ue),xn=e=>te(e,"position",Ue),vn=new Set(["image","url"]),wn=e=>te(e,vn,Nn),yn=e=>te(e,"",kn),se=()=>!0,te=(e,t,r)=>{const s=_e.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},jn=e=>un.test(e)&&!pn.test(e),Ue=()=>!1,kn=e=>fn.test(e),Nn=e=>hn.test(e),Sn=()=>{const e=z("colors"),t=z("spacing"),r=z("blur"),s=z("brightness"),o=z("borderColor"),i=z("borderRadius"),l=z("borderSpacing"),a=z("borderWidth"),u=z("contrast"),f=z("grayscale"),h=z("hueRotate"),g=z("invert"),c=z("gap"),p=z("gradientColorStops"),v=z("gradientColorStopPositions"),m=z("inset"),b=z("margin"),N=z("opacity"),x=z("padding"),y=z("saturate"),w=z("scale"),j=z("sepia"),E=z("skew"),$=z("space"),R=z("translate"),k=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",A,t],C=()=>[A,t],P=()=>["",G,K],D=()=>["auto",ee,A],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],T=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",A],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[ee,A];return{cacheSize:500,separator:":",theme:{colors:[se],spacing:[G,K],blur:["none","",q,A],brightness:L(),borderColor:[e],borderRadius:["none","","full",q,A],borderSpacing:C(),borderWidth:P(),contrast:L(),grayscale:O(),hueRotate:L(),invert:O(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[mn,K],inset:S(),margin:S(),opacity:L(),padding:C(),saturate:L(),scale:L(),sepia:O(),skew:L(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",A]}],container:["container"],columns:[{columns:[q]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),A]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",re,A]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",A]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",re,A]}],"grid-cols":[{"grid-cols":[se]}],"col-start-end":[{col:["auto",{span:["full",re,A]},A]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[se]}],"row-start-end":[{row:["auto",{span:[re,A]},A]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",A]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",A]}],gap:[{gap:[c]}],"gap-x":[{"gap-x":[c]}],"gap-y":[{"gap-y":[c]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",A,t]}],"min-w":[{"min-w":[A,t,"min","max","fit"]}],"max-w":[{"max-w":[A,t,"none","full","min","max","fit","prose",{screen:[q]},q]}],h:[{h:[A,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[A,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[A,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[A,t,"auto","min","max","fit"]}],"font-size":[{text:["base",q,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",A]}],"line-clamp":[{"line-clamp":["none",ee,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,A]}],"list-image":[{"list-image":["none",A]}],"list-style-type":[{list:["none","disc","decimal",A]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,K]}],"underline-offset":[{"underline-offset":["auto",G,A]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),xn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...T(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:T()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...T()]}],"outline-offset":[{"outline-offset":[G,A]}],"outline-w":[{outline:[G,K]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[G,K]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,yn]}],"shadow-color":[{shadow:[se]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",q,A]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[y]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",A]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",A]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",A]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[re,A]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",A]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",A]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",A]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,K,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cn=an(Sn);function Xe(...e){return Cn(nt.clsx(e))}function An({autoWidth:e=!0,className:t,style:r}){const[s,o]=d.useState(()=>V.getActiveAppId()),[i,l]=d.useState(()=>H.getRunningApps()),{isMobile:a}=ve();d.useEffect(()=>{const b=V.subscribe("activeAppId",N=>{o(N)});return()=>{b()}},[]),d.useEffect(()=>H.subscribe(()=>{l(H.getRunningApps())}),[]),d.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const x=V.getActiveAppId();x&&!H.isRunning(x)&&H.launchApp(x)}},[]);const u=b=>{H.closeApp(b)},f=s?Q.get(s):null,g=(f==null?void 0:f.width)??400,c=s!==null,m={...{overflow:"hidden",display:c?"flex":"none",flexDirection:"column",flexShrink:0,...e&&c?{width:a?"100%":g}:{}},...r};return n.jsx("div",{className:Xe("nc-app-panel",t),style:m,children:i.map(b=>n.jsx(xe,{appId:b.appId,isActive:s===b.appId,onClose:()=>u(b.appId)},b.appId))})}function Rn({pinnedAppIds:e,className:t=""}){const{isMobile:r}=ve(),[s,o]=d.useState(()=>V.getActiveAppId()),[i,l]=d.useState(()=>H.getRunningApps());d.useEffect(()=>{const c=V.subscribe("activeAppId",p=>{o(p)});return()=>{c()}},[]),d.useEffect(()=>H.subscribe(()=>{l(H.getRunningApps())}),[]);const a=c=>{s===c?H.setActiveApp(null):H.launchApp(c)},u=e.map(c=>Q.get(c)).filter(c=>!!c),f=i.filter(c=>!e.includes(c.appId)).map(c=>({running:c,def:Q.get(c.appId)})).filter(c=>!!c.def),h=c=>i.some(p=>p.appId===c),g=r?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${r?"nc-mobile":"nc-desktop"} ${t}`,children:[u.map(c=>{const p=c.icon,v=s===c.id,m=h(c.id);return n.jsxs("button",{className:`nc-app-taskbar-button ${v?"nc-active":""} ${m?"nc-running":""}`,onClick:()=>a(c.id),title:c.titleKey||c.id,children:[n.jsx(p,{size:g}),m&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},c.id)}),f.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),f.map(({running:c,def:p})=>{const v=p.icon,m=s===c.appId;return n.jsxs("button",{className:`nc-app-taskbar-button ${m?"nc-active":""} nc-running`,onClick:()=>a(c.appId),title:p.titleKey||p.id,children:[n.jsx(v,{size:g}),n.jsx("span",{className:"nc-app-taskbar-indicator"})]},c.appId)})]})}function In({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const l=u=>{s&&u.target===u.currentTarget&&r()};if(!t)return null;const a=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:l,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:u=>u.stopPropagation(),children:n.jsx(xe,{appId:e,isActive:!0,onClose:r})})});return ie.createPortal(a,document.body)}const ye=d.createContext(null),Je=d.createContext(null);function Mn(){const e=d.useContext(ye);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function En(){const e=d.useContext(Je);if(!e)throw new Error("useNavView must be used within NavStack");return e}const je=d.createContext(null);function $n({rootView:e,children:t}){const{t:r}=_.useTranslation(),s=Oe(),[o,i]=d.useState([e]),[l,a]=d.useState([null]),u=d.useCallback((w,j)=>{a(E=>{const $=[...E];return $[w]=j,$})},[]),f=d.useCallback(w=>{a(j=>{const E=[...j];return E[w]=null,E})},[]),h=d.useCallback(w=>{i(j=>[...j,w]),a(j=>[...j,null])},[]),g=d.useCallback(()=>{i(w=>w.length<=1?w:w.slice(0,-1)),a(w=>w.slice(0,-1))},[]),c=d.useCallback(()=>{i([e]),a([null])},[e]),p=o.length,v=p>1,m=o.length-1,b=o[o.length-1],N=b!=null&&b.titleKey?r(b.titleKey):(b==null?void 0:b.title)??"";d.useEffect(()=>{s.setTitle(N)},[N,s]),d.useEffect(()=>{v?s.setBackHandler(g):s.clearBackHandler()},[v,g,s]),d.useEffect(()=>{const w=l[l.length-1];w?s.setToolbar(w):s.clearToolbar()},[l,s]);const x={push:h,pop:g,reset:c,depth:p,canGoBack:v,currentTitle:N},y={stack:o,toolbarStack:l,updateToolbar:u,clearToolbarAt:f,topIndex:m};return n.jsx(ye.Provider,{value:x,children:n.jsx(je.Provider,{value:y,children:t})})}function Tn({index:e,children:t}){const r=d.useContext(je);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,l=d.useCallback(f=>{e===i&&s(e,f)},[e,i,s]),a=d.useCallback(()=>{e===i&&o(e)},[e,i,o]),u={setToolbar:l,clearToolbar:a};return n.jsx(Je.Provider,{value:u,children:t})}function Pn(){const e=d.useContext(ye),t=d.useContext(je);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(Tn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=me;exports.Alert=st;exports.AppContainer=xe;exports.AppContext=be;exports.AppDialog=In;exports.AppPanel=An;exports.AppTaskbar=Rn;exports.AppTitleBar=Fe;exports.Battery=ot;exports.Button=F;exports.ButtonGroup=it;exports.Checkbox=ct;exports.CloseButton=ge;exports.ComboBox=ft;exports.ContextMenu=xt;exports.CsvTextArea=Bt;exports.Dialog=vt;exports.DialogClose=X;exports.EditButton=mt;exports.Hyperlink=bt;exports.Input=jt;exports.ListGroup=Nt;exports.ListGroupItem=kt;exports.MonthRangePicker=Ct;exports.MultiSelect=St;exports.NavStackContainer=Pn;exports.NavStackProvider=$n;exports.Notification=He;exports.NotificationContainer=Ht;exports.NumberInput=At;exports.RefreshButton=ht;exports.Slider=Rt;exports.TabPanel=Le;exports.TabPanels=Mt;exports.Tabs=Et;exports.Toggle=$t;exports.TrashButton=gt;exports.ViewportProvider=qt;exports.appRegistry=Q;exports.appStateStore=V;exports.cn=Xe;exports.createAppI18nFactory=Ot;exports.notificationManager=Wt;exports.runningAppsStore=H;exports.showNotification=We;exports.useApp=Oe;exports.useDialog=Be;exports.useNavStack=Mn;exports.useNavView=En;exports.useViewport=ve;
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|