efficient-shell 5.6.1 → 6.4.0
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 +184 -44
- package/THIRD_PARTY_NOTICES.md +212 -0
- package/dist/Browser-USPZWDYH.js +43 -0
- package/dist/Calculator-FP5HUWCW.js +29 -0
- package/dist/ConfirmDialog-3TIHKJRT.js +1 -0
- package/dist/{CurrencyConverter-2IGOOR3I.js → CurrencyConverter-XD5LYOCD.js} +8 -8
- package/dist/Documents-ADFEHEUW.js +52 -0
- package/dist/Files-BVUVRNC5.js +87 -0
- package/dist/Notepad-WJI5ODGS.js +25 -0
- package/dist/PdfViewer-226I3LSD.js +1 -0
- package/dist/PomodoroTimer-GEMQHIPJ.js +91 -0
- package/dist/Preview-HNSEYNZL.js +182 -0
- package/dist/Sidebar-PVHZPNIY.js +44 -0
- package/dist/{Spreadsheet-SRAUU3OA.js → Spreadsheet-6Z5ACGTT.js} +14 -14
- package/dist/{Stock-7EKOAQ7C.js → Stock-X3LIU4ZX.js} +4 -4
- package/dist/{Weather-RWI6NKB2.js → Weather-BLO354GM.js} +14 -14
- package/dist/{WorldClock-CEHWDFEO.js → WorldClock-BAH7QFRG.js} +7 -7
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-2SSRFEOZ.js +91 -0
- package/dist/{chunk-TFETN2GI.js → chunk-4JZZLUGG.js} +1 -1
- package/dist/{chunk-GG7AE6OC.js → chunk-5K76RQML.js} +1 -1
- package/dist/chunk-5LUN632W.js +5 -0
- package/dist/chunk-5MDQNFOG.js +9 -0
- package/dist/chunk-7IQ3B77H.js +1 -0
- package/dist/{chunk-SKB6L53D.js → chunk-7PGHRG6J.js} +9 -9
- package/dist/chunk-CXJQ42XT.js +21 -0
- package/dist/chunk-DBXZS7OA.js +29 -0
- package/dist/{chunk-X4FJ54PP.js → chunk-FIEA5CGB.js} +1 -1
- package/dist/chunk-GJ37JCC2.js +1 -0
- package/dist/{chunk-KXAUDC3A.js → chunk-GWDVD3VQ.js} +27 -27
- package/dist/chunk-HQLAISFX.js +11 -0
- package/dist/chunk-I2H2CKID.js +3 -0
- package/dist/{chunk-YIH6JLMV.js → chunk-I534M65N.js} +2 -2
- package/dist/{chunk-WWF2EQXF.js → chunk-IHZL3GJU.js} +1 -1
- package/dist/chunk-K6DKX55N.js +1 -0
- package/dist/chunk-KNUR2UEG.js +1 -0
- package/dist/{chunk-JXAAZGLJ.js → chunk-MORDXCV6.js} +1 -1
- package/dist/chunk-PFKMIPZH.js +1028 -0
- package/dist/chunk-PJPK2ADX.js +1 -0
- package/dist/chunk-Q5O5UMJY.js +6 -0
- package/dist/chunk-QJHWLDEN.js +108 -0
- package/dist/chunk-R5VRLW5Z.js +1 -0
- package/dist/chunk-S3LGKIZ3.js +12 -0
- package/dist/chunk-SBF5A6XV.js +1 -0
- package/dist/chunk-SK5DL6JX.js +24 -0
- package/dist/{chunk-CLPJDJH4.js → chunk-UUYPUKP7.js} +1 -1
- package/dist/{chunk-AFYQTVZO.js → chunk-UVBK6YSR.js} +1 -1
- package/dist/chunk-VR6TR575.js +13 -0
- package/dist/{chunk-7WC3EOFS.js → chunk-XO2AMGVU.js} +1 -1
- package/dist/{chunk-N3A3GWJI.js → chunk-YX2IMURA.js} +12 -12
- package/dist/chunk-ZEIKSMFR.js +10 -0
- package/dist/client-DLm3Fvbc.d.ts +65 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/icons/efficient-looks.d.ts +1 -1
- package/dist/icons/efficient.d.ts +1 -1
- package/dist/icons/index.d.ts +12 -12
- package/dist/icons/index.js +1 -1
- package/dist/{index-ZI6vl2Wq.d.ts → index-D5bms_uA.d.ts} +186 -76
- package/dist/index.d.ts +6 -4
- package/dist/index.js +639 -639
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +22 -22
- package/dist/markdown/index.js +6 -6
- package/dist/markup/index.d.ts +460 -36
- package/dist/markup/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{registry-J-TU7zKx.d.ts → registry-Dw6QO2Ch.d.ts} +12 -9
- package/dist/{strings-BVB64Nck.d.ts → strings-fYzxZPn4.d.ts} +5 -0
- package/dist/telemetry/index.d.ts +39 -0
- package/dist/telemetry/index.js +1 -0
- package/dist/ui/index.d.ts +4 -3
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +62 -21
- package/package.json +7 -21
- package/dist/Browser-RXGEZ77D.js +0 -43
- package/dist/Calculator-MVPKTZZF.js +0 -29
- package/dist/ConfirmDialog-XOYCYFA7.js +0 -1
- package/dist/Documents-YBLR7WVX.js +0 -52
- package/dist/Files-7XNR5IL2.js +0 -87
- package/dist/Notepad-ZQYQXV75.js +0 -25
- package/dist/PdfViewer-SQVMMA7B.js +0 -1
- package/dist/PomodoroTimer-XIUN4M73.js +0 -91
- package/dist/Preview-YCOA5JPP.js +0 -182
- package/dist/Sidebar-VI7E3EKI.js +0 -44
- package/dist/chunk-3HJTOINK.js +0 -1
- package/dist/chunk-4SWPNARR.js +0 -5
- package/dist/chunk-5ABLFFC5.js +0 -24
- package/dist/chunk-6LTDJKIL.js +0 -138
- package/dist/chunk-F6B3J3GW.js +0 -6
- package/dist/chunk-HZZNJHRH.js +0 -1
- package/dist/chunk-IMMHJIV5.js +0 -29
- package/dist/chunk-OGXU7QFW.js +0 -12
- package/dist/chunk-P4CIOJHP.js +0 -3
- package/dist/chunk-RBDGN4YU.js +0 -9
- package/dist/chunk-RC2EG6P4.js +0 -1026
- package/dist/chunk-RL626E7Q.js +0 -13
- package/dist/chunk-RMJZOKHY.js +0 -10
- package/dist/chunk-SFCDHHQP.js +0 -1
- package/dist/chunk-TNBCUZVE.js +0 -1
- package/dist/chunk-VWBQ2P5G.js +0 -108
- package/dist/chunk-XWSWYMGM.js +0 -2
- package/dist/chunk-YGC7AX3X.js +0 -11
- package/dist/chunk-Z7D6Y5WA.js +0 -21
- package/dist/icons/heroicons.d.ts +0 -6
- package/dist/icons/heroicons.js +0 -1
- package/dist/icons/lucide.d.ts +0 -6
- package/dist/icons/lucide.js +0 -1
package/dist/chunk-RL626E7Q.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-DSSLOQDW.js";import{FolderFallback as t,PageFallback as r}from"./chunk-6LTDJKIL.js";import{Icon as n}from"./chunk-XWSWYMGM.js";import{isValidElement as o,cloneElement as i}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var d=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function s(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return d[Math.abs(t)%d.length]}var c={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},f={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},p={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},u={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function m({className:e}){/* @__PURE__ */
|
|
2
|
-
return l(n,{name:"folder",fallback:t,className:e})}function h(t,r){return r&&e[r]||(t?e[t]:void 0)}var w=/* @__PURE__ */l("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function g({entityType:e,isSelected:t,entityId:r,label:n,fileKind:d}){const g="preview-file"===e&&d,y=g?u[d]:null,x=g?p[d]:null;if("folder"===e)/* @__PURE__ */
|
|
3
|
-
return l("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */l(m,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=h(r,n),a=s(r||n||"page");/* @__PURE__ */
|
|
4
|
-
return l("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */l("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${a} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&o(e)?i(e,{className:"h-7 w-7 text-white"}):w})})}/* @__PURE__ */
|
|
5
|
-
return a("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
|
|
6
|
-
/* @__PURE__ */a("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${y??c[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
|
|
7
|
-
/* @__PURE__ */l("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
|
|
8
|
-
/* @__PURE__ */l("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
|
|
9
|
-
/* @__PURE__ */l("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
|
|
10
|
-
/* @__PURE__ */l("span",{className:`absolute inset-0 flex items-center justify-center text-[9px] font-bold pt-2 ${y??c[e]??"text-gray-600"}`,children:x??f[e]??e.slice(0,3).toUpperCase()})]})}function y({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
|
-
return l(m,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=h(e.entityId,e.label);/* @__PURE__ */
|
|
12
|
-
return l("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${s(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&o(t)?i(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */l("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const t=("preview-file"===e.entityType&&e.fileKind?u[e.fileKind]:c[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return l(n,{name:"page",fallback:r,className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:1.5})}function x(e){return"preview-file"===e.entityType&&e.fileKind?p[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":f[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var b=null,v=/* @__PURE__ */new Set;function _(e){b=e,v.forEach(e=>e())}function k(e){return v.add(e),()=>{v.delete(e)}}function N(){return b}var j="__REACT_OS_SHELL_FILES_VIEW__",S="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function I(){"undefined"!=typeof window&&(window[j]="trash",window.dispatchEvent(new CustomEvent(S)))}function T(e){"undefined"!=typeof window&&(window[j]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function L(){if("undefined"==typeof window)return null;const e=window[j];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function P(){const e=L();return"undefined"!=typeof window&&(window[j]=null),e}export{y as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,S as FILES_SHOW_TRASH_EVENT,g as FileIconTile,m as FolderGlyph,P as consumeFilesViewRequest,x as desktopItemTypeLabel,N as getDesktopFoldersSnapshot,L as peekFilesViewRequest,_ as publishDesktopFolders,T as requestFilesDesktopFolderView,I as requestFilesTrashView,k as subscribeDesktopFolders};
|
package/dist/chunk-RMJZOKHY.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-X4FJ54PP.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{CheckFallback as l,ChevronRightFallback as u}from"./chunk-6LTDJKIL.js";import{Icon as c}from"./chunk-XWSWYMGM.js";import{createContext as s,forwardRef as d,useContext as p,useRef as m,useId as h,useState as f,useEffect as g,useMemo as y,useCallback as x}from"react";import{createPortal as w}from"react-dom";import{jsxs as b,jsx as v,Fragment as k}from"react/jsx-runtime";var C=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),N="data-native-context-menu";function T(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function L(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(T(t,`[${N}]`))return!0;if(T(t,"textarea"))return!0;if(T(t,"img, picture, canvas, video, audio"))return!0;const n=T(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(C.has(e))return!0}const r=T(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var M=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function E(e,t,n){const r=T(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return M.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function W(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return L(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function $(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function P(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function R(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function A(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function B(e,t,n,r,o,i=!1,a=8){const l=t+o,u=e-o-n,c=u>=a;return i&&c?{left:u,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:c?{left:u,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function H(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var D=s(null),j=s(!1);function S({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:s=!1}){const d=m(null),p=h(),[x,b]=f([]),k=m();g(()=>()=>clearTimeout(k.current),[]);const C=i(),N=y(()=>{const e=()=>clearTimeout(k.current);return{id:p,depth:0,path:x,open:(t,n)=>{e(),b(e=>$(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>b(e=>P(e,t)),200)},closeBelow:t=>{e(),b(e=>P(e,t))},cancelClose:e,closeTree:()=>{e(),b([]),u?.()},root:d}},[p,x,u]);g(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${p}"]`)||d.current&&!d.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>d.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,p]),g(()=>{const e=d.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const T=H(),M=/(^|[\s:])!?z-/.test(l),E=/* @__PURE__ */v("div",{ref:d,"data-popup-menu-tree":p,className:`fixed rounded-(--radius-popup) ${"tight"===T?"py-1":"large"===T?"py-2":"py-1.5"} ${l}`,onContextMenu:e=>{L(e.target)||e.preventDefault()},style:{...M?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */v(D.Provider,{value:N,children:t})});return s?C?w(E,document.body):null:E}function F(e,t,n,r=!1){const o=H(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var I=/* @__PURE__ */v(c,{name:"check",fallback:l,"aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function z({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
-
return v("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&I}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&I})}var q=d(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:c},s){const d=p(D),m=p(j),h=F(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
-
return b("button",{ref:s,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),d&&d.depth>0&&"checkbox"!==f&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */v(z,{kind:f,checked:!!a}),t]})}),J=/* @__PURE__ */v(c,{name:"chevron-right",fallback:u,"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",strokeWidth:2});function K(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function U(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function X({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:c}){const s=p(D),d=h(),f=m(null),C=m(null),N=m(),T=m(!1),M=`${d}-menu`;g(()=>()=>clearTimeout(N.current),[]);const E=s?.depth??0,W=s?.path[E],$=!!W&&W.key===d&&!i,P=x(e=>{if(!s||i||!f.current)return;clearTimeout(N.current),T.current=e;const t=f.current.getBoundingClientRect(),n=f.current.closest("[data-popup-submenu-panel]")??f.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=E>0&&(s.path[E-1]?.flipped??!1),a=B(r.left,r.right,u,window.innerWidth,4,o);s.open(E,{key:d,y:t.top,...a})},[s,i,E,d,u]),R=e=>{s?.closeBelow(E),f.current?.focus()};g(()=>{if($)return r(e=>"Escape"===e.key&&(!(s&&s.path.length>E+1)&&(R(),!0)),()=>C.current)}),a(()=>{if(!$||!W)return;const e=()=>{const e=C.current;if(!e||!f.current)return;const t=f.current.closest("[data-popup-submenu-panel]")??f.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??f.current.getBoundingClientRect(),r=E>0&&(s?.path[E-1]?.flipped??!1),o=e.offsetWidth||u,i=B(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=A(f.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{$&&T.current&&(T.current=!1,U(C.current)[0]?.focus())},[$]);const j=y(()=>s&&{...s,depth:E+1},[s,E]);if(!s)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=F(!1,i,l,$),I=H();/* @__PURE__ */
|
|
4
|
-
return b(k,{children:[
|
|
5
|
-
/* @__PURE__ */b("button",{ref:f,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":$,"aria-controls":$?M:void 0,disabled:i,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;$?t&&U(C.current)[0]?.focus():P(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),P(!0))},onMouseEnter:()=>{i||(s.cancelClose(),$?s.closeBelow(E+1):(clearTimeout(N.current),N.current=setTimeout(()=>P(!1),120)))},onMouseLeave:()=>{clearTimeout(N.current),s.scheduleClose(E)},children:[n,
|
|
6
|
-
/* @__PURE__ */v("span",{className:"min-w-0 flex-1 truncate",children:t}),J]}),$&&w(
|
|
7
|
-
/* @__PURE__ */v("div",{ref:C,id:M,role:"menu","data-popup-menu-tree":s.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===I?"py-1":"large"===I?"py-2":"py-1.5"),style:{left:W.left,top:W.y,minWidth:u,maxHeight:void 0===c?"calc(100vh - 16px)":`min(${"number"==typeof c?`${c}px`:c}, calc(100vh - 16px))`,zIndex:K(s.root.current)+E+1,animation:(W.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=U(C.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),R())},onMouseEnter:()=>{s.cancelClose(),clearTimeout(N.current)},onMouseLeave:()=>s.scheduleClose(E+1),onContextMenu:e=>{L(e.target)||e.preventDefault()},children:/* @__PURE__ */v(D.Provider,{value:j,children:o})}),document.body)]})}function Z(){const e=H();/* @__PURE__ */
|
|
8
|
-
return v("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function G({children:e}){const t=H(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
9
|
-
return v("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function O({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
|
|
10
|
-
return v("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{z as MenuCheckMark,O as MenuIcon,j as MenuSemanticsContext,N as NATIVE_MENU_ATTR,S as PopupMenu,Z as PopupMenuDivider,q as PopupMenuItem,G as PopupMenuLabel,X as PopupSubmenu,A as clampMenuTop,P as closeMenuBelow,E as describeContextTarget,F as itemLook,L as keepsNativeMenu,W as leavesContextMenuAlone,B as menuPanelLeft,$ as openMenuLevel,R as resolveMenuLevels};
|
package/dist/chunk-SFCDHHQP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="5.6.1",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-TNBCUZVE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{formatPlain as e,formatFixed as o,formatGrouped as t,formatPercent as i}from"./chunk-C3QOHMR6.js";import{createContext as a,useContext as n,useMemo as r,useEffect as s}from"react";import{jsx as l}from"react/jsx-runtime";function d(a){const n=o=>e(o,a),r=e=>t(e,a),s=(e,t)=>o(e,t,a),l=(e,o)=>i(e,o,a);return{window:{minimize:"Minimize",restore:"Restore",maximize:"Maximize",windowed:"Windowed",pinOnTop:"Pin on top",unpin:"Unpin from top",close:"Close",windowSuffix:"window",prev:"Prev",next:"Next",snapLayouts:"Snap layouts",snapLeft:"Snap left half",snapRight:"Snap right half",snapTopLeft:"Snap top-left quarter",snapTopRight:"Snap top-right quarter",snapBottomLeft:"Snap bottom-left quarter",snapBottomRight:"Snap bottom-right quarter"},taskbar:{closeWindow:"Close window",offscreenHint:"This window is off screen — click to bring it back",offscreenDot:"Off screen — click to bring this window back",expose:"Exposé — show all open windows as thumbnails",addToDesktop:"Add to desktop",removeFromDesktop:"Remove from desktop",minimizeAllWindows:"Minimize all",restoreAllWindows:"Restore all",closeAllWindows:"Close all"},logout:{goodbye:"Goodbye",seeYou:"See you next time"},about:{aboutPrefix:"About",thisApp:"this app",openSourceLicenses:"Open Source Licenses",whatsNew:"What's New",noChangelog:"No changelog available."},table:{empty:"Nothing to show",loading:"Loading",selectAll:"Select all rows",selectRow:"Select row"},select:{none:"— None —",noMatches:"No matches",allSelected:"All options selected",clear:"Clear selection",remove:"Remove"},notifications:{title:"Notifications",markAllRead:"Mark all read",dnd:"Do not disturb",dndOn:"Do not disturb is on",caughtUp:"All caught up",empty:"No notifications yet",viewAll:"View all notifications",cardLabel:"Notification",dismiss:"Dismiss notification"},form:{errorSummaryTitle:"There is a problem"},help:{title:"Help",searchPlaceholder:"Search help…",empty:"No help articles yet.",noResults:"No articles match your search.",loading:"Loading…",pickArticle:"Pick a help article from the left.",noBody:"This article has no body yet.",draft:"Draft",newArticle:"+ New",edit:"Edit"},update:{available:"A new version is available.",refreshNow:"Refresh now"},pageTabs:{label:"Open pages",close:"Close",closeOthers:"Close other tabs",closeRight:"Close tabs to the right",closeAll:"Close all tabs",unsaved:"Unsaved changes",copy:e=>`Copy ${e}`,copied:"Copied",tabMenu:"Window menu",discardTitle:"Discard unsaved changes?",discardOne:"This page has changes that have not been saved. Close it anyway?",discardMany:"pages have changes that have not been saved. Close them anyway?",discardConfirm:"Discard and close",keepEditing:"Keep editing"},dialog:{close:"Close",cancel:"Cancel",ok:"OK",confirmTitle:"Confirm",destructiveTitle:"Confirm Action",destructiveCancel:"Dismiss",destructiveConfirm:"Delete",typeToConfirm:e=>`Type ${e} to confirm:`,promptTitle:"Enter a value"},calendar:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",monthPanel:"Choose a month",yearPanel:"Choose a year",chooseMonth:e=>`Choose a month, currently ${e}`,chooseYear:e=>`Choose a year, currently ${e}`},datePicker:{placeholder:"Select a date",dialog:"Choose a date",clear:"Clear",today:"Today",required:"Required"},dateRange:{placeholder:"Date Range",clearRange:"Clear date range",dialog:"Date range",from:"From",to:"To",start:"Start",end:"End",fromOnly:e=>`From ${e}`,toOnly:e=>`To ${e}`,range:(e,o)=>`${e} to ${o}`,required:"Required",last2Weeks:"Last 2 Weeks",lastMonth:"Last Month",last3Months:"Last 3 Months",last6Months:"Last 6 Months",last12Months:"Last 12 Months",custom:"Custom",clear:"Clear",cancel:"Cancel",apply:"Apply"},pagination:{label:"Pagination",first:"First page",previous:"Previous page",next:"Next page",last:"Last page"},list:{selected:e=>`${n(e)} selected`,selectedNotShown:(e,o)=>`${n(e)} selected, ${n(o)} not shown`,allLoaded:(e,o)=>`All ${r(e)} ${o} loaded`,count:(e,o)=>`${r(e)} ${o}`,loadedOf:(e,o,t)=>`${r(e)} of ${r(o)} ${t}`,loadingMore:"Loading more...",loadError:"Couldn't load this list",loadErrorMessage:"Something went wrong fetching these records. Check your connection and try again.",retry:"Try again"},kanban:{loading:"Loading…",empty:"No items.",dropHere:"Drop here",addItem:"Add item"},files:{attach:"Attach files",drop:"Drop files to attach",remove:e=>`Remove ${e}`,chooseMany:"Choose files",chooseOne:"Choose a file",dragMany:"or drag them here",dragOne:"or drag it here",notAccepted:(e,o)=>`${e} is not an accepted file type${o?` (${o})`:""}`,tooLarge:(e,o,t)=>`${e} is ${o} — the limit is ${t}`,tooMany:(e,o)=>`${e} was not added — ${n(o)} ${1===o?"file":"files"} is the limit`,bytes:e=>`${n(e)} B`,kilobytes:e=>`${n(e)} KB`,megabytes:e=>`${s(e,1)} MB`},media:{uploadImage:"Upload an image",uploadVideo:"Upload a video",uploadFile:"Upload a file",upload:"Upload media",cta:"Choose from library or upload",replace:"Replace",remove:"Remove",uploading:"Uploading…",cover:"Cover",add:"Add",addMedia:"Add media",empty:"No media.",removeItem:e=>`Remove ${e}`,reorder:(e,o,t)=>`${e}, item ${n(o)} of ${n(t)}. Use arrow keys to reorder.`},brandAsset:{save:e=>`Save ${e}`,remove:e=>`Remove ${e}`,discard:"Discard change",saveFailed:e=>`Could not save ${e}.`,removeFailed:e=>`Could not remove ${e}.`,region:(e,o)=>`${e} for ${o}`,usedFor:e=>`Used for ${e}.`,previews:e=>`${e} previews`,preview:"Preview",alt:(e,o)=>`${e} ${o}`},copy:{copy:"Copy",copyLabel:e=>`Copy ${e}`,copied:"Copied",copyValue:e=>`Copy ${e}`,copiedValue:"Copied!",copiedLabel:e=>`${e} copied`,failed:"Could not copy to the clipboard"},keypad:{backspace:"Backspace",enter:"Enter"},banner:{dismiss:"Dismiss"},badge:{remove:"Remove",removeItem:e=>`Remove ${e}`},breadcrumbs:{label:"Breadcrumb",hidden:"Hidden crumbs"},emptyState:{message:"Nothing here yet."},errors:{notFound:"Page not found",notFoundBody:"The page you're looking for doesn't exist or was moved.",forbidden:"Access denied",forbiddenBody:"You don't have permission to view this page.",noAccess:"You don't have access to this",serverError:"Something went wrong",serverErrorBody:"An unexpected error occurred. Please try again.",retry:"Try again",details:"Error details"},search:{placeholder:"Search...",escBadge:"ESC",searching:"Searching...",noResults:"No results found.",minChars:e=>`Type at least ${n(e)} characters to search...`,navigate:"navigate",open:"open",close:"close",enterKey:"Enter",escKey:"Esc",recent:"Recent",favorites:"Favorites",actions:"Actions",listLabel:"Search results",groupCount:(e,o)=>`${n(e)}${o?"+":""}`,groupLabel:(e,o,t)=>`${e}, ${n(o)}${t?"+":""}`,seeAll:e=>`See all ${e}`,searchFailed:"Search failed — check your connection and try again.",partialFailure:"Some results could not be loaded.",tabKey:"Tab",nextGroup:"next group"},grid:{selectAll:"Select all",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:e=>`Delete row ${e}`,insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:e=>`Delete column ${e}`,resize:"Drag to resize · double-click to auto-fit",fill:"Drag to fill"},sidebar:{resize:"Drag to resize · double-click to reset"},resizeHandle:{label:"Resize panel",hint:"Drag to resize · double-click to reset"},number:{increase:"Increase",decrease:"Decrease"},slider:{value:e=>`${e} value`},displayChips:{shown:"Shown",hidden:"Hidden",shownHint:"Shown · click to hide",hiddenHint:"Hidden · click to show"},corners:{radius:"Corner radius",unit:"px",radiusMark:"R"},widths:{column:e=>`Column ${e}`,divider:(e,o)=>`Divider between column ${e} and column ${o}`,dividerValue:(e,o,t,i)=>`Column ${e} ${l(o,0)}, column ${t} ${l(i,0)}`,dragHint:"Drag to change the widths",hint:(e,o)=>`Column ${e} fills the rest of the row. No column goes below ${l(o,0)}.`,reset:"Reset to equal"},color:{swatch:(e,o)=>`${e}: ${o}`,none:"None",panel:e=>`${e} picker`,square:"Saturation and brightness",squareValue:(e,o)=>`Saturation ${l(e,0)}, brightness ${l(o,0)}`,hue:"Hue",hex:e=>`${e} hex code`,presets:"Presets",clear:"No color"},imageFocus:{picture:(e,o)=>`${e}: ${o}`,hint:"Drag the dot on the picture, or move it with the arrow keys. Shift moves it further.",noImage:"Choose an image first. There is nothing to focus yet."},link:{linkType:"Link type",address:"Link address",addressPlaceholder:"Link (e.g. /wheels or https://…)",unsafe:"Use a web address (https://…), a page on this site (/…), mailto: or tel:.",unavailable:e=>`${e} (unavailable)`,filter:"Filter",noFilter:"No filter (all products)",value:"Value",filterHint:"Filters come from Product Types. Only values in this site's catalogue are listed.",title:"Link",apply:"Apply",cancel:"Cancel",remove:"Remove",addLink:"Add a link",text:e=>`${e} text`,linkOf:(e,o)=>`${e} link: ${o||"none"}`},tree:{empty:"Nothing here yet",dropHere:"Drop here",dragHint:"Drag to move",moveHint:"Alt+Arrow Up or Alt+Arrow Down moves it",insertHere:"Insert here"},layout:{desktop:"Desktop",sidebar:"Sidebar",switchToDesktop:"Switch to Desktop",switchToSidebar:"Switch to Sidebar",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",search:"Search…",navLabel:"Main menu",openWindows:"Open windows",pageResult:"Page",accountMenu:e=>`Account menu for ${e}`,profile:"My Profile",notifications:"Notifications",reportIssue:"Suggestion or Bug",signOut:"Sign Out",signOutTitle:"Sign Out",signOutMessage:"Do you want to log out? All windows will reopen when you log back in."},markdown:{screenshot:"Screenshot"},severity:{success:"ok",warning:"warning",danger:"critical",unrecognised:e=>`unrecognised severity ${e}`},meter:{noData:"no data",warningAt:e=>`warning ≥ ${n(e)}`,criticalAt:e=>`critical ≥ ${n(e)}`,noReading:"no reading",noBudget:"no budget",ofBudget:e=>`${e} of budget`,budget:"budget",hoursMinutes:(e,o)=>`${n(e)}h ${n(o)}m`,minutesSeconds:(e,o)=>`${n(e)}m ${n(o)}s`,seconds:e=>`${n(e)}s`},charts:{showTable:"Show the data as a table",loading:"Loading chart data",noData:"No data in this window.",windowStart:"Window start",windowEnd:"Window end",window:(e,o,t)=>`Time window — showing ${e} to ${o} of ${n(t)} intervals`,overIntervals:(e,o)=>`${e.join(", ")} over ${n(o)} intervals`,acrossCategories:(e,o)=>`${e.join(", ")} across ${n(o)} categories`,acrossMeasures:(e,o)=>`${e.join(", ")} across ${n(o)} measures`,breakdown:(e,o)=>`Breakdown of ${e} across ${n(o)} segments`,funnel:(e,o,t)=>`Funnel of ${n(e)} stages, ${o} down to ${t}`,radialTrack:e=>`${n(e)} categories, as concentric proportions`,radialCycle:e=>`${n(e)} categories, around a cycle`,tableFrom:"From",tableTo:"To",tableItem:"Item",tableLevel:"Level",tableSeries:"Series",inBucket:e=>`${e} in this bucket`,inCategory:e=>`${e} in this category`,value:"Value",share:"Share",count:"Count",flow:"Flow",totalFlow:"Total flow",throughput:"Throughput",open:"Open",high:"High",low:"Low",close:"Close",maximum:"Maximum",q3:"Q3",median:"Median",q1:"Q1",minimum:"Minimum",distribution:"Distribution",fiveNumber:(e,o)=>`${e}: five-number summary for ${n(o)} categories`,outliers:e=>`${n(e)} outlier${e>1?"s":""} beyond the whiskers`,price:"Price",ohlc:(e,o)=>`${e}: open, high, low and close across ${n(o)} periods`,closedAbove:"Closed above its open",closedBelow:"Closed below its open",noFlows:"No flows to chart.",chord:e=>`Flows between ${n(e)} participants`,noStages:"No stages to chart.",ofFirstStage:"Of first stage",droppedHere:"Dropped here",intensity:"Intensity",noActivity:"No activity in this window.",heatmap:(e,o,t)=>`${e} across ${n(o)} rows and ${n(t)} columns`,countAxis:"count",histogram:(e,o,t)=>`${e}: ${n(o)} bins over ${n(t)} observations`,observations:"Observations",notEnough:"Not enough eligible requests to judge.",objectiveMet:e=>`objective ${e} met`,objectiveMissed:e=>`objective ${e} missed`,nothingToPlot:"Nothing to plot.",nothingToCompare:"Nothing to compare.",other:"Other",nothingToBreakDown:"Nothing to break down.",range:"Range",rangeLabel:(e,o)=>`${e}: low and high across ${n(o)} categories`,nothingToRank:"Nothing to rank in this window.",emphasised:"(emphasised)",sankey:(e,o)=>`Flow between ${n(e)} nodes over ${n(o)} links`,noObservations:"No observations in this window.",xAxis:"x",yAxis:"y",size:"Size",scatter:(e,o,t)=>`${e.join(", ")}: ${o} against ${t}`,outsideRange:e=>`${n(e)} ${1===e?"point":"points"} outside the shown range`,waterfall:(e,o,t)=>`Waterfall of ${n(e)} steps from ${o} to ${t}`,balance:"Balance",increase:"Increase",decrease:"Decrease",runningTotal:"Running total",sunburst:(e,o)=>`Hierarchy of ${e} across ${n(o)} levels`,treemap:e=>`Treemap of ${n(e)} items`,trendUp:"up",trendDown:"down",trendFlat:"flat"},timeline:{days:e=>`${r(e)} days`,daysToToday:e=>`${r(e)} days to today`,notReached:"Not yet reached",next:"Next",more:e=>`+${n(e)} more`,today:"Today",todayTitle:e=>`Today — ${e}`,open:e=>`Open ${e}`,openButton:"Open",scrub:"Scrub the timeline",alsoToCome:e=>`Also to come: ${e.join(", ")}`,start:e=>`Start · ${e}`,events:(e,o)=>`${n(e)} events · ${o.join(", ")}`,started:e=>`started ${e}`,duration:e=>`${r(e)} day${1===e?"":"s"}`,reached:(e,o)=>`${n(e)} of ${n(o)} milestones`,milestones:e=>`${e} milestones`},production:{heading:"Production progress",start:"Start",estimated:"Estimated",estimatedCompletion:"Estimated completion",estDone:"Est. done",play:"Play",pause:"Pause",playTitle:"Play the timeline, report by report",backTo:e=>`Back to ${e}`,showing:e=>`Showing ${e}`,overall:e=>`${l(e,0)} overall`,inStock:e=>`${r(e)} pc in stock`,noReport:"No production report filed yet",leadTime:e=>`${r(e)} day${1===e?"":"s"} lead time`,report:"Production report",shipment:"Shipment",inspection:"Inspection",invoice:"Invoice",scrub:"Scrub the production timeline",label:(e,o)=>`Production reports and events, ${e} to ${o}`},containers:{items:e=>`${n(e)} items`,pieces:e=>`${n(e)} pcs`,split:(e,o)=>`(${n(e)} instr / ${n(o)} loaded)`,added:(e,o)=>`${n(e)} new (${n(o)} pcs)`,fill:(e,o)=>`${s(e,1)} / ${n(o)} m³`,total:"Total:",instructed:e=>`${s(e,2)} m³ instruction`,loaded:e=>`${s(e,2)} m³ loaded`,volume:e=>`${s(e,2)} m³`,noVolume:"Volume: N/A (no volume data for these part numbers)"},toast:{notification:"Notification"},map:{failed:"The map could not be drawn here. The list has everything it shows.",approximate:e=>`${e}, approximate location`,approximateTitle:e=>`${e} (approximate)`,places:e=>1===e?"place":"places",group:(e,o)=>`${n(e)} ${o} here`,stops:e=>`Stops ${e}`,closeBy:(e,o)=>`${n(e)} more ${o} close by, drawn when the map is closer`,spread:"Press to see them apart",cycle:"They stand on one spot: press for the next of them",fullScreen:"Full screen",leaveFullScreen:"Leave full screen",chosen:e=>`${e}, chosen on the map`,closeCard:"Close",openRecord:"Open"},pdf:{previousPage:"Previous page",nextPage:"Next page",pageOf:(e,o)=>`${n(e)} / ${n(o)}`,zoomOut:"Zoom out",zoomIn:"Zoom in",zoom:"Zoom",fitWidth:"Fit width",fitPage:"Fit page",fit:"Fit",fitHint:"Fit to the pane: follows its size until you zoom by hand",print:"Print",download:"Download",email:"Email",loading:"Loading PDF…",loadFailed:"Failed to load PDF",allowPopups:"Allow popups to print"},loading:{label:"Loading..."},language:{title:"Language",description:"The language of menus, labels and messages.",reloadNote:"The page reloads when you change the language."},entityList:{open:"Open",copy:"Copy",copyColumn:e=>`Copy ${e}`,copyRows:e=>1===e?"Copy row":`Copy ${n(e)} rows`,exportSelected:"Export selected to CSV",selectAll:"Select all",selectAllLoaded:e=>`Select all ${n(e)} loaded`,clearSelection:"Clear selection",refresh:"Refresh",copiedText:"Text",copiedRows:e=>1===e?"Row":`${n(e)} rows`,exported:e=>`Exported ${n(e)} ${1===e?"row":"rows"}.`,exportTruncated:(e,o)=>`Exported ${n(e)} of ${n(o)} rows. The server capped this export, so the file is incomplete.`,exportTruncatedUnknown:e=>`Exported only some of the ${n(e)} rows. The server capped this export, so the file is incomplete.`,exportFailed:"CSV export failed."},columns:{choose:"Choose columns",heading:"Columns",reset:"Reset",saveDefault:"Save as default for all users",savedDefault:"Saved as default",select:"Select",selectDone:"Done",showSelection:"Show selection column",hideSelection:"Hide selection column"},record:{loading:"Loading record…",signInRequired:"Sign in required",signInBody:"Your session may have expired. Sign in again to open this record.",notFound:"Record not found",loadFailed:"Couldn't load record",checkConnection:"Check your connection and try again.",rejected:"The server rejected this request.",retry:"Try again"},password:{current:"Current Password",newPassword:"New Password",confirm:"Confirm Password",submit:"Change Password",submitting:"Changing...",done:"Done",currentRequired:"Current password is required.",tooShort:e=>`New password must be at least ${n(e)} characters.`,mismatch:"Passwords do not match.",failed:"Failed to change password.",changed:"Your password has been changed successfully."},pdfAction:{label:"PDF",loading:"Loading...",preview:"Preview",download:"Download",email:"Send by Email",downloaded:e=>`${e} downloaded.`,tookTooLong:e=>`${e} took too long to load. Please try again.`,previewLoading:"LOADING PDF",previewTookTooLong:"This document took too long to load. Close this window and try again.",previewFailed:"Failed to load PDF."},undo:{undo:"Undo",redo:"Redo",undoStep:(e,o)=>`Undo ${e} (${o})`,redoStep:(e,o)=>`Redo ${e} (${o})`,nothingToUndo:"Nothing to undo",nothingToRedo:"Nothing to redo"},sounds:{title:"Sounds",enable:"Sound effects",autosave:"Changes are saved automatically",choice:(e,o)=>`${e} — ${o}`,packClassic:"Classic",packMinimal:"Minimal",packRetro:"Retro",packSoft:"Soft",packArcade:"Arcade",packSilent:"Silent",eventClick:"Click",eventSuccess:"Success",eventError:"Error",eventNotification:"Notification",eventStartup:"Startup",eventTimerDone:"Timer",eventLogout:"Logout"},serverStatus:{connected:"Connected",disconnected:"Disconnected",checking:"Checking…",lastOkTitle:(e,o)=>`${e} · last ok ${o}`,details:"Server connection details",lastPoll:e=>`Last poll ${e}.`,lastFailure:e=>`Last failure ${e}.`,firstPoll:"First poll in flight…",server:"Server",protocol:"Protocol",browser:"Browser",online:"Online",offline:"Offline",lastOk:"Last OK",lastFail:"Last fail",latency:"Latency",poll:"Poll",pollEvery:e=>`every ${n(e)} s`,session:"Session",user:"User",notSignedIn:"Not signed in",role:"Role",build:"Build",app:"App",userAgent:"UA",pingHint:"Click ↻ to ping now",refresh:"Refresh"},bulkImport:{description:"Paste from spreadsheets, type directly, or upload a CSV. Rows don't need to be in order — they'll be matched. Values not in the list will be added to the end. Fields left blank will not be affected.",lines:e=>`${n(e)} lines`,total:(e,o)=>`${e}: ${o}`,clear:"Clear",upload:"Upload CSV",importLines:e=>`Import ${n(e)} Lines`,importing:"Importing...",importFailed:"Import failed.",enterAtLeastOne:e=>`Enter at least one ${e||"value"}.`,allSkipped:"All rows skipped.",cancel:"Cancel",mapTitle:"Map CSV columns to fields",skip:"— Skip —",columnOption:(e,o)=>`Column ${n(e)} (e.g. ${o})`,rowsDetected:e=>`${n(e)} rows detected`,confirmMapping:"Confirm Mapping",duplicatesTitle:"Duplicate entries detected",duplicatesFound:e=>`${n(e)} ${1===e?"value appears":"values appear"} more than once in your import. Choose how to handle each before proceeding.`,occurrences:e=>`${n(e)} occurrences`,keepFirst:"Keep first",keepLast:"Keep last",keepAll:"Keep all",skipAll:"Skip all",keptDropped:(e,o)=>`${n(e)} kept · ${n(o)} dropped`,proceed:"Proceed",duplicatesMerged:e=>`${n(e)} ${1===e?"value appeared":"values appeared"} more than once. Each is merged into a single line with its quantity summed — review before proceeding.`,mergedFrom:"Merged from",mergedRows:e=>`${n(e)} rows`,mergeSummary:(e,o)=>`${n(e)} duplicate rows → ${n(o)} merged line${1===o?"":"s"}`},preview:{windowTitle:e=>`${e} - Preview`,untitled:"Untitled",open:"Open",formats:"PDF · DXF · 3D · Images",dropHere:e=>`Drop a file here, or click ${e}.`,supportedFormats:"Supported formats",formatPdf:"multi-page document viewer",formatDxf:e=>`vector CAD drawings (optional ${e} peer dep)`,format3d:e=>`3D models (optional ${e} peer dep)`,formatImage:"raster images",dwgNote:"DWG files need to be converted to PDF or DXF first (server-side).",dropToOpen:"Drop to open",dwgUnsupported:"DWG files need server-side conversion. Convert to PDF or DXF first.",unsupportedType:e=>`Unsupported file type: .${e||"unknown"}`,converting:"Converting file",download:"Download",email:"Email",howToNavigate:"How to navigate",stopMeasuring:"Stop measuring (Esc)",scrollToZoom:"Scroll to zoom",closePanel:"Close",annotate:"Annotate",annotateHint:"Annotate this image",view:"View",viewHint:"Back to viewer",copy:"Copy",save:"Save",imageFailed:"Failed to load image.",downloadFailed:"Download failed — couldn't reach the file."},drawing:{loading:"Loading drawing…",notInstalled:"dxf-viewer is not installed in this app.",renderFailed:"Failed to render DXF.",layers:"Layers",layersHint:"Toggle layer visibility",allLayers:"All",noLayers:"None",measure:"Measure",measureHint:"Measure distance — click two points on the drawing, or type DI / DIM below",auto:"Auto",autoHint:"Auto — AutoCAD DIMLINEAR: measures ΔX or ΔY, whichever is larger between the two picks",horizontalHint:"Horizontal — distance along the X axis between two picks (AutoCAD DIMLINEAR horizontal)",verticalHint:"Vertical — distance along the Y axis between two picks (AutoCAD DIMLINEAR vertical)",point:"Point",pointHint:"Point — straight-line (Euclidean) distance between two picks (AutoCAD DIST)",fixX:"fix Δx",fixY:"fix Δy",fixHint:"Lock the second pick's axis coord to first pick + this value (mm). The reported measurement becomes the perpendicular distance.",clearFixed:"Clear fixed distance",horizontalDistance:e=>"Horizontal distance (Δx) between the two picked points"+(e?" — Auto resolved to the X axis":""),verticalDistance:e=>"Vertical distance (Δy) between the two picked points"+(e?" — Auto resolved to the Y axis":""),straightDistance:"Straight-line distance between the two picked points",fit:"Fit",fitHint:"Fit drawing to view",dragToPan:"Drag to pan",fitToReset:"Fit to reset",typeToMeasure:e=>`Type ${e} to measure`,commandPlaceholder:"Type a command — DI, DIM, H, V, Z, LA (? for help)",commandHelp:"Commands: DI distance · DIM/DLI linear dim · H / V force axis · <number> lock Δ · U undo pick · Z fit · LA layers · Esc exit",echoDistance:(e,o,t)=>`Distance = ${e} ΔX = ${o} ΔY = ${t}`,echoLinear:(e,o)=>`Linear dimension = ${e} (${o})`,echoLocked:(e,o,t,i)=>`${e} = ${o} with ${t} locked to ${i}`,axisLocked:(e,o)=>`${e} locked to ${o} — the label shows the perpendicular distance`,fixedCleared:"Fixed distance cleared.",fixedNeedsAxis:"Fixed distances apply in H or V mode — type H or V first.",echoDist:"DIST — click two points; straight-line distance (Esc to exit)",echoDimLinear:"DIMLINEAR — click two points; measures ΔX or ΔY, whichever is larger (H / V to force)",echoHorizontal:"Horizontal — ΔX between the two picks",echoVertical:"Vertical — ΔY between the two picks",echoAuto:"Auto (DIMLINEAR) — measures along the dominant axis of the two picks",measureOn:"Measure on — click two points.",measureOff:"Measure off.",pickRemoved:"Last pick removed.",zoomExtents:"Zoom extents.",layersToggled:"Layer panel toggled.",measurementCleared:"Measurement cleared.",readOnly:e=>`${e} is a drawing command — Preview is a read-only viewer. Measuring: DI, DIM, H, V (? for help)`,unknownCommand:e=>`Unknown command "${e}" — try DI, DIM, H, V, Z, LA (? for help)`,cancelled:"*Cancel*"},model:{loading:"Loading 3D model…",stepNote:"STEP files load OpenCascade WASM (~5 MB) on first use.",notInstalled:"online-3d-viewer is not installed in this app. Add it to enable 3D file viewing.",loadFailed:"Failed to load 3D model.",rootNode:"Root",node:"Node",collapse:"Collapse",expand:"Expand",fitToView:"Fit to view",hide:"Hide",show:"Show",isometric:"ISO",isometricView:"Isometric view",top:"TOP",topView:"Top view",front:"FRT",frontView:"Front view",side:"SDE",sideView:"Side view",perspective:"Perspective",orthographic:"Orthographic",toPerspective:"Switch to perspective view",toOrthographic:"Switch to orthographic view",snapshot:"Save snapshot as PNG",measureHint:"Measure distance — click two points on the model",point:"Point",pointHint:"Point — measure straight-line distance between two picked points",perpendicularHint:"Perpendicular — pick two surfaces and measure the perpendicular gap between them",straightDistance:"Straight-line distance between the two picked points",perpendicularDistance:"Perpendicular distance between the two picked surfaces",meshesHint:"Toggle meshes panel",displayHint:"Toggle display panel",downloadOriginal:"Download original file",meshes:"Meshes",readingModel:"Reading model…",noStructure:"No structure available",allVisible:"All visible",hiddenCount:e=>`${n(e)} hidden`,dragToRotate:"Drag to rotate",rightDragToPan:"Right-click drag to pan",display:"Model Display",backgroundColor:"Background Color",showEdges:"Show Edges",edgeColor:"Edge Color",edgeThreshold:"Edge Threshold",sectionView:"Section View",angle:"Angle",axis:"Axis",flipHint:"Flip section direction",flip:"flip →",flipped:"← flipped",position:"Position",resetDisplay:"Reset to Default"},annotator:{toolSelect:"Select / Move",toolDraw:"Pen / Draw",toolRect:"Rectangle",toolEllipse:"Ellipse",toolArrow:"Arrow",toolMosaic:"Mosaic",toolText:"Text",toolCrop:"Crop",weight:"Weight",radius:"Radius",size:"Size",padding:"Pad",fontSystem:"System",fontSerif:"Serif",fontMono:"Mono",fontCursive:"Cursive",bold:"Bold",boldLetter:"B",italic:"Italic",italicLetter:"I",underline:"Underline",underlineLetter:"U",border:"Border",borderColor:"Text-box border color",addBorder:"Add a border",removeBorder:"Remove border",fill:"Fill",fillColor:"Text-box background color",addFill:"Add a background fill",removeFill:"Remove fill",add:"Add",zoomOut:"Zoom out",zoomIn:"Zoom in",fit:"Fit",fitHint:"Fit to area",undo:"Undo",applyCrop:"Apply Crop",cancel:"Cancel",apply:"Apply",hintSelected:"Drag to move. Drag a corner to resize. Delete / Backspace removes. Click outside to deselect.",hintSelect:"Tap a shape to select. Double-click text to edit.",hintText:"Click to drop a text label.",hintCrop:"Drag a rectangle to set the crop region.",hintDraw:"Drag to draw freehand.",hintShape:"Drag on the image to draw.",textPlaceholder:"Type then Enter…",loadFailed:"Failed to load image",exportFailed:"Failed to export",clipboardUnsupported:"Clipboard images not supported in this browser",copyFailed:"Failed to copy",copied:"Copied to clipboard",copyRefused:"Copy failed (clipboard permission?)"},attachment:{fallbackName:"attachment",noLink:"This attachment has no download link.",spreadsheetFailed:"Could not open the spreadsheet — opening the file instead.",workbookUnavailable:"Spreadsheet preview is unavailable for this file type. Opening the file instead.",noViewer:"Opening this file outside the app — no viewer can show it here.",loading:"LOADING FILE",loadFailed:"Failed to load this file."},aboutApp:{title:e=>`About ${e}`,version:e=>`Version ${e}`,partOf:e=>`Part of the ${e} desktop environment`,shellVersion:e=>`shell v${e}`,spreadsheet:"Multi-sheet spreadsheet editor with CSV / TSV import and export.",notepad:"Color-coded notes with checklists, desktop stickies and entity autolinking.",documents:"Letter-page editor for Word documents and plain-text files — images, lists, alignment.",preview:"Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar.",files:"Personal file manager with folders, uploads, quota, trash and desktop shortcut folders.",browser:"Minimal web browser with bookmarks, history and navigation bar."}}}var c=d(),p=/* @__PURE__ */new Map;var h=a(c),u=a(null),m=/* @__PURE__ */new Set;var g=c,w={};function f(){return g}function $({value:e=w,locale:o,children:t}){const i=n(u),a=r(()=>function(e){if(e)try{return Intl.getCanonicalLocales(e)[0]}catch{return void(m.has(e)||(m.add(e),console.error(`[efficient-shell] ShellStringsProvider: locale="${e}" is not a BCP 47 language tag, so it is ignored and numbers and dates keep their default formatting. Pass a tag such as "de-DE" or "ja".`)))}}(o),[o]),f=void 0===o?i?.locale:a,$=r(()=>{const o=function(e){if(!e)return c;let o=p.get(e);return o||(o=d(e),p.set(e,o)),o}(f),t={};for(const i of Object.keys(o))t[i]={...o[i],...e[i]??{}};return t},[e,f]),v=r(()=>({locale:f}),[f]),y=null!==i;return s(()=>{if(!y)return g=$,()=>{g===$&&(g=c)}},[$,y]),/* @__PURE__ */l(u.Provider,{value:v,children:/* @__PURE__ */l(h.Provider,{value:$,children:t})})}function v(){return n(h)}function y(){return n(u)?.locale}function b(e){const[o="",...t]=e("\0").split("\0");return[o,t.join("")]}export{c as DEFAULT_SHELL_STRINGS,$ as ShellStringsProvider,f as currentShellStrings,b as splitAround,y as useShellLocale,v as useShellStrings};
|
package/dist/chunk-VWBQ2P5G.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import{isStaleChunkError as e,CMD_Z as t,CMD_SHIFT_Z as n,LoadingSpinner as r,Result as o,useIsMobile as i,useShellPrefs as a}from"./chunk-YGC7AX3X.js";import{computeMaximizedBox as l,isSidebarStripReserved as s,boxFillsWorkArea as c,readAlwaysMaximizedFlag as d,WORK_AREA_CHANGED_EVENT as u,useShellAuth as h,scrollerIsFluid as m,growBoxToWidth as p,widthToFit as f,navIcons as w}from"./chunk-DSSLOQDW.js";import{Button_default as y}from"./chunk-OGXU7QFW.js";import{CopyButton as g}from"./chunk-P4CIOJHP.js";import{confirm as b}from"./chunk-IMMHJIV5.js";import{PopupMenu as v,PopupMenuItem as x,PopupMenuDivider as k,PopupMenuLabel as E}from"./chunk-RMJZOKHY.js";import{Z_LAYERS as C,runEscapeInterceptors as M}from"./chunk-X4FJ54PP.js";import{WarningFallback as N,StarFallback as S,BookmarkSquareFallback as L,CheckFallbackB as T,CloseFallback as z,RemoveFallback as A,ExpandFallback as D,WindowFallback as P,ExpandFallbackB as I,GridFallbackC as W,ArrowRightFallbackB as K}from"./chunk-6LTDJKIL.js";import{Icon as O}from"./chunk-XWSWYMGM.js";import{useShellStrings as $}from"./chunk-TNBCUZVE.js";import{createContext as R,useContext as F,Component as q,useLayoutEffect as j,useRef as B,useEffect as H,useState as Y,useSyncExternalStore as X,useCallback as U,isValidElement as J,Fragment as V,Children as _,cloneElement as G,useMemo as Q,useReducer as Z,useId as ee,Suspense as te}from"react";import{jsxs as ne,jsx as re,Fragment as oe}from"react/jsx-runtime";import{createPortal as ie}from"react-dom";import{XMarkIcon as ae}from"@heroicons/react/24/outline";import{useLocation as le}from"react-router-dom";import{useQueryClient as se,useQuery as ce}from"@tanstack/react-query";function de(e){return"component"in e}function ue(e){return"endpoint"in e}var he={};function me(e){he=e}var pe=new Proxy({},{get:(e,t)=>he[t],has:(e,t)=>t in he,ownKeys:()=>Object.keys(he),getOwnPropertyDescriptor(e,t){if(t in he)return{configurable:!0,enumerable:!0,value:he[t]}}}),fe=null;function we(e){fe=e}function ye(){return null!==fe}var ge=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),be=new Proxy({},{get:(e,t)=>fe?fe[t]:"string"==typeof t&&ge.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ve=R(null);function xe(){return F(ve)?.pageSearch??""}var ke=null,Ee=/* @__PURE__ */new Set;function Ce(e){ke!==e&&(ke=e,Ee.forEach(e=>e()))}function Me(){return ke}function Ne(e){return Ee.add(e),()=>{Ee.delete(e)}}function Se({error:t,onReload:n}){const r=e(t);/* @__PURE__ */
|
|
2
|
-
return ne("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
-
/* @__PURE__ */re(O,{name:"warning",fallback:N,className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
-
/* @__PURE__ */ne("div",{className:"min-w-0",children:[
|
|
5
|
-
/* @__PURE__ */re("p",{className:"text-sm font-medium text-gray-700",children:r?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
|
-
/* @__PURE__ */re("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:r?"A new version was deployed while this tab was open. Reload the page to pick it up.":t.message||String(t)})]}),
|
|
7
|
-
/* @__PURE__ */re("button",{type:"button",onClick:r?()=>window.location.reload():n,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:r?"Reload page":"Reload window"})]})}var Le=class extends q{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */re(Se,{error:e,onReload:this.reset}):this.props.children}},Te=R(null),ze="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ae({className:e="",auto:r=!1}){const o=F(Te),i=$().undo,a=o?.claimOwnMount;if(j(()=>{if(!r&&a)return a(!0),()=>a(!1)},[r,a]),!o||!o.enabled)return null;const{undo:l,redo:s,canUndo:c,canRedo:d,undoLabel:u,redoLabel:h}=o;/* @__PURE__ */
|
|
8
|
-
return ne("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":r?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */re("button",{type:"button",onClick:l,disabled:!c,title:c?i.undoStep(u??"",t):i.nothingToUndo,className:ze,children:i.undo}),
|
|
10
|
-
/* @__PURE__ */re("button",{type:"button",onClick:s,disabled:!d,title:d?i.redoStep(h??"",n):i.nothingToRedo,className:ze,children:i.redo})]})}var De=/* @__PURE__ */new Set([408,429]);function Pe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ie(e){const t=Pe(e);return null!=t&&(t>=400&&t<500&&!De.has(t))}function We(e,t){return!Ie(t)&&e<3}function Ke(){const e=$().loading;/* @__PURE__ */
|
|
11
|
-
return re("div",{className:"flex items-center justify-center p-8 text-sm text-gray-400",children:e.label})}var Oe="flex-1 min-h-0";function $e(){const e=$().record;/* @__PURE__ */
|
|
12
|
-
return re(r,{label:e.loading,padding:"",className:Oe})}function Re(e){return e??void 0}function Fe({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:i}){const a=$().record;if(t||e&&n)/* @__PURE__ */return re($e,{});if(r){const e=Pe(r);if(401===e)/* @__PURE__ */
|
|
13
|
-
return re(o,{status:"warning",title:a.signInRequired,subTitle:a.signInBody,className:Oe});if(403===e)/* @__PURE__ */
|
|
14
|
-
return re(o,{status:"403",className:Oe});if(404===e||410===e)/* @__PURE__ */
|
|
15
|
-
return re(o,{status:"404",title:a.notFound,className:Oe});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
16
|
-
return re(o,{status:"500",title:a.loadFailed,subTitle:t?a.checkConnection:a.rejected,extra:t?/* @__PURE__ */re(y,{variant:"secondary",size:"sm",onClick:i,children:a.retry}):void 0,className:Oe})}/* @__PURE__ */
|
|
17
|
-
return re(o,{status:"404",title:a.notFound,className:Oe})}function qe({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */re(oe,{children:t(e)}):/* @__PURE__ */re(Fe,{...n})}var je=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Be(e){return"string"==typeof e&&(e.startsWith("new-")||je.test(e))}function He(e){if(Be(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ye=R({openWindows:[],openEntity:()=>{},openPage:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Xe=R(null);function Ue(e){const t=F(Xe),n=B(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),j(()=>{if(t)return t(n.current,e)},[t,e]),H(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Je(){const e=B(/* @__PURE__ */new Map),[t,n]=Y(!1);return{dirty:t,registerDirty:U((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function Ve(){return F(Ye)}function _e(e){if("page"!==e.type&&He(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function Ge({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Je(),i=pe[e.route];if(!i||!de(i))return null;const a=i,l=a.component;/* @__PURE__ */
|
|
18
|
-
return re($r,{open:!0,onClose:t,icon:w[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */re(Xe.Provider,{value:o,children:/* @__PURE__ */re(te,{fallback:/* @__PURE__ */re("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */re(Ke,{})}),children:/* @__PURE__ */re(l,{})})})})}function Qe({entityType:e,entityId:t,label:n}){const r=$(),o=se(),{data:i}=ce({queryKey:["my-profile-sidebar"],enabled:ye(),queryFn:()=>be.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],l=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
|
|
19
|
-
return re("button",{onClick:()=>{const r=l?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];be.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:l?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(l?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */re(O,{name:"star",fallback:S,className:"h-4 w-4",fill:l?"currentColor":"none",strokeWidth:1.5})})}var Ze=/* @__PURE__ */new Set;function et({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=pe[e.entityType];if(!o||!ue(o))return null;const i=o,[a,l]=Y(!1),{dirty:s,registerDirty:c}=Je(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,u=e.entitySnapshot?._duplicate,h=Be(e.entityId),m=!i.selfFetching&&!u&&!h&&ye(),p=ce({queryKey:[d,e.entityId],queryFn:()=>{return be.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Re(e.entitySnapshot),initialDataUpdatedAt:0,enabled:m,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Ie(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:We}),f=p.data,y=p.refetch;H(()=>{var t;if(m)return t=t=>{t!==e.id||Ze.has(t)||y({cancelRefetch:!1})},jn.add(t),()=>{jn.delete(t)}},[y,e.id,m]);const g=U(()=>{a&&!s?l(!1):t()},[a,s,t]),b=i.selfFetching?e.label:f?i.title(f,a,l):e.label,v=i.icon,x=v?w[v]:null,k=b,E=!i.selfFetching&&f&&i.footer&&!u?i.footer(f):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */re(te,{fallback:/* @__PURE__ */re(Ke,{}),children:i.render(f??e.entitySnapshot,t,e.entityId,a,l)}):null!=f?/* @__PURE__ */re(te,{fallback:/* @__PURE__ */re($r,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */re($e,{})}),children:i.render(f,t,e.entityId,a,l)}):/* @__PURE__ */re($r,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */re(Fe,{isPending:p.isPending,isFetching:p.isFetching,enabled:m,error:p.error,onRetry:y})}):/* @__PURE__ */re($r,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:x,title:k,footer:E,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:s,editing:a||h||u,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */re(Xe.Provider,{value:c,children:/* @__PURE__ */re(te,{fallback:/* @__PURE__ */re($e,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,l):/* @__PURE__ */re(qe,{entity:f,isPending:p.isPending,isFetching:p.isFetching,enabled:m,error:p.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,l)})})})})}function tt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function nt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function rt(e){const t=tt(e),n=t??nt(e);if(!n)return;if(t&&!er(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Bn(o)}function ot(e){if("page"!==e.type)return!0;const t=e.route?pe[e.route]:void 0;if(!t||!de(t))return!0;const n=t;return!n.widget&&!n.utility}function it(){const e=pr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var at=/* @__PURE__ */new Map;function lt(){const e=it();if(e)return at.get(e)}function st(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var ct="rosh-peek-style";function dt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(ct))return;const e=document.createElement("style");e.id=ct,e.textContent="body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:249!important}html.rosh-reduce-transparency body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.92}@media (prefers-reduced-motion:reduce){body.rosh-peeking [data-modal-panel]{transition:none}}",document.head.appendChild(e)}(),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")),e&&e.setAttribute("data-peek-focus",""),document.body.classList.toggle("rosh-peeking",!!e))}function ut(){"undefined"!=typeof document&&(document.body.classList.remove("rosh-peeking"),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")))}function ht({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const l=$(),s=B(null),[c,d]=Y({w:n,h:Math.round(.75*r)}),[u,h]=Y(!1);return j(()=>{const o=s.current;if(!o)return;const i=tt(e)??st(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const l=Math.min(n/a.width,r/a.height),c=Math.max(80,Math.round(a.width*l)),u=Math.max(60,Math.round(a.height*l));d({w:c,h:u}),h(!0);const m=i.cloneNode(!0);return m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px",m.style.transform=`scale(${l})`,m.style.transformOrigin="top left",m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */ne("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-md cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
20
|
-
/* @__PURE__ */re("div",{ref:s,className:"absolute inset-0 z-0 overflow-hidden"}),!u&&/* @__PURE__ */ne("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
21
|
-
/* @__PURE__ */re(O,{name:"window",fallback:P,className:"h-6 w-6",strokeWidth:1.5}),
|
|
22
|
-
/* @__PURE__ */re("span",{className:"mt-1 text-[10px] uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */re("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-[10px] font-medium text-white bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */re("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-white flex items-center justify-center",title:l.taskbar.closeWindow,children:/* @__PURE__ */re(O,{name:"close",fallback:z,className:"h-3 w-3",strokeWidth:3})})]})}function mt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=$(),l=e.length>1,s=B(null),[c,d]=Y({left:-9999,top:-9999,ready:!1}),[u,h]=Y(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");j(()=>{const e=s.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),d({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),H(()=>ut,[]);const m="top"===u,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-[11px] font-medium text-gray-900 bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return ie(
|
|
23
|
-
/* @__PURE__ */re("div",{ref:s,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:300,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:l?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{ut(),i()},children:e.map(e=>{const t=tt(e.id)??st(e.label),o=t?function(e){if(er(e))return null;const t=e.getBoundingClientRect(),n=Jn(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
24
|
-
return ne("div",{className:"group flex flex-col items-center",onMouseEnter:()=>dt(t),children:[!m&&/* @__PURE__ */re("span",{className:p,children:e.label}),
|
|
25
|
-
/* @__PURE__ */re(ht,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */re("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */ne("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-1.5 py-0.5 text-[10px] font-semibold text-white shadow-sm",children:[
|
|
26
|
-
/* @__PURE__ */re(O,{name:"arrow-right",fallback:K,className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function pt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function ft({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=$(),[a,l]=Y(null);H(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return l(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const s=X(fr,pr),[,c]=Y(0);H(()=>{const e=()=>c(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=Y(0);H(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const u=e=>{const t=st(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[h,m]=Y(null),[p,f]=Y(null),[y,g]=Y(null),b=B(null),C=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{m(null),f(null)},150)},M=e.filter(e=>!e.route||!pe[e.route]?.utility);if(!a||!a.isConnected||0===M.length)return null;const N=[],S=/* @__PURE__ */new Map;for(const e of M){const t=e.route?pe[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=S.get(r);if(void 0!==o)N[o].items.push(e);else{S.set(r,N.length);const o=n?.label??t?.label??e.label;N.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return ie(
|
|
27
|
-
/* @__PURE__ */ne(oe,{children:[N.map(e=>{const n=e.route?w[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(s){const t=document.querySelector(`[data-modal-id="${s}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const l=e.items.length>1,c=e.items.some(e=>{const t=tt(e.id)??st(e.label);return!!t&&!er(t)});/* @__PURE__ */
|
|
28
|
-
return ne("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{m(n),f(r)},350)));var n,r},onMouseLeave:C,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),m(null),f(null),l?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-1.5 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&J(n)?G(n,{className:"h-3.5 w-3.5 shrink-0 "+(a?"text-blue-600":"text-gray-400")}):/* @__PURE__ */re(O,{name:"expand",fallback:I,className:"h-3.5 w-3.5 shrink-0 "+(a?"text-blue-600":"text-gray-400"),strokeWidth:2}),
|
|
29
|
-
/* @__PURE__ */re("span",{className:"truncate flex-1",children:l?e.label:u(r.label)}),c&&/* @__PURE__ */re("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),l&&/* @__PURE__ */re("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-blue-500/80 text-white text-[10px] font-bold leading-none",children:e.items.length}),!l&&/* @__PURE__ */re("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */re(O,{name:"close",fallback:z,className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
30
|
-
/* @__PURE__ */re("div",{className:"flex-1"}),M.length>=2&&/* @__PURE__ */ne("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium text-blue-600 border border-blue-300 hover:bg-blue-50 transition-colors shrink-0",children:[
|
|
31
|
-
/* @__PURE__ */re(O,{name:"grid",fallback:W,className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */ne(v,{portal:!0,minWidth:200,style:pt(y.x,y.y),onClose:()=>g(null),children:[
|
|
32
|
-
/* @__PURE__ */re(E,{children:y.label}),
|
|
33
|
-
/* @__PURE__ */ne(x,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=zn.get(e);t&&Hn(t)}(e.id))},children:[
|
|
34
|
-
/* @__PURE__ */re(O,{name:"remove",fallback:A,className:"h-4 w-4 text-gray-400",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
35
|
-
/* @__PURE__ */ne(x,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
|
|
36
|
-
/* @__PURE__ */re("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */re("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
37
|
-
/* @__PURE__ */re(k,{}),
|
|
38
|
-
/* @__PURE__ */ne(x,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
39
|
-
/* @__PURE__ */re(O,{name:"close",fallback:z,className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),h&&p&&/* @__PURE__ */re(mt,{items:h,anchorEl:p,onActivate:e=>{o(e),m(null),f(null)},onClose:e=>{t(e),m(null),f(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:C})]}),a)}var wt=["/login","/forgot-password","/reset-password","/force-change-password"];function yt({children:e,windowAccentForRoute:t}){const n=le(),r=wt.some(e=>n.pathname.startsWith(e)),[o,i]=Y([]),a=B(o);j(()=>{a.current=o},[o]);const l=X(Ne,Me,Me),s=B(/* @__PURE__ */new Map),c=e=>{const t=ot(e),n=!!l&&"page"===e.type&&e.route===l,r=e.pageSearch||void 0,o=s.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return s.current.set(e.id,i),i};H(()=>{at.clear();for(const e of o)e.route&&at.set(e.id,e.route)},[o]);const d=U(e=>{i(t=>t.filter(t=>t.id!==e))},[]),u=U(e=>{var t;tt(e)||nt(e)?(t=e,window.dispatchEvent(new CustomEvent(wr,{detail:{windowKey:t}}))):d(e)},[d]),h=(e,t=!1)=>{const n=Mn;t&&Ze.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(Nn.get(i)??-1)>a)||Bn(o),t&&Ze.delete(e)},50)},m=U((e,t,n,r,o)=>{if(!pe[e]||!ue(pe[e]))return;const a=`${e}:${t}`,l=it();i(i=>{const s=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return s?(h(s.id),i):(h(a,!0),[...i,{id:a,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Re(n),openedFrom:l}])})},[]),p=U((e,t={})=>{if(!pe[e]||!de(pe[e]))return;const n=pe[e],{reuse:r=!1,background:o=!1,shellOwned:l,search:s}=t,c=e=>{var t;o?(t=e,Wn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void u(t.id)}const d=it();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!s&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...l?{shellOwned:l}:{},...s?{pageSearch:s}:{}}]}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),s&&i.pageSearch!==s?t.map(e=>e===i?{...e,pageSearch:s}:e):t);const a=`page:${e}`;return c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...l?{shellOwned:l}:{},...s?{pageSearch:s}:{}}]})},[u]),f=U(()=>{},[]),w=U(()=>{},[]),y=u,g=u;/* @__PURE__ */
|
|
40
|
-
return ne(Ye.Provider,{value:{openWindows:o,openEntity:m,openPage:p,closeEntity:y,minimize:f,items:[],openItems:o,restore:w,remove:g,restoreIfMinimized:()=>!1},children:[e,
|
|
41
|
-
/* @__PURE__ */re(ft,{openWindows:o,onRemove:u,onSplitView:Kr,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&Bn(e)}})},onActivateById:rt}),
|
|
42
|
-
/* @__PURE__ */re(Or,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
return re(ve.Provider,{value:c(e),children:/* @__PURE__ */re(Le,{fallback:(t,n)=>/* @__PURE__ */re($r,{open:!0,onClose:()=>d(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */re(Se,{error:t,onReload:n})}),children:/* @__PURE__ */re(Bt,{spec:_e(e),children:/* @__PURE__ */re(Yr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */re(Ge,{item:e,onClose:()=>d(e.id),accentRgb:n}):/* @__PURE__ */re(et,{item:e,onClose:()=>d(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var gt=null,bt=/* @__PURE__ */new Set;function vt(){return gt}function xt(e){if(gt!==e){gt=e;for(const e of bt)e()}}function kt(e){return bt.add(e),()=>{bt.delete(e)}}var Et=!1,Ct={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Mt=()=>{};function Nt(e){Et=e,Ct={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function St(e,t){Et&&("submenu"===e?Ct.submenus++:Ct.menus++,Ct.menuKey=t)}function Lt(e){if(!Et)return Mt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Et)return;const r=performance.now()-t;"move"===e?Ct.moveMs+=r:Ct.resizeMs+=r}}function Tt(){const e=Ct;return Ct={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var zt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),At=/* @__PURE__ */new Set(["svg"]);function Dt(e){const t=[],n={text:"",accessories:[]};return Pt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Pt(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>Pt(e,t,n));if(!J(e))return;const r=e;if(r.type!==g)if(r.type!==V){if("string"==typeof r.type){if(At.has(r.type))return;if(!zt.has(r.type))return n.push(" "),_.toArray(r.props.children).forEach(e=>Pt(e,t,n)),void n.push(" ")}t.accessories.push(G(r,{key:`title-part-${t.accessories.length}`}))}else _.toArray(r.props.children).forEach(e=>Pt(e,t,n));else void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text)}var It=/* @__PURE__ */new Map,Wt=/* @__PURE__ */new Set,Kt=0;function Ot(){Kt++,Wt.forEach(e=>e())}function $t(e){return It.get(e)}function Rt(e){return Wt.add(e),()=>{Wt.delete(e)}}function Ft(){return Kt}var qt=R(""),jt=R(null);function Bt({spec:e,children:t}){/* @__PURE__ */
|
|
45
|
-
return re(jt.Provider,{value:e,children:t})}var Ht=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Yt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Xt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Ut(e){return Jt(e).replace(/\s+/g," ").trim()}function Jt(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(Jt).join("");if(J(e)){const t=e,n="string"==typeof t.type?t.type:"";return Ht.has(n)?"":` ${Jt(t.props?.children)} `}return""}function Vt(e){const t=F(qt);H(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var _t={};function Gt(e,t,n){const r=F(qt);H(()=>{if(!r)return;_t[r]||(_t[r]=[]);const o={label:e,icon:n,onClick:t};return _t[r].push(o),()=>{_t[r]=(_t[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Qt({title:e}){const t=B(null);return H(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */re("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function Zt(e){}var en=R(null);function tn(){return F(qt)}function nn(){const e=X(fr,pr),t=F(en);return t?.active??(kn.length<=1||null!=e)}function rn({children:e,position:t="right",quiet:n=!1}){const r=F(en),[o,i]=Y(null);return H(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),l=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(l)}},[r,t,n]),o?ie(e,o):null}function on({onClick:e,children:t,className:n}){const r=F(en);/* @__PURE__ */
|
|
46
|
-
return re("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./ConfirmDialog-XOYCYFA7.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var an="erp_window_positions",ln={};try{const e=localStorage.getItem(an);e&&(ln=JSON.parse(e))}catch{}var sn=null;function cn(){sn&&clearTimeout(sn),sn=setTimeout(()=>{try{localStorage.setItem(an,JSON.stringify(ln))}catch{}},500)}var dn="erp_activation_order",un=[];try{const e=localStorage.getItem(dn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(un=t)}catch{}var hn=null;function mn(){hn&&clearTimeout(hn),hn=setTimeout(()=>{try{localStorage.setItem(dn,JSON.stringify(un))}catch{}},500)}function pn(e,t){ln[e]||(ln[e]=t,cn())}function fn(e){return ln[e]?{...ln[e]}:null}function wn(e,t){ln[e]=t,cn()}function yn(){const e=l(),t=s();let n=!1;for(const r of Object.keys(ln))c(ln[r],e,t)&&(delete ln[r],n=!0);n&&cn()}var gn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},bn=4e3,vn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},xn={small:.8,medium:1,large:1.25,maximized:1.25},kn=[],En=/* @__PURE__ */new Set,Cn=/* @__PURE__ */new Set,Mn=0,Nn=/* @__PURE__ */new Map;var Sn=0;function Ln(){return Sn}function Tn(){Sn++,En.forEach(e=>e())}var zn=/* @__PURE__ */new Map,An=/* @__PURE__ */new Map,Dn=/* @__PURE__ */new Map;function Pn(){for(let e=kn.length-1;e>=0;e--){const t=Dn.get(kn[e]);if(t?.tab)return t.owner}return null}function In(){return X(fr,Pn,()=>null)}var Wn=/* @__PURE__ */new Set;var Kn=null;function On(e){Kn=null,Bn(e)}function $n(e){Kn=e;const t=zn.get(e);t&&On(t)}function Rn(e){Kn===e&&(Kn=null)}function Fn(e,t,n){if(n&&Dn.set(e,n),t)if(zn.set(t,e),An.set(e,t),Wn.delete(t)){kn.unshift(e);const n=un.indexOf(t);-1!==n&&un.splice(n,1),un.unshift(t),mn()}else!function(e,t){const n=un.indexOf(t);if(-1===n)return void kn.push(e);let r=kn.length;for(let e=0;e<kn.length;e++){const t=An.get(kn[e]);if(t&&un.indexOf(t)>n){r=e;break}}kn.splice(r,0,e)}(e,t),-1===un.indexOf(t)&&(un.push(t),mn());else kn.push(e);Tn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Kn===t&&On(e)}function qn(e){return e?Dn.get(e)?.owner??An.get(e)??null:null}var jn=/* @__PURE__ */new Set;function Bn(e){const t=qn(pr()),n=kn.indexOf(e);-1!==n&&kn.splice(n,1),kn.push(e);const r=Dn.get(e);if(r?.root&&r.tab&&d()){const e=kn.filter(e=>{const t=Dn.get(e);return!!t&&!t.root&&t.owner===r.owner});for(const t of e)kn.splice(kn.indexOf(t),1),kn.push(t)}Cn.delete(e);const o=An.get(e);if(o){const e=un.indexOf(o);-1!==e&&un.splice(e,1),un.push(o),mn(),Kn&&Kn!==o&&(Kn=null)}Tn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=qn(pr());i&&i!==t&&jn.forEach(e=>e(i))}function Hn(e){const t=kn.indexOf(e);-1!==t&&kn.splice(t,1),Cn.add(e),Nn.set(e,++Mn);const n=An.get(e);if(n){const e=un.indexOf(n);-1!==e&&(un.splice(e,1),mn())}Tn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var Yn=/* @__PURE__ */new Set;var Xn=8,Un=32;function Jn(){return l()}var Vn=40,_n=80,Gn=384,Qn=400;function Zn(e,t=Jn()){const n=Math.min(Math.max(e.x,t.x+_n-e.w),t.x+t.w-_n),r=Math.min(Math.max(e.y,t.y),t.y+t.h-Vn);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function er(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Jn();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function tr(e){const t=Jn(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var nr=null;function rr(e){const t=(nr||((nr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none","z-index: 40","border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(nr)),nr);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function or(){nr&&(nr.style.opacity="0",nr.style.display="none")}var ir=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],ar=350,lr=200;function sr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=Y(!1),l=B(void 0),s=B(void 0);H(()=>()=>{clearTimeout(l.current),clearTimeout(s.current)},[]);const c=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!0),ar)},d=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!1),lr)};/* @__PURE__ */
|
|
47
|
-
return ne("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:d,children:[
|
|
48
|
-
/* @__PURE__ */re("button",{onClick:t,onFocus:c,onBlur:d,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */re("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(s.current),onMouseLeave:d,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-gray-200 bg-white p-1.5 shadow-lg",children:ir.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */re("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(s.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */re("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var cr="rosh-gesture-style";var dr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},ur=4;function hr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(cr))return;const e=document.createElement("style");e.id=cr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=Lt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function mr(e){const t=kn.indexOf(e);if(-1===t)return-1;const n=C.window+t*C.windowStep,r=Dn.get(e);if(!r||r.root||!r.tab||!d())return n;let o=-1;for(const[e,t]of Dn){if(!t.root||t.owner!==r.owner)continue;const n=kn.indexOf(e);-1!==n&&(o=Math.max(o,C.window+n*C.windowStep))}return o>=n?o+2+Math.min(t,7):n}function pr(){return kn[kn.length-1]||null}function fr(e){return En.add(e),()=>{En.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=kn.length-1;e>=0;e--)Yn.has(kn[e])||kn.splice(e,1);un=un.filter(e=>{const t=zn.get(e);return null!=t&&Yn.has(t)}),mn(),Tn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var wr="modal-close-request";function yr(e){X(fr,Ln);const t=F(en);if(kn.length<=1)return!0;if(e){const t=zn.get(e);if(null!=t)return pr()===t}return t?.active??null!=pr()}var gr=!1,br=/* @__PURE__ */new Set;function vr(e){return br.add(e),()=>br.delete(e)}function xr(){return gr}function kr(e){gr!==e&&(gr=e,br.forEach(e=>e()))}function Er(){kr(!gr)}function Cr(){kr(!1)}var Mr=null,Nr=/* @__PURE__ */new Set;function Sr(e){return Nr.add(e),()=>Nr.delete(e)}function Lr(){return Mr}function Tr(e){Mr!==e&&(Mr=e,Nr.forEach(e=>e()))}var zr=null,Ar=/* @__PURE__ */new Set;function Dr(e){return Ar.add(e),()=>Ar.delete(e)}function Pr(){return zr}function Ir(e){zr!==e&&(zr=e,Ar.forEach(e=>e()))}function Wr(){if(!zr)return void kr(!1);Tr(zr),Ir(null),kr(!1)}function Kr(){kr(!gr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Or(){const e=X(vr,xr),[t,n]=Y(e),[r,o]=Y(e);return H(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?ie(
|
|
49
|
-
/* @__PURE__ */re("div",{onMouseDown:e=>{e.stopPropagation(),kr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:2e3,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function $r({open:e,onClose:t,title:n,icon:r,copyText:o,size:s="lg",dirty:h=!1,onNext:w,onPrev:y,footer:g,bodyScroll:E,onMinimize:N,initialBox:I,actions:W,actionsLeft:K,editing:R=!1,allowPinOnTop:q,initialPosition:V,widget:_,compact:Z,appStyle:ee,flushBody:te,autoHeight:le,autoMinHeight:se,autoWidth:ce,widgetMenu:de,dimensions:ue,windowKey:he,openedFromKey:me,accentRgb:pe,children:fe}){const we=i(),[ye,ge]=Y(0),[be,xe]=Y(!1),ke=B(null),Ee=B(0);H(()=>{Ee.current=ye},[ye]);const Ce=U(e=>{we&&(ke.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},xe(!0),xt(me??null))},[we,me]),Me=X(kt,vt);H(()=>{if(!be)return;const e=e=>{if(!ke.current)return;const t=e.clientX-ke.current.startX;if(Math.abs(e.clientY-ke.current.startY)>Math.abs(t)+12)return ke.current=null,xe(!1),ge(0),void xt(null);ge(Math.max(0,t))},n=()=>{if(!ke.current)return;const e=.3*window.innerWidth,n=Ee.current>e;ke.current=null,xe(!1),n?(ge(window.innerWidth),setTimeout(()=>{t(),ge(0),xt(null)},180)):(ge(0),xt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n)}},[be]);const[Ne,Se]=Y(n),ze=$(),De=ze.window;H(()=>{Se(n)},[n]);const Pe=Q(()=>Ut(Ne).trim()||void 0,[Ne]),[Ie,We]=Y(!1),Ke=B(!1),[Oe,$e]=Y(!1),[Re,Fe]=Y(null),qe=F(jt),je=F(ve),{prefs:Be,save:He}=a(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Je=!!qe&&Xe.some(e=>e.entityType===qe.entityType&&e.entityId===qe.entityId),_e=U(()=>{if(!qe)return;const e=Je?Xe.filter(e=>!(e.entityType===qe.entityType&&e.entityId===qe.entityId)):[...Xe,{entityType:qe.entityType,entityId:qe.entityId,label:qe.label}];He({favorite_documents:e})},[qe,Je,Xe,He]),[Ge,Qe]=Y(null),[Ze,et]=Y("top-right"===V?"right":"left"),tt=B(!1),nt=B(null);j(()=>{const e=nt.current;e&&(pe?e.style.setProperty("--window-accent-rgb",pe):e.style.removeProperty("--window-accent-rgb"))},[pe]);const rt=B(!1),ot=B(null),it=B(null),at=B(null),[lt,st]=Y(!1),ct=B(null),dt=!!(g||W||K)||lt,ut=F(Te),ht=""!==F(qt),mt=B(null);mt.current=je?{owner:je.key,tab:je.tab,root:!ht}:null;const pt=he||(je&&!ht?je.key:null),ft=!!ut&&!ht&&ut.enabled&&ut.hasState&&(R||ut.declaredEditable)&&!ut.handMounted&&dt&&!_&&!Z&&!ee&&!we,wt=/* @__PURE__ */re(O,{name:"window",fallback:P,className:"h-4 w-4 text-gray-400",strokeWidth:1.5}),yt=r&&J(r)?G(r,{className:`h-4 w-4 ${r.props?.className??""}`.trim()}):r??wt,gt=()=>/* @__PURE__ */re("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Fe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:yt}),bt=40,{minimize:Et,items:Ct,restoreIfMinimized:Mt,openWindows:Nt}=Ve(),St=B(`modal-${Math.random().toString(36).slice(2,8)}`).current;H(()=>{if(_)return Yn.add(St),()=>{Yn.delete(St)}},[_,St]),H(()=>{const e=e=>{const t=e.detail;t?.id===St&&Se(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[St]);const[Lt,Tt]=Y(C.window),zt=function(e){const t=X(fr,pr);return kn.length<=1||t===e}(St),At=function(e){return X(fr,()=>Cn.has(e))}(St),Pt=X(vr,xr),Wt=X(Sr,Lr),Kt=X(Dr,Pr),$t=!q&&!_,Rt=Pt&&$t,[Ft,Bt]=Y(!1),Ht=Rt&&Kt===St,[Jt,Vt]=Y(!1),Gt=Jt&&$t&&Wt===St?"picked":null,Qt=B(Rt);H(()=>{if(Qt.current&&!Rt){Vt(!0);const e=setTimeout(()=>{Vt(!1),Mr===St&&Tr(null)},700);return Qt.current=Rt,()=>clearTimeout(e)}Qt.current=Rt},[Rt,St]),H(()=>{Rt||Bt(!1)},[Rt]),H(()=>{const e=it.current,t=at.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>st(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[e]),H(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&nt.current){const t=nt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=it.current,n=at.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[e]);const Zt=B(!1),tn=U(l,[]),nn=U(()=>{const e=l(),t=ue?ue[0]:gn[s]||672,n=e.w-80,r=e.h-80,o=Math.min(t,n),i=xn[vn()],a=ue?Math.min(ue[1],r):(()=>{const t=("sm"===s?500:"md"===s?600:"lg"===s?700:"xl"===s?800:920)*i;return Math.max(320,Math.min(t,e.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||d()?0:30*(kn.length-1),u=Math.max(bt,(r-a)/2),h=(n-o)/2,m=e.h-bt-a-u;return"top-right"===V?{x:e.x+e.w-o-bt,y:e.y+bt,w:o,h:a}:"top-left"===V?{x:e.x+bt,y:e.y+bt,w:o,h:a}:{x:e.x+Math.max(bt,(n-o)/2+bt)+Math.min(c,Math.max(0,h)),y:e.y+u+Math.min(c,Math.max(0,m)),w:o,h:a}},[s]),rn=B(!1);e||(rn.current=!1);const on=he||o||null;H(()=>{if(!e)return;Fn(St,on,mt.current??void 0),he||Bn(St),Zt.current=!1,Tt(mr(St));const t=()=>{Tt(mr(St))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===he;if(!e.label)return!1;const t=nt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Bn(St),Mn.current)return;const t=Jn(),n=Math.min(Kn.current.w,t.w-40),o=Math.min(Kn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;dn({x:i,y:a,w:n,h:o}),Wn(!1)},i=e=>{const t=e.detail;r(t)&&(Bn(St),Fe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==he)return;Bn(St);const t=Kn.current,n=function(e,t=Jn()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=nt.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}dn(n)};return window.addEventListener("modal-reorder",t),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=kn.indexOf(e);-1!==t&&(kn.splice(t,1),Tn()),Cn.delete(e),Nn.delete(e),Dn.delete(e);const n=An.get(e);n&&(An.delete(e),zn.delete(n))}(St),window.removeEventListener("modal-reorder",t),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[e,St,on,tn]);const an=!_&&"maximized"===vn(),[sn,dn]=Y(()=>{if(on&&ln[on]){const e={...ln[on]};return ue&&(e.w=ue[0],le||(e.h=ue[1])),Zn(e)}return I?{x:I.x,y:I.y,w:I.w,h:I.h}:an?tn():nn()}),[un,hn]=Y(()=>!le),[mn,pn]=Y(()=>d()),fn=B(mn),wn=B(null);H(()=>{const e=()=>{const e=d();e!==fn.current&&wn.current?.(e),fn.current=e,pn(e),Tt(mr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const yn=mn&&!!je?.tab&&!ht&&!_&&!we,En=yn,Mn=B(En);Mn.current=En;const Sn=In(),Ln=mn&&!!je?.tab&&!_&&!we&&!Pt&&Sn!==je.key,[Pn,Wn]=Y(()=>on&&ln[on]||I?En:En||an),Kn=B(sn);Kn.current=sn;const On=B(Pn);j(()=>{On.current=Pn},[Pn]),j(()=>{if(un||yn)return;const e=nt.current,t=ot.current;if(!e||!t)return;const n=se??(_?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const l=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&s.unobserve(a),s.observe(c),a=c);const d=e.offsetHeight-t.offsetHeight,u=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=u,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Kn.current.y)-24),g=w?Math.min(Kn.current.h,y):Math.min(Math.max(n,d+p),y),b=Math.abs(g-o)>1;b&&(o=g,dn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),_||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;l(),o===e&&hn(!0)},160)))},s=new ResizeObserver(l);l(),ct.current&&s.observe(ct.current);const c=new MutationObserver(l);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{s.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[un,_,se,dt,yn]),j(()=>{if(!le||!un||_||!e)return;const t=ct.current;if(!t)return;let n=t.offsetHeight;const r=new ResizeObserver(()=>{if(!t.isConnected)return;const e=t.offsetHeight,r=e-n,o=e>0!=n>0;if(n=e,!o||0===r||Pn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,l=Math.max(i,window.innerHeight-a-Math.max(0,Kn.current.y)-24);dn(e=>({...e,h:Math.min(Math.max(i,e.h+r),l)}))});return r.observe(t),()=>r.disconnect()},[le,un,_,e,Pn,se]);const $n=!1!==ce&&!_&&!ee&&!we,[Rn,qn]=Y(()=>!$n);j(()=>{if(Rn||!e)return;if(!$n||Pn)return void qn(!0);const t=nt.current,n=ot.current;if(!t||!n)return;const r=/* @__PURE__ */new WeakSet;let o=Kn.current.w,i=0;const a=()=>qn(!0),s=()=>{i=0;const e=Kn.current;if(Math.abs(e.w-o)>1||document.body.classList.contains("rosh-gesturing"))return void a();const s=l(),c=s.w-80;if(e.w>=c)return void a();const d=[],u=[];for(const e of[n,...Array.from(n.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||r.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(d.push(e),u.push(t))}if(!d.length)return;const h=Math.min(c,e.w+Math.max(...u)),w=h-e.w,y=t.style.width;t.style.width=`${h}px`;const g=d.map((e,t)=>({over:u[t],residual:e.scrollWidth-e.clientWidth}));t.style.width=y,g.forEach((e,t)=>{m(e,w)||r.add(d[t])});const b=p(e,f(e.w,w,g),s,bt);b!==e&&(o=b.w,dn(b))};s();const c=new MutationObserver(()=>{i||(i=requestAnimationFrame(s))});c.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const d=setTimeout(a,bn);return()=>{c.disconnect(),i&&cancelAnimationFrame(i),clearTimeout(d)}},[Rn,e,$n,Pn]);const jn=B(null),Vn=!(!je?.tab||ht||_||we);wn.current=e=>{if(!Vn)return;if(e)return jn.current||(jn.current={box:{...Kn.current},maximized:On.current}),void(On.current=!0);const t=jn.current;jn.current=null;const n=l();if(t?.maximized)return On.current=!0,Wn(!0),void dn(n);const r=t?.box??(on?ln[on]:void 0);if(On.current=!1,Wn(!1),r&&!c(r,n,!1)){const e={...r};ue&&(e.w=ue[0],le||(e.h=ue[1])),dn(Zn(e))}else dn(nn())},H(()=>{En&&(On.current=!0,Wn(!0),dn(tn()))},[En,tn]),H(()=>{if(_)return;const e=()=>{const e=on?ln[on]:void 0;if(On.current=!1,Wn(!1),e){const t={...e};ue&&(t.w=ue[0],le||(t.h=ue[1])),dn(Zn(t))}else dn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[_,nn,on]),H(()=>{e&&on&&!yn&&(ln[on]=sn,cn()),e&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,e,on,yn]),H(()=>{if(!e)return;const t=()=>{On.current?dn(tn()):document.body.classList.contains("rosh-gesturing")||dn(Zn)};window.addEventListener("resize",t),window.addEventListener(u,t);let n=null;return Pn&&(n=new MutationObserver(t),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",t),window.removeEventListener(u,t),n?.disconnect()}},[e,Pn,tn]),H(()=>{if(e&&(We(!1),Ke.current=!1,tt.current=!1,qn(!$n),!Mn.current)){if(on&&ln[on]){const e=ln[on];return void dn(t=>Zn({...e,...le?{h:t.h}:{},...$n?{x:t.x,w:t.w}:{}}))}I&&(dn({x:I.x,y:I.y,w:I.w,h:I.h}),Wn(I.maximized))}},[e]),H(()=>{if(!e||"auto"!==h)return;let t;const n=e=>{nt.current?.contains(e.target)&&!Ke.current&&(Ke.current=!0,t=setTimeout(()=>We(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(t),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[e,h]);const _n="auto"===h?Ie:!0===h,er=je&&!ht?je.key:null,nr=Q(()=>Dt(Ne),[Ne]),ir=B({shortcutSpec:qe,isOnDesktop:Je,toggleDesktopShortcut:_e,taskbarStrings:ze.taskbar});j(()=>{ir.current={shortcutSpec:qe,isOnDesktop:Je,toggleDesktopShortcut:_e,taskbarStrings:ze.taskbar}});const ar=B(null);ar.current||(ar.current={open:(e,t)=>Fe({x:e,y:t}),items:()=>{const e=ir.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of _t[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),H(()=>{e&&er&&function(e,t){const n=It.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.menu===t.menu||(It.set(e,t),Ot())}(er,{title:nr.text||Pe,dirty:_n,copy:nr.copy,menu:ar.current??void 0})},[e,er,Pe,_n,nr.text,nr.copy]),H(()=>{if(e&&er)return()=>{return e=er,void(It.delete(e)&&Ot());var e}},[e,er]),Ue(!(he||!e)&&_n);const lr=U(async()=>{if(!tt.current){if(_n||"auto"===h&&Ke.current){tt.current=!0;const e=Pe,t=await b({title:"Discard changes?",message:e?`“${e}” has unsaved changes. Are you sure you want to close? All changes will be lost.`:"You have unsaved changes. Are you sure you want to close? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});if(tt.current=!1,!t)return}t()}},[_n,h,t,Pe]);j(()=>{if(!e||!pt)return;const t=e=>{e.detail?.windowKey===pt&&lr()};return window.addEventListener(wr,t),()=>window.removeEventListener(wr,t)},[e,pt,lr]);const cr=B(null),yr=U(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Fe(null),Bn(St),Mn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=nt.current,l=a?.getBoundingClientRect();let s,c,d,u;if(cr.current){const t=cr.current;cr.current=null,u=t.w,d=t.h;const n=l?Math.min(Math.max(20,e.clientX-l.left),t.w-20):t.w/2;s=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${u}px`,a.style.height=`${d}px`,a.style.left=`${s}px`,a.style.top=`${c}px`)}else s=l?l.left:Kn.current.x,c=l?l.top:Kn.current.y,d=l?l.height:Kn.current.h,u=l?l.width:Kn.current.w;Wn(!1),dn(e=>({...e,x:s,y:c,w:u,h:d}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<ur&&Math.abs(e.clientY-i)<ur)return;r=hr(t,n,"move","move"),a&&(a.style.transition="none")}const l=s+e.clientX-o,d=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${l-s}px, ${d-c}px)`),Kn.current={...Kn.current,x:l,y:d},!_){const t=function(e,t){const n=Jn(),r=e<=n.x+Xn,o=e>=n.x+n.w-Xn,i=t<=n.y+Xn,a=t>=n.y+n.h-Xn,l=e<=n.x+Un,s=e>=n.x+n.w-Un,c=t<=n.y+Un,d=t>=n.y+n.h-Un;return i&&l?"tl":i&&s?"tr":a&&l?"bl":a&&s?"br":c&&r?"tl":c&&o?"tr":d&&r?"bl":d&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?rr(tr(t)):or())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),or();const e=Zn({...Kn.current});if(Kn.current=e,!_&&h){cr.current={x:s,y:c,w:u,h:d};const e=tr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void dn(e)}if(_){const t=e.x+e.w/2,n=window.innerWidth/2;et(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),dn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),gr=U((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,l=nt.current,s=l?.getBoundingClientRect(),c=s?s.left:Kn.current.x,d=s?s.top:Kn.current.y,u=s?s.width:Kn.current.w,h=s?s.height:Kn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Wn(!1),dn({x:c,y:d,w:u,h:h}),Kn.current={x:c,y:d,w:u,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Kn.current=e,l&&(l.style.left=`${e.x}px`,l.style.top=`${e.y}px`,l.style.width=`${e.w}px`,l.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<ur&&Math.abs(e.clientY-a)<ur)return;o=hr(n,r,dr[t],"resize")}g=((e,t)=>{let n=c,r=d,o=u,i=h;if(f&&(o=Math.max(Gn,u+e)),w&&(i=Math.max(Qn,h+t)),m){const t=Math.max(Gn,u-e);n=c+u-t,o=t}if(p){const e=Math.max(Qn,h-t);r=d+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),dn({...Kn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),br=U(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),Bn(St),"Enter"===e.key)return void(Pn?(Wn(!1),dn(nn())):(Wn(!0),dn(tn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{cr.current||(cr.current={...Kn.current})};if(r<0)return e(),Wn(!0),void dn(tn());if(r>0){if(Pn)return Wn(!1),void dn(nn());if(cr.current){const e=Zn(cr.current);return cr.current=null,Kn.current=e,void dn(e)}return void Hn(St)}e(),Wn(!1);const t=tr(n<0?"left":"right");return Kn.current=t,void dn(t)}if(Pn)return;const o=Kn.current,i=e.shiftKey?{...o,w:Math.max(Gn,o.w+24*n),h:Math.max(Qn,o.h+24*r)}:Zn({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Kn.current=i,dn(i)},[St,Pn,nn,tn]),Er=U(e=>{cr.current||(cr.current={...Kn.current}),Wn(!1);const t=tr(e);Kn.current=t,dn(t),Bn(St)},[St]),Cr=En||Rt?{}:{tabIndex:0,role:"group","aria-label":Pe?`${Pe} — ${De.windowSuffix}`:De.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:br},Nr=()=>{Wn(!0),dn(tn())},zr=U(()=>{const e=nt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Yt);t&&!t.disabled&&t.click()}},[]);H(()=>{if(!e)return;if(_)return;const t=e=>{if(kn[kn.length-1]===St&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),zr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&nt.current?.contains(t)))return;if(t.closest(Xt))return;e.preventDefault()}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,zr,St,_]),H(()=>{if(!e)return;const t=e=>{kn[kn.length-1]===St&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:St}})),Ke.current=!1,We(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:St}}))))};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),H(()=>{if(!e)return;if(_)return;const t=e=>{if("Escape"===e.key&&kn[kn.length-1]===St){if(M(e))return e.preventDefault(),void e.stopPropagation();if(yn&&!R)return;e.preventDefault(),e.stopPropagation(),lr()}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,lr,St,_,yn,R]);const Ar=e&&(void 0!==w||void 0!==y),Ir=U(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-[9999] bg-gray-900 text-white px-5 py-2.5 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(H(()=>{if(!e)return;const t=e=>{if(kn[kn.length-1]!==St)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Ar&&(e.preventDefault(),w?w():Ir("bottom")),"k"===e.key&&Ar&&(e.preventDefault(),y?y():Ir("top"))))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,w,y,Ar,Ir,St]),!e||rn.current)return null;const Wr=Rt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),l=n%o,s=r-o*(i-1),c=a===i-1&&s<o,d=Jn(),u=(d.w-20*(o+1))/o,h=(d.h-14*(i+1)-22*i)/i,m=c?(o-s)*(u+20)/2:0;return{x:d.x+20+l*(u+20)+m,y:d.y+14+a*(h+14+22),w:u,h:h}}(St):null,Kr=Rt&&Wr?Math.min(Wr.w/sn.w,Wr.h/sn.h):1,Or=(()=>{if(Rt&&Wr){const e=Kr,t=sn.w*e,n=sn.h*e,r=Wr.x+(Wr.w-t)/2-sn.x,o=Wr.y+(Wr.h-n)/2-sn.y,i=Ft||Ht;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:i?2020:2010,boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(Jt&&$t){const e="picked"===Gt;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:2030}:{}}}return null})(),$r=/* @__PURE__ */ne("div",{children:[
|
|
50
|
-
/* @__PURE__ */ne("div",{ref:nt,"data-modal-panel":!0,"data-modal-id":St,"data-window-key":he||void 0,...q?{"data-utility":""}:{},...Oe?{"data-pinned-top":""}:{},..._?{"data-widget":""}:{},...je?{"data-window-owner":je.key}:{},...je&&!ht?{"data-window-root":""}:{},...yn?{"data-window-tab":""}:{},className:yn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(_?zt?"shadow-2xl":"shadow-lg":"border "+(zt?"shadow-2xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(rt.current=!1,Rt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Tr(St),kr(!1),void Bn(St)}if(!zt&&!_&&!Oe&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===nt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),rt.current=!0,Fe(null),Bn(St),window.addEventListener("mouseup",()=>{setTimeout(()=>{rt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{rt.current&&(rt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Rt)return;Fe(null);e.target.closest("[data-modal-panel]")===nt.current&&(e.target.closest("button, input, a, select, textarea")||Bn(St))},style:we?{zIndex:Lt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ye}px)`,transition:be?"none":"transform 180ms ease-out",..._?{display:"none"}:{},...Lt<0?{display:"none"}:{},...zt||Oe||Me&&he===Me?{}:{display:"none"}}:{zIndex:Oe?C.pinnedWindow:Lt+1,width:sn.w,height:sn.h,top:sn.y,..._&&"right"===Ze?{right:window.innerWidth-sn.x-sn.w}:{left:sn.x},...Lt<0&&!Oe?{display:"none"}:{},...Ln?{visibility:"hidden",pointerEvents:"none"}:{},...Or??{}},children:[we&&!_&&/* @__PURE__ */re("div",{onPointerDown:Ce,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),_?null:yn?je?.home?null:/* @__PURE__ */ne(oe,{children:[
|
|
51
|
-
/* @__PURE__ */re("h2",{"data-window-title":!0,className:"sr-only",children:nr.text||Pe}),(nr.accessories.length>0||Ar)&&/* @__PURE__ */ne("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-3 border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:[
|
|
52
|
-
/* @__PURE__ */re("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:nr.accessories}),Ar&&/* @__PURE__ */ne("span",{className:"flex items-center gap-1 shrink-0 text-[10px] text-gray-400",children:[
|
|
53
|
-
/* @__PURE__ */re("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1.5 py-0.5 font-medium text-gray-500",children:"K"}),
|
|
54
|
-
/* @__PURE__ */re("span",{children:De.prev}),
|
|
55
|
-
/* @__PURE__ */re("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1.5 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
|
|
56
|
-
/* @__PURE__ */re("span",{children:De.next})]})]})]}):we?null:
|
|
57
|
-
/* @__PURE__ */ne("div",Z?{onPointerDown:yr,"data-window-chrome":"",...Cr,className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
58
|
-
/* @__PURE__ */ne("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-1.5",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Rt&>(),
|
|
59
|
-
/* @__PURE__ */re("span",{className:"truncate",children:Rt?Ut(Ne):Ne})]}),!Rt&&/* @__PURE__ */ne("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[q&&/* @__PURE__ */re("button",{onClick:()=>$e(e=>!e),title:Oe?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */re(O,{name:"bookmark-square",fallback:L,className:"h-3 w-3",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
60
|
-
/* @__PURE__ */re("button",{type:"button",onClick:lr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */re(O,{name:"close",fallback:ae,className:"h-4 w-4"})})]})]}:ee?{onPointerDown:yr,"data-window-chrome":"",...Cr,className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
61
|
-
/* @__PURE__ */ne("div",{"data-window-title":!0,title:Pe,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-1.5",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Rt&>(),
|
|
62
|
-
/* @__PURE__ */re("span",{className:"truncate",children:Rt?Ut(Ne):Ne})]}),!Rt&&/* @__PURE__ */ne("div",{className:"flex items-center gap-0.5 shrink-0 ml-2",children:[q&&/* @__PURE__ */re("button",{onClick:()=>$e(e=>!e),title:Oe?De.unpin:De.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */re(O,{name:"bookmark-square",fallback:L,className:"h-3 w-3",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
63
|
-
/* @__PURE__ */re("button",{onClick:()=>Hn(St),title:De.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!En&&/* @__PURE__ */re(sr,{maximized:Pn,onToggleMax:()=>{Pn?(Wn(!1),dn(nn())):Nr()},onSnap:Er,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:De}),
|
|
64
|
-
/* @__PURE__ */re("button",{type:"button",onClick:lr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */re(O,{name:"close",fallback:ae,className:"h-4 w-4"})})]})]}:{onPointerDown:yr,"data-window-chrome":"",...Cr,className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
65
|
-
/* @__PURE__ */ne("div",{"data-window-title":!0,title:Pe,className:"text-base font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Rt&>(),
|
|
66
|
-
/* @__PURE__ */re("span",{className:"truncate",children:Rt?Ut(Ne):Ne})]}),!Rt&&/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5 shrink-0 ml-4",children:[Ar&&/* @__PURE__ */ne("span",{className:"flex items-center gap-1 mr-1 text-[10px] text-gray-400",children:[
|
|
67
|
-
/* @__PURE__ */re("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 font-medium text-gray-500",children:"K"}),
|
|
68
|
-
/* @__PURE__ */re("span",{children:De.prev}),
|
|
69
|
-
/* @__PURE__ */re("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
|
|
70
|
-
/* @__PURE__ */re("span",{children:De.next})]}),q&&/* @__PURE__ */re("button",{onClick:()=>$e(e=>!e),title:Oe?De.unpin:De.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Oe?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */re(O,{name:"bookmark-square",fallback:L,className:"h-3.5 w-3.5",fill:Oe?"currentColor":"none",strokeWidth:1.5})}),
|
|
71
|
-
/* @__PURE__ */re("button",{onClick:()=>Hn(St),title:De.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!En&&/* @__PURE__ */re(sr,{maximized:Pn,onToggleMax:()=>{Pn?(Wn(!1),dn(nn())):Nr()},onSnap:Er,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:De}),
|
|
72
|
-
/* @__PURE__ */re("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:"ESC"}),
|
|
73
|
-
/* @__PURE__ */re("button",{type:"button",onClick:lr,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */re(O,{name:"close",fallback:ae,className:"h-5 w-5"})})]})]}),pe&&Ye&&!_&&!we&&/* @__PURE__ */re("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${zt?.9:.55})`}}),
|
|
74
|
-
/* @__PURE__ */re(qt.Provider,{value:St,children:/* @__PURE__ */re(en.Provider,{value:{rightRef:it,leftRef:at,notify:()=>st(!0),active:zt,isDirty:_n,footerOpen:dt&&!_&&!Z&&!ee&&!we},children:/* @__PURE__ */re("div",{ref:ot,..._?{onPointerDown:yr,onContextMenu:e=>{e.preventDefault(),Qe({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${_?"p-0 cursor-move":ee||te?"p-0":Z?"p-2":"p-4"} ${_||yn?"":"backdrop-blur-sm"} ${!1===E||ee||te?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${_?"rounded-2xl select-none":""}`,style:{..._?{touchAction:"none"}:{},backgroundColor:_?"transparent":yn?"rgb(var(--window-content-rgb))":zt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */re(Le,{children:fe})})})}),_&&Ge&&/* @__PURE__ */ne(v,{minWidth:160,style:{left:Ge.x,top:Ge.y},onClose:()=>Qe(null),children:[
|
|
75
|
-
/* @__PURE__ */re(x,{onClick:()=>{Qe(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:St}))},children:"Settings"}),
|
|
76
|
-
/* @__PURE__ */re(k,{}),de&&/* @__PURE__ */ne(oe,{children:[de,
|
|
77
|
-
/* @__PURE__ */re(k,{})]}),
|
|
78
|
-
/* @__PURE__ */ne(x,{onClick:()=>{Qe(null),$e(e=>!e)},children:[
|
|
79
|
-
/* @__PURE__ */re("span",{className:"flex-1",children:"Always on Top"}),Oe&&/* @__PURE__ */re(O,{name:"check",fallback:T,className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
80
|
-
/* @__PURE__ */re(k,{}),
|
|
81
|
-
/* @__PURE__ */re(x,{onClick:()=>{Qe(null),lr()},children:"Close"})]}),
|
|
82
|
-
/* @__PURE__ */ne("div",{onPointerDown:yr,ref:ct,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${yn?"":" cursor-move"}${zt&&!yn?" backdrop-blur-sm":""}${_||Z||ee||we||!dt?" hidden":""}`,style:{touchAction:"none",backgroundColor:yn?"rgb(var(--window-footer-rgb))":zt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
83
|
-
/* @__PURE__ */ne("div",{className:"flex items-center gap-2 min-w-0",children:[ft&&/* @__PURE__ */re(Ae,{auto:!0}),K,
|
|
84
|
-
/* @__PURE__ */re("div",{ref:at,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),g]}),
|
|
85
|
-
/* @__PURE__ */ne("div",{className:"flex items-center gap-2 ml-auto",children:[
|
|
86
|
-
/* @__PURE__ */re("div",{ref:it,"data-modal-actions":!0,className:"flex items-center gap-2"}),W]})]}),!_&&!we&&!Rt&&zt&&!En&&/* @__PURE__ */ne(oe,{children:[
|
|
87
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
88
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
89
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
90
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
91
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
92
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
93
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
94
|
-
/* @__PURE__ */re("div",{onPointerDown:e=>gr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Rt&&/* @__PURE__ */re("div",{className:"absolute inset-0",style:{zIndex:9999,cursor:"pointer",background:"transparent"},onMouseEnter:()=>Bt(!0),onMouseLeave:()=>Bt(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Bn(St),kr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Ft&&/* @__PURE__ */re("button",{type:"button","data-expose-close":!0,"aria-label":ze.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Kr})`,transformOrigin:"top right",zIndex:1e4},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),lr()},children:/* @__PURE__ */re(O,{name:"close",fallback:z,className:"h-4 w-4",strokeWidth:2.2})})})]}),Rt&&Wr&&/* @__PURE__ */re("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Wr.x,top:Wr.y+Wr.h+4,width:Wr.w,zIndex:Ft?2021:2011,color:"white",fontSize:12,fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Ut(Ne)})]}),Rr=Re&&/* @__PURE__ */ne(v,{style:{left:Re.x,top:Re.y},onClose:()=>Fe(null),minWidth:160,children:[!_&&!Z&&!yn&&/* @__PURE__ */ne(oe,{children:[
|
|
95
|
-
/* @__PURE__ */ne(x,{onClick:()=>{Hn(St),Fe(null)},children:[
|
|
96
|
-
/* @__PURE__ */re(O,{name:"remove",fallback:A,className:"h-4 w-4 text-gray-400",strokeWidth:1.5}),De.minimize]}),!En&&/* @__PURE__ */ne(x,Pn?{onClick:()=>{Wn(!1),dn(nn()),Fe(null)},children:[
|
|
97
|
-
/* @__PURE__ */re("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */re("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),De.windowed]}:{onClick:()=>{Nr(),Fe(null)},children:[
|
|
98
|
-
/* @__PURE__ */re(O,{name:"expand",fallback:D,className:"h-4 w-4 text-gray-400",strokeWidth:1.5}),De.maximize]})]}),q&&!yn&&/* @__PURE__ */ne(x,{onClick:()=>{$e(e=>!e),Fe(null)},children:[
|
|
99
|
-
/* @__PURE__ */re(O,{name:"bookmark-square",fallback:L,className:"h-4 w-4 "+(Oe?"text-blue-600":"text-gray-400"),fill:Oe?"currentColor":"none",strokeWidth:1.5}),Oe?De.unpin:De.pinOnTop]}),qe&&/* @__PURE__ */ne(x,{onClick:()=>{Fe(null),_e()},children:[
|
|
100
|
-
/* @__PURE__ */re(O,{name:"star",fallback:S,className:"h-4 w-4 "+(Je?"text-yellow-500":"text-gray-400"),fill:Je?"currentColor":"none",strokeWidth:1.5}),Je?ze.taskbar.removeFromDesktop:ze.taskbar.addToDesktop]}),(_t[St]||[]).length>0&&/* @__PURE__ */re(oe,{children:(_t[St]||[]).map((e,t)=>/* @__PURE__ */ne(x,{onClick:()=>{Fe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(yn&&je?.home)&&/* @__PURE__ */ne(oe,{children:[
|
|
101
|
-
/* @__PURE__ */re(k,{}),
|
|
102
|
-
/* @__PURE__ */ne(x,{danger:!0,onClick:()=>{Fe(null),lr()},children:[
|
|
103
|
-
/* @__PURE__ */re(O,{name:"close",fallback:ae,className:"h-4 w-4"}),De.close]})]})]}),Fr=!!he&&Nt.some(e=>e.id===he),qr=!At||Fr||_?null:/* @__PURE__ */ne("div",{"data-modal-restore-tab":!0,"data-modal-id":St,className:"fixed left-1/2 z-[1200] flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-1.5 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
104
|
-
/* @__PURE__ */re("button",{type:"button",onClick:()=>Bn(St),title:De.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Pe||De.windowSuffix}),
|
|
105
|
-
/* @__PURE__ */re("button",{type:"button",onClick:()=>Bn(St),title:De.restore,"aria-label":De.restore,className:"rounded px-1.5 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
106
|
-
/* @__PURE__ */re("button",{type:"button",onClick:()=>{lr()},title:De.close,"aria-label":De.close,className:"rounded px-1.5 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return ie(
|
|
107
|
-
/* @__PURE__ */ne(jt.Provider,{value:null,children:[$r,Rr,qr]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{gr&&"Escape"===e.key&&(Ir(null),kr(!1))});var Rr=100,Fr={past:[],future:[]};function qr(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Rr?r.slice(r.length-Rr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Fr}}var jr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Br=500,Hr=250;function Yr({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=Z(qr,Fr),a=B(/* @__PURE__ */new Map),[l,s]=Y(0),c=l>0,[d,u]=Y(0),[m,p]=Y(0),f=m>0,{hasAnyPerm:w}=h(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=B(null),b=B(!1),v=U(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),x=U((e,t)=>{a.current.has(e)||s(e=>e+1),a.current.set(e,t)},[]),k=U(e=>{a.current.delete(e)&&s(e=>e-1)},[]),E=U(e=>{u(t=>t+(e?1:-1))},[]),C=U(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=Y(0),S=M>0,L=U(e=>{N(t=>t+(e?1:-1))},[]),T=F(Te),z=T?.claimReadOnly;H(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;H(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=B({last:0,count:0,tripped:!1}),P=B(!1),I=U((e,t,n)=>{if(b.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Hr&&(r.count=0),r.last=o,++r.count>Br)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Br} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);g.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&i({type:"record",step:e})})},[y,v]),W=U(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),K=U(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),i({type:"undo",redoStep:t})},[o.past,v,W]),O=U(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),i({type:"redo",undoStep:t})},[o.future,v,W]),[$,R]=Y(0),q=B(0),j=B(0),X=B(!1),J=U(()=>{b.current=!0,P.current=!1,g.current=null,q.current+=1,j.current=q.current,R(q.current)},[]),V=B(void 0),_=U(e=>{void 0!==e&&(void 0!==V.current&&e!==V.current&&(X.current=!0),V.current=e),J()},[J]);H(()=>{b.current&&$===j.current&&(b.current=!1,g.current=null,(P.current||X.current)&&i({type:"clear"}),P.current=!1,X.current=!1)},[$]);const G=U(()=>{X.current=!0,i({type:"clear"}),J()},[J]),ee=y&&o.past.length>0,te=y&&o.future.length>0,oe=yr(r),ie=B({undo:K,redo:O,canUndo:ee,canRedo:te});ie.current={undo:K,redo:O,canUndo:ee,canRedo:te},H(()=>{if(!oe||!y)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&jr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=Q(()=>({register:x,unregister:k,record:I,undo:K,redo:O,clear:G,baseline:_,canUndo:ee,canRedo:te,enabled:y,hasState:c,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ee?o.past[o.past.length-1].label:null,redoLabel:te?o.future[0].label:null}),[x,k,I,K,O,G,_,ee,te,y,c,S,L,E,f,C,o.past,o.future]),le=""!==tn(),se=F(en)?.footerOpen??!1,ce=le&&y&&c&&!S&&se;/* @__PURE__ */
|
|
108
|
-
return ne(Te.Provider,{value:ae,children:[ce&&/* @__PURE__ */re(rn,{position:"left",quiet:!0,children:/* @__PURE__ */re(Ae,{auto:!0})}),e]})}function Xr(){const e=F(Te),t=U(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function Ur(e){const t=F(Te),n=t?.claimReadOnly,r=t?.claimEditable;H(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function Jr(e,t,n){const r=F(Te),o=ee(),i=B(e),a=B(t);a.current=t,H(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:l,coalesceKey:s=null}=n,c=B(r);c.current=r;const d=B({label:l,coalesceKey:s});d.current={label:l,coalesceKey:s},H(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(d.current.label,d.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function Vr(e,t){const[n,r]=Y(e);return Jr(n,e=>r(()=>e),t),[n,r]}export{on as CancelButton,Qe as DocFavStar,Fe as EntityWindowFallback,$e as EntityWindowLoading,qe as EntityWindowState,Xt as KEY_ACTIVATED_SELECTOR,Ke as LoadingSpinner,Yt as MODAL_SUBMIT_SELECTOR,$r as Modal,rn as ModalActions,Ae as UndoControls,Yr as UndoProvider,pe as WINDOW_REGISTRY,Se as WindowCrashedFallback,Le as WindowErrorBoundary,yt as WindowManagerProvider,Qt as WindowTitle,rt as activateWindowById,Lt as beginWindowGesture,Rn as cancelWindowFront,be as client_default,Wr as commitExposeHighlight,Tt as drainPerfEvents,Cr as exitExposeMode,yn as forgetMaximizedWindowBoxes,pr as getActiveModalId,lt as getActiveWindowRoute,Pr as getExposeHighlight,Ft as getWindowChromeVersion,fn as getWindowPosition,Be as isDraftEntityId,He as isDraftEntityWindow,ue as isEntityEntry,de as isPageEntry,ye as isShellApiClientConfigured,ot as isTabWindow,St as markMenuOpen,$t as readWindowChrome,$n as requestWindowFront,Ir as setExposeHighlight,Nt as setPerfCollecting,we as setShellApiClient,Ce as setShellHomeRoute,me as setShellWindowRegistry,pn as setWindowDefaultPosition,wn as setWindowPosition,Dt as splitTitle,Dr as subscribeExposeHighlight,Rt as subscribeWindowChrome,Er as toggleExposeMode,In as useCurrentTabKey,tn as useEnclosingModalId,yr as useIsActiveWindow,nn as useModalActive,xe as usePageSearch,Xr as useUndo,Ur as useUndoCanEdit,Jr as useUndoable,Vr as useUndoableState,Vt as useWidgetSettings,Ue as useWindowDirty,Ve as useWindowManager,Gt as useWindowMenuItem,Zt as useWindowTitle};
|
package/dist/chunk-XWSWYMGM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useSyncExternalStore as e}from"react";import{jsx as t}from"react/jsx-runtime";var n=/* @__PURE__ */new Map,o=null,i=null,l=0,a=/* @__PURE__ */new Set;function r(){l+=1;for(const e of[...a])e()}function s(e){return a.add(e),()=>{a.delete(e)}}function c(){return l}function f(e){let t=n.get(e.name),i=!1;t?t.label!==e.label&&(t.label=e.label,i=!0):(t={label:e.label,icons:/* @__PURE__ */new Map,looks:/* @__PURE__ */new Map},n.set(e.name,t),o??=e.name,i=!0);for(const[n,o]of Object.entries(e.icons))t.icons.get(n)!==o&&(t.icons.set(n,o),i=!0);for(const[n,o]of Object.entries(e.looks??{})){let e=t.looks.get(n);e||t.looks.set(n,e=/* @__PURE__ */new Map);for(const[t,n]of Object.entries(o))e.get(t)!==n&&(e.set(t,n),i=!0)}i&&r()}function u(e,t){f({name:e,label:n.get(e)?.label??"",icons:t})}function d(e){o!==e&&(o=e,r())}function b(e){const t=e||null;i!==t&&(i=t,r())}function m(){return i&&n.has(i)?i:o}function g(){return[...n].filter(([,e])=>""!==e.label).map(([e,t])=>({name:e,label:t.label}))}function p(e,t){const i=[m(),o,...n.keys()];if(t)for(const o of i){const i=o?n.get(o)?.looks.get(t)?.get(e):void 0;if(i)return i}for(const t of i){const o=t?n.get(t)?.icons.get(e):void 0;if(o)return o}}var v={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},w=/* @__PURE__ */new Set;function h({name:n,glyph:o,size:i,tone:l,look:a,title:r,fallback:f,className:u,...d}){e(s,c,c);const b=n??o,m=p(b,a)??f;if(!m)return w.has(b)||(w.add(b),console.warn(`efficient-shell/icons: no registered icon set draws "${b}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==r||void 0!==d["aria-label"]||void 0!==d["aria-labelledby"],h=[l?v[l]:"",u??""].filter(Boolean).join(" ");/* @__PURE__ */
|
|
2
|
-
return t(m,{width:i??"1em",height:i??"1em","data-icon":b,"aria-hidden":!g||void 0,role:g?"img":void 0,"aria-label":r,...d,className:h||void 0})}export{h as Icon,m as activeIconSet,g as iconSets,c as iconsVersion,f as registerIconSet,u as registerIcons,p as resolveIcon,d as setDefaultIconSet,b as setIconSet,s as subscribeIcons};
|
package/dist/chunk-YGC7AX3X.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{InfoFallback as r,ErrorFallback as n,CloseFallback as o,CheckFallback as i}from"./chunk-6LTDJKIL.js";import{Icon as a}from"./chunk-XWSWYMGM.js";import{useShellStrings as s}from"./chunk-TNBCUZVE.js";import{createContext as c,useSyncExternalStore as l,useCallback as u,useContext as d,useMemo as f}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var w="(max-width: 767px), (pointer: coarse)";function p(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(w).matches}function g(){return!1}function y(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(w);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function v(){return l(y,p,g)}var x={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},b={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},_={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function N({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
|
-
return h(a,{name:"check",fallback:i,...t});case"error":/* @__PURE__ */
|
|
3
|
-
return h(a,{name:"close",fallback:o,...t});case"warning":/* @__PURE__ */
|
|
4
|
-
return h(a,{name:"error",fallback:n,...t});default:/* @__PURE__ */
|
|
5
|
-
return h(a,{name:"info",fallback:r,...t})}}function S({status:e="info",title:t,subTitle:r,extra:n,icon:o,children:i,className:a=""}){const c=x[e],l=s().errors;/* @__PURE__ */
|
|
6
|
-
return m("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${a}`.trim(),children:[
|
|
7
|
-
/* @__PURE__ */h("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${b[c]}`,children:o??/* @__PURE__ */h(N,{tone:c})}),
|
|
8
|
-
/* @__PURE__ */h("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??_[e]?.(l)??""}),r&&/* @__PURE__ */h("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:r}),i&&/* @__PURE__ */h("div",{className:"mt-4 w-full max-w-md text-left",children:i}),n&&/* @__PURE__ */h("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:n})]})}function C({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */h("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */h("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */m("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
|
|
9
|
-
/* @__PURE__ */h("p",{className:"text-sm text-gray-500",children:r})]})}var D="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),E={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},L=D?0:1,M=E.MOD[L],T=E.ALT[L],k="⇧",A="⏎",I=E.CMD_ENTER[L],j=E.CMD_S[L],H=E.CMD_K[L],F=E.CMD_DOT[L],Z=E.CMD_A[L],O=E.CMD_Z[L],P=E.CMD_SHIFT_Z[L],$=E.ALT_SHIFT_D[L],K=E.ALT_SHIFT_E[L],z=E.ALT_SHIFT_N[L],J=new Map(D?Object.values(E).map(([e,t])=>[e,t]):[]);function R(t){return e()?t:J.get(t)??t}var U="inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",W={sm:"px-1 py-0.5 text-[10px]",md:"px-1.5 py-0.5 text-[11px]"};function B({keys:e,size:t="md",className:r=""}){const n=R(e);/* @__PURE__ */
|
|
10
|
-
return h("kbd",{className:[U,W[t],r].filter(Boolean).join(" "),children:n})}var G=c(null);function V({value:e,children:t}){/* @__PURE__ */
|
|
11
|
-
return h(G.Provider,{value:e,children:t})}function X(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:u(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var Y={prefs:{},save:()=>{}};function q(){return d(G)??Y}function Q(){const{prefs:e,save:t}=q(),r=u(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return f(()=>({prefs:e,save:r}),[e,r])}var ee="react-os-shell:stale-chunk-reload-at",te=3e4,re="vite:preloadError",ne="/_next/static/",oe=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ie(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return oe.test(t)}function ae(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(ee),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?ne:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(ee),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(ee,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ie(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(re,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(re,s),d&&window.removeEventListener("error",d,!0)}}export{T as ALT,$ as ALT_SHIFT_D,K as ALT_SHIFT_E,z as ALT_SHIFT_N,Z as CMD_A,F as CMD_DOT,I as CMD_ENTER,H as CMD_K,j as CMD_S,P as CMD_SHIFT_Z,O as CMD_Z,A as ENTER,B as Kbd,C as LoadingSpinner,M as MOD,ne as NEXT_CHUNK_PATH_PREFIX,S as Result,k as SHIFT,te as STALE_CHUNK_RELOAD_COOLDOWN_MS,ee as STALE_CHUNK_RELOAD_KEY,V as ShellPrefsProvider,re as VITE_PRELOAD_ERROR_EVENT,ae as installStaleChunkReload,D as isMac,ie as isStaleChunkError,v as useIsMobile,X as useLocalStoragePrefs,Q as useShellPrefs,q as useShellPrefsAdapter,R as useShortcutLabel};
|
package/dist/chunk-Z7D6Y5WA.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-P4CIOJHP.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-RMJZOKHY.js";import{CloseFallbackC as i}from"./chunk-6LTDJKIL.js";import{Icon as a}from"./chunk-XWSWYMGM.js";import{useShellStrings as o}from"./chunk-TNBCUZVE.js";import{useState as s,useEffect as c,Fragment as d}from"react";import{jsxs as m,jsx as u,Fragment as p}from"react/jsx-runtime";var y="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function h(){/* @__PURE__ */
|
|
2
|
-
return u(a,{name:"close",fallback:i,"aria-hidden":"true",className:"size-3.5"})}function b({text:n,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(n);/* @__PURE__ */
|
|
3
|
-
return u("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */u(t,{copied:i,className:"size-3.5"})})}function f({tabs:e,activeKey:t,idFor:i,panelMounted:a,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const I=o().pageTabs,[$,z]=s(null),M=e.length;c(()=>{if(!t)return;const e=document.getElementById(i(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[i,t,M]);const D=e.some(e=>e.key===t)?t:e[0]?.key,_=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(i(n.key,"tab"))?.focus()},A=$?e.find(e=>e.key===$.key):void 0,B=A&&j?j(A.key):[],E=A?e.indexOf(A):-1,L=e=>e.some(e=>!e.pinned),T=e=>()=>{z(null),e()};/* @__PURE__ */
|
|
4
|
-
return m("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
5
|
-
/* @__PURE__ */u("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
6
|
-
/* @__PURE__ */u("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(i(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)_(n+1);else if("ArrowLeft"===t.key)_(n-1);else if("Home"===t.key)_(0);else if("End"===t.key)_(e.length-1);else{if("Delete"!==t.key||e[n].pinned)return;g(e[n].key)}t.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map((n,r)=>{const l=n.key===t,o=!!n.dirty,s=n.icon,c=l?N??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",p=r>0&&!l&&e[r-1].key!==t,x={type:"button",role:"tab",id:i(n.key,"tab"),"aria-selected":l,"aria-controls":a?.(n.key)?i(n.key,"panel"):void 0,tabIndex:n.key===D?0:-1,title:n.title,onClick:()=>f(n.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),z({x:e.clientX,y:e.clientY,key:t.key})})(e,n),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,n),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=s&&
|
|
7
|
-
/* @__PURE__ */m("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[s,o&&!l&&!n.pinned&&
|
|
8
|
-
/* @__PURE__ */u("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),w=l&&!!C&&!!s;return n.pinned?/* @__PURE__ */u("div",{role:"presentation",className:`group relative flex h-9 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${s?"w-10":""} ${c}`,...k,children:/* @__PURE__ */m("button",{...x,className:`flex h-full items-center justify-center rounded-t-md ${s?"w-full":"px-3"} ${y}`,children:[v,
|
|
9
|
-
/* @__PURE__ */u("span",{className:s?"sr-only":"whitespace-nowrap text-[13px]",children:n.title})]})},n.key):/* @__PURE__ */m(d,{children:[p&&/* @__PURE__ */u("span",{"aria-hidden":"true",className:"mb-2.5 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
10
|
-
/* @__PURE__ */m("div",{role:"presentation",className:`group @container relative flex h-9 items-center rounded-t-md border border-b-0 text-[13px] transition-colors ${l&&(n.copy||w)?"flex-[0_1_20rem]":"flex-[0_1_15rem]"} ${l?"min-w-[4.25rem]":"min-w-[2.75rem]"} ${c}`,...k,children:[w&&
|
|
11
|
-
/* @__PURE__ */u("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":I.tabMenu,title:I.tabMenu,onClick:e=>{const t=e.currentTarget.getBoundingClientRect();C?.(n.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-1.5 ${y}`,children:v}),
|
|
12
|
-
/* @__PURE__ */m("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${w?"pl-1.5":"pl-3"} ${y} ${l?w?"":"@max-[5rem]:pl-2.5":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-1.5"}`,children:[!w&&v,
|
|
13
|
-
/* @__PURE__ */u("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(s?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:n.title})]}),l&&n.copy&&/* @__PURE__ */u(b,{text:n.copy,label:I.copy(n.copy),copiedLabel:I.copied}),
|
|
14
|
-
/* @__PURE__ */m("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[o&&/* @__PURE__ */u("span",{role:"img","aria-label":I.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
15
|
-
/* @__PURE__ */u("button",{type:"button",tabIndex:-1,"aria-label":I.closeTab?.(n.title)??`${I.close} ${n.title}`,onClick:()=>g(n.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(o?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */u(h,{})})]})]})]},n.key)})}),w&&/* @__PURE__ */u("div",{className:"flex shrink-0 items-center gap-2 self-center",children:w}),$&&A&&/* @__PURE__ */m(n,{portal:!0,style:{left:$.x,top:$.y},onClose:()=>z(null),children:[B.length>0&&/* @__PURE__ */m(p,{children:[B.map((e,t)=>/* @__PURE__ */m(r,{onClick:T(e.onSelect),children:[e.icon,e.label]},t)),
|
|
16
|
-
/* @__PURE__ */u(l,{})]}),
|
|
17
|
-
/* @__PURE__ */u(r,{disabled:A.pinned,onClick:T(()=>g(A.key)),children:I.close}),
|
|
18
|
-
/* @__PURE__ */u(l,{}),
|
|
19
|
-
/* @__PURE__ */u(r,{disabled:!L(e.filter(e=>e.key!==A.key)),onClick:T(()=>x("others",A.key)),children:I.closeOthers}),
|
|
20
|
-
/* @__PURE__ */u(r,{disabled:!L(e.slice(E+1)),onClick:T(()=>x("right",A.key)),children:I.closeRight}),
|
|
21
|
-
/* @__PURE__ */u(r,{disabled:!L(e),onClick:T(()=>x("all",null)),children:I.closeAll})]})]})}export{f as TabStrip};
|
package/dist/icons/heroicons.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{MagnifyingGlassPlusIcon as e,WrenchScrewdriverIcon as o,WrenchIcon as r,Square2StackIcon as a,WindowIcon as l,ExclamationTriangleIcon as c,WalletIcon as t,ViewColumnsIcon as i,VideoCameraSlashIcon as n,CheckBadgeIcon as s,ArrowUpTrayIcon as d,ArrowUturnLeftIcon as p,UnderlineIcon as h,TvIcon as b,TruckIcon as u,TrashIcon as m,H1Icon as g,PhoneIcon as f,UserGroupIcon as w,ViewfinderCircleIcon as k,TagIcon as v,DeviceTabletIcon as y,TableCellsIcon as x,ArrowsRightLeftIcon as q,SunIcon as j,PaintBrushIcon as z,StrikethroughIcon as H,BuildingStorefrontIcon as A,StopCircleIcon as B,StarIcon as C,StopIcon as D,SpeakerWaveIcon as E,SparklesIcon as F,SignalSlashIcon as G,SignalIcon as I,ShieldExclamationIcon as J,ShieldCheckIcon as K,ShareIcon as L,Cog6ToothIcon as M,ServerIcon as N,PaperAirplaneIcon as O,MagnifyingGlassIcon as P,ScaleIcon as Q,MinusCircleIcon as R,MinusIcon as S,ArrowPathIcon as T,ArrowUturnRightIcon as U,ReceiptRefundIcon as V,ReceiptPercentIcon as W,CubeIcon as X,PrinterIcon as Y,PresentationChartBarIcon as Z,PowerIcon as $,PlayIcon as _,DevicePhoneMobileIcon as ee,PercentBadgeIcon as oe,UsersIcon as re,PauseIcon as ae,DocumentIcon as le,NumberedListIcon as ce,ChatBubbleBottomCenterTextIcon as te,NoSymbolIcon as ie,EllipsisVerticalIcon as ne,EllipsisHorizontalIcon as se,MoonIcon as de,BanknotesIcon as pe,MicrophoneIcon as he,EqualsIcon as be,Bars3Icon as ue,MegaphoneIcon as me,MapIcon as ge,ArrowRightStartOnRectangleIcon as fe,LockClosedIcon as we,MapPinIcon as ke,ListBulletIcon as ve,LinkSlashIcon as ye,LinkIcon as xe,LightBulbIcon as qe,RectangleGroupIcon as je,Square3Stack3DIcon as ze,KeyIcon as He,ItalicIcon as Ae,InformationCircleIcon as Be,InboxIcon as Ce,PhotoIcon as De,IdentificationIcon as Ee,CursorArrowRippleIcon as Fe,HomeIcon as Ge,QuestionMarkCircleIcon as Ie,HeartIcon as Je,HashtagIcon as Ke,HandThumbUpIcon as Le,HandRaisedIcon as Me,Squares2X2Icon as Ne,GlobeAltIcon as Oe,GiftIcon as Pe,FolderPlusIcon as Qe,FolderOpenIcon as Re,FolderIcon as Se,FlagIcon as Te,FireIcon as Ue,SwatchIcon as Ve,FunnelIcon as We,FaceSmileIcon as Xe,EyeSlashIcon as Ye,EyeIcon as Ze,ArrowTopRightOnSquareIcon as $e,ArrowsPointingOutIcon as _e,ExclamationCircleIcon as eo,EnvelopeIcon as oo,PencilIcon as ro,DocumentDuplicateIcon as ao,ArrowDownTrayIcon as lo,CurrencyDollarIcon as co,DocumentMagnifyingGlassIcon as to,DocumentCheckIcon as io,DocumentTextIcon as no,ComputerDesktopIcon as so,CalendarIcon as po,CubeTransparentIcon as ho,ClipboardDocumentIcon as bo,ClipboardDocumentCheckIcon as uo,PencilSquareIcon as mo,BuildingOfficeIcon as go,ArrowsPointingInIcon as fo,CodeBracketIcon as wo,CloudArrowDownIcon as ko,CloudIcon as vo,XCircleIcon as yo,XMarkIcon as xo,ClockIcon as qo,ClipboardDocumentListIcon as jo,ClipboardIcon as zo,CircleStackIcon as Ho,ChevronUpDownIcon as Ao,ChevronUpIcon as Bo,ChevronRightIcon as Co,ChevronLeftIcon as Do,ChevronDownIcon as Eo,ChevronDoubleRightIcon as Fo,ChevronDoubleLeftIcon as Go,CheckCircleIcon as Io,CheckIcon as Jo,ChatBubbleOvalLeftEllipsisIcon as Ko,ChatBubbleLeftRightIcon as Lo,ChatBubbleLeftIcon as Mo,ChartBarSquareIcon as No,ChartBarIcon as Oo,PresentationChartLineIcon as Po,ShoppingCartIcon as Qo,CreditCardIcon as Ro,CameraIcon as So,CalendarDaysIcon as To,CalculatorIcon as Uo,CursorArrowRaysIcon as Vo,BuildingOffice2Icon as Wo,BuildingLibraryIcon as Xo,BugAntIcon as Yo,BriefcaseIcon as Zo,VariableIcon as $o,BookmarkSquareIcon as _o,BookmarkIcon as er,BookOpenIcon as or,BoltIcon as rr,BoldIcon as ar,NewspaperIcon as lr,VideoCameraIcon as cr,TicketIcon as tr,DocumentCurrencyDollarIcon as ir,BellAlertIcon as nr,BellIcon as sr,BeakerIcon as dr,Battery50Icon as pr,Bars3BottomLeftIcon as hr,ShoppingBagIcon as br,PaperClipIcon as ur,AtSymbolIcon as mr,ArrowUpRightIcon as gr,ArrowUpIcon as fr,ArrowTrendingUpIcon as wr,ArrowTrendingDownIcon as kr,ArrowRightIcon as vr,ArrowLongRightIcon as yr,ArrowLeftEndOnRectangleIcon as xr,ArrowLeftIcon as qr,ArrowDownIcon as jr,ArchiveBoxIcon as zr,SquaresPlusIcon as Hr,Bars4Icon as Ar,AdjustmentsHorizontalIcon as Br,UserPlusIcon as Cr,PlusCircleIcon as Dr,PlusIcon as Er,UserCircleIcon as Fr,UserIcon as Gr,AcademicCapIcon as Ir}from"@heroicons/react/24/outline";var Jr={name:"heroicons",label:"Heroicons",icons:{"academic-cap":Ir,account:Gr,"account-circle":Fr,add:Er,"add-circle":Dr,"add-person":Cr,adjust:Br,"align-justify":Ar,apps:Hr,"archive-box":zr,"arrow-down":jr,"arrow-left":qr,"arrow-left-end-on-rectangle":xr,"arrow-long-right":yr,"arrow-right":vr,"arrow-trending-down":kr,"arrow-trending-up":wr,"arrow-up":fr,"arrow-up-right":gr,"at-symbol":mr,attach:ur,bag:br,"bars-3-bottom-left":hr,battery:pr,beaker:dr,bell:sr,"bell-alert":nr,billing:ir,"block-coupon":tr,"block-divider":S,"block-video":cr,"blog-post":lr,bold:ar,bolt:rr,"book-open":or,bookmark:er,"bookmark-square":_o,braces:$o,briefcase:Zo,bug:Yo,"building-library":Xo,"building-office-2":Wo,button:Vo,calculator:Uo,calendar:To,camera:So,"card-payment":Ro,cart:Qo,chart:Po,"chart-bar":Oo,"chart-bar-square":No,chat:Mo,"chat-bubble-left-right":Lo,"chat-bubble-oval-left-ellipsis":Ko,check:Jo,"check-circle":Io,"chevron-double-left":Go,"chevron-double-right":Fo,"chevron-down":Eo,"chevron-left":Do,"chevron-right":Co,"chevron-up":Bo,"chevron-up-down":Ao,"circle-stack":Ho,clipboard:zo,"clipboard-document-list":jo,clock:qo,close:xo,"close-circle":yo,cloud:vo,"cloud-download":ko,code:wo,collapse:fo,company:go,compose:mo,copied:uo,copy:bo,"cube-transparent":ho,date:po,desktop:so,document:no,"document-check":io,"document-magnifying-glass":to,dollar:co,download:lo,duplicate:ao,edit:ro,email:oo,error:eo,expand:_e,external:$e,eye:Ze,"eye-off":Ye,"face-smile":Xe,filter:We,finish:Ve,fire:Ue,flag:Te,folder:Se,"folder-open":Re,"folder-plus":Qe,gift:Pe,globe:Oe,grid:Ne,hand:Me,"hand-thumb-up":Le,hash:Ke,heart:Je,help:Ie,home:Ge,hover:Fe,identification:Ee,image:De,inbox:Ce,info:Be,italic:Ae,key:He,layers:ze,layout:je,lightbulb:qe,link:xe,"link-slash":ye,list:ve,location:ke,lock:we,logout:fe,map:ge,megaphone:me,menu:ue,meta:be,microphone:he,money:pe,moon:de,more:se,"more-vertical":ne,"no-symbol":ie,note:te,"numbered-list":ce,page:le,pause:ae,people:re,percent:oe,phone:ee,play:_,power:$,"presentation-chart-bar":Z,print:Y,product:X,"receipt-percent":W,"receipt-refund":V,redo:U,refresh:T,remove:S,"remove-circle":R,scale:Q,search:P,send:O,server:N,settings:M,share:L,"shield-check":K,"shield-exclamation":J,signal:I,"signal-slash":G,sparkles:F,"speaker-wave":E,square:D,star:C,"stop-circle":B,store:A,strike:H,styles:z,sun:j,swap:q,table:x,tablet:y,tag:v,target:k,team:w,telephone:f,title:g,trash:m,truck:u,tv:b,underline:h,undo:p,upload:d,verified:s,"video-off":n,"view-columns":i,wallet:t,warning:c,window:l,windows:a,wrench:r,"wrench-screwdriver":o,"zoom-in":e}};export{Jr as heroicons};
|