@nice2dev/ui 1.0.5 → 1.0.8
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/README.md +253 -207
- package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
- package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
- package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
- package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
- package/dist/NiceButton-B5RXLDwI.cjs +1 -0
- package/dist/NiceButton-CDiS45Ya.cjs +1 -0
- package/dist/NiceButton-D9l39Rs7.js +595 -0
- package/dist/NiceButton-DmTHNHet.js +450 -0
- package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
- package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
- package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
- package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
- package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
- package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
- package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
- package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
- package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
- package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
- package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
- package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
- package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
- package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
- package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
- package/dist/NiceErrorBoundary-D1hh5GGe.js +732 -0
- package/dist/NiceErrorBoundary-Dta4TGee.cjs +1 -0
- package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
- package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
- package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
- package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
- package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
- package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
- package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
- package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
- package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
- package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
- package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
- package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
- package/dist/NiceModuleLifecyclePanel-BapdidD6.js +4776 -0
- package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CsFsm534.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
- package/dist/NicePinCodeInput-4q8yULuo.js +13359 -0
- package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
- package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
- package/dist/NicePinCodeInput-eD2q8nGa.cjs +692 -0
- package/dist/NicePinCodeInput.css +1 -0
- package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
- package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
- package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
- package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP.js +5666 -0
- package/dist/NiceSavedQueryPanel-xpk09zy1.cjs +596 -0
- package/dist/NiceSavedQueryPanel.css +1 -0
- package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
- package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
- package/dist/NiceStockChart-CHlOnWzN.cjs +287 -0
- package/dist/NiceStockChart-Cpmv9_Cc.js +2341 -0
- package/dist/NiceStockChart.css +1 -0
- package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
- package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
- package/dist/NiceToggle-C1UKGXmJ.js +209 -0
- package/dist/NiceToggle-CaY1u82g.js +277 -0
- package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
- package/dist/NiceToggle-lVi-ETi0.cjs +1 -0
- package/dist/NiceWindow-D1awkyFl.js +1636 -0
- package/dist/NiceWindow-IdHAcP70.cjs +1 -0
- package/dist/NiceWindow-SiCaREbq.js +1408 -0
- package/dist/NiceWindow-yARTUJsg.cjs +1 -0
- package/dist/charts-Bx_kNBsE.js +4280 -0
- package/dist/charts-DECVsCHX.cjs +754 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +1043 -0
- package/dist/charts.mjs +23 -0
- package/dist/core-BZBTsGWN.cjs +96 -0
- package/dist/core-BpghV7Ls.js +17555 -0
- package/dist/core-CfXsl755.js +16305 -0
- package/dist/core-DGJSUW64.cjs +96 -0
- package/dist/data-branching-De4ExX-S.cjs +1 -0
- package/dist/data-branching-DiRfob1f.js +6071 -0
- package/dist/data-branching.cjs +1 -0
- package/dist/data-branching.d.ts +401 -0
- package/dist/data-branching.mjs +9 -0
- package/dist/data.cjs +1 -0
- package/dist/data.d.ts +2003 -0
- package/dist/data.mjs +21 -0
- package/dist/devops-BnYinjkT.cjs +17 -0
- package/dist/devops-Ckh57eti.js +7198 -0
- package/dist/devops.cjs +1 -0
- package/dist/devops.d.ts +758 -0
- package/dist/devops.mjs +12 -0
- package/dist/editors.cjs +1 -0
- package/dist/editors.d.ts +2728 -0
- package/dist/editors.mjs +66 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.d.ts +339 -0
- package/dist/feedback.mjs +16 -0
- package/dist/index-C853adw1.cjs +6199 -0
- package/dist/index-CBIZ6mTQ.cjs +5734 -0
- package/dist/index-CIl98Vbm.js +72951 -0
- package/dist/index-CNwVELPJ.js +62857 -0
- package/dist/index-CUx_-gKK.cjs +1 -0
- package/dist/index-x8mRM4Jc.js +17 -0
- package/dist/index.cjs +1 -7866
- package/dist/index.css +1 -0
- package/dist/index.d.ts +4888 -180
- package/dist/index.mjs +1021 -105889
- package/dist/lazy.cjs +1 -0
- package/dist/lazy.d.ts +1880 -0
- package/dist/lazy.mjs +98 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.d.ts +1862 -0
- package/dist/navigation.mjs +576 -0
- package/dist/no-code-BCuadkm4.cjs +332 -0
- package/dist/no-code-TL7PyulA.js +7005 -0
- package/dist/no-code.cjs +1 -0
- package/dist/no-code.d.ts +870 -0
- package/dist/no-code.mjs +13 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.d.ts +706 -0
- package/dist/overlays.mjs +482 -0
- package/package.json +51 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),Y=require("./core-DGJSUW64.cjs"),n=require("react"),de=require("react-dom"),rt=({visible:e,onClose:i,title:o,items:c,showCancelButton:f=!0,cancelText:u,className:h,style:_})=>{const{t:x}=Y.useNiceTranslation();return e?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"nice-actionsheet__overlay",onClick:i}),t.jsxs("div",{className:`nice-actionsheet ${h||""}`,style:_,children:[o&&t.jsx("div",{className:"nice-actionsheet__title",children:o}),t.jsx("div",{className:"nice-actionsheet__items",children:c.map((y,a)=>t.jsxs("button",{className:`nice-actionsheet__item ${y.type==="danger"?"nice-actionsheet__item--danger":""}`,disabled:y.disabled,onClick:()=>{y.onClick?.(),i()},children:[y.icon&&t.jsx("span",{className:"nice-actionsheet__icon",children:y.icon}),y.text]},a))}),f&&t.jsx("button",{className:"nice-actionsheet__cancel",onClick:i,children:u||x("cancel","Cancel")})]})]}):null},at=({open:e,onClose:i,children:o,title:c,size:f="md",closeOnBackdropClick:u=!0,closeOnEscape:h=!0,disableFocusTrap:_=!1,disableBodyScroll:x=!0,zIndex:y=1e3,className:a,style:C})=>{const M=n.useRef(null);Y.useFocusTrap(M,e&&!_),n.useEffect(()=>{if(!x&&e){const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=l}}},[e,x]),n.useEffect(()=>{if(!h||!e)return;const l=k=>{k.key==="Escape"&&(k.preventDefault(),i())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[h,e,i]);const p=n.useCallback(l=>{u&&l.target===l.currentTarget&&i()},[u,i]);if(!e)return null;const N={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[f];return de.createPortal(t.jsx("div",{className:"nice-modal__overlay",style:{zIndex:y},onClick:p,role:"presentation",children:t.jsx("div",{ref:M,className:`nice-modal ${N} ${a||""}`,role:"dialog","aria-modal":"true","aria-label":c,style:C,tabIndex:-1,children:o})}),document.body)},lt=({children:e,showClose:i=!0,onClose:o,className:c})=>t.jsxs("div",{className:`nice-modal__header ${c||""}`,children:[t.jsx("div",{className:"nice-modal__title",children:e}),i&&o&&t.jsx("button",{type:"button",className:"nice-modal__close",onClick:o,"aria-label":"Close",children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:t.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),dt=({children:e,className:i})=>t.jsx("div",{className:`nice-modal__body ${i||""}`,children:e}),ut=({children:e,className:i})=>t.jsx("div",{className:`nice-modal__footer ${i||""}`,children:e}),mt=({open:e,onClose:i,children:o,position:c="right",size:f=320,title:u,closeOnBackdropClick:h=!0,closeOnEscape:_=!0,swipeToClose:x=!0,zIndex:y=1e3,className:a,style:C})=>{const M=n.useRef(null),[p,N]=n.useState(!1),[l,k]=n.useState(0);Y.useFocusTrap(M,e),n.useEffect(()=>{if(!_||!e)return;const d=j=>{j.key==="Escape"&&(j.preventDefault(),i())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[_,e,i]);const r=n.useCallback(d=>{let j=0;switch(c){case"left":j=Math.min(0,d.deltaX);break;case"right":j=Math.max(0,d.deltaX);break;case"top":j=Math.min(0,d.deltaY);break;case"bottom":j=Math.max(0,d.deltaY);break}k(j)},[c]),w=n.useCallback(d=>{let S=!1;switch(c){case"left":S=d.deltaX<-100;break;case"right":S=d.deltaX>100;break;case"top":S=d.deltaY<-100;break;case"bottom":S=d.deltaY>100;break}S&&(Y.triggerHaptic("light"),i()),k(0),N(!1)},[c,i]),{ref:g}=Y.usePan({enabled:x&&e,onPanStart:()=>N(!0),onPan:r,onPanEnd:w}),E=n.useCallback(d=>{h&&d.target===d.currentTarget&&i()},[h,i]);if(!e)return null;const R=c==="left"||c==="right",P=R?{width:typeof f=="number"?`${f}px`:f}:{height:typeof f=="number"?`${f}px`:f},s=()=>{if(p)return R?`translateX(${l}px)`:`translateY(${l}px)`};return de.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`nice-drawer__overlay ${e?"nice-drawer__overlay--visible":""}`,style:{zIndex:y},onClick:E}),t.jsx("div",{ref:d=>{M.current=d,g.current=d},className:`nice-drawer nice-drawer--${c} ${e?"nice-drawer--open":""} ${a||""}`,style:{...P,zIndex:y+1,transform:s(),transition:p?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":u,tabIndex:-1,children:o})]}),document.body)},ht=({open:e,onClose:i,children:o,title:c,showHandle:f=!0,snapPoints:u=[.5,.9],initialSnap:h=0,expandable:_=!0,closeOnBackdropClick:x=!0,closeOnEscape:y=!0,hapticFeedback:a=!0,zIndex:C=1e3,className:M,style:p})=>{const N=n.useRef(null),l=n.useRef(null),[k,r]=n.useState(h),[w,g]=n.useState(!1),[E,R]=n.useState(0),P=n.useRef(0);n.useEffect(()=>{e&&(r(h),R(0))},[e,h]),Y.useFocusTrap(N,e),n.useEffect(()=>{if(!y||!e)return;const m=v=>{v.key==="Escape"&&(v.preventDefault(),i())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[y,e,i]),n.useEffect(()=>{if(e){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[e]);const s=n.useCallback(m=>{const v=m.target.closest(".nice-bottom-sheet__handle"),b=l.current,H=!b||b.scrollTop<=0;!v&&!H||(g(!0),P.current=m.touches[0].clientY)},[]),d=n.useCallback(m=>{if(!w)return;const v=m.touches[0].clientY-P.current;(v>0||k<u.length-1)&&R(v)},[w,k,u.length]),j=n.useCallback(()=>{if(!w)return;const m=window.innerHeight;u[k]*m;const v=-E,b=m*.15;v>b&&_&&k<u.length-1?(r(k+1),a&&Y.triggerHaptic("selection")):v<-b&&(k>0?(r(k-1),a&&Y.triggerHaptic("selection")):(a&&Y.triggerHaptic("light"),i())),g(!1),R(0)},[w,E,k,u,_,a,i]),S=n.useCallback(()=>{x&&i()},[x,i]);if(!e)return null;const $=u[k]*100,I=w?E:0;return de.createPortal(t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`nice-bottom-sheet__overlay ${e?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:S}),t.jsxs("div",{ref:N,className:`nice-bottom-sheet ${e?"nice-bottom-sheet--open":""} ${M||""}`,style:{zIndex:C+1,height:`${$}vh`,transform:`translateY(${Math.max(0,I)}px)`,transition:w?"none":"transform 0.3s ease-out, height 0.3s ease-out",...p},role:"dialog","aria-modal":"true","aria-label":c,tabIndex:-1,onTouchStart:s,onTouchMove:d,onTouchEnd:j,children:[f&&t.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),c&&t.jsx("div",{className:"nice-bottom-sheet__title",children:c}),t.jsx("div",{ref:l,className:"nice-bottom-sheet__content",children:o})]})]}),document.body)},ft=({trigger:e,children:i,placement:o="bottom",triggerMode:c="click",open:f,onOpenChange:u,hoverDelay:h=200,offset:_=8,className:x,showArrow:y=!0})=>{const[a,C]=n.useState(!1),M=n.useRef(null),p=n.useRef(null),N=n.useRef(null),l=f!==void 0,k=l?f:a,r=n.useCallback(s=>{l||C(s),u?.(s)},[l,u]);Y.useClickOutside(p,()=>{c!=="manual"&&k&&r(!1)});const w=n.useCallback(()=>{c==="click"&&r(!k)},[c,k,r]),g=n.useCallback(()=>{c==="hover"&&(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>r(!0),h))},[c,h,r]),E=n.useCallback(()=>{c==="hover"&&(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>r(!1),h))},[c,h,r]),[R,P]=n.useState({top:0,left:0});return n.useEffect(()=>{if(!k||!M.current||!p.current)return;const s=M.current.getBoundingClientRect(),d=p.current.getBoundingClientRect(),j=window.innerWidth,S=window.innerHeight;let $=0,I=0;const[m,v="center"]=o.split("-");switch(m){case"top":$=s.top-d.height-_,I=s.left+(s.width-d.width)/2;break;case"bottom":$=s.bottom+_,I=s.left+(s.width-d.width)/2;break;case"left":$=s.top+(s.height-d.height)/2,I=s.left-d.width-_;break;case"right":$=s.top+(s.height-d.height)/2,I=s.right+_;break}m==="top"||m==="bottom"?(v==="start"&&(I=s.left),v==="end"&&(I=s.right-d.width)):(v==="start"&&($=s.top),v==="end"&&($=s.bottom-d.height)),I=Math.max(8,Math.min(j-d.width-8,I)),$=Math.max(8,Math.min(S-d.height-8,$)),P({top:$,left:I})},[k,o,_]),t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:M,className:"nice-popover__trigger",onClick:w,onMouseEnter:g,onMouseLeave:E,style:{display:"inline-block"},children:e}),k&&de.createPortal(t.jsxs("div",{ref:p,className:`nice-popover nice-popover--${o} ${x||""}`,style:{position:"fixed",top:R.top,left:R.left,zIndex:1100},onMouseEnter:g,onMouseLeave:E,role:"tooltip",children:[y&&t.jsx("div",{className:"nice-popover__arrow"}),t.jsx("div",{className:"nice-popover__content",children:i})]}),document.body)]})},pt=({items:e,children:i,onOpen:o,onClose:c,className:f})=>{const[u,h]=n.useState(!1),[_,x]=n.useState({x:0,y:0}),y=n.useRef(null),a=n.useRef(null);Y.useClickOutside(y,()=>{u&&(h(!1),c?.())});const C=n.useCallback(N=>{N.preventDefault(),x({x:N.clientX,y:N.clientY}),h(!0),o?.()},[o]),M=n.useCallback(N=>{!N.disabled&&N.onClick&&(N.onClick(),h(!1),c?.())},[c]);n.useEffect(()=>{if(!u)return;const N=l=>{l.key==="Escape"&&(h(!1),c?.())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[u,c]);const p=N=>t.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:N.map(l=>l.divider?t.jsx("li",{className:"nice-context-menu__divider",role:"separator"},l.key):t.jsx("li",{role:"presentation",children:t.jsxs("button",{type:"button",className:`nice-context-menu__item ${l.disabled?"nice-context-menu__item--disabled":""} ${l.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:l.disabled,onClick:()=>M(l),children:[l.icon&&t.jsx("span",{className:"nice-context-menu__icon",children:l.icon}),t.jsx("span",{className:"nice-context-menu__label",children:l.label})]})},l.key))});return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:a,onContextMenu:C,style:{display:"contents"},children:i}),u&&de.createPortal(t.jsx("div",{ref:y,className:`nice-context-menu ${f||""}`,style:{position:"fixed",left:_.x,top:_.y,zIndex:1200},role:"menu",children:p(e)}),document.body)]})},xt=({visible:e,onClose:i,targetRef:o,position:c="bottom",title:f,showArrow:u=!0,width:h,children:_,className:x,style:y,displayStyle:a})=>{Y.useComponentDisplayClass("tooltip",a);const C=n.useRef(null),[M,p]=n.useState({top:0,left:0}),N=n.useCallback(()=>{const l=o.current,k=C.current;if(!l||!k)return;const r=l.getBoundingClientRect(),w=k.getBoundingClientRect();let g=0,E=0;const R=8;switch(c){case"top":g=r.top-w.height-R,E=r.left+(r.width-w.width)/2;break;case"bottom":g=r.bottom+R,E=r.left+(r.width-w.width)/2;break;case"left":g=r.top+(r.height-w.height)/2,E=r.left-w.width-R;break;case"right":g=r.top+(r.height-w.height)/2,E=r.right+R;break}p({top:g+window.scrollY,left:E+window.scrollX})},[o,c]);return n.useEffect(()=>{if(e){requestAnimationFrame(N);const l=k=>{C.current&&!C.current.contains(k.target)&&o.current&&!o.current.contains(k.target)&&i()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)}},[e,N,i,o]),e?t.jsxs("div",{ref:C,className:`nice-popover nice-popover--${c} ${x||""}`,style:{...y,position:"absolute",top:M.top,left:M.left,width:h},children:[u&&t.jsx("div",{className:`nice-popover__arrow nice-popover__arrow--${c}`}),f&&t.jsx("div",{className:"nice-popover__title",children:f}),t.jsx("div",{className:"nice-popover__content",children:_})]}):null},gt=({visible:e,message:i,container:o,showIndicator:c=!0,shading:f=!0,className:u,style:h})=>{const{t:_}=Y.useNiceTranslation();if(!e)return null;const x=!!o?.current,y=t.jsxs("div",{className:`nice-loadpanel ${u||""}`,style:h,children:[f&&t.jsx("div",{className:"nice-loadpanel__shade"}),t.jsxs("div",{className:"nice-loadpanel__box",children:[c&&t.jsx("div",{className:"nice-spinner nice-spinner--md"}),t.jsx("span",{className:"nice-loadpanel__text",children:i||_("loading","Loading...")})]})]});if(x&&o.current){const a=o.current;return a.style.position=a.style.position||"relative",y}return y},_t=({direction:e="row",align:i,justify:o,wrap:c,gap:f,flex:u,children:h,className:_,style:x})=>t.jsx("div",{className:`nice-box ${_||""}`,style:{display:"flex",flexDirection:e,alignItems:i,justifyContent:o,flexWrap:c?"wrap":void 0,gap:f,flex:u,...x},children:h}),bt=({direction:e="row",items:i,gap:o,className:c,style:f})=>t.jsx("div",{className:`nice-responsivebox ${c||""}`,style:{display:"flex",flexDirection:e,gap:o,...f},children:i.map((u,h)=>t.jsx("div",{style:{flex:u.ratio??1,flexBasis:u.baseSize,flexShrink:u.shrink??1},children:u.children},h))}),wt=({width:e=200,height:i=200,minWidth:o=50,minHeight:c=50,maxWidth:f=1/0,maxHeight:u=1/0,handles:h=["right","bottom","bottomRight"],onResize:_,children:x,className:y,style:a})=>{const[C,M]=n.useState({width:e,height:i}),p=n.useRef(null),N=(r,w)=>{w.preventDefault();const g=w.clientX,E=w.clientY,R=C.width,P=C.height,s=j=>{const S=j.clientX-g,$=j.clientY-E;let I=R,m=P;(r.includes("right")||r==="right")&&(I=R+S),(r.includes("bottom")||r==="bottom")&&(m=P+$),(r.includes("left")||r==="left")&&(I=R-S),(r.includes("top")||r==="top")&&(m=P-$),I=Math.max(o,Math.min(f,I)),m=Math.max(c,Math.min(u,m)),M({width:I,height:m}),_?.({width:I,height:m})},d=()=>{document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",d)};document.addEventListener("pointermove",s),document.addEventListener("pointerup",d)},l=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"}},k=r=>{const w={position:"absolute",zIndex:1},g=8;return r==="right"?{...w,top:0,right:-g/2,width:g,height:"100%",cursor:l(r)}:r==="bottom"?{...w,left:0,bottom:-g/2,width:"100%",height:g,cursor:l(r)}:r==="left"?{...w,top:0,left:-g/2,width:g,height:"100%",cursor:l(r)}:r==="top"?{...w,top:-g/2,left:0,width:"100%",height:g,cursor:l(r)}:r==="bottomRight"?{...w,bottom:-g/2,right:-g/2,width:g*2,height:g*2,cursor:l(r)}:r==="bottomLeft"?{...w,bottom:-g/2,left:-g/2,width:g*2,height:g*2,cursor:l(r)}:r==="topRight"?{...w,top:-g/2,right:-g/2,width:g*2,height:g*2,cursor:l(r)}:r==="topLeft"?{...w,top:-g/2,left:-g/2,width:g*2,height:g*2,cursor:l(r)}:w};return t.jsxs("div",{ref:p,className:`nice-resizable ${y||""}`,style:{...a,width:C.width,height:C.height,position:"relative",overflow:"hidden"},children:[x,h.map(r=>t.jsx("div",{style:k(r),onPointerDown:w=>N(r,w)},r))]})},vt=({direction:e="vertical",showScrollbar:i="onInteraction",width:o,height:c,onScroll:f,children:u,className:h,style:_})=>{const x=e==="horizontal"||e==="both"?"auto":"hidden",y=e==="vertical"||e==="both"?"auto":"hidden",a=i==="never"?"nice-scrollview--hide-sb":i==="always"?"nice-scrollview--show-sb":"";return t.jsx("div",{className:`nice-scrollview ${a} ${h||""}`,style:{..._,width:o,height:c,overflowX:x,overflowY:y},onScroll:f,children:u})};function fe(e,i){if(!e)return{score:1,indices:[]};const o=e.toLowerCase(),c=i.toLowerCase();let f=0;const u=[];let h=0,_=-1;for(let x=0;x<c.length&&f<o.length;x++)c[x]===o[f]&&(u.push(x),_===x-1&&(h+=3),(x===0||/[\s\-_/.]/.test(i[x-1]))&&(h+=5),i[x]===e[f]&&(h+=1),h+=1,_=x,f++);return f<o.length?null:(h-=u[0]*.1,{score:h,indices:u})}function Ce(e,i){if(i.length===0)return[e];const o=[];let c=0;const f=new Set(i);for(let u=0;u<e.length;u++)f.has(u)&&(c<u&&o.push(e.slice(c,u)),o.push(n.createElement("mark",{key:`m-${u}`,className:"nice-command-palette__match"},e[u])),c=u+1);return c<e.length&&o.push(e.slice(c)),o}function yt(e,i){switch(i.type){case"REGISTER":{const o=new Map(e.commands);return o.set(i.command.id,i.command),{...e,commands:o}}case"REGISTER_BATCH":{const o=new Map(e.commands);for(const c of i.commands)o.set(c.id,c);return{...e,commands:o}}case"UNREGISTER":{const o=new Map(e.commands);return o.delete(i.id),{...e,commands:o}}case"OPEN":return{...e,isOpen:!0,query:"",selectedIndex:0};case"CLOSE":return{...e,isOpen:!1,query:"",selectedIndex:0};case"SET_QUERY":return{...e,query:i.query,selectedIndex:0};case"SET_SELECTED":return{...e,selectedIndex:i.index};case"ADD_RECENT":{const o=e.recentIds.filter(c=>c!==i.id);return{...e,recentIds:[i.id,...o].slice(0,i.maxRecent)}}default:return e}}const Ee=n.createContext(null);function Me(){const e=n.useContext(Ee);if(!e)throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");return e}const Se=({children:e,commands:i,placeholder:o="Type a command...",maxVisible:c=10,maxRecent:f=5,className:u,emptyText:h="No commands found",closeOnAction:_=!0,onOpen:x,onClose:y})=>{const[a,C]=n.useReducer(yt,{commands:new Map(i?.map(m=>[m.id,m])??[]),isOpen:!1,query:"",selectedIndex:0,recentIds:[]}),M=n.useRef(null),p=n.useRef(null),[N,l]=n.useState(!1),k=n.useCallback(m=>{C({type:"REGISTER",command:m})},[]),r=n.useCallback(m=>{C({type:"UNREGISTER",id:m})},[]),w=n.useCallback(m=>{C({type:"REGISTER_BATCH",commands:m})},[]),g=n.useCallback(()=>{C({type:"OPEN"}),x?.()},[x]),E=n.useCallback(()=>{C({type:"CLOSE"}),y?.()},[y]),R=n.useCallback(()=>{a.isOpen?E():g()},[a.isOpen,E,g]),s=n.useMemo(()=>{const m=Array.from(a.commands.values()).filter(b=>!b.hidden);if(!a.query.trim()){const b=a.recentIds.map(L=>a.commands.get(L)).filter(L=>!!L&&!L.hidden),H=m.filter(L=>!a.recentIds.includes(L.id));return H.sort((L,K)=>L.label.localeCompare(K.label)),[...b,...H].map(L=>({command:L,match:null,isRecent:a.recentIds.includes(L.id)}))}return m.map(b=>{const H=fe(a.query,b.label),L=b.description?fe(a.query,b.description):null,K=b.keywords?.map(T=>fe(a.query,T)).filter(Boolean)[0]??null,ie=[H,L,K].filter(Boolean).sort((T,X)=>(X?.score??0)-(T?.score??0))[0];return{command:b,match:ie,isRecent:!1}}).filter(b=>b.match!==null).sort((b,H)=>(H.match?.score??0)-(b.match?.score??0))},[a.commands,a.query,a.recentIds]).slice(0,c),d=n.useCallback(async m=>{const v=a.commands.get(m);if(!(!v||v.disabled)){l(!0);try{await v.action(),C({type:"ADD_RECENT",id:m,maxRecent:f})}finally{l(!1),_&&E()}}},[a.commands,f,_,E]);n.useEffect(()=>{const m=v=>{(v.metaKey||v.ctrlKey)&&v.key==="k"&&(v.preventDefault(),R()),v.key==="Escape"&&a.isOpen&&(v.preventDefault(),E())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[R,a.isOpen,E]),n.useEffect(()=>{a.isOpen&&requestAnimationFrame(()=>M.current?.focus())},[a.isOpen]);const j=n.useCallback(m=>{const v=s.length;if(v){if(m.key==="ArrowDown")m.preventDefault(),C({type:"SET_SELECTED",index:(a.selectedIndex+1)%v});else if(m.key==="ArrowUp")m.preventDefault(),C({type:"SET_SELECTED",index:(a.selectedIndex-1+v)%v});else if(m.key==="Enter"){m.preventDefault();const b=s[a.selectedIndex];b&&d(b.command.id)}}},[s,a.selectedIndex,d]);n.useEffect(()=>{if(!p.current)return;p.current.children[a.selectedIndex]?.scrollIntoView({block:"nearest"})},[a.selectedIndex]);const S=n.useMemo(()=>({registerCommand:k,unregisterCommand:r,registerCommands:w,open:g,close:E,toggle:R,isOpen:a.isOpen,executeCommand:d}),[k,r,w,g,E,R,a.isOpen,d]),$=n.useMemo(()=>{const m=new Map;for(const v of s){const b=v.command.category??"General";m.has(b)||m.set(b,[]),m.get(b).push(v)}return m},[s]);let I=0;return t.jsxs(Ee.Provider,{value:S,children:[e,a.isOpen&&t.jsx("div",{className:`nice-command-palette__overlay ${u??""}`,onClick:E,children:t.jsxs("div",{className:"nice-command-palette",role:"dialog","aria-label":"Command Palette","aria-modal":"true",onClick:m=>m.stopPropagation(),children:[t.jsx("div",{className:"nice-command-palette__input-wrapper",children:t.jsx("input",{ref:M,className:"nice-command-palette__input",type:"text",placeholder:o,value:a.query,onChange:m=>C({type:"SET_QUERY",query:m.target.value}),onKeyDown:j,"aria-label":"Search commands","aria-autocomplete":"list","aria-controls":"nice-command-palette-list","aria-activedescendant":s[a.selectedIndex]?`nice-cmd-${s[a.selectedIndex].command.id}`:void 0})}),t.jsxs("div",{ref:p,id:"nice-command-palette-list",className:"nice-command-palette__list",role:"listbox",children:[s.length===0&&t.jsx("div",{className:"nice-command-palette__empty",children:h}),Array.from($.entries()).map(([m,v])=>t.jsxs("div",{className:"nice-command-palette__group",children:[t.jsx("div",{className:"nice-command-palette__category",children:m}),v.map(b=>{const H=I++,L=H===a.selectedIndex;return t.jsxs("div",{id:`nice-cmd-${b.command.id}`,className:`nice-command-palette__item ${L?"nice-command-palette__item--selected":""} ${b.command.disabled?"nice-command-palette__item--disabled":""}`,role:"option","aria-selected":L,"aria-disabled":b.command.disabled,onClick:()=>!b.command.disabled&&d(b.command.id),onMouseEnter:()=>C({type:"SET_SELECTED",index:H}),children:[b.command.icon&&t.jsx("span",{className:"nice-command-palette__icon",children:b.command.icon}),t.jsxs("div",{className:"nice-command-palette__label-group",children:[t.jsx("span",{className:"nice-command-palette__label",children:b.match&&a.query?Ce(b.command.label,b.match.indices):b.command.label}),b.command.description&&t.jsx("span",{className:"nice-command-palette__description",children:b.command.description})]}),b.command.shortcut&&t.jsx("kbd",{className:"nice-command-palette__shortcut",children:b.command.shortcut}),b.isRecent&&t.jsx("span",{className:"nice-command-palette__recent-badge",children:"Recent"})]},b.command.id)})]},m))]}),N&&t.jsx("div",{className:"nice-command-palette__executing",children:"Executing..."})]})})]})};Se.displayName="NiceCommandPaletteProvider";function Nt(e){const{registerCommands:i,unregisterCommand:o}=Me();n.useEffect(()=>(i(e),()=>{for(const c of e)o(c.id)}),[])}const Re=n.forwardRef(({blocked:e,message:i,children:o,className:c,style:f,id:u},h)=>{const _=Y.useControlId(u);return t.jsxs("div",{ref:h,id:_,className:`nice-block-ui ${c||""}`,style:{position:"relative",...f},children:[o,e&&t.jsx("div",{className:"nice-block-ui__overlay","aria-busy":"true",role:"alert",children:i&&t.jsx("div",{className:"nice-block-ui__message",children:i})})]})});Re.displayName="NiceBlockUI";const ze=n.forwardRef(({windows:e,onChange:i,onClose:o,onFocus:c,showTaskbar:f=!0,size:u="md",className:h,style:_,id:x,...y},a)=>{const C=Y.useControlId(x),{t:M}=Y.useNiceTranslation(),[p,N]=n.useState(null),l=n.useRef(null),k=Math.max(1,...e.map(s=>s.zIndex??1)),r=n.useCallback((s,d)=>{const j=e.map(S=>S.key===s?{...S,...d}:S);i?.(j)},[e,i]),w=n.useCallback(s=>{r(s,{zIndex:k+1}),c?.(s)},[r,k,c]),g=n.useCallback(s=>{o?.(s),i?.(e.filter(d=>d.key!==s))},[e,i,o]),E=n.useCallback(s=>{const d=e.find(j=>j.key===s);d&&r(s,{minimized:!d.minimized,maximized:!1})},[e,r]),R=n.useCallback(s=>{const d=e.find(j=>j.key===s);d&&r(s,{maximized:!d.maximized,minimized:!1})},[e,r]);n.useEffect(()=>{if(!p)return;const s=j=>{const S=e.find($=>$.key===p.key);if(S)if(p.mode==="move")r(p.key,{x:j.clientX-p.offsetX,y:j.clientY-p.offsetY});else{const I=l.current?.getBoundingClientRect(),m=I?.left??0,v=I?.top??0;r(p.key,{width:Math.max(200,j.clientX-m-S.x),height:Math.max(100,j.clientY-v-S.y)})}},d=()=>N(null);return document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d)}},[p,e,r]);const P=n.useCallback((s,d,j)=>{d.preventDefault();const S=e.find($=>$.key===s);S&&(w(s),N({key:s,offsetX:j==="move"?d.clientX-S.x:0,offsetY:j==="move"?d.clientY-S.y:0,mode:j}))},[e,w]);return t.jsxs("div",{ref:s=>{l.current=s,typeof a=="function"?a(s):a&&(a.current=s)},id:C,className:`nice-wm nice-wm--${u} ${h??""}`,style:{..._,position:"relative",overflow:"hidden"},...y,children:[e.map(s=>{if(s.minimized)return null;const d=s.maximized,j=d?{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 t.jsxs("div",{className:`nice-wm__window ${d?"nice-wm__window--maximized":""}`,style:j,onMouseDown:()=>w(s.key),role:"dialog","aria-label":s.title,children:[t.jsxs("div",{className:"nice-wm__titlebar",onMouseDown:S=>!d&&P(s.key,S,"move"),children:[s.icon&&t.jsx("span",{className:"nice-wm__icon",children:s.icon}),t.jsx("span",{className:"nice-wm__title",children:s.title}),t.jsxs("div",{className:"nice-wm__controls",children:[(s.minimizable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--min",onClick:()=>E(s.key),title:M("wm.minimize","Minimize"),children:"─"}),(s.maximizable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--max",onClick:()=>R(s.key),title:M("wm.maximize","Maximize"),children:d?"❐":"☐"}),(s.closable??!0)&&t.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--close",onClick:()=>g(s.key),title:M("wm.close","Close"),children:"✕"})]})]}),t.jsx("div",{className:"nice-wm__body",children:s.content}),(s.resizable??!0)&&!d&&t.jsx("div",{className:"nice-wm__resize-handle",onMouseDown:S=>P(s.key,S,"resize")})]},s.key)}),f&&t.jsx("div",{className:"nice-wm__taskbar",role:"toolbar","aria-label":M("wm.taskbar","Taskbar"),children:e.map(s=>t.jsxs("button",{type:"button",className:`nice-wm__taskbar-btn ${s.minimized?"nice-wm__taskbar-btn--minimized":""}`,onClick:()=>{s.minimized&&E(s.key),w(s.key)},children:[s.icon&&t.jsx("span",{className:"nice-wm__taskbar-icon",children:s.icon}),t.jsx("span",{className:"nice-wm__taskbar-label",children:s.title})]},s.key))})]})});ze.displayName="NiceWindowManager";function kt(e,i){const o=document.querySelector(e);if(!o)return null;const c=o.getBoundingClientRect();return{top:c.top-i+window.scrollY,left:c.left-i+window.scrollX,width:c.width+i*2,height:c.height+i*2}}function jt(e,i,o,c){const u={w:window.innerWidth,h:window.innerHeight+window.scrollY},h={top:{top:e.top-o-12,left:e.left+e.width/2-i/2},bottom:{top:e.top+e.height+12,left:e.left+e.width/2-i/2},left:{top:e.top+e.height/2-o/2,left:e.left-i-12},right:{top:e.top+e.height/2-o/2,left:e.left+e.width+12}};if(c&&c!=="auto")return{...h[c],actualPlacement:c};for(const _ of["bottom","top","right","left"]){const x=h[_];if(x.top>=0&&x.left>=0&&x.top+o<=u.h&&x.left+i<=u.w)return{...x,actualPlacement:_}}return{...h.bottom,actualPlacement:"bottom"}}const ve=({steps:e,active:i,onFinish:o,onSkip:c,onStepChange:f,closeOnEscape:u=!0,closeOnOverlayClick:h=!1,showProgress:_=!0,showSkipButton:x=!0,labels:y,animationDuration:a=300,overlayOpacity:C=.6,zIndex:M=1e4})=>{const[p,N]=n.useState(0),[l,k]=n.useState(null),[r,w]=n.useState({w:340,h:200}),[g,E]=n.useState(!0),R=n.useRef(null),P=n.useRef(-1),s=e[p],d=p===e.length-1,j=p===0,S=y?.next??"Next",$=y?.back??"Back",I=y?.finish??"Finish",m=y?.skip??"Skip",v=y?.stepOf??"of";n.useEffect(()=>{if(R.current){const T=R.current.getBoundingClientRect();w({w:T.width,h:T.height})}},[p,i]),n.useEffect(()=>{if(!i||!s)return;const T=()=>{const X=kt(s.target,s.highlightPadding??8);k(X)};if(T(),s.scrollIntoView!==!1){document.querySelector(s.target)?.scrollIntoView({behavior:"smooth",block:"center"});const pe=setTimeout(T,350);return()=>clearTimeout(pe)}},[i,s,p]),n.useEffect(()=>{!i||!s||P.current!==p&&(P.current>=0&&P.current<e.length&&e[P.current]?.onLeave?.(),s.onEnter?.(),P.current=p)},[i,s,p,e]),n.useEffect(()=>{if(!i||!s?.advanceOn)return;const T=document.querySelector(s.target);if(!T)return;const X=()=>b();return T.addEventListener(s.advanceOn.event,X),()=>T.removeEventListener(s.advanceOn.event,X)},[i,s,p]),n.useEffect(()=>{if(!i)return;const T=X=>{X.key==="Escape"&&u?c?.():X.key==="ArrowRight"?b():X.key==="ArrowLeft"&&H()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[i,p,u]),n.useEffect(()=>{E(!0);const T=setTimeout(()=>E(!1),a);return()=>clearTimeout(T)},[p,a]);const b=n.useCallback(()=>{if(d)s?.onLeave?.(),o?.();else{const T=p+1;N(T),f?.(T)}},[p,d,o,f,s]),H=n.useCallback(()=>{if(!j){const T=p-1;N(T),f?.(T)}},[p,j,f]),L=n.useMemo(()=>l?jt(l,r.w,r.h,s?.placement):{top:window.innerHeight/2,left:window.innerWidth/2,actualPlacement:"bottom"},[l,r,s?.placement]);if(!i||!s)return null;const K=Math.max(document.documentElement.scrollWidth,window.innerWidth),ie=Math.max(document.documentElement.scrollHeight,window.innerHeight);return t.jsxs("div",{className:"nice-tutorial",style:{zIndex:M},"aria-modal":"true",role:"dialog","aria-label":"Tutorial",children:[t.jsxs("svg",{className:"nice-tutorial__overlay",style:{position:"absolute",top:0,left:0,width:K,height:ie,pointerEvents:"auto"},onClick:h?c:void 0,children:[t.jsx("defs",{children:t.jsxs("mask",{id:"nice-tutorial-mask",children:[t.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),l&&t.jsx("rect",{x:l.left,y:l.top,width:l.width,height:l.height,rx:"8",fill:"black",className:g?"nice-tutorial__spotlight--entering":""})]})}),t.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`rgba(0,0,0,${C})`,mask:"url(#nice-tutorial-mask)"})]}),l&&t.jsx("div",{className:`nice-tutorial__highlight ${g?"nice-tutorial__highlight--entering":""}`,style:{position:"absolute",top:l.top,left:l.left,width:l.width,height:l.height,transition:`all ${a}ms ease`}}),s.disableInteraction&&l&&t.jsx("div",{className:"nice-tutorial__blocker",style:{position:"absolute",top:l.top,left:l.left,width:l.width,height:l.height}}),t.jsxs("div",{ref:R,className:`nice-tutorial__tooltip nice-tutorial__tooltip--${L.actualPlacement} ${g?"nice-tutorial__tooltip--entering":""}`,style:{position:"absolute",top:L.top,left:L.left,transition:`all ${a}ms ease`,maxWidth:380,zIndex:M+1},children:[s.showArrow!==!1&&t.jsx("div",{className:`nice-tutorial__arrow nice-tutorial__arrow--${L.actualPlacement}`}),t.jsxs("div",{className:"nice-tutorial__header",children:[t.jsx("h4",{className:"nice-tutorial__title",children:s.title}),x&&t.jsx("button",{type:"button",className:"nice-tutorial__close",onClick:c,"aria-label":m,children:"✕"})]}),t.jsx("div",{className:"nice-tutorial__content",dangerouslySetInnerHTML:{__html:Y.sanitizeHtml(s.content)}}),t.jsxs("div",{className:"nice-tutorial__footer",children:[_&&t.jsxs("div",{className:"nice-tutorial__progress",children:[e.map((T,X)=>t.jsx("span",{className:`nice-tutorial__dot ${X===p?"nice-tutorial__dot--active":""} ${X<p?"nice-tutorial__dot--done":""}`},X)),t.jsxs("span",{className:"nice-tutorial__step-label",children:[p+1," ",v," ",e.length]})]}),t.jsxs("div",{className:"nice-tutorial__actions",children:[x&&!d&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--skip",onClick:c,children:m}),!j&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--back",onClick:H,children:$}),!s.waitForAction&&t.jsx("button",{type:"button",className:"nice-tutorial__btn nice-tutorial__btn--next",onClick:b,children:d?I:S})]})]})]})]})};ve.displayName="NiceTutorial";const Ie=n.createContext({startTutorial:()=>{},stopTutorial:()=>{},isActive:!1,currentStep:0,nextStep:()=>{},prevStep:()=>{},goToStep:()=>{}});function Ct(){return n.useContext(Ie)}const Te=({children:e})=>{const[i,o]=n.useState([]),[c,f]=n.useState(!1),[u,h]=n.useState(0),_=n.useCallback(p=>{o(p),h(0),f(!0)},[]),x=n.useCallback(()=>{f(!1),h(0),o([])},[]),y=n.useCallback(()=>{h(p=>Math.min(p+1,i.length-1))},[i.length]),a=n.useCallback(()=>{h(p=>Math.max(p-1,0))},[]),C=n.useCallback(p=>{h(Math.max(0,Math.min(p,i.length-1)))},[i.length]),M={startTutorial:_,stopTutorial:x,isActive:c,currentStep:u,nextStep:y,prevStep:a,goToStep:C};return t.jsxs(Ie.Provider,{value:M,children:[e,c&&i.length>0&&t.jsx(ve,{steps:i,active:c,onFinish:x,onSkip:x,onStepChange:h})]})};Te.displayName="NiceTutorialProvider";function Et(e,i,o,c,f){const u=e<=f,h=e+f>=o,_=i<=f,x=i+f>=c;return _&&u?"top-left":_&&h?"top-right":x&&u?"bottom-left":x&&h?"bottom-right":u?"left":h?"right":_?"top":x?"bottom":"none"}function Mt(e){switch(e){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 $e=n.forwardRef(({windowKey:e,title:i,icon:o,children:c,footer:f,x:u=100,y:h=100,width:_=480,height:x=360,minWidth:y=200,minHeight:a=120,maxWidth:C,maxHeight:M,zIndex:p=1,closable:N=!0,minimizable:l=!0,maximizable:k=!0,fullscreenable:r=!1,pinnable:w=!1,resizable:g=!0,draggable:E=!0,snappable:R=!0,snapThreshold:P=20,minimized:s,maximized:d,fullscreen:j,pinned:S,focused:$,onClose:I,onMinimize:m,onMaximize:v,onFullscreen:b,onPin:H,onFocus:L,onMove:K,onResize:ie,onSnap:T,onTitleBarDoubleClick:X,size:pe="md",statusBar:ye,titleBarActions:Le,className:Pe,style:De,id:Ne,accessMode:Ye,...Xe},He)=>{const Be=Y.useControlId(Ne),Oe=Y.useNiceAccessMode(Ye,Ne),{t:ce}=Y.useNiceTranslation();if(Oe==="hidden")return null;const[ue,ne]=n.useState({x:u,y:h}),[me,he]=n.useState({width:_,height:x}),[qe,Ae]=n.useState(!1),[Fe,We]=n.useState(!1),[Ue,Ge]=n.useState(!1),[Ve,Qe]=n.useState(!1),[F,xe]=n.useState("none"),Ze=s??qe,A=d??Fe,q=j??Ue,oe=S??Ve,ge=$??!0,ee=ue.x,te=ue.y,G=me.width,V=me.height,W=n.useRef(null),O=n.useRef(null),D=n.useRef(null),Je=n.useCallback(()=>{I?.(e)},[e,I]),Ke=n.useCallback(()=>{Ae(!0),m?.(e)},[e,m]),_e=n.useCallback(()=>{const z=!A;We(z),!z&&D.current?(ne({x:D.current.x,y:D.current.y}),he({width:D.current.w,height:D.current.h}),D.current=null):z&&(D.current={x:ee,y:te,w:G,h:V}),xe("none"),v?.(e,z)},[e,A,ee,te,G,V,v]),be=n.useCallback(()=>{const z=!q;Ge(z),z?D.current={x:ee,y:te,w:G,h:V}:D.current&&(ne({x:D.current.x,y:D.current.y}),he({width:D.current.w,height:D.current.h}),D.current=null),b?.(e,z)},[e,q,ee,te,G,V,b]),et=n.useCallback(()=>{const z=!oe;Qe(z),H?.(e,z)},[e,oe,H]),re=n.useCallback(()=>{L?.(e)},[e,L]),tt=n.useCallback(()=>{X?X(e):k&&_e()},[e,k,_e,X]);n.useEffect(()=>{if(!W.current)return;const z=Q=>{if(!W.current)return;const U=Q.clientX-W.current.startX+W.current.origX,ae=Q.clientY-W.current.startY+W.current.origY;ne({x:U,y:ae}),K?.(e,{x:U,y:ae})},B=Q=>{if(W.current){if(R){const U=Et(Q.clientX,Q.clientY,window.innerWidth,window.innerHeight,P);U!=="none"&&(D.current={x:ue.x,y:ue.y,w:G,h:V},xe(U),T?.(e,U))}W.current=null}};return document.addEventListener("mousemove",z),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",B)}});const nt=n.useCallback(z=>{!E||A||q||(z.preventDefault(),F!=="none"&&(D.current&&(ne({x:D.current.x,y:D.current.y}),he({width:D.current.w,height:D.current.h})),xe("none")),re(),W.current={startX:z.clientX,startY:z.clientY,origX:ee,origY:te})},[E,A,q,F,ee,te,re]);n.useEffect(()=>{if(!O.current)return;const z=Q=>{if(!O.current)return;const U=Q.clientX-O.current.startX,ae=Q.clientY-O.current.startY,se=O.current.handle;let Z=O.current.origW,J=O.current.origH;if(se.includes("e")&&(Z=O.current.origW+U),se.includes("w")&&(Z=O.current.origW-U),se.includes("s")&&(J=O.current.origH+ae),se.includes("n")&&(J=O.current.origH-ae),Z=Math.max(y,C?Math.min(C,Z):Z),J=Math.max(a,M?Math.min(M,J):J),se.includes("w")){const we=me.width-Z;ne(le=>({...le,x:le.x+we}))}if(se.includes("n")){const we=me.height-J;ne(le=>({...le,y:le.y+we}))}he({width:Z,height:J}),ie?.(e,{width:Z,height:J})},B=()=>{O.current=null};return document.addEventListener("mousemove",z),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",B)}});const st=n.useCallback((z,B)=>{!g||A||q||F!=="none"||(B.preventDefault(),B.stopPropagation(),re(),O.current={startX:B.clientX,startY:B.clientY,origW:G,origH:V,handle:z})},[g,A,q,F,G,V,re]);if(n.useEffect(()=>{if(!ge)return;const z=B=>{B.key==="Escape"&&q&&be()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[ge,q,be]),Ze)return null;const ke=F!=="none"?Mt(F):null,je=A||q,it=q?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:999999}:A?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:p}:ke?{position:"absolute",...ke,zIndex:p}:{position:"absolute",top:te,left:ee,width:G,height:V,zIndex:p},ct=["n","e","s","w","ne","se","sw","nw"],ot={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 t.jsxs("div",{ref:He,id:Be,className:`nice-window nice-window--${pe} ${ge?"nice-window--focused":""} ${oe?"nice-window--pinned":""} ${je?"nice-window--maximized":""} ${F!=="none"?`nice-window--snapped-${F}`:""} ${Pe??""}`,style:{...it,...De},onMouseDown:re,role:"dialog","aria-label":i,...Xe,children:[t.jsxs("div",{className:"nice-window__titlebar",onMouseDown:nt,onDoubleClick:tt,children:[o&&t.jsx("span",{className:"nice-window__icon",children:o}),t.jsx("span",{className:"nice-window__title",children:i}),t.jsxs("div",{className:"nice-window__actions",children:[Le,w&&t.jsx("button",{type:"button",className:`nice-window__action nice-window__action--pin ${oe?"nice-window__action--active":""}`,onClick:et,title:ce("window.pin",oe?"Unpin":"Pin"),children:"📌"}),l&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--minimize",onClick:Ke,title:ce("window.minimize","Minimize"),children:"─"}),k&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--maximize",onClick:_e,title:ce("window.maximize",A?"Restore":"Maximize"),children:A?"❐":"☐"}),r&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--fullscreen",onClick:be,title:ce("window.fullscreen",q?"Exit Full Screen":"Full Screen"),children:q?"⇲":"⇱"}),N&&t.jsx("button",{type:"button",className:"nice-window__action nice-window__action--close",onClick:Je,title:ce("window.close","Close"),children:"✕"})]})]}),t.jsx("div",{className:"nice-window__body",children:c}),f&&t.jsx("div",{className:"nice-window__footer",children:f}),ye&&t.jsx("div",{className:"nice-window__statusbar",children:ye}),g&&!je&&F==="none"&&t.jsx(t.Fragment,{children:ct.map(z=>t.jsx("div",{className:`nice-window__resize nice-window__resize--${z}`,style:{cursor:ot[z]},onMouseDown:B=>st(z,B)},z))})]})});$e.displayName="NiceWindow";exports.NiceActionSheet=rt;exports.NiceBlockUI=Re;exports.NiceBottomSheet=ht;exports.NiceBox=_t;exports.NiceCommandPaletteProvider=Se;exports.NiceContextMenu=pt;exports.NiceDrawer=mt;exports.NiceLoadPanel=gt;exports.NiceModal=at;exports.NiceModalBody=dt;exports.NiceModalFooter=ut;exports.NiceModalHeader=lt;exports.NicePopover=ft;exports.NicePopover$1=xt;exports.NiceResizable=wt;exports.NiceResponsiveBox=bt;exports.NiceScrollView=vt;exports.NiceTutorial=ve;exports.NiceTutorialProvider=Te;exports.NiceWindow=$e;exports.NiceWindowManager=ze;exports.fuzzyMatch=fe;exports.highlightMatches=Ce;exports.useCommandPalette=Me;exports.useNiceTutorial=Ct;exports.useRegisterCommands=Nt;
|