@nice2dev/ui 1.2.2 → 1.3.1
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/CHANGELOG.md +474 -0
- package/dist/NiceButton-CnAIqCbd.js +101 -0
- package/dist/NiceButton-DzCqkG5a.cjs +1 -0
- package/dist/NiceCodeEditor-CK6B54mu.js +1215 -0
- package/dist/NiceCodeEditor-bJReZPDO.cjs +268 -0
- package/dist/NiceColorPicker-BV3olE3M.cjs +1 -0
- package/dist/NiceColorPicker-CyY-4q89.js +552 -0
- package/dist/NiceDataGrid-BQIqitMM.cjs +10 -0
- package/dist/NiceDataGrid-C1eI6Pso.js +2267 -0
- package/dist/NiceDataGrid-Cs4vOOTE.js +2267 -0
- package/dist/NiceDataGrid-jZvzaCv3.cjs +10 -0
- package/dist/NiceForm-CfAPcXdX.cjs +1 -0
- package/dist/NiceForm-DYcrWaN1.js +5017 -0
- package/dist/NiceForm-DfKYNQti.js +5017 -0
- package/dist/NiceForm-ZzfYumoR.cjs +1 -0
- package/dist/NiceGantt-TEXbAELi.js +333 -0
- package/dist/NiceGantt-s2cgt5zD.cjs +1 -0
- package/dist/NiceHtmlEditor-CDZeF_zG.cjs +10 -0
- package/dist/NiceHtmlEditor-CdWgddg3.js +901 -0
- package/dist/NiceLoginForm-DRPldHXa.js +808 -0
- package/dist/NiceLoginForm-IGLUCQUE.cjs +1 -0
- package/dist/NiceMention-CgDp0sl9.cjs +430 -0
- package/dist/NiceMention-DBvFvx71.js +11653 -0
- package/dist/NiceMention-VhH0Dllr.cjs +430 -0
- package/dist/NiceMention-cOqXnI0M.js +11653 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-BlYhFDhP.js +80 -0
- package/dist/NiceModal-DmWz2PDM.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BWUYyWfY.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BdcJATGF.js +7190 -0
- package/dist/NiceModuleLifecyclePanel-D8EoXqBy.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-SN6G7t64.js +7189 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-BJS65foT.js +200 -0
- package/dist/NicePagination-D_3GfWp5.cjs +1 -0
- package/dist/NicePivotGrid-D_kRF1Dt.js +1180 -0
- package/dist/NicePivotGrid-DqluEkCI.cjs +152 -0
- package/dist/NiceSavedQueryPanel-C2Tn1cMW.js +5311 -0
- package/dist/NiceSavedQueryPanel-Cs_dypgU.js +5311 -0
- package/dist/NiceSavedQueryPanel-DDKtL1AA.cjs +586 -0
- package/dist/NiceSavedQueryPanel-DTSOHW2v.cjs +586 -0
- package/dist/NiceScheduler-BmHcJLBe.cjs +5 -0
- package/dist/NiceScheduler-DI2sg3Rr.js +1710 -0
- package/dist/NiceScheduler-GJLvkXJ3.cjs +5 -0
- package/dist/NiceScheduler-UT49u2Vq.js +1710 -0
- package/dist/NiceSelect-CdUHd8rj.cjs +1 -0
- package/dist/NiceSelect-fOelG_QB.js +495 -0
- package/dist/NiceWindow-CqSsTjrS.cjs +1 -0
- package/dist/NiceWindow-DZLPhXbR.js +2223 -0
- package/dist/charts-BYQwl_GS.js +4789 -0
- package/dist/charts-C6iOu0H6.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-lazy-B_laOXNf.cjs +1 -0
- package/dist/core-lazy-BpbIO1EN.cjs +1 -0
- package/dist/core-lazy-L7MVTPp1.js +351 -0
- package/dist/core-lazy-VQEjdz0L.js +351 -0
- package/dist/data-branching-7rpktFJ-.cjs +1 -0
- package/dist/data-branching-BS0aFUMu.js +6428 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +3 -3
- package/dist/devops-CFytAJQr.cjs +18 -0
- package/dist/devops-CW8YY_zA.js +9122 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.css +1 -0
- package/dist/devops.mjs +5 -5
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +8 -8
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +21 -16
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +262 -257
- package/dist/index.css +1 -1
- package/dist/index.d.ts +402 -27
- package/dist/index.mjs +21437 -20148
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +50 -7
- package/dist/navigation.mjs +404 -354
- package/dist/no-code-BaAI_sJR.js +8318 -0
- package/dist/no-code-oQTeAtnW.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +5 -0
- package/dist/overlays.mjs +1 -1
- package/dist/pickerCommons-BQi6IEAt.js +661 -0
- package/dist/pickerCommons-CUGHOWyc.cjs +1 -0
- package/dist/pickerCommons-D-dwdCBZ.js +659 -0
- package/dist/pickerCommons-DvQptSPX.cjs +1 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +8 -5
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),g=require("@nice2dev/ui-core"),t=require("react"),je=require("react-dom"),ut=[],mt=({visible:n,onClose:i,title:c,items:o=ut,showCancelButton:l=!0,cancelText:d,size:m="md",disabled:x,readOnly:f,loading:C,error:M,className:T,style:P})=>{const{t:R}=g.useNiceTranslation();if(!n)return null;const v=x||C||f;return e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"presentation",className:"nice-actionsheet__overlay",onClick:i}),e.jsxs("div",{className:`nice-actionsheet nice-actionsheet--${m} ${x?"nice-actionsheet--disabled":""} ${f?"nice-actionsheet--readonly":""} ${C?"nice-actionsheet--loading":""} ${M?"nice-actionsheet--error":""} ${T||""}`,style:P,"aria-disabled":x||void 0,"aria-readonly":f||void 0,"aria-busy":C||void 0,children:[M&&e.jsx("div",{className:"nice-actionsheet__error",role:"alert",children:M}),C&&e.jsx("span",{className:"nice-actionsheet__spinner","aria-hidden":"true",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),c&&e.jsx("div",{className:"nice-actionsheet__title",children:c}),e.jsx("div",{className:"nice-actionsheet__items",children:o.map((a,u)=>e.jsxs("button",{className:`nice-actionsheet__item ${a.type==="danger"?"nice-actionsheet__item--danger":""}`,disabled:a.disabled||v,onClick:()=>{v||(a.onClick?.(),i())},children:[a.icon&&e.jsx("span",{className:"nice-actionsheet__icon",children:a.icon}),a.text]},u))}),l&&e.jsx("button",{className:"nice-actionsheet__cancel",onClick:i,children:d||R("cancel","Cancel")})]})]})},ft=({visible:n,onClose:i,targetRef:c,position:o="bottom",title:l,showArrow:d=!0,width:m,children:x,className:f,style:C,displayStyle:M})=>{g.useComponentDisplayClass("tooltip",M);const T=t.useRef(null),[P,R]=t.useState({top:0,left:0}),v=t.useCallback(()=>{const a=c.current,u=T.current;if(!a||!u)return;const r=a.getBoundingClientRect(),p=u.getBoundingClientRect();let y=0,h=0;const L=8;switch(o){case"top":y=r.top-p.height-L,h=r.left+(r.width-p.width)/2;break;case"bottom":y=r.bottom+L,h=r.left+(r.width-p.width)/2;break;case"left":y=r.top+(r.height-p.height)/2,h=r.left-p.width-L;break;case"right":y=r.top+(r.height-p.height)/2,h=r.right+L;break}R({top:y+window.scrollY,left:h+window.scrollX})},[c,o]);return t.useEffect(()=>{if(n){requestAnimationFrame(v);const a=u=>{const r=u.target;(r instanceof Element?r:r?.parentElement??null)?.closest('.nice-select__dropdown, [role="listbox"], [role="option"]')||T.current&&!T.current.contains(r)&&c.current&&!c.current.contains(r)&&i()};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)}},[n,v,i,c]),g.useOverlayFocus(T,{open:n,modal:!1,onClose:()=>i()}),n?e.jsxs("div",{ref:T,className:`nice-popover nice-popover--${o} ${f||""}`,style:{...C,position:"absolute",top:P.top,left:P.left,width:m},role:"dialog","aria-label":l,children:[d&&e.jsx("div",{className:`nice-popover__arrow nice-popover__arrow--${o}`}),l&&e.jsx("div",{className:"nice-popover__title",children:l}),e.jsx("div",{className:"nice-popover__content",children:x})]}):null},ht=({visible:n,message:i,container:c,showIndicator:o=!0,shading:l=!0,className:d,style:m})=>{const{t:x}=g.useNiceTranslation();if(!n)return null;const f=!!c?.current,C=e.jsxs("div",{className:`nice-loadpanel ${d||""}`,style:m,children:[l&&e.jsx("div",{className:"nice-loadpanel__shade"}),e.jsxs("div",{className:"nice-loadpanel__box",children:[o&&e.jsx("div",{className:"nice-spinner nice-spinner--md"}),e.jsx("span",{className:"nice-loadpanel__text",children:i||x("loading","Loading...")})]})]});if(f&&c.current){const M=c.current;return M.style.position=M.style.position||"relative",C}return C},pt=({direction:n="row",align:i,justify:c,wrap:o,gap:l,flex:d,children:m,className:x,style:f})=>e.jsx("div",{className:`nice-box ${x||""}`,style:{display:"flex",flexDirection:n,alignItems:i,justifyContent:c,flexWrap:o?"wrap":void 0,gap:l,flex:d,...f},children:m}),xt=[],wt=({direction:n="row",items:i=xt,gap:c,className:o,style:l})=>e.jsx("div",{className:`nice-responsivebox ${o||""}`,style:{display:"flex",flexDirection:n,gap:c,...l},children:i.map((d,m)=>e.jsx("div",{style:{flex:d.ratio??1,flexBasis:d.baseSize,flexShrink:d.shrink??1},children:d.children},m))}),gt=({width:n=200,height:i=200,minWidth:c=50,minHeight:o=50,maxWidth:l=1/0,maxHeight:d=1/0,handles:m=["right","bottom","bottomRight"],onResize:x,children:f,className:C,style:M})=>{const[T,P]=t.useState({width:n,height:i}),R=t.useRef(null),v=(r,p)=>{p.preventDefault();const y=p.clientX,h=p.clientY,L=T.width,E=T.height,Y={n:"top",s:"bottom",e:"right",w:"left",ne:"topRight",se:"bottomRight",sw:"bottomLeft",nw:"topLeft"}[r]??r,S=Y==="right"||Y==="topRight"||Y==="bottomRight",B=Y==="left"||Y==="topLeft"||Y==="bottomLeft",k=Y==="bottom"||Y==="bottomRight"||Y==="bottomLeft",s=Y==="top"||Y==="topRight"||Y==="topLeft",N=I=>{const O=I.clientX-y,H=I.clientY-h;let w=L,q=E;S&&(w=L+O),B&&(w=L-O),k&&(q=E+H),s&&(q=E-H),w=Math.max(c,Math.min(l,w)),q=Math.max(o,Math.min(d,q)),P({width:w,height:q}),x?.({width:w,height:q})},j=()=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",j)};document.addEventListener("pointermove",N),document.addEventListener("pointerup",j)},a=r=>{switch(r){case"top":case"bottom":return"ns-resize";case"left":case"right":return"ew-resize";case"topLeft":case"bottomRight":return"nwse-resize";case"topRight":case"bottomLeft":return"nesw-resize";default:return"default"}},u=r=>{const p={position:"absolute",zIndex:1},y=8;return r==="right"?{...p,top:0,right:-y/2,width:y,height:"100%",cursor:a(r)}:r==="bottom"?{...p,left:0,bottom:-y/2,width:"100%",height:y,cursor:a(r)}:r==="left"?{...p,top:0,left:-y/2,width:y,height:"100%",cursor:a(r)}:r==="top"?{...p,top:-y/2,left:0,width:"100%",height:y,cursor:a(r)}:r==="bottomRight"?{...p,bottom:-y/2,right:-y/2,width:y*2,height:y*2,cursor:a(r)}:r==="bottomLeft"?{...p,bottom:-y/2,left:-y/2,width:y*2,height:y*2,cursor:a(r)}:r==="topRight"?{...p,top:-y/2,right:-y/2,width:y*2,height:y*2,cursor:a(r)}:r==="topLeft"?{...p,top:-y/2,left:-y/2,width:y*2,height:y*2,cursor:a(r)}:p};return e.jsxs("div",{ref:R,className:`nice-resizable ${C||""}`,style:{...M,width:T.width,height:T.height,position:"relative",overflow:"hidden"},children:[f,m.map(r=>e.jsx("div",{style:u(r),onPointerDown:p=>v(r,p)},r))]})},bt=({direction:n="vertical",showScrollbar:i="onInteraction",width:c,height:o,onScroll:l,children:d,className:m,style:x})=>{const f=n==="horizontal"||n==="both"?"auto":"hidden",C=n==="vertical"||n==="both"?"auto":"hidden",M=i==="never"?"nice-scrollview--hide-sb":i==="always"?"nice-scrollview--show-sb":"";return e.jsx("div",{className:`nice-scrollview ${M} ${m||""}`,style:{...x,width:c,height:o,overflowX:f,overflowY:C},onScroll:l,children:d})},_t=[];function Ce(){const n=t.useContext(g.NiceThemeContext);return n?.portalTarget?n.portalTarget:typeof document<"u"?document.body:null}const vt=({open:n,onClose:i,children:c,title:o,size:l="md",closeOnBackdropClick:d=!0,closeOnEscape:m=!0,disableFocusTrap:x=!1,disableBodyScroll:f=!0,zIndex:C=1e3,className:M,style:T})=>{const P=t.useRef(null);g.useOverlayFocus(P,{open:n,modal:!x,onClose:i,closeOnEscape:m});const R=Ce();t.useEffect(()=>{if(!f&&n){const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}}},[n,f]);const v=t.useCallback(u=>{d&&u.target===u.currentTarget&&i()},[d,i]);if(!n)return null;const a={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[l];return je.createPortal(e.jsx("div",{className:"nice-modal__overlay",style:{zIndex:C},onClick:v,role:"presentation",children:e.jsx("div",{ref:P,className:`nice-modal ${a} ${M||""}`,role:"dialog","aria-modal":"true","aria-label":o,style:T,tabIndex:-1,children:c})}),R)},yt=({children:n,showClose:i=!0,onClose:c,className:o})=>{const{t:l}=g.useNiceTranslation();return e.jsxs("div",{className:`nice-modal__header ${o||""}`,children:[e.jsx("div",{className:"nice-modal__title",children:n}),i&&c&&e.jsx("button",{type:"button",className:"nice-modal__close",onClick:c,"aria-label":l("overlays.close","Close"),children:e.jsx(g.NiceIcon,{name:"close",size:20})})]})},Nt=({children:n,className:i})=>e.jsx("div",{className:`nice-modal__body ${i||""}`,children:n}),kt=({children:n,className:i})=>e.jsx("div",{className:`nice-modal__footer ${i||""}`,children:n}),jt=({open:n,onClose:i,children:c,position:o="right",size:l=320,title:d,closeOnBackdropClick:m=!0,closeOnEscape:x=!0,swipeToClose:f=!0,zIndex:C=1e3,className:M,style:T})=>{const P=t.useRef(null),[R,v]=t.useState(!1),[a,u]=t.useState(0);g.useOverlayFocus(P,{open:n,onClose:i,closeOnEscape:x});const r=Ce(),p=t.useCallback(S=>{let B=0;switch(o){case"left":B=Math.min(0,S.deltaX);break;case"right":B=Math.max(0,S.deltaX);break;case"top":B=Math.min(0,S.deltaY);break;case"bottom":B=Math.max(0,S.deltaY);break}u(B)},[o]),y=t.useCallback(S=>{let k=!1;switch(o){case"left":k=S.deltaX<-100;break;case"right":k=S.deltaX>100;break;case"top":k=S.deltaY<-100;break;case"bottom":k=S.deltaY>100;break}k&&(g.triggerHaptic("light"),i()),u(0),v(!1)},[o,i]),{ref:h}=g.usePan({enabled:f&&n,onPanStart:()=>v(!0),onPan:p,onPanEnd:y}),L=t.useCallback(S=>{m&&S.target===S.currentTarget&&i()},[m,i]);if(!n)return null;const E=o==="left"||o==="right",V=E?{width:typeof l=="number"?`${l}px`:l}:{height:typeof l=="number"?`${l}px`:l},Y=()=>{if(R)return E?`translateX(${a}px)`:`translateY(${a}px)`};return je.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"presentation",className:`nice-drawer__overlay ${n?"nice-drawer__overlay--visible":""}`,style:{zIndex:C},onClick:L}),e.jsx("div",{ref:S=>{P.current=S,h.current=S},className:`nice-drawer nice-drawer--${o} ${n?"nice-drawer--open":""} ${M||""}`,style:{...V,zIndex:C+1,transform:Y(),transition:R?"none":void 0,...T},role:"dialog","aria-modal":"true","aria-label":d,tabIndex:-1,children:c})]}),r)},Ct=({open:n,onClose:i,children:c,title:o,showHandle:l=!0,snapPoints:d=[.5,.9],initialSnap:m=0,expandable:x=!0,closeOnBackdropClick:f=!0,closeOnEscape:C=!0,hapticFeedback:M=!0,zIndex:T=1e3,className:P,style:R})=>{const v=t.useRef(null),a=t.useRef(null),[u,r]=t.useState(m),[p,y]=t.useState(!1),[h,L]=t.useState(0),E=t.useRef(0);t.useEffect(()=>{n&&(r(m),L(0))},[n,m]),g.useOverlayFocus(v,{open:n,onClose:i,closeOnEscape:C});const V=Ce();t.useEffect(()=>{if(n){const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}}},[n]);const Y=t.useCallback(j=>{const I=j.target.closest(".nice-bottom-sheet__handle"),O=a.current,H=!O||O.scrollTop<=0;!I&&!H||(y(!0),E.current=j.touches[0].clientY)},[]),S=t.useCallback(j=>{if(!p)return;const I=j.touches[0].clientY-E.current;(I>0||u<d.length-1)&&L(I)},[p,u,d.length]),B=t.useCallback(()=>{if(!p)return;const j=window.innerHeight;d[u]*j;const I=-h,O=j*.15;I>O&&x&&u<d.length-1?(r(u+1),M&&g.triggerHaptic("selection")):I<-O&&(u>0?(r(u-1),M&&g.triggerHaptic("selection")):(M&&g.triggerHaptic("light"),i())),y(!1),L(0)},[p,h,u,d,x,M,i]),k=t.useCallback(()=>{f&&i()},[f,i]);if(!n)return null;const s=d[u]*100,N=p?h:0;return je.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"presentation",className:`nice-bottom-sheet__overlay ${n?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:T},onClick:k}),e.jsxs("div",{ref:v,className:`nice-bottom-sheet ${n?"nice-bottom-sheet--open":""} ${P||""}`,style:{zIndex:T+1,height:`${s}vh`,transform:`translateY(${Math.max(0,N)}px)`,transition:p?"none":"transform 0.3s ease-out, height 0.3s ease-out",...R},role:"dialog","aria-modal":"true","aria-label":o,tabIndex:-1,onTouchStart:Y,onTouchMove:S,onTouchEnd:B,children:[l&&e.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),o&&e.jsx("div",{className:"nice-bottom-sheet__title",children:o}),e.jsx("div",{ref:a,className:"nice-bottom-sheet__content",children:c})]})]}),V)},Et=({trigger:n,children:i,placement:c="bottom",triggerMode:o="click",open:l,onOpenChange:d,hoverDelay:m=200,offset:x=8,className:f,showArrow:C=!0})=>{const[M,T]=t.useState(!1),P=t.useRef(null),R=t.useRef(null),v=t.useRef(null),a=Ce(),u=l!==void 0,r=u?l:M,p=t.useCallback(k=>{u||T(k),d?.(k)},[u,d]);g.useClickOutside(R,()=>{o!=="manual"&&r&&p(!1)});const y=o!=="hover";g.useOverlayFocus(R,{open:r&&y,modal:!1,onClose:()=>p(!1)});const h=t.useCallback(()=>{o==="click"&&p(!r)},[o,r,p]),L=t.useCallback(()=>{o==="hover"&&(v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>p(!0),m))},[o,m,p]),E=t.useCallback(()=>{o==="hover"&&(v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>p(!1),m))},[o,m,p]),V=t.useCallback(k=>{const s=k.relatedTarget;!P.current?.contains(s)&&!R.current?.contains(s)&&E()},[E]),Y=t.useCallback(k=>{o==="hover"&&r&&k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),v.current&&window.clearTimeout(v.current),p(!1))},[o,r,p]),[S,B]=t.useState({top:0,left:0});return t.useEffect(()=>{if(!r||!P.current||!R.current)return;const k=P.current.getBoundingClientRect(),s=R.current.getBoundingClientRect(),N=window.innerWidth,j=window.innerHeight;let I=0,O=0;const[H,w="center"]=c.split("-");switch(H){case"top":I=k.top-s.height-x,O=k.left+(k.width-s.width)/2;break;case"bottom":I=k.bottom+x,O=k.left+(k.width-s.width)/2;break;case"left":I=k.top+(k.height-s.height)/2,O=k.left-s.width-x;break;case"right":I=k.top+(k.height-s.height)/2,O=k.right+x;break}H==="top"||H==="bottom"?(w==="start"&&(O=k.left),w==="end"&&(O=k.right-s.width)):(w==="start"&&(I=k.top),w==="end"&&(I=k.bottom-s.height)),O=Math.max(8,Math.min(N-s.width-8,O)),I=Math.max(8,Math.min(j-s.height-8,I)),B({top:I,left:O})},[r,c,x]),e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:P,className:"nice-popover__trigger",onClick:h,onMouseEnter:L,onMouseLeave:E,onFocus:L,onBlur:V,onKeyDown:Y,style:{display:"inline-block"},children:n}),r&&je.createPortal(e.jsxs("div",{ref:R,className:`nice-popover nice-popover--${c} ${f||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:L,onMouseLeave:E,role:y?"dialog":"tooltip",children:[C&&e.jsx("div",{className:"nice-popover__arrow"}),e.jsx("div",{className:"nice-popover__content",children:i})]}),a)]})},It=({items:n=_t,children:i,onOpen:c,onClose:o,className:l})=>{const[d,m]=t.useState(!1),[x,f]=t.useState({x:0,y:0}),C=t.useRef(null),M=t.useRef(null),T=Ce();g.useClickOutside(C,()=>{d&&(m(!1),o?.())});const P=t.useCallback(u=>{if(u.preventDefault(),u.clientX===0&&u.clientY===0&&u.target instanceof Element){const r=u.target.getBoundingClientRect();f({x:r.left,y:r.bottom})}else f({x:u.clientX,y:u.clientY});m(!0),c?.()},[c]),R=t.useCallback(()=>{m(!1),o?.()},[o]),v=t.useCallback(u=>{!u.disabled&&u.onClick&&(u.onClick(),R())},[R]);g.useOverlayFocus(C,{open:d,modal:!1,onClose:R}),g.useRovingFocus(C,{orientation:"vertical",wrap:!0,typeahead:!0});const a=u=>e.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:u.map(r=>r.divider?e.jsx("li",{className:"nice-context-menu__divider",role:"separator"},r.key):e.jsx("li",{role:"presentation",children:e.jsxs("button",{type:"button",className:`nice-context-menu__item ${r.disabled?"nice-context-menu__item--disabled":""} ${r.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:r.disabled,onClick:()=>v(r),children:[r.icon&&e.jsx("span",{className:"nice-context-menu__icon",children:r.icon}),e.jsx("span",{className:"nice-context-menu__label",children:r.label})]})},r.key))});return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:M,onContextMenu:P,style:{display:"contents"},children:i}),d&&je.createPortal(e.jsx("div",{ref:C,className:`nice-context-menu ${l||""}`,style:{position:"fixed",left:x.x,top:x.y,zIndex:1200},children:a(n)}),T)]})};function Oe(n,i){if(!n)return{score:1,indices:[]};const c=n.toLowerCase(),o=i.toLowerCase();let l=0;const d=[];let m=0,x=-1;for(let f=0;f<o.length&&l<c.length;f++)o[f]===c[l]&&(d.push(f),x===f-1&&(m+=3),(f===0||/[\s\-_/.]/.test(i[f-1]))&&(m+=5),i[f]===n[l]&&(m+=1),m+=1,x=f,l++);return l<c.length?null:(m-=d[0]*.1,{score:m,indices:d})}function Ke(n,i){if(i.length===0)return[n];const c=[];let o=0;const l=new Set(i);for(let d=0;d<n.length;d++)l.has(d)&&(o<d&&c.push(n.slice(o,d)),c.push(t.createElement("mark",{key:`m-${d}`,className:"nice-command-palette__match"},n[d])),o=d+1);return o<n.length&&c.push(n.slice(o)),c}function Rt(n,i){switch(i.type){case"REGISTER":{const c=new Map(n.commands);return c.set(i.command.id,i.command),{...n,commands:c}}case"REGISTER_BATCH":{const c=new Map(n.commands);for(const o of i.commands)c.set(o.id,o);return{...n,commands:c}}case"UNREGISTER":{const c=new Map(n.commands);return c.delete(i.id),{...n,commands:c}}case"OPEN":return{...n,isOpen:!0,query:"",selectedIndex:0};case"CLOSE":return{...n,isOpen:!1,query:"",selectedIndex:0};case"SET_QUERY":return{...n,query:i.query,selectedIndex:0};case"SET_SELECTED":return{...n,selectedIndex:i.index};case"ADD_RECENT":{const c=n.recentIds.filter(o=>o!==i.id);return{...n,recentIds:[i.id,...c].slice(0,i.maxRecent)}}default:return n}}const Ge=t.createContext(null);function Qe(){const n=t.useContext(Ge);if(!n)throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");return n}const Ze=({children:n,commands:i,placeholder:c,maxVisible:o=10,maxRecent:l=5,className:d,emptyText:m,closeOnAction:x=!0,onOpen:f,onClose:C,includeActions:M=!0})=>{const{t:T}=g.useNiceTranslation(),P=g.useNiceActions(),R=T("commandPalette.general","General"),v=Ce(),[a,u]=t.useReducer(Rt,{commands:new Map(i?.map(_=>[_.id,_])??[]),isOpen:!1,query:"",selectedIndex:0,recentIds:[]}),r=t.useRef(null),p=t.useRef(null),[y,h]=t.useState(!1),L=t.useCallback(_=>{u({type:"REGISTER",command:_})},[]),E=t.useCallback(_=>{u({type:"UNREGISTER",id:_})},[]),V=t.useCallback(_=>{u({type:"REGISTER_BATCH",commands:_})},[]),Y=t.useCallback(()=>{u({type:"OPEN"}),f?.()},[f]),S=t.useCallback(()=>{u({type:"CLOSE"}),C?.()},[C]),B=t.useCallback(()=>{a.isOpen?S():Y()},[a.isOpen,S,Y]),k=t.useMemo(()=>{const _=new Map(a.commands);if(M)for(const z of P){const b=`action:${z.id}`;z.palette===!1||_.has(b)||_.set(b,{id:b,label:z.label,description:z.description,category:z.group,shortcut:typeof z.keyboard=="string"?z.keyboard:z.keyboard?.[0],disabled:z.when?!z.when():!1,action:()=>{g.triggerNiceAction(z.id,"keyboard")}})}return _},[a.commands,P,M,a.isOpen]),N=t.useMemo(()=>{const _=Array.from(k.values()).filter(b=>!b.hidden);if(!a.query.trim()){const b=a.recentIds.map(F=>k.get(F)).filter(F=>!!F&&!F.hidden),W=_.filter(F=>!a.recentIds.includes(F.id));return W.sort((F,se)=>F.label.localeCompare(se.label)),[...b,...W].map(F=>({command:F,match:null,isRecent:a.recentIds.includes(F.id)}))}return _.map(b=>{const W=Oe(a.query,b.label),F=b.description?Oe(a.query,b.description):null,se=b.keywords?.map(ne=>Oe(a.query,ne)).filter(Boolean)[0]??null,re=[W,F,se].filter(Boolean).sort((ne,pe)=>(pe?.score??0)-(ne?.score??0))[0]??null;return{command:b,match:re,isRecent:!1}}).filter(b=>b.match!==null).sort((b,W)=>(W.match?.score??0)-(b.match?.score??0))},[k,a.query,a.recentIds]).slice(0,o),j=t.useCallback(async _=>{const z=k.get(_);if(!(!z||z.disabled)){h(!0);try{await z.action(),u({type:"ADD_RECENT",id:_,maxRecent:l})}finally{h(!1),x&&S()}}},[k,l,x,S]);g.useIntent("menu",()=>B());const I=t.useRef(null);g.useOverlayFocus(I,{open:a.isOpen,onClose:S,initialFocus:r}),g.useIntent(["navigate","activate"],_=>{const z=N.length;if(_.intent==="activate"){const W=N[a.selectedIndex];return W&&j(W.command.id),!0}if(!z||_.direction!=="up"&&_.direction!=="down")return!1;const b=_.direction==="down"?1:-1;return u({type:"SET_SELECTED",index:(a.selectedIndex+b+z)%z}),!0},{ref:I,enabled:a.isOpen}),g.useInputHints(I,a.isOpen?[{intent:"navigate",label:T("commandPalette.choose","Choose")},{intent:"activate",label:T("commandPalette.run","Run")},{intent:"back",label:T("input.hint.close","Close")}]:[]);const O=t.useCallback(_=>{const z=N.length;if(z){if(_.key==="ArrowDown")_.preventDefault(),u({type:"SET_SELECTED",index:(a.selectedIndex+1)%z});else if(_.key==="ArrowUp")_.preventDefault(),u({type:"SET_SELECTED",index:(a.selectedIndex-1+z)%z});else if(_.key==="Enter"){_.preventDefault();const b=N[a.selectedIndex];b&&j(b.command.id)}}},[N,a.selectedIndex,j]);t.useEffect(()=>{if(!p.current)return;p.current.children[a.selectedIndex]?.scrollIntoView?.({block:"nearest"})},[a.selectedIndex]);const H=t.useMemo(()=>({registerCommand:L,unregisterCommand:E,registerCommands:V,open:Y,close:S,toggle:B,isOpen:a.isOpen,executeCommand:j}),[L,E,V,Y,S,B,a.isOpen,j]),w=t.useMemo(()=>{const _=new Map;for(const z of N){const b=z.command.category??R;_.has(b)||_.set(b,[]),_.get(b).push(z)}return _},[N,R]);let q=0;return e.jsxs(Ge.Provider,{value:H,children:[n,a.isOpen&&je.createPortal(e.jsx("div",{className:`nice-command-palette__overlay ${d??""}`,role:"presentation",onClick:_=>{_.stopPropagation(),_.target===_.currentTarget&&S()},children:e.jsxs("div",{ref:I,className:"nice-command-palette",role:"dialog","aria-label":T("commandPalette.title","Command palette"),"aria-modal":"true",children:[e.jsx("div",{className:"nice-command-palette__input-wrapper",children:e.jsx("input",{ref:r,className:"nice-command-palette__input",type:"text",placeholder:c??T("commandPalette.placeholder","Type a command..."),value:a.query,onChange:_=>u({type:"SET_QUERY",query:_.target.value}),onKeyDown:O,"aria-label":T("commandPalette.search","Search commands"),"aria-autocomplete":"list","aria-controls":"nice-command-palette-list","aria-activedescendant":N[a.selectedIndex]?`nice-cmd-${N[a.selectedIndex].command.id}`:void 0})}),e.jsxs("div",{ref:p,id:"nice-command-palette-list",className:"nice-command-palette__list",role:"listbox",children:[N.length===0&&e.jsx("div",{className:"nice-command-palette__empty",children:m??T("commandPalette.empty","No commands found")}),Array.from(w.entries()).map(([_,z])=>e.jsxs("div",{className:"nice-command-palette__group",children:[e.jsx("div",{className:"nice-command-palette__category",children:_}),z.map(b=>{const W=q++,F=W===a.selectedIndex;return e.jsxs("div",{id:`nice-cmd-${b.command.id}`,className:`nice-command-palette__item ${F?"nice-command-palette__item--selected":""} ${b.command.disabled?"nice-command-palette__item--disabled":""}`,role:"option","aria-selected":F,"aria-disabled":b.command.disabled,onClick:()=>!b.command.disabled&&j(b.command.id),onMouseEnter:()=>u({type:"SET_SELECTED",index:W}),children:[b.command.icon&&e.jsx("span",{className:"nice-command-palette__icon",children:b.command.icon}),e.jsxs("div",{className:"nice-command-palette__label-group",children:[e.jsx("span",{className:"nice-command-palette__label",children:b.match&&a.query?Ke(b.command.label,b.match.indices):b.command.label}),b.command.description&&e.jsx("span",{className:"nice-command-palette__description",children:b.command.description})]}),b.command.shortcut&&e.jsx("kbd",{className:"nice-command-palette__shortcut",children:b.command.shortcut}),b.isRecent&&e.jsx("span",{className:"nice-command-palette__recent-badge",children:T("commandPalette.recent","Recent")})]},b.command.id)})]},_))]}),y&&e.jsx("div",{className:"nice-command-palette__executing",children:T("commandPalette.executing","Executing...")})]})}),v)]})};process.env.NODE_ENV!=="production"&&(Ze.displayName="NiceCommandPaletteProvider");function Tt(n){const{registerCommands:i,unregisterCommand:c}=Qe();t.useEffect(()=>(i(n),()=>{for(const o of n)c(o.id)}),[])}const Mt=Object.assign(t.forwardRef(({blocked:n,message:i,spinner:c,blur:o,children:l,className:d,style:m,id:x},f)=>{const C=g.useControlId(x);return e.jsxs("div",{ref:f,id:C,className:`nice-block-ui ${d||""}`,style:{position:"relative",...m},children:[l,n&&e.jsx("div",{className:`nice-block-ui__overlay${o?" nice-block-ui__overlay--blur":""}`,"aria-busy":"true",role:"alert",children:(c||i)&&e.jsxs("div",{className:"nice-block-ui__content",children:[c&&e.jsx("div",{className:"nice-block-ui__spinner","aria-hidden":"true"}),i&&e.jsx("div",{className:"nice-block-ui__message",children:i})]})})]})}),{displayName:"NiceBlockUI"}),St=Object.assign(t.forwardRef(({windows:n,children:i,onChange:c,onClose:o,onFocus:l,showTaskbar:d=!0,size:m="md",className:x,style:f,id:C,...M},T)=>{const P=g.useControlId(C),{t:R}=g.useNiceTranslation(),[v,a]=t.useState(null),u=t.useRef(null),r=t.useRef(null);g.useRovingFocus(r,{orientation:"horizontal",itemSelector:".nice-wm__taskbar-btn"});const p=t.useRef(null),y=t.useCallback(s=>{const N=[...u.current?.querySelectorAll("[data-wm-key]")??[]].find(j=>j.getAttribute("data-wm-key")===s);return N?((g.focusCandidates(N)[0]??N).focus(),!0):!1},[]);t.useEffect(()=>{const s=p.current;s&&y(s)&&(p.current=null)});const h=t.useMemo(()=>n??[],[n]),L=Math.max(1,...h.map(s=>s.zIndex??1)),E=t.useCallback((s,N)=>{const j=h.map(I=>I.key===s?{...I,...N}:I);c?.(j)},[h,c]),V=t.useCallback(s=>{E(s,{zIndex:L+1}),l?.(s)},[E,L,l]),Y=t.useCallback(s=>{o?.(s),c?.(h.filter(N=>N.key!==s))},[h,c,o]),S=t.useCallback(s=>{const N=h.find(j=>j.key===s);N&&E(s,{minimized:!N.minimized,maximized:!1})},[h,E]),B=t.useCallback(s=>{const N=h.find(j=>j.key===s);N&&E(s,{maximized:!N.maximized,minimized:!1})},[h,E]);t.useEffect(()=>{if(!v)return;const s=j=>{const I=h.find(O=>O.key===v.key);if(I)if(v.mode==="move")E(v.key,{x:j.clientX-v.offsetX,y:j.clientY-v.offsetY});else{const H=u.current?.getBoundingClientRect(),w=H?.left??0,q=H?.top??0;E(v.key,{width:Math.max(200,j.clientX-w-I.x),height:Math.max(100,j.clientY-q-I.y)})}},N=()=>a(null);return document.addEventListener("mousemove",s),document.addEventListener("mouseup",N),()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",N)}},[v,h,E]);const k=t.useCallback((s,N,j)=>{N.preventDefault();const I=h.find(O=>O.key===s);I&&(V(s),a({key:s,offsetX:j==="move"?N.clientX-I.x:0,offsetY:j==="move"?N.clientY-I.y:0,mode:j}))},[h,V]);return e.jsxs("div",{ref:s=>{u.current=s,typeof T=="function"?T(s):T&&(T.current=s)},id:P,className:`nice-wm nice-wm--${m} ${x??""}`,style:{...f,position:"relative",overflow:"hidden"},...M,children:[h.map(s=>{if(s.minimized)return null;const N=s.maximized,j=N?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:s.zIndex??1}:{position:"absolute",top:s.y,left:s.x,width:s.width,height:s.height,zIndex:s.zIndex??1};return e.jsxs("div",{className:`nice-wm__window ${N?"nice-wm__window--maximized":""}`,style:j,onMouseDown:()=>V(s.key),onFocus:()=>{(s.zIndex??1)<L&&V(s.key)},role:"dialog","aria-label":s.title,tabIndex:-1,"data-wm-key":s.key,"data-nice-focus-scope":"spatial","data-nice-region":s.title,children:[e.jsxs("div",{className:"nice-wm__titlebar",onMouseDown:I=>!N&&k(s.key,I,"move"),children:[s.icon&&e.jsx("span",{className:"nice-wm__icon",children:s.icon}),e.jsx("span",{className:"nice-wm__title",children:s.title}),e.jsxs("div",{className:"nice-wm__controls",children:[(s.minimizable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--min",onClick:()=>S(s.key),title:R("wm.minimize","Minimize"),children:e.jsx(g.NiceIcon,{name:"minus",size:14})}),(s.maximizable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--max",onClick:()=>B(s.key),title:R("wm.maximize","Maximize"),children:e.jsx(g.NiceIcon,{name:N?"copy":"window",size:14})}),(s.closable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--close",onClick:()=>Y(s.key),title:R("wm.close","Close"),children:e.jsx(g.NiceIcon,{name:"close",size:14})})]})]}),e.jsx("div",{className:"nice-wm__body",children:s.content}),(s.resizable??!0)&&!N&&e.jsx("div",{className:"nice-wm__resize-handle",onMouseDown:I=>k(s.key,I,"resize")})]},s.key)}),n===void 0&&i,d&&e.jsx("div",{ref:r,className:"nice-wm__taskbar",role:"toolbar","aria-label":R("wm.taskbar","Taskbar"),"data-nice-region":R("wm.taskbar","Taskbar"),children:h.map(s=>e.jsxs("button",{type:"button",className:`nice-wm__taskbar-btn ${s.minimized?"nice-wm__taskbar-btn--minimized":""}`,onClick:()=>{s.minimized&&S(s.key),V(s.key),(s.minimized||!y(s.key))&&(p.current=s.key)},children:[s.icon&&e.jsx("span",{className:"nice-wm__taskbar-icon",children:s.icon}),e.jsx("span",{className:"nice-wm__taskbar-label",children:s.title})]},s.key))})]})}),{displayName:"NiceWindowManager"});function zt(n,i){const c=document.querySelector(n);if(!c)return null;const o=c.getBoundingClientRect();return{top:o.top-i+window.scrollY,left:o.left-i+window.scrollX,width:o.width+i*2,height:o.height+i*2}}function $t(n,i,c,o){const d={w:window.innerWidth,h:window.innerHeight+window.scrollY},m={top:{top:n.top-c-12,left:n.left+n.width/2-i/2},bottom:{top:n.top+n.height+12,left:n.left+n.width/2-i/2},left:{top:n.top+n.height/2-c/2,left:n.left-i-12},right:{top:n.top+n.height/2-c/2,left:n.left+n.width+12}};if(o&&o!=="auto")return{...m[o],actualPlacement:o};for(const x of["bottom","top","right","left"]){const f=m[x];if(f.top>=0&&f.left>=0&&f.top+c<=d.h&&f.left+i<=d.w)return{...f,actualPlacement:x}}return{...m.bottom,actualPlacement:"bottom"}}function Pt(){return e.jsx(g.NiceIcon,{name:"close",size:16})}function Lt(){return e.jsx(g.NiceIcon,{name:"chevron-left",size:16})}function Ot(){return e.jsx(g.NiceIcon,{name:"chevron-right",size:16})}function Yt(){return e.jsx(g.NiceIcon,{name:"skip-forward",size:16})}function Dt(){return e.jsx(g.NiceIcon,{name:"play",size:16})}function Ft(){return e.jsx(g.NiceIcon,{name:"pause",size:16})}function Le(n,i,c){return c==="text"?e.jsx("span",{className:"nice-tutorial__btn-label",children:i}):c==="icon-text"?e.jsxs(e.Fragment,{children:[n,e.jsx("span",{className:"nice-tutorial__btn-label",children:i})]}):n}const Bt=[],We=({steps:n=Bt,active:i,onFinish:c,onSkip:o,onStepChange:l,closeOnEscape:d=!0,closeOnOverlayClick:m=!1,showProgress:x=!0,showSkipButton:f=!0,labels:C,animationDuration:M=300,overlayOpacity:T=.6,zIndex:P=1e4,buttonsPlacement:R="floating-bottom",buttonsDisplay:v="icon",showAutoplay:a=!0,autoplayInterval:u=5e3,autoplaySpeedRange:r={min:2e3,max:15e3},onAutoplayChange:p})=>{const{t:y}=g.useNiceTranslation(),[h,L]=t.useState(0),[E,V]=t.useState(null),[Y,S]=t.useState({w:340,h:200}),[B,k]=t.useState(!0),[s,N]=t.useState(!1),[j,I]=t.useState(u),O=t.useRef(null),H=t.useRef(-1),w=n[h],q=h===n.length-1,_=h===0,z=C?.next??"Next",b=C?.back??"Back",W=C?.finish??"Finish",F=C?.skip??"Skip",se=C?.stepOf??"of",re=C?.play??"Play",ne=C?.pause??"Pause",pe=C?.speed??"Speed",Se=C?.close??"Close";t.useEffect(()=>{i&&(L(0),N(!1),I(u))},[i,u]),t.useEffect(()=>{if(O.current){const $=O.current.getBoundingClientRect();S({w:$.width,h:$.height})}},[h,i]),t.useEffect(()=>{if(!i||!w)return;const $=w.highlightPadding??0,X=()=>{const K=zt(w.target,$);V(K)};if(X(),w.scrollIntoView!==!1){document.querySelector(w.target)?.scrollIntoView({behavior:"smooth",block:"center"});const Ie=setTimeout(X,350);return()=>clearTimeout(Ie)}},[i,w,h]),t.useEffect(()=>{!i||!w||H.current!==h&&(H.current>=0&&H.current<n.length&&n[H.current]?.onLeave?.(),w.onEnter?.(),H.current=h)},[i,w,h,n]);const oe=t.useCallback(()=>{if(q)w?.onLeave?.(),c?.();else{const $=h+1;L($),l?.($)}},[h,q,c,l,w]),xe=t.useCallback(()=>{if(!_){const $=h-1;L($),l?.($)}},[h,_,l]),ze=t.useCallback($=>{$!==h&&$>=0&&$<n.length&&(L($),l?.($))},[h,n.length,l]);t.useEffect(()=>{if(!i||!w?.advanceOn)return;const $=document.querySelector(w.target);if(!$)return;const X=()=>oe();return $.addEventListener(w.advanceOn.event,X),()=>$.removeEventListener(w.advanceOn.event,X)},[i,w,h,oe]);const we=t.useRef(null),G=!!(i&&w);g.useOverlayFocus(we,{open:G,modal:!(w?.waitForAction||w?.advanceOn),onClose:()=>o?.(),closeOnEscape:d,closeHint:F}),t.useEffect(()=>{const $=we.current;if(!G||!$)return;const X=K=>{if(!(K.defaultPrevented||K.target instanceof HTMLInputElement)){if(K.key==="ArrowRight")oe();else if(K.key==="ArrowLeft")xe();else if(K.key==="Home"||K.key==="End")ze(K.key==="Home"?0:n.length-1);else return;K.preventDefault()}};return $.addEventListener("keydown",X),()=>$.removeEventListener("keydown",X)},[G,oe,xe,ze,n.length]);const ye=g.useInputEngine(),A=G?w?.title:void 0;t.useEffect(()=>{A&&h>0&&ye?.announce(A)},[ye,A,h]);const Ee=t.useId(),$e=`${Ee}-content`;g.useIntent(["sectionPrev","sectionNext"],$=>{if($.intent==="sectionNext"){if(w?.waitForAction)return!1;oe()}else xe()},{ref:we,enabled:G}),g.useInputHints(we,G?[..._?[]:[{intent:"sectionPrev",label:b}],...w?.waitForAction?[]:[{intent:"sectionNext",label:q?W:z}]]:[]),t.useEffect(()=>{k(!0);const $=setTimeout(()=>k(!1),M);return()=>clearTimeout($)},[h,M]),t.useEffect(()=>{if(!i||!s)return;const $=setInterval(()=>{L(X=>{if(X>=n.length-1)return N(!1),p?.(!1),n[X]?.onLeave?.(),c?.(),X;const K=X+1;return l?.(K),K})},Math.max(500,j));return()=>clearInterval($)},[i,s,j,n,p,c,l]);const ge=t.useCallback(()=>{N($=>{const X=!$;return p?.(X),X})},[p]),ee=t.useMemo(()=>E?$t(E,Y.w,Y.h,w?.placement):{top:typeof window<"u"?window.innerHeight/2:0,left:typeof window<"u"?window.innerWidth/2:0,actualPlacement:"bottom"},[E,Y,w?.placement]),ae=n.length===0?0:(h+1)/n.length*100,be=t.useCallback($=>{const X=a&&n.length>1,K=f&&!q&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--skip nice-tutorial__btn--${v}`,onClick:o,"aria-label":F,title:F,children:Le(e.jsx(Yt,{}),F,v)}),Ie=!_&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--back nice-tutorial__btn--${v}`,onClick:xe,"aria-label":b,title:b,children:Le(e.jsx(Lt,{}),b,v)}),Fe=!w?.waitForAction&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--next nice-tutorial__btn--${v}`,onClick:oe,"aria-label":q?W:z,title:q?W:z,children:Le(e.jsx(Ot,{}),q?W:z,v)}),Be=X&&e.jsx("button",{type:"button",className:["nice-tutorial__btn","nice-tutorial__btn--play",`nice-tutorial__btn--${v}`,s?"nice-tutorial__btn--active":""].filter(Boolean).join(" "),onClick:ge,"aria-label":s?ne:re,title:s?ne:re,"aria-pressed":s,children:Le(s?e.jsx(Ft,{}):e.jsx(Dt,{}),s?ne:re,v)});return e.jsxs("div",{className:["nice-tutorial__controls",$?"nice-tutorial__controls--inline":"nice-tutorial__controls--floating-bottom"].join(" "),style:$?void 0:{zIndex:P+2},role:"group","aria-label":y("tutorial.tutorialControls","Tutorial controls"),children:[K,Ie,x&&e.jsxs("span",{className:"nice-tutorial__step-label","aria-live":"polite",children:[h+1," ",se," ",n.length]}),Fe,X&&e.jsx("div",{className:"nice-tutorial__progress-bar",role:"progressbar","aria-valuenow":Math.round(ae),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${h+1} ${se} ${n.length}`,children:e.jsx("div",{className:"nice-tutorial__progress-bar-fill",style:{width:`${ae}%`}})}),Be,X&&e.jsxs("label",{className:"nice-tutorial__speed",children:[e.jsx("input",{type:"range",className:"nice-tutorial__speed-slider",min:r.min,max:r.max,step:500,value:r.min+r.max-j,onChange:te=>I(r.min+r.max-Number(te.target.value)),"aria-label":pe}),e.jsxs("span",{className:"nice-tutorial__speed-value",children:[(j/1e3).toFixed(1),"s"]})]})]})},[a,f,x,v,_,q,o,F,b,z,W,re,ne,pe,se,xe,oe,w,s,ge,h,n.length,ae,j,r,P,y]);if(!i||!w)return null;const Ye=typeof document<"u"?Math.max(document.documentElement.scrollWidth,window.innerWidth):0,De=typeof document<"u"?Math.max(document.documentElement.scrollHeight,window.innerHeight):0;return e.jsxs("div",{ref:we,className:"nice-tutorial",style:{zIndex:P},"aria-modal":w.waitForAction||w.advanceOn?void 0:!0,role:"dialog","aria-label":w.title?void 0:y("tutorial.tutorial","Tutorial"),"aria-labelledby":w.title?Ee:void 0,"aria-describedby":w.content?$e:void 0,children:[e.jsxs("svg",{className:"nice-tutorial__overlay",style:{position:"absolute",top:0,left:0,width:Ye,height:De,pointerEvents:"auto"},onClick:m?o:void 0,children:[e.jsx("defs",{children:e.jsxs("mask",{id:"nice-tutorial-mask",children:[e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),E&&e.jsx("rect",{x:E.left,y:E.top,width:E.width,height:E.height,rx:"4",fill:"black",className:B?"nice-tutorial__spotlight--entering":""})]})}),e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`rgba(0,0,0,${T})`,mask:"url(#nice-tutorial-mask)"})]}),E&&e.jsx("div",{className:`nice-tutorial__highlight ${B?"nice-tutorial__highlight--entering":""}`,style:{position:"absolute",top:E.top,left:E.left,width:E.width,height:E.height,transition:`all ${M}ms ease`}}),w.disableInteraction&&E&&e.jsx("div",{className:"nice-tutorial__blocker",style:{position:"absolute",top:E.top,left:E.left,width:E.width,height:E.height}}),e.jsxs("div",{ref:O,className:`nice-tutorial__tooltip nice-tutorial__tooltip--${ee.actualPlacement} ${B?"nice-tutorial__tooltip--entering":""}`,style:{position:"absolute",top:ee.top,left:ee.left,transition:`all ${M}ms ease`,maxWidth:380,zIndex:P+1},children:[w.showArrow!==!1&&e.jsx("div",{className:`nice-tutorial__arrow nice-tutorial__arrow--${ee.actualPlacement}`}),e.jsxs("div",{className:"nice-tutorial__header",children:[e.jsx("h4",{id:Ee,className:"nice-tutorial__title",children:w.title}),f&&e.jsx("button",{type:"button",className:"nice-tutorial__close",onClick:o,"aria-label":Se,title:Se,children:e.jsx(Pt,{})})]}),e.jsx("div",{id:$e,className:"nice-tutorial__content",dangerouslySetInnerHTML:{__html:g.sanitizeHtml(w.content)}}),R==="inline"&&be(!0)]}),R==="floating-bottom"&&be(!1)]})};process.env.NODE_ENV!=="production"&&(We.displayName="NiceTutorial");const Je=t.createContext({startTutorial:()=>{},stopTutorial:()=>{},isActive:!1,currentStep:0,nextStep:()=>{},prevStep:()=>{},goToStep:()=>{}});function Ht(){return t.useContext(Je)}const et=({children:n})=>{const[i,c]=t.useState([]),[o,l]=t.useState(!1),[d,m]=t.useState(0),x=t.useCallback(R=>{c(R),m(0),l(!0)},[]),f=t.useCallback(()=>{l(!1),m(0),c([])},[]),C=t.useCallback(()=>{m(R=>Math.min(R+1,i.length-1))},[i.length]),M=t.useCallback(()=>{m(R=>Math.max(R-1,0))},[]),T=t.useCallback(R=>{m(Math.max(0,Math.min(R,i.length-1)))},[i.length]),P={startTutorial:x,stopTutorial:f,isActive:o,currentStep:d,nextStep:C,prevStep:M,goToStep:T};return e.jsxs(Je.Provider,{value:P,children:[n,o&&i.length>0&&e.jsx(We,{steps:i,active:o,onFinish:f,onSkip:f,onStepChange:m})]})};process.env.NODE_ENV!=="production"&&(et.displayName="NiceTutorialProvider");function Xt(n,i,c,o,l){const d=n<=l,m=n+l>=c,x=i<=l,f=i+l>=o;return x&&d?"top-left":x&&m?"top-right":f&&d?"bottom-left":f&&m?"bottom-right":d?"left":m?"right":x?"top":f?"bottom":"none"}function qt(n){switch(n){case"left":return{left:0,top:0,width:"50%",height:"100%"};case"right":return{left:"50%",top:0,width:"50%",height:"100%"};case"top":return{left:0,top:0,width:"100%",height:"50%"};case"bottom":return{left:0,top:"50%",width:"100%",height:"50%"};case"top-left":return{left:0,top:0,width:"50%",height:"50%"};case"top-right":return{left:"50%",top:0,width:"50%",height:"50%"};case"bottom-left":return{left:0,top:"50%",width:"50%",height:"50%"};case"bottom-right":return{left:"50%",top:"50%",width:"50%",height:"50%"};default:return null}}const At=Object.assign(t.forwardRef(({windowKey:n,title:i,icon:c,children:o,footer:l,x:d,y:m,defaultPosition:x,width:f=480,height:C=360,minWidth:M=200,minHeight:T=120,maxWidth:P,maxHeight:R,zIndex:v=1,closable:a=!0,minimizable:u=!0,maximizable:r=!0,fullscreenable:p=!1,pinnable:y=!1,resizable:h=!0,draggable:L=!0,snappable:E=!0,snapThreshold:V=20,minimized:Y,maximized:S,fullscreen:B,pinned:k,focused:s,onClose:N,onMinimize:j,onMaximize:I,onFullscreen:O,onPin:H,onFocus:w,onMove:q,onResize:_,onSnap:z,onTitleBarDoubleClick:b,size:W="md",statusBar:F,titleBarActions:se,className:re,style:ne,id:pe,accessMode:Se,...oe},xe)=>{const ze=g.useControlId(pe),we=g.useNiceAccessMode(Se,pe),{t:G}=g.useNiceTranslation(),ye=t.useRef(null);ye.current==null&&(ye.current=`nice-window-${Math.random().toString(36).slice(2,10)}`);const A=n??ye.current,Ee=d??x?.x??100,$e=m??x?.y??100,[ge,ee]=t.useState({x:Ee,y:$e}),[ae,be]=t.useState({width:f,height:C}),[Ye,De]=t.useState(!1),[$,X]=t.useState(!1),[K,Ie]=t.useState(!1),[Fe,Be]=t.useState(!1),[te,He]=t.useState("none"),tt=Y??Ye,ie=S??$,Z=B??K,Re=k??Fe,Pe=s??!0,_e=ge.x,ve=ge.y,le=ae.width,de=ae.height,ue=t.useRef(null),J=t.useRef(null),U=t.useRef(null),nt=t.useCallback(()=>{N?.(A)},[A,N]),it=t.useCallback(()=>{De(!0),j?.(A)},[A,j]),Xe=t.useCallback(()=>{const D=!ie;X(D),!D&&U.current?(ee({x:U.current.x,y:U.current.y}),be({width:U.current.w,height:U.current.h}),U.current=null):D&&(U.current={x:_e,y:ve,w:le,h:de}),He("none"),I?.(A,D)},[A,ie,_e,ve,le,de,I]),qe=t.useCallback(()=>{const D=!Z;Ie(D),D?U.current={x:_e,y:ve,w:le,h:de}:U.current&&(ee({x:U.current.x,y:U.current.y}),be({width:U.current.w,height:U.current.h}),U.current=null),O?.(A,D)},[A,Z,_e,ve,le,de,O]),st=t.useCallback(()=>{const D=!Re;Be(D),H?.(A,D)},[A,Re,H]),Ne=t.useCallback(()=>{w?.(A)},[A,w]),ot=t.useCallback(()=>{b?b(A):r&&Xe()},[A,r,Xe,b]);t.useEffect(()=>{const D=me=>{if(!ue.current)return;const ce=me.clientX-ue.current.startX+ue.current.origX,Te=me.clientY-ue.current.startY+ue.current.origY;ee({x:ce,y:Te}),q?.(A,{x:ce,y:Te})},Q=me=>{if(ue.current){if(E){const ce=Xt(me.clientX,me.clientY,window.innerWidth,window.innerHeight,V);ce!=="none"&&(U.current={x:ge.x,y:ge.y,w:le,h:de},He(ce),z?.(A,ce))}ue.current=null}};return document.addEventListener("mousemove",D),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",Q)}});const ct=t.useCallback(D=>{!L||ie||Z||(D.preventDefault(),te!=="none"&&(U.current&&(ee({x:U.current.x,y:U.current.y}),be({width:U.current.w,height:U.current.h})),He("none")),Ne(),ue.current={startX:D.clientX,startY:D.clientY,origX:_e,origY:ve})},[L,ie,Z,te,_e,ve,Ne]);t.useEffect(()=>{const D=me=>{if(!J.current)return;const ce=me.clientX-J.current.startX,Te=me.clientY-J.current.startY,ke=J.current.handle;let fe=J.current.origW,he=J.current.origH;if(ke.includes("e")&&(fe=J.current.origW+ce),ke.includes("w")&&(fe=J.current.origW-ce),ke.includes("s")&&(he=J.current.origH+Te),ke.includes("n")&&(he=J.current.origH-Te),fe=Math.max(M,P?Math.min(P,fe):fe),he=Math.max(T,R?Math.min(R,he):he),ke.includes("w")){const Ae=ae.width-fe;ee(Me=>({...Me,x:Me.x+Ae}))}if(ke.includes("n")){const Ae=ae.height-he;ee(Me=>({...Me,y:Me.y+Ae}))}be({width:fe,height:he}),_?.(A,{width:fe,height:he})},Q=()=>{J.current=null};return document.addEventListener("mousemove",D),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",Q)}});const rt=t.useCallback((D,Q)=>{!h||ie||Z||te!=="none"||(Q.preventDefault(),Q.stopPropagation(),Ne(),J.current={startX:Q.clientX,startY:Q.clientY,origW:le,origH:de,handle:D})},[h,ie,Z,te,le,de,Ne]);if(t.useEffect(()=>{if(!Pe)return;const D=Q=>{Q.key==="Escape"&&Z&&qe()};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[Pe,Z,qe]),we==="hidden"||tt)return null;const Ue=te!=="none"?qt(te):null,Ve=ie||Z,at=Z?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:999999}:ie?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:v}:Ue?{position:"absolute",...Ue,zIndex:v}:{position:"absolute",top:ve,left:_e,width:le,height:de,zIndex:v},lt=["n","e","s","w","ne","se","sw","nw"],dt={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",sw:"nesw-resize",nw:"nwse-resize",se:"nwse-resize"};return e.jsxs("div",{ref:xe,id:ze,className:`nice-window nice-window--${W} ${Pe?"nice-window--focused":""} ${Re?"nice-window--pinned":""} ${Ve?"nice-window--maximized":""} ${te!=="none"?`nice-window--snapped-${te}`:""} ${re??""}`,style:{...at,...ne},onMouseDown:Ne,onFocus:Pe?void 0:Ne,role:"dialog","aria-label":i,tabIndex:-1,"data-nice-focus-scope":"spatial","data-nice-region":i,...oe,children:[e.jsxs("div",{className:"nice-window__titlebar",onMouseDown:ct,onDoubleClick:ot,children:[c&&e.jsx("span",{className:"nice-window__icon",children:c}),e.jsx("span",{className:"nice-window__title",children:i}),e.jsxs("div",{className:"nice-window__actions",children:[se,y&&e.jsx("button",{type:"button",className:`nice-window__action nice-window__action--pin ${Re?"nice-window__action--active":""}`,onClick:st,title:Re?G("window.unpin","Unpin"):G("window.pin","Pin"),children:e.jsx(g.NiceIcon,{name:"paperclip",size:14})}),u&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--minimize",onClick:it,title:G("window.minimize","Minimize"),children:e.jsx(g.NiceIcon,{name:"minus",size:14})}),r&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--maximize",onClick:Xe,title:ie?G("window.restore","Restore"):G("window.maximize","Maximize"),children:e.jsx(g.NiceIcon,{name:ie?"copy":"window",size:14})}),p&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--fullscreen",onClick:qe,title:Z?G("window.exitFullscreen","Exit Full Screen"):G("window.fullscreen","Full Screen"),children:e.jsx(g.NiceIcon,{name:Z?"collapse":"expand",size:14})}),a&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--close",onClick:nt,title:G("window.close","Close"),children:e.jsx(g.NiceIcon,{name:"close",size:14})})]})]}),e.jsx("div",{className:"nice-window__body",children:o}),l&&e.jsx("div",{className:"nice-window__footer",children:l}),F&&e.jsx("div",{className:"nice-window__statusbar",children:F}),h&&!Ve&&te==="none"&&e.jsx(e.Fragment,{children:lt.map(D=>e.jsx("div",{className:`nice-window__resize nice-window__resize--${D}`,style:{cursor:dt[D]},onMouseDown:Q=>rt(D,Q)},D))})]})}),{displayName:"NiceWindow"});exports.NiceActionSheet=mt;exports.NiceBlockUI=Mt;exports.NiceBottomSheet=Ct;exports.NiceBox=pt;exports.NiceCommandPaletteProvider=Ze;exports.NiceContextMenu=It;exports.NiceDrawer=jt;exports.NiceLoadPanel=ht;exports.NiceModal=vt;exports.NiceModalBody=Nt;exports.NiceModalFooter=kt;exports.NiceModalHeader=yt;exports.NicePopover=Et;exports.NicePopover$1=ft;exports.NiceResizable=gt;exports.NiceResponsiveBox=wt;exports.NiceScrollView=bt;exports.NiceTutorial=We;exports.NiceTutorialProvider=et;exports.NiceWindow=At;exports.NiceWindowManager=St;exports.fuzzyMatch=Oe;exports.highlightMatches=Ke;exports.useCommandPalette=Qe;exports.useNiceTutorial=Ht;exports.useRegisterCommands=Tt;
|