efficient-shell 7.26.0 → 7.28.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.
Files changed (73) hide show
  1. package/dist/{Browser-3FDTXKE5.js → Browser-CUAQCAZ2.js} +14 -14
  2. package/dist/Calculator-YQS2NTUZ.js +29 -0
  3. package/dist/ConfirmDialog-YZCM3HJP.js +1 -0
  4. package/dist/CurrencyConverter-ZIERKELA.js +21 -0
  5. package/dist/{Documents-WUZBS5SD.js → Documents-GOOHQYBQ.js} +27 -27
  6. package/dist/{Files-363VK5RY.js → Files-R4Z3BYJL.js} +43 -43
  7. package/dist/Notepad-YV4JDSRK.js +25 -0
  8. package/dist/PdfViewer-JLIMTMVK.js +1 -0
  9. package/dist/{PomodoroTimer-BMBZ2TTC.js → PomodoroTimer-GYLJIAWS.js} +20 -20
  10. package/dist/{Preview-KXLUDKH2.js → Preview-K4QOB3J2.js} +8 -8
  11. package/dist/Sidebar-4RJEWBBN.js +44 -0
  12. package/dist/Spreadsheet-7WU4NDJP.js +37 -0
  13. package/dist/{Stock-4LFU53UL.js → Stock-7AOF4PKL.js} +7 -7
  14. package/dist/{Weather-BIOZMSPH.js → Weather-23SUCMNL.js} +18 -18
  15. package/dist/{WorldClock-BO6TIFOK.js → WorldClock-ENURKJG6.js} +7 -7
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-42B7TUEB.js → chunk-3VYANOTN.js} +1 -1
  20. package/dist/{chunk-6RFXIPCN.js → chunk-4MSDABE3.js} +1 -1
  21. package/dist/{chunk-56UKP6J6.js → chunk-5TFUQOEM.js} +1 -1
  22. package/dist/{chunk-5MBF4FPG.js → chunk-76VZ67RK.js} +2 -2
  23. package/dist/{chunk-RMXUKHVK.js → chunk-7776CT23.js} +1 -1
  24. package/dist/{chunk-LG3UEPOI.js → chunk-A22D3FXG.js} +4 -4
  25. package/dist/{chunk-ZXHA3XDM.js → chunk-ABXVRYKR.js} +1 -1
  26. package/dist/{chunk-H3U47ZEL.js → chunk-AHBO5PKR.js} +11 -11
  27. package/dist/{chunk-C2PGWIIO.js → chunk-BJN6DNDM.js} +1 -1
  28. package/dist/{chunk-MEIVZG77.js → chunk-EBTCC5N3.js} +9 -9
  29. package/dist/chunk-EZ73LTEI.js +1 -0
  30. package/dist/chunk-FHKJQU3U.js +27 -0
  31. package/dist/{chunk-DY43MKMT.js → chunk-HCQ7SIGC.js} +1 -1
  32. package/dist/{chunk-6JVUT3D4.js → chunk-I4GL7BVS.js} +2 -2
  33. package/dist/{chunk-YJZ4VVDT.js → chunk-ITW5DB2J.js} +13 -13
  34. package/dist/{chunk-OICSZKUO.js → chunk-IUBESHKK.js} +1 -1
  35. package/dist/{chunk-F2GDJO2Y.js → chunk-KROUETJQ.js} +16 -16
  36. package/dist/chunk-KWW5PPQN.js +1 -0
  37. package/dist/chunk-MQUGCJRS.js +1035 -0
  38. package/dist/{chunk-2I3Z4UFG.js → chunk-QHL3LL5F.js} +14 -14
  39. package/dist/chunk-QJ4YAH34.js +108 -0
  40. package/dist/{chunk-RVPQRXC4.js → chunk-RYBDLJJV.js} +1 -1
  41. package/dist/chunk-SUXBGACL.js +10 -0
  42. package/dist/chunk-WOZ36LPR.js +9 -0
  43. package/dist/{chunk-6AXCLPSI.js → chunk-XTAGVLZJ.js} +1 -1
  44. package/dist/chunk-XZXMVACA.js +5 -0
  45. package/dist/file-intake/index.js +1 -1
  46. package/dist/i18n/index.d.ts +1 -1
  47. package/dist/{index-cfVn8e67.d.ts → index-HJwNWiNU.d.ts} +1 -1
  48. package/dist/index.d.ts +15 -14
  49. package/dist/index.js +678 -631
  50. package/dist/locales/zh-Hans.d.ts +1 -1
  51. package/dist/locales/zh-Hans.js +1 -1
  52. package/dist/map/index.js +8 -8
  53. package/dist/page-tabs/index.js +5 -5
  54. package/dist/pdf/index.js +1 -1
  55. package/dist/{strings-DkffgGGm.d.ts → strings-BuYlsGKG.d.ts} +17 -0
  56. package/dist/telemetry/index.js +1 -1
  57. package/dist/ui/index.d.ts +2 -2
  58. package/dist/ui/index.js +1 -1
  59. package/package.json +1 -1
  60. package/dist/Calculator-HARXMYLM.js +0 -29
  61. package/dist/ConfirmDialog-VL3YU35U.js +0 -1
  62. package/dist/CurrencyConverter-KQ5UR4AU.js +0 -21
  63. package/dist/Notepad-PJUJ5VF2.js +0 -25
  64. package/dist/PdfViewer-4KFBJ4ZV.js +0 -1
  65. package/dist/Sidebar-GO32NHGH.js +0 -44
  66. package/dist/Spreadsheet-XPLYPDLZ.js +0 -37
  67. package/dist/chunk-CV3XVHWR.js +0 -108
  68. package/dist/chunk-DBWGMZCY.js +0 -1
  69. package/dist/chunk-QD22TNW3.js +0 -27
  70. package/dist/chunk-QKNGN4H4.js +0 -10
  71. package/dist/chunk-SKDIIPFY.js +0 -1
  72. package/dist/chunk-SZTKBF3D.js +0 -13
  73. package/dist/chunk-VROJD5KW.js +0 -1035
@@ -1,108 +0,0 @@
1
- import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as s,widthToFit as l,navIcons as c}from"./chunk-DSSLOQDW.js";import{CopyButton as d}from"./chunk-DY43MKMT.js";import{isStaleChunkError as u,CMD_Z as h,CMD_SHIFT_Z as m,Result as p,useIsMobile as f,useShellPrefs as w}from"./chunk-QKNGN4H4.js";import{LoadingSpinner as y}from"./chunk-NVFKXL52.js";import{Button_default as g}from"./chunk-SZTKBF3D.js";import{confirm as b,dialogA11y as v}from"./chunk-F2GDJO2Y.js";import{PopupMenu as x,PopupMenuItem as k,PopupMenuDivider as E,PopupMenuLabel as C}from"./chunk-GNW45MGV.js";import{Z_LAYERS as M,runEscapeInterceptors as N}from"./chunk-FIEA5CGB.js";import{reportBoundaryError as S}from"./chunk-KNUR2UEG.js";import{useShellStrings as L}from"./chunk-DBWGMZCY.js";import{Icon as T}from"./chunk-B427NVDP.js";import{createContext as z,useContext as A,Component as D,useLayoutEffect as P,useRef as I,useEffect as K,useState as $,useSyncExternalStore as W,useCallback as O,isValidElement as R,Fragment as F,Children as q,cloneElement as j,useMemo as B,useId as H,useReducer as Y,Suspense as U}from"react";import{jsxs as X,jsx as V,Fragment as _}from"react/jsx-runtime";import{createPortal as G}from"react-dom";import{useLocation as J}from"react-router-dom";import{useQueryClient as Q,useQuery as Z}from"@tanstack/react-query";function ee(e){return"component"in e}function te(e){return"endpoint"in e}var ne={};function re(e){ne=e}var oe=new Proxy({},{get:(e,t)=>ne[t],has:(e,t)=>t in ne,ownKeys:()=>Object.keys(ne),getOwnPropertyDescriptor(e,t){if(t in ne)return{configurable:!0,enumerable:!0,value:ne[t]}}}),ie=null;function ae(e){ie=e}function se(){return null!==ie}var le=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),ce=new Proxy({},{get:(e,t)=>ie?ie[t]:"string"==typeof t&&le.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),de=z(null);function ue(){return A(de)?.pageSearch??""}var he=null,me=/* @__PURE__ */new Set;function pe(e){he!==e&&(he=e,me.forEach(e=>e()))}function fe(){return he}function we(e){return me.add(e),()=>{me.delete(e)}}function ye({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
2
- return X("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
- /* @__PURE__ */V(T,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
- /* @__PURE__ */X("div",{className:"min-w-0",children:[
5
- /* @__PURE__ */V("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
6
- /* @__PURE__ */V("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
7
- /* @__PURE__ */V("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var ge=class extends D{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),S(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */V(ye,{error:e,onReload:this.reset}):this.props.children}},be=z(null),ve="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function xe({className:e="",auto:t=!1}){const n=A(be),r=L().undo,o=n?.claimOwnMount;if(P(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:d}=n;/* @__PURE__ */
8
- return X("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
- /* @__PURE__ */V("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",h):r.nothingToUndo,className:ve,children:r.undo}),
10
- /* @__PURE__ */V("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(d??"",m):r.nothingToRedo,className:ve,children:r.redo})]})}var ke=/* @__PURE__ */new Set([408,429]);function Ee(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ce(e){const t=Ee(e);return null!=t&&(t>=400&&t<500&&!ke.has(t))}function Me(e,t){return!Ce(t)&&e<3}function Ne(){const e=L().loading;/* @__PURE__ */
11
- return V(y,{size:"sm",padding:"p-8",label:e.label})}var Se="flex-1 min-h-0";function Le(){const e=L().record;/* @__PURE__ */
12
- return V(y,{label:e.loading,padding:"",className:Se})}function Te(e){return e??void 0}function ze({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=L().record;if(t||e&&n)/* @__PURE__ */return V(Le,{});if(r){const e=Ee(r);if(401===e)/* @__PURE__ */
13
- return V(p,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Se});if(403===e)/* @__PURE__ */
14
- return V(p,{status:"403",className:Se});if(404===e||410===e)/* @__PURE__ */
15
- return V(p,{status:"404",title:i.notFound,className:Se});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
16
- return V(p,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */V(g,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Se})}/* @__PURE__ */
17
- return V(p,{status:"404",title:i.notFound,className:Se})}function Ae({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */V(_,{children:t(e)}):/* @__PURE__ */V(ze,{...n})}var De=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Pe(e){return"string"==typeof e&&(e.startsWith("new-")||De.test(e))}function Ie(e){if(Pe(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ke=z({openWindows:[],openEntity:()=>{},openPage:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),$e=z(null);function We(e){const t=A($e),n=I(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),P(()=>{if(t)return t(n.current,e)},[t,e]),K(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Oe(){const e=I(/* @__PURE__ */new Map),[t,n]=$(!1);return{dirty:t,registerDirty:O((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 Re(){return A(Ke)}function Fe(e){if("page"!==e.type&&Ie(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 qe({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Oe(),i=oe[e.route];if(!i||!ee(i))return null;const a=i,s=a.component;/* @__PURE__ */
18
- return V(zr,{open:!0,onClose:t,icon:c[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__ */V($e.Provider,{value:o,children:/* @__PURE__ */V(U,{fallback:/* @__PURE__ */V("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */V(Ne,{})}),children:/* @__PURE__ */V(s,{})})})})}function je({entityType:e,entityId:t,label:n}){const r=L(),o=Q(),{data:i}=Z({queryKey:["my-profile-sidebar"],enabled:se(),queryFn:()=>ce.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
19
- return V("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ce.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:s?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(s?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */V(T,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var Be=/* @__PURE__ */new Set;function He({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=oe[e.entityType];if(!o||!te(o))return null;const i=o,[a,s]=$(!1),{dirty:l,registerDirty:d}=Oe(),u=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Pe(e.entityId),p=!i.selfFetching&&!h&&!m&&se(),f=Z({queryKey:[u,e.entityId],queryFn:()=>{return ce.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Te(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Ce(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Me}),w=f.data,y=f.refetch;K(()=>{var t;if(p)return t=t=>{t!==e.id||Be.has(t)||y({cancelRefetch:!1})},In.add(t),()=>{In.delete(t)}},[y,e.id,p]);const g=O(()=>{a&&!l?s(!1):t()},[a,l,t]),b=i.selfFetching?e.label:w?i.title(w,a,s):e.label,v=i.icon,x=v?c[v]:null,k=b,E=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */V(U,{fallback:/* @__PURE__ */V(Ne,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */V(U,{fallback:/* @__PURE__ */V(zr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */V(Le,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */V(zr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */V(ze,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */V(zr,{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:l,editing:a||m||h,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */V($e.Provider,{value:d,children:/* @__PURE__ */V(U,{fallback:/* @__PURE__ */V(Le,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */V(Ae,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function Ye(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function Ue(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function Xe(e){const t=Ye(e),n=t??Ue(e);if(!n)return;if(t&&!Un(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Kn(o)}function Ve(e){if("page"!==e.type)return!0;const t=e.route?oe[e.route]:void 0;if(!t||!ee(t))return!0;const n=t;return!n.widget&&!n.utility}function _e(){const e=ar();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var Ge=/* @__PURE__ */new Map;function Je(){const e=_e();if(e)return Ge.get(e)}function Qe(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 Ze="rosh-peek-style",et=M.peek,tt=M.taskbarPreview;function nt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Ze))return;const e=document.createElement("style");e.id=Ze,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:${et}!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 rt(){"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 ot({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=L(),l=I(null),[c,d]=$({w:n,h:Math.round(.75*r)}),[u,h]=$(!1);return P(()=>{const o=l.current;if(!o)return;const i=Ye(e)??Qe(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=Math.min(n/a.width,r/a.height),c=Math.max(80,Math.round(a.width*s)),u=Math.max(60,Math.round(a.height*s));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(${s})`,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__ */X("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
20
- /* @__PURE__ */V("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!u&&/* @__PURE__ */X("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
21
- /* @__PURE__ */V(T,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
22
- /* @__PURE__ */V("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */V("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-white bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */V("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:s.taskbar.closeWindow,children:/* @__PURE__ */V(T,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function it({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=L(),s=e.length>1,l=I(null),[c,d]=$({left:-9999,top:-9999,ready:!1}),[u,h]=$(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");P(()=>{const e=l.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]),K(()=>rt,[]);const m="top"===u,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs 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 G(
23
- /* @__PURE__ */V("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:tt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{rt(),i()},children:e.map(e=>{const t=Ye(e.id)??Qe(e.label),o=t?function(e){if(Un(e))return null;const t=e.getBoundingClientRect(),n=Fn(),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 X("div",{className:"group flex flex-col items-center",onMouseEnter:()=>nt(t),children:[!m&&/* @__PURE__ */V("span",{className:p,children:e.label}),
25
- /* @__PURE__ */V(ot,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */V("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */X("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-white shadow-sm",children:[
26
- /* @__PURE__ */V(T,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function at(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 st({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=L(),[a,s]=$(null);K(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(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 l=W(sr,ar),[,d]=$(0);K(()=>{const e=()=>d(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,u]=$(0);K(()=>{const e=()=>u(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Qe(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=$(null),[f,w]=$(null),[y,g]=$(null),b=I(null),v=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},M=e.filter(e=>!e.route||!oe[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?oe[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 G(
27
- /* @__PURE__ */X(_,{children:[N.map(e=>{const n=e.route?c[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(l){const t=document.querySelector(`[data-modal-id="${l}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,d=e.items.some(e=>{const t=Ye(e.id)??Qe(e.label);return!!t&&!Un(t)});/* @__PURE__ */
28
- return X("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(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:v,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),p(null),w(null),s?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-2 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&&R(n)?j(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */V(T,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
29
- /* @__PURE__ */V("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),d&&/* @__PURE__ */V("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */V("span",{className:"shrink-0 px-2 py-0.5 rounded-full bg-blue-500/80 text-white text-2xs font-bold leading-none",children:e.items.length}),!s&&/* @__PURE__ */V("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__ */V(T,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
30
- /* @__PURE__ */V("div",{className:"flex-1"}),M.length>=2&&/* @__PURE__ */X("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-blue-50 transition-colors shrink-0",children:[
31
- /* @__PURE__ */V(T,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */X(x,{portal:!0,minWidth:200,style:at(y.x,y.y),onClose:()=>g(null),children:[
32
- /* @__PURE__ */V(C,{children:y.label}),
33
- /* @__PURE__ */X(k,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=kn.get(e);t&&$n(t)}(e.id))},children:[
34
- /* @__PURE__ */V(T,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
35
- /* @__PURE__ */X(k,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
36
- /* @__PURE__ */V("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */V("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__ */V(E,{}),
38
- /* @__PURE__ */X(k,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
39
- /* @__PURE__ */V(T,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */V(it,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:v})]}),a)}var lt=["/login","/forgot-password","/reset-password","/force-change-password"];function ct({children:e,windowAccentForRoute:t}){const n=J(),r=lt.some(e=>n.pathname.startsWith(e)),[o,i]=$([]),a=I(o);P(()=>{a.current=o},[o]);const s=W(we,fe,fe),l=I(/* @__PURE__ */new Map),c=e=>{const t=Ve(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.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 l.current.set(e.id,i),i};K(()=>{Ge.clear();for(const e of o)e.route&&Ge.set(e.id,e.route)},[o]);const d=O(e=>{i(t=>t.filter(t=>t.id!==e))},[]),u=O(e=>{var t;Ye(e)||Ue(e)?(t=e,window.dispatchEvent(new CustomEvent(lr,{detail:{windowKey:t}}))):d(e)},[d]),h=(e,t=!1)=>{const n=yn;t&&Be.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,(gn.get(i)??-1)>a)||Kn(o),t&&Be.delete(e)},50)},m=O((e,t,n,r,o)=>{if(!oe[e]||!te(oe[e]))return;const a=`${e}:${t}`,s=_e();i(i=>{const l=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return l?(h(l.id),i):(h(a,!0),[...i,{id:a,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Te(n),openedFrom:s}])})},[]),p=O((e,t={})=>{if(!oe[e]||!ee(oe[e]))return;const n=oe[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l}=t,c=e=>{var t;o?(t=e,Sn.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=_e();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&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,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}}]}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}}]})},[u]),f=O(()=>{},[]),w=O(()=>{},[]),y=u,g=u;/* @__PURE__ */
40
- return X(Ke.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__ */V(st,{openWindows:o,onRemove:u,onSplitView:Lr,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&&Kn(e)}})},onActivateById:Xe}),
42
- /* @__PURE__ */V(Tr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
43
- /* @__PURE__ */
44
- return V(de.Provider,{value:c(e),children:/* @__PURE__ */V(ge,{fallback:(t,n)=>/* @__PURE__ */V(zr,{open:!0,onClose:()=>d(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */V(ye,{error:t,onReload:n})}),children:/* @__PURE__ */V(Kt,{spec:Fe(e),children:/* @__PURE__ */V(Wr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */V(qe,{item:e,onClose:()=>d(e.id),accentRgb:n}):/* @__PURE__ */V(He,{item:e,onClose:()=>d(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var dt=null,ut=/* @__PURE__ */new Set;function ht(){return dt}function mt(e){if(dt!==e){dt=e;for(const e of ut)e()}}function pt(e){return ut.add(e),()=>{ut.delete(e)}}var ft=!1,wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},yt=()=>{};function gt(e){ft=e,wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function bt(e,t){ft&&("submenu"===e?wt.submenus++:wt.menus++,wt.menuKey=t)}function vt(e){if(!ft)return yt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!ft)return;const r=performance.now()-t;"move"===e?wt.moveMs+=r:wt.resizeMs+=r}}function xt(){const e=wt;return wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var kt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Et=/* @__PURE__ */new Set(["svg"]);function Ct(e){const t=[],n={text:"",accessories:[]};return Mt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Mt(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=>Mt(e,t,n));if(!R(e))return;const r=e;if(r.type!==d)if(r.type!==F){if("string"==typeof r.type){if(Et.has(r.type))return;if(!kt.has(r.type))return n.push(" "),q.toArray(r.props.children).forEach(e=>Mt(e,t,n)),void n.push(" ")}t.accessories.push(j(r,{key:`title-part-${t.accessories.length}`}))}else q.toArray(r.props.children).forEach(e=>Mt(e,t,n));else void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text)}var Nt=/* @__PURE__ */new Map,St=/* @__PURE__ */new Set,Lt=0;function Tt(){Lt++,St.forEach(e=>e())}function zt(e){return Nt.get(e)}function At(e){return St.add(e),()=>{St.delete(e)}}function Dt(){return Lt}var Pt=z(""),It=z(null);function Kt({spec:e,children:t}){/* @__PURE__ */
45
- return V(It.Provider,{value:e,children:t})}var $t=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Wt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Ot='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Rt(e){return Ft(e).replace(/\s+/g," ").trim()}function Ft(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(Ft).join("");if(R(e)){const t=e,n="string"==typeof t.type?t.type:"";return $t.has(n)?"":` ${Ft(t.props?.children)} `}return""}function qt(e){const t=A(Pt);K(()=>{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 jt={};function Bt(e,t,n){const r=A(Pt);K(()=>{if(!r)return;jt[r]||(jt[r]=[]);const o={label:e,icon:n,onClick:t};return jt[r].push(o),()=>{jt[r]=(jt[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Ht({title:e}){const t=I(null);return K(()=>{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__ */V("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function Yt(e){}var Ut=z(null);function Xt(){return A(Pt)}function Vt(){const e=W(sr,ar),t=A(Ut);return t?.active??(pn.length<=1||null!=e)}function _t({children:e,position:t="right",quiet:n=!1}){const r=A(Ut),[o,i]=$(null);return K(()=>{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),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?G(e,o):null}function Gt({onClick:e,children:t,className:n}){const r=A(Ut);/* @__PURE__ */
46
- return V("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./ConfirmDialog-VL3YU35U.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 Jt="erp_window_positions",Qt={};try{const e=localStorage.getItem(Jt);e&&(Qt=JSON.parse(e))}catch{}var Zt=null;function en(){Zt&&clearTimeout(Zt),Zt=setTimeout(()=>{try{localStorage.setItem(Jt,JSON.stringify(Qt))}catch{}},500)}var tn="erp_activation_order",nn=[];try{const e=localStorage.getItem(tn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(nn=t)}catch{}var rn=null;function on(){rn&&clearTimeout(rn),rn=setTimeout(()=>{try{localStorage.setItem(tn,JSON.stringify(nn))}catch{}},500)}function an(e,t){Qt[e]||(Qt[e]=t,en())}function sn(e){return Qt[e]?{...Qt[e]}:null}function ln(e,t){Qt[e]=t,en()}function cn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(Qt))n(Qt[e],r,o)&&(delete Qt[e],i=!0);i&&en()}var dn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},un=4e3,hn=()=>{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"},mn={small:.8,medium:1,large:1.25,maximized:1.25},pn=[],fn=/* @__PURE__ */new Set,wn=/* @__PURE__ */new Set,yn=0,gn=/* @__PURE__ */new Map;var bn=0;function vn(){return bn}function xn(){bn++,fn.forEach(e=>e())}var kn=/* @__PURE__ */new Map,En=/* @__PURE__ */new Map,Cn=/* @__PURE__ */new Map;function Mn(){for(let e=pn.length-1;e>=0;e--){const t=Cn.get(pn[e]);if(t?.tab)return t.owner}return null}function Nn(){return W(sr,Mn,()=>null)}var Sn=/* @__PURE__ */new Set;var Ln=null;function Tn(e){Ln=null,Kn(e)}function zn(e){Ln=e;const t=kn.get(e);t&&Tn(t)}function An(e){Ln===e&&(Ln=null)}function Dn(e,t,n){if(n&&Cn.set(e,n),t)if(kn.set(t,e),En.set(e,t),Sn.delete(t)){pn.unshift(e);const n=nn.indexOf(t);-1!==n&&nn.splice(n,1),nn.unshift(t),on()}else!function(e,t){const n=nn.indexOf(t);if(-1===n)return void pn.push(e);let r=pn.length;for(let e=0;e<pn.length;e++){const t=En.get(pn[e]);if(t&&nn.indexOf(t)>n){r=e;break}}pn.splice(r,0,e)}(e,t),-1===nn.indexOf(t)&&(nn.push(t),on());else pn.push(e);xn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Ln===t&&Tn(e)}function Pn(e){return e?Cn.get(e)?.owner??En.get(e)??null:null}var In=/* @__PURE__ */new Set;function Kn(e){const t=Pn(ar()),n=pn.indexOf(e);-1!==n&&pn.splice(n,1),pn.push(e);const o=Cn.get(e);if(o?.root&&o.tab&&r()){const e=pn.filter(e=>{const t=Cn.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)pn.splice(pn.indexOf(t),1),pn.push(t)}wn.delete(e);const i=En.get(e);if(i){const e=nn.indexOf(i);-1!==e&&nn.splice(e,1),nn.push(i),on(),Ln&&Ln!==i&&(Ln=null)}xn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Pn(ar());a&&a!==t&&In.forEach(e=>e(a))}function $n(e){const t=pn.indexOf(e);-1!==t&&pn.splice(t,1),wn.add(e),gn.set(e,++yn);const n=En.get(e);if(n){const e=nn.indexOf(n);-1!==e&&(nn.splice(e,1),on())}xn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var Wn=/* @__PURE__ */new Set;var On=8,Rn=32;function Fn(){return e()}var qn=40,jn=80,Bn=384,Hn=400;function Yn(e,t=Fn()){const n=Math.min(Math.max(e.x,t.x+jn-e.w),t.x+t.w-jn),r=Math.min(Math.max(e.y,t.y),t.y+t.h-qn);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Un(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Fn();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 Xn(e){const t=Fn(),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 Vn=null;function _n(e){const t=(Vn||((Vn=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${M.snapPreview}`,"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(Vn)),Vn);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 Gn(){Vn&&(Vn.style.opacity="0",Vn.style.display="none")}var Jn=[{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"}],Qn=350,Zn=200;function er({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=$(!1),s=I(void 0),l=I(void 0);K(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),Qn)},d=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),Zn)};/* @__PURE__ */
47
- return X("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:d,children:[
48
- /* @__PURE__ */V("button",{onClick:t,onFocus:c,onBlur:d,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */V("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.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-2 shadow-lg",children:Jn.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */V("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.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__ */V("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var tr="rosh-gesture-style";var nr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},rr=4;function or(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(tr))return;const e=document.createElement("style");e.id=tr,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=vt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function ir(e){const t=pn.indexOf(e);if(-1===t)return-1;const n=M.window+t*M.windowStep,o=Cn.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of Cn){if(!t.root||t.owner!==o.owner)continue;const n=pn.indexOf(e);-1!==n&&(i=Math.max(i,M.window+n*M.windowStep))}return i>=n?i+2+Math.min(t,7):n}function ar(){return pn[pn.length-1]||null}function sr(e){return fn.add(e),()=>{fn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=pn.length-1;e>=0;e--)Wn.has(pn[e])||pn.splice(e,1);nn=nn.filter(e=>{const t=kn.get(e);return null!=t&&Wn.has(t)}),on(),xn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var lr="modal-close-request";function cr(e){W(sr,vn);const t=A(Ut);if(pn.length<=1)return!0;if(e){const t=kn.get(e);if(null!=t)return ar()===t}return t?.active??null!=ar()}var dr=!1,ur=/* @__PURE__ */new Set;function hr(e){return ur.add(e),()=>ur.delete(e)}function mr(){return dr}function pr(e){dr!==e&&(dr=e,ur.forEach(e=>e()))}function fr(){pr(!dr)}function wr(){pr(!1)}var yr=null,gr=/* @__PURE__ */new Set;function br(e){return gr.add(e),()=>gr.delete(e)}function vr(){return yr}function xr(e){yr!==e&&(yr=e,gr.forEach(e=>e()))}var kr=null,Er=/* @__PURE__ */new Set;function Cr(e){return Er.add(e),()=>Er.delete(e)}function Mr(){return kr}function Nr(e){kr!==e&&(kr=e,Er.forEach(e=>e()))}function Sr(){if(!kr)return void pr(!1);xr(kr),Nr(null),pr(!1)}function Lr(){pr(!dr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Tr(){const e=W(hr,mr),[t,n]=$(e),[r,o]=$(e);return K(()=>{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?G(
49
- /* @__PURE__ */V("div",{onMouseDown:e=>{e.stopPropagation(),pr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:M.expose,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 zr({open:t,onClose:i,title:c,icon:d,copyText:u,size:h="lg",dirty:m=!1,onNext:p,onPrev:y,footer:g,bodyScroll:C,onMinimize:S,initialBox:z,actions:D,actionsLeft:F,editing:q=!1,allowPinOnTop:Y,initialPosition:U,widget:J,compact:Q,appStyle:Z,flushBody:ee,autoHeight:te,autoMinHeight:ne,autoWidth:re,widgetMenu:oe,dimensions:ie,windowKey:ae,openedFromKey:se,accentRgb:le,children:ce}){const ue=f(),[he,me]=$(0),[pe,fe]=$(!1),we=I(null),ye=I(0);K(()=>{ye.current=he},[he]);const ve=O(e=>{ue&&(we.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},fe(!0),mt(se??null))},[ue,se]),ke=W(pt,ht);K(()=>{if(!pe)return;const e=e=>{if(!we.current)return;const t=e.clientX-we.current.startX;if(Math.abs(e.clientY-we.current.startY)>Math.abs(t)+12)return we.current=null,fe(!1),me(0),void mt(null);me(Math.max(0,t))},t=()=>{if(!we.current)return;const e=.3*window.innerWidth,t=ye.current>e;we.current=null,fe(!1),t?(me(window.innerWidth),setTimeout(()=>{i(),me(0),mt(null)},180)):(me(0),mt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[pe]);const[Ee,Ce]=$(c),Me=L(),Ne=Me.window;K(()=>{Ce(c)},[c]);const Se=B(()=>Rt(Ee).trim()||void 0,[Ee]),Le=H(),[Te,ze]=$(!1),Ae=I(!1),[De,Pe]=$(!1),[Ie,Ke]=$(null),$e=A(It),Oe=A(de),{prefs:Fe,save:qe}=w(),je=!!Fe.window_accent_stripe,Be=Fe.favorite_documents||[],He=!!$e&&Be.some(e=>e.entityType===$e.entityType&&e.entityId===$e.entityId),Ye=O(()=>{if(!$e)return;const e=He?Be.filter(e=>!(e.entityType===$e.entityType&&e.entityId===$e.entityId)):[...Be,{entityType:$e.entityType,entityId:$e.entityId,label:$e.label}];qe({favorite_documents:e})},[$e,He,Be,qe]),[Ue,Xe]=$(null),[Ve,_e]=$("top-right"===U?"right":"left"),Ge=I(!1),Je=I(null);P(()=>{const e=Je.current;e&&(le?e.style.setProperty("--window-accent-rgb",le):e.style.removeProperty("--window-accent-rgb"))},[le]);const Qe=I(!1),Ze=I(null),et=I(null),tt=I(null),[nt,rt]=$(!1),ot=I(null),it=!!(g||D||F)||nt,at=A(be),st=""!==A(Pt),lt=I(null);lt.current=Oe?{owner:Oe.key,tab:Oe.tab,root:!st}:null;const ct=ae||(Oe&&!st?Oe.key:null),dt=!!at&&!st&&at.enabled&&at.hasState&&(q||at.declaredEditable)&&!at.handMounted&&it&&!J&&!Q&&!Z&&!ue,ut=/* @__PURE__ */V(T,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),ft=d&&R(d)?j(d,{className:`h-4 w-4 ${d.props?.className??""}`.trim()}):d??ut,wt=()=>/* @__PURE__ */V("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ke(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:ft}),yt=40,{minimize:gt,items:bt,restoreIfMinimized:vt,openWindows:xt}=Re(),kt=I(`modal-${Math.random().toString(36).slice(2,8)}`).current;K(()=>{if(J)return Wn.add(kt),()=>{Wn.delete(kt)}},[J,kt]),K(()=>{const e=e=>{const t=e.detail;t?.id===kt&&Ce(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[kt]);const[Et,Mt]=$(M.window),St=function(e){const t=W(sr,ar);return pn.length<=1||t===e}(kt),Lt=function(e){return W(sr,()=>wn.has(e))}(kt),zt=W(hr,mr),At=W(br,vr),Dt=W(Cr,Mr),Kt=!Y&&!J,$t=zt&&Kt,[Ft,qt]=$(!1),Bt=$t&&Dt===kt,[Ht,Yt]=$(!1),Xt=Ht&&Kt&&At===kt?"picked":null,Vt=I($t);K(()=>{if(Vt.current&&!$t){Yt(!0);const e=setTimeout(()=>{Yt(!1),yr===kt&&xr(null)},700);return Vt.current=$t,()=>clearTimeout(e)}Vt.current=$t},[$t,kt]),K(()=>{$t||qt(!1)},[$t]),K(()=>{const e=et.current,t=tt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>rt(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()},[t]),K(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&Je.current){const t=Je.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=et.current,n=tt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const _t=I(!1),Gt=O(e,[]),Jt=O(()=>{const t=e(),n=ie?ie[0]:dn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=mn[hn()],l=ie?Math.min(ie[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(pn.length-1),d=Math.max(yt,(i-l)/2),u=(o-a)/2,m=t.h-yt-l-d;return"top-right"===U?{x:t.x+t.w-a-yt,y:t.y+yt,w:a,h:l}:"top-left"===U?{x:t.x+yt,y:t.y+yt,w:a,h:l}:{x:t.x+Math.max(yt,(o-a)/2+yt)+Math.min(c,Math.max(0,u)),y:t.y+d+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),Zt=I(!1);t||(Zt.current=!1);const tn=ae||u||null;K(()=>{if(!t)return;Dn(kt,tn,lt.current??void 0),ae||Kn(kt),_t.current=!1,Mt(ir(kt));const e=()=>{Mt(ir(kt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ae;if(!e.label)return!1;const t=Je.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Kn(kt),Mn.current)return;const t=Fn(),n=Math.min(An.current.w,t.w-40),o=Math.min(An.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;on({x:i,y:a,w:n,h:o}),zn(!1)},i=e=>{const t=e.detail;r(t)&&(Kn(kt),Ke({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ae)return;Kn(kt);const t=An.current,n=function(e,t=Fn()){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=Je.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)}on(n)};return window.addEventListener("modal-reorder",e),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=pn.indexOf(e);-1!==t&&(pn.splice(t,1),xn()),wn.delete(e),gn.delete(e),Cn.delete(e);const n=En.get(e);n&&(En.delete(e),kn.delete(n))}(kt),window.removeEventListener("modal-reorder",e),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"))}},[t,kt,tn,Gt]);const nn=!J&&"maximized"===hn(),[rn,on]=$(()=>{if(tn&&Qt[tn]){const e={...Qt[tn]};return ie&&(e.w=ie[0],te||(e.h=ie[1])),Yn(e)}return z?{x:z.x,y:z.y,w:z.w,h:z.h}:nn?Gt():Jt()}),[an,sn]=$(()=>!te),[ln,cn]=$(()=>r()),fn=I(ln),yn=I(null);K(()=>{const e=()=>{const e=r();e!==fn.current&&yn.current?.(e),fn.current=e,cn(e),Mt(ir(kt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[kt]);const bn=ln&&!!Oe?.tab&&!st&&!J&&!ue,vn=bn,Mn=I(vn);Mn.current=vn;const Sn=Nn(),Ln=ln&&!!Oe?.tab&&!J&&!ue&&!zt&&Sn!==Oe.key,[Tn,zn]=$(()=>tn&&Qt[tn]||z?vn:vn||nn),An=I(rn);An.current=rn;const Pn=I(Tn);P(()=>{Pn.current=Tn},[Tn]),P(()=>{if(an||bn)return;const e=Je.current,t=Ze.current;if(!e||!t)return;const n=ne??(J?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.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,An.current.y)-24),g=w?Math.min(An.current.h,y):Math.min(Math.max(n,d+p),y),b=Math.abs(g-o)>1;b&&(o=g,on(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),J||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&sn(!0)},160)))},l=new ResizeObserver(s);s(),ot.current&&l.observe(ot.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[an,J,ne,it,bn]),P(()=>{if(!te||!an||J||!t)return;const e=ot.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Tn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ne??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,An.current.y)-24);on(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[te,an,J,t,Tn,ne]);const In=!1!==re&&!J&&!Z&&!ue,[qn,jn]=$(()=>!In);P(()=>{if(qn||!t)return;if(!In||Tn)return void jn(!0);const n=Je.current,r=Ze.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=An.current.w,c=0;const d=()=>jn(!0),u=()=>{c=0;const t=An.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void d();const u=e(),h=u.w-80;if(t.w>=h)return void d();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const b=s(t,l(t.w,w,g),u,yt);b!==t&&(i=b.w,on(b))};u();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(u))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(d,un);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[qn,t,In,Tn]);const Un=I(null),Vn=!(!Oe?.tab||st||J||ue);yn.current=t=>{if(!Vn)return;if(t)return Un.current||(Un.current={box:{...An.current},maximized:Pn.current}),void(Pn.current=!0);const r=Un.current;Un.current=null;const o=e();if(r?.maximized)return Pn.current=!0,zn(!0),void on(o);const i=r?.box??(tn?Qt[tn]:void 0);if(Pn.current=!1,zn(!1),i&&!n(i,o,!1)){const e={...i};ie&&(e.w=ie[0],te||(e.h=ie[1])),on(Yn(e))}else on(Jt())},K(()=>{vn&&(Pn.current=!0,zn(!0),on(Gt()))},[vn,Gt]),K(()=>{if(J)return;const e=()=>{const e=tn?Qt[tn]:void 0;if(Pn.current=!1,zn(!1),e){const t={...e};ie&&(t.w=ie[0],te||(t.h=ie[1])),on(Yn(t))}else on(Jt())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[J,Jt,tn]),K(()=>{t&&tn&&!bn&&(Qt[tn]=rn,en()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[rn,t,tn,bn]),K(()=>{if(!t)return;const e=()=>{Pn.current?on(Gt()):document.body.classList.contains("rosh-gesturing")||on(Yn)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Tn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Tn,Gt]),K(()=>{if(t&&(ze(!1),Ae.current=!1,Ge.current=!1,jn(!In),!Mn.current)){if(tn&&Qt[tn]){const e=Qt[tn];return void on(t=>Yn({...e,...te?{h:t.h}:{},...In?{x:t.x,w:t.w}:{}}))}z&&(on({x:z.x,y:z.y,w:z.w,h:z.h}),zn(z.maximized))}},[t]),K(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{Je.current?.contains(t.target)&&!Ae.current&&(Ae.current=!0,e=setTimeout(()=>ze(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const Jn="auto"===m?Te:!0===m,Qn=Oe&&!st?Oe.key:null,Zn=B(()=>Ct(Ee),[Ee]),tr=I({shortcutSpec:$e,isOnDesktop:He,toggleDesktopShortcut:Ye,taskbarStrings:Me.taskbar});P(()=>{tr.current={shortcutSpec:$e,isOnDesktop:He,toggleDesktopShortcut:Ye,taskbarStrings:Me.taskbar}});const cr=I(null);cr.current||(cr.current={open:(e,t)=>Ke({x:e,y:t}),items:()=>{const e=tr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of jt[kt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),K(()=>{t&&Qn&&function(e,t){const n=Nt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.menu===t.menu||(Nt.set(e,t),Tt())}(Qn,{title:Zn.text||Se,dirty:Jn,copy:Zn.copy,menu:cr.current??void 0})},[t,Qn,Se,Jn,Zn.text,Zn.copy]),K(()=>{if(t&&Qn)return()=>{return e=Qn,void(Nt.delete(e)&&Tt());var e}},[t,Qn]),We(!(ae||!t)&&Jn);const dr=O(async()=>{if(!Ge.current){if(Jn||"auto"===m&&Ae.current){Ge.current=!0;const e=Se,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(Ge.current=!1,!t)return}i()}},[Jn,m,i,Se]);P(()=>{if(!t||!ct)return;const e=e=>{e.detail?.windowKey===ct&&dr()};return window.addEventListener(lr,e),()=>window.removeEventListener(lr,e)},[t,ct,dr]);const ur=I(null),fr=O(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ke(null),Kn(kt),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=Je.current,s=a?.getBoundingClientRect();let l,c,d,u;if(ur.current){const t=ur.current;ur.current=null,u=t.w,d=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${u}px`,a.style.height=`${d}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:An.current.x,c=s?s.top:An.current.y,d=s?s.height:An.current.h,u=s?s.width:An.current.w;zn(!1),on(e=>({...e,x:l,y:c,w:u,h:d}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<rr&&Math.abs(e.clientY-i)<rr)return;r=or(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,d=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${d-c}px)`),An.current={...An.current,x:s,y:d},!J){const t=function(e,t){const n=Fn(),r=e<=n.x+On,o=e>=n.x+n.w-On,i=t<=n.y+On,a=t>=n.y+n.h-On,s=e<=n.x+Rn,l=e>=n.x+n.w-Rn,c=t<=n.y+Rn,d=t>=n.y+n.h-Rn;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"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?_n(Xn(t)):Gn())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),Gn();const e=Yn({...An.current});if(An.current=e,!J&&h){ur.current={x:l,y:c,w:u,h:d};const e=Xn(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 on(e)}if(J){const t=e.x+e.w/2,n=window.innerWidth/2;_e(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),on(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),wr=O((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,s=Je.current,l=s?.getBoundingClientRect(),c=l?l.left:An.current.x,d=l?l.top:An.current.y,u=l?l.width:An.current.w,h=l?l.height:An.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;zn(!1),on({x:c,y:d,w:u,h:h}),An.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,An.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<rr&&Math.abs(e.clientY-a)<rr)return;o=or(n,r,nr[t],"resize")}g=((e,t)=>{let n=c,r=d,o=u,i=h;if(f&&(o=Math.max(Bn,u+e)),w&&(i=Math.max(Hn,h+t)),m){const t=Math.max(Bn,u-e);n=c+u-t,o=t}if(p){const e=Math.max(Hn,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?.(),on({...An.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),gr=O(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(),Kn(kt),"Enter"===e.key)return void(Tn?(zn(!1),on(Jt())):(zn(!0),on(Gt())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{ur.current||(ur.current={...An.current})};if(r<0)return e(),zn(!0),void on(Gt());if(r>0){if(Tn)return zn(!1),void on(Jt());if(ur.current){const e=Yn(ur.current);return ur.current=null,An.current=e,void on(e)}return void $n(kt)}e(),zn(!1);const t=Xn(n<0?"left":"right");return An.current=t,void on(t)}if(Tn)return;const o=An.current,i=e.shiftKey?{...o,w:Math.max(Bn,o.w+24*n),h:Math.max(Hn,o.h+24*r)}:Yn({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});An.current=i,on(i)},[kt,Tn,Jt,Gt]),kr=O(e=>{ur.current||(ur.current={...An.current}),zn(!1);const t=Xn(e);An.current=t,on(t),Kn(kt)},[kt]),Er=vn||$t?{}:{tabIndex:0,role:"group","aria-label":Se?`${Se} — ${Ne.windowSuffix}`:Ne.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:gr},Nr=()=>{zn(!0),on(Gt())},Sr=O(()=>{const e=Je.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Wt);t&&!t.disabled&&t.click()}},[]);K(()=>{if(!t)return;if(J)return;const e=e=>{if(pn[pn.length-1]===kt&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Sr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&Je.current?.contains(t)))return;if(t.closest(Ot))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,kt,J]),K(()=>{if(!t)return;const e=e=>{pn[pn.length-1]===kt&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:kt}})),Ae.current=!1,ze(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:kt}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),K(()=>{if(!t)return;if(J)return;const e=e=>{if("Escape"===e.key&&pn[pn.length-1]===kt){if(N(e))return e.preventDefault(),void e.stopPropagation();if(bn&&!q)return;e.preventDefault(),e.stopPropagation(),dr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,dr,kt,J,bn,q]);const Lr=t&&(void 0!==p||void 0!==y),Tr=O(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-(--z-toast) bg-gray-900 text-white flex min-h-10 items-center px-5 py-3 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(K(()=>{if(!t)return;const e=e=>{if(pn[pn.length-1]!==kt)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Lr&&(e.preventDefault(),p?p():Tr("bottom")),"k"===e.key&&Lr&&(e.preventDefault(),y?y():Tr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,y,Lr,Tr,kt]),!t||Zt.current)return null;const zr=$t?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),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,d=Fn(),u=(d.w-20*(o+1))/o,h=(d.h-14*(i+1)-22*i)/i,m=c?(o-l)*(u+20)/2:0;return{x:d.x+20+s*(u+20)+m,y:d.y+14+a*(h+14+22),w:u,h:h}}(kt):null,Ar=$t&&zr?Math.min(zr.w/rn.w,zr.h/rn.h):1,Dr=(()=>{if($t&&zr){const e=Ar,t=rn.w*e,n=rn.h*e,r=zr.x+(zr.w-t)/2-rn.x,o=zr.y+(zr.h-n)/2-rn.y,i=Ft||Bt;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:M.expose+(i?20:10),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(Ht&&Kt){const e="picked"===Xt;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:M.expose+30}:{}}}return null})(),Pr=v({modal:!1,titleId:!J&&(bn?!Oe?.home:!ue)?Le:void 0,label:Zn.text||Se}),Ir=/* @__PURE__ */X("div",{children:[
50
- /* @__PURE__ */X("div",{ref:Je,"data-modal-panel":!0,"data-modal-id":kt,"data-window-key":ae||void 0,...Y?{"data-utility":""}:{},...De?{"data-pinned-top":""}:{},...J?{"data-widget":""}:{},...Oe?{"data-window-owner":Oe.key}:{},...Oe&&!st?{"data-window-root":""}:{},...bn?{"data-window-tab":""}:{},...Pr,className:bn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(J?St?"shadow-xl":"shadow-lg":"border "+(St?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(Qe.current=!1,$t){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),xr(kt),pr(!1),void Kn(kt)}if(!St&&!J&&!De&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===Je.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),Qe.current=!0,Ke(null),Kn(kt),window.addEventListener("mouseup",()=>{setTimeout(()=>{Qe.current=!1},0)},{once:!0}))}},onClickCapture:e=>{Qe.current&&(Qe.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if($t)return;Ke(null);e.target.closest("[data-modal-panel]")===Je.current&&(e.target.closest("button, input, a, select, textarea")||Kn(kt))},style:ue?{zIndex:Et+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${he}px)`,transition:pe?"none":"transform 180ms ease-out",...J?{display:"none"}:{},...Et<0?{display:"none"}:{},...St||De||ke&&ae===ke?{}:{display:"none"}}:{zIndex:De?M.pinnedWindow:Et+1,width:rn.w,height:rn.h,top:rn.y,...J&&"right"===Ve?{right:window.innerWidth-rn.x-rn.w}:{left:rn.x},...Et<0&&!De?{display:"none"}:{},...Ln?{visibility:"hidden",pointerEvents:"none"}:{},...Dr??{}},children:[ue&&!J&&/* @__PURE__ */V("div",{onPointerDown:ve,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),J?null:bn?Oe?.home?null:/* @__PURE__ */X(_,{children:[
51
- /* @__PURE__ */V("h2",{id:Le,"data-window-title":!0,className:"sr-only",children:Zn.text||Se}),(Zn.accessories.length>0||Lr)&&/* @__PURE__ */X("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__ */V("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:Zn.accessories}),Lr&&/* @__PURE__ */X("span",{className:"flex items-center gap-1 shrink-0 text-2xs text-gray-400",children:[
53
- /* @__PURE__ */V("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-2 py-0.5 font-medium text-gray-500",children:"K"}),
54
- /* @__PURE__ */V("span",{children:Ne.prev}),
55
- /* @__PURE__ */V("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-2 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
56
- /* @__PURE__ */V("span",{children:Ne.next})]})]})]}):ue?null:
57
- /* @__PURE__ */X("div",Q?{onPointerDown:fr,"data-window-chrome":"",...Er,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 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 "+(St?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:St?"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__ */X("div",{"data-window-title":!0,title:Se,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:St?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!$t&&wt(),
59
- /* @__PURE__ */V("span",{id:Le,className:"truncate",children:$t?Rt(Ee):Ee})]}),!$t&&/* @__PURE__ */X("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[Y&&/* @__PURE__ */V("button",{onClick:()=>Pe(e=>!e),title:De?Ne.unpin:Ne.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(De?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */V(T,{name:"bookmark-square",className:"h-3 w-3",fill:De?"currentColor":"none",strokeWidth:1.5})}),
60
- /* @__PURE__ */V("button",{type:"button",onClick:dr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */V(T,{name:"close",className:"h-4 w-4"})})]})]}:Z?{onPointerDown:fr,"data-window-chrome":"",...Er,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 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 "+(St?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:St?"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__ */X("div",{"data-window-title":!0,title:Se,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:St?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!$t&&wt(),
62
- /* @__PURE__ */V("span",{id:Le,className:"truncate",children:$t?Rt(Ee):Ee})]}),!$t&&/* @__PURE__ */X("div",{className:"flex items-center gap-0.5 shrink-0 ml-2",children:[Y&&/* @__PURE__ */V("button",{onClick:()=>Pe(e=>!e),title:De?Ne.unpin:Ne.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(De?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */V(T,{name:"bookmark-square",className:"h-3 w-3",fill:De?"currentColor":"none",strokeWidth:1.5})}),
63
- /* @__PURE__ */V("button",{onClick:()=>$n(kt),title:Ne.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!vn&&/* @__PURE__ */V(er,{maximized:Tn,onToggleMax:()=>{Tn?(zn(!1),on(Jt())):Nr()},onSnap:kr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Ne}),
64
- /* @__PURE__ */V("button",{type:"button",onClick:dr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */V(T,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:fr,"data-window-chrome":"",...Er,className:"flex items-center justify-between h-(--row-height-window-bar) px-4 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 "+(St?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:St?"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__ */X("div",{"data-window-title":!0,title:Se,className:"text-base font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:St?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!$t&&wt(),
66
- /* @__PURE__ */V("span",{id:Le,className:"truncate",children:$t?Rt(Ee):Ee})]}),!$t&&/* @__PURE__ */X("div",{className:"flex items-center gap-2 shrink-0 ml-4",children:[Lr&&/* @__PURE__ */X("span",{className:"flex items-center gap-1 mr-1 text-2xs text-gray-400",children:[
67
- /* @__PURE__ */V("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 font-medium text-gray-500",children:"K"}),
68
- /* @__PURE__ */V("span",{children:Ne.prev}),
69
- /* @__PURE__ */V("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
70
- /* @__PURE__ */V("span",{children:Ne.next})]}),Y&&/* @__PURE__ */V("button",{onClick:()=>Pe(e=>!e),title:De?Ne.unpin:Ne.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(De?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */V(T,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:De?"currentColor":"none",strokeWidth:1.5})}),
71
- /* @__PURE__ */V("button",{onClick:()=>$n(kt),title:Ne.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!vn&&/* @__PURE__ */V(er,{maximized:Tn,onToggleMax:()=>{Tn?(zn(!1),on(Jt())):Nr()},onSnap:kr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Ne}),
72
- /* @__PURE__ */V("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-2 py-0.5 text-2xs font-medium text-gray-400",children:"ESC"}),
73
- /* @__PURE__ */V("button",{type:"button",onClick:dr,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */V(T,{name:"close",className:"h-5 w-5"})})]})]}),le&&je&&!J&&!ue&&/* @__PURE__ */V("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${St?.9:.55})`}}),
74
- /* @__PURE__ */V(Pt.Provider,{value:kt,children:/* @__PURE__ */V(Ut.Provider,{value:{rightRef:et,leftRef:tt,notify:()=>rt(!0),active:St,isDirty:Jn,footerOpen:it&&!J&&!Q&&!Z&&!ue},children:/* @__PURE__ */V("div",{ref:Ze,...J?{onPointerDown:fr,onContextMenu:e=>{e.preventDefault(),Xe({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${J?"p-0 cursor-move":Z||ee?"p-0":Q?"p-2":"p-4"} ${J||bn?"":"backdrop-blur-sm"} ${!1===C||Z||ee?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${J?"rounded-2xl select-none":""}`,style:{...J?{touchAction:"none"}:{},backgroundColor:J?"transparent":bn?"rgb(var(--window-content-rgb))":St?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */V(ge,{children:ce})})})}),J&&Ue&&/* @__PURE__ */X(x,{minWidth:160,style:{left:Ue.x,top:Ue.y},onClose:()=>Xe(null),children:[
75
- /* @__PURE__ */V(k,{onClick:()=>{Xe(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:kt}))},children:"Settings"}),
76
- /* @__PURE__ */V(E,{}),oe&&/* @__PURE__ */X(_,{children:[oe,
77
- /* @__PURE__ */V(E,{})]}),
78
- /* @__PURE__ */X(k,{onClick:()=>{Xe(null),Pe(e=>!e)},children:[
79
- /* @__PURE__ */V("span",{className:"flex-1",children:"Always on Top"}),De&&/* @__PURE__ */V(T,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
80
- /* @__PURE__ */V(E,{}),
81
- /* @__PURE__ */V(k,{onClick:()=>{Xe(null),dr()},children:"Close"})]}),
82
- /* @__PURE__ */X("div",{onPointerDown:fr,ref:ot,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${bn?"":" cursor-move"}${St&&!bn?" backdrop-blur-sm":""}${J||Q||Z||ue||!it?" hidden":""}`,style:{touchAction:"none",backgroundColor:bn?"rgb(var(--window-footer-rgb))":St?"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__ */X("div",{className:"flex items-center gap-2 min-w-0",children:[dt&&/* @__PURE__ */V(xe,{auto:!0}),F,
84
- /* @__PURE__ */V("div",{ref:tt,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),g]}),
85
- /* @__PURE__ */X("div",{className:"flex items-center gap-2 ml-auto",children:[
86
- /* @__PURE__ */V("div",{ref:et,"data-modal-actions":!0,className:"flex items-center gap-2"}),D]})]}),!J&&!ue&&!$t&&St&&!vn&&/* @__PURE__ */X(_,{children:[
87
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
88
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
89
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
90
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
91
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
92
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
93
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
94
- /* @__PURE__ */V("div",{onPointerDown:e=>wr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),$t&&/* @__PURE__ */V("div",{className:"absolute inset-0",style:{zIndex:M.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>qt(!0),onMouseLeave:()=>qt(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Kn(kt),pr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Ft&&/* @__PURE__ */V("button",{type:"button","data-expose-close":!0,"aria-label":Me.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/Ar})`,transformOrigin:"top right",zIndex:M.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),dr()},children:/* @__PURE__ */V(T,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),$t&&zr&&/* @__PURE__ */V("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:zr.x,top:zr.y+zr.h+4,width:zr.w,zIndex:M.expose+(Ft?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Rt(Ee)})]}),Kr=Ie&&/* @__PURE__ */X(x,{style:{left:Ie.x,top:Ie.y},onClose:()=>Ke(null),minWidth:160,children:[!J&&!Q&&!bn&&/* @__PURE__ */X(_,{children:[
95
- /* @__PURE__ */X(k,{onClick:()=>{$n(kt),Ke(null)},children:[
96
- /* @__PURE__ */V(T,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Ne.minimize]}),!vn&&/* @__PURE__ */X(k,Tn?{onClick:()=>{zn(!1),on(Jt()),Ke(null)},children:[
97
- /* @__PURE__ */V("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */V("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),Ne.windowed]}:{onClick:()=>{Nr(),Ke(null)},children:[
98
- /* @__PURE__ */V(T,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Ne.maximize]})]}),Y&&!bn&&/* @__PURE__ */X(k,{onClick:()=>{Pe(e=>!e),Ke(null)},children:[
99
- /* @__PURE__ */V(T,{name:"bookmark-square",className:"h-4 w-4 "+(De?"text-blue-600":""),fill:De?"currentColor":"none",strokeWidth:1.5}),De?Ne.unpin:Ne.pinOnTop]}),$e&&/* @__PURE__ */X(k,{onClick:()=>{Ke(null),Ye()},children:[
100
- /* @__PURE__ */V(T,{name:"star",className:"h-4 w-4",fill:He?"currentColor":"none",strokeWidth:1.5}),He?Me.taskbar.removeFromDesktop:Me.taskbar.addToDesktop]}),(jt[kt]||[]).length>0&&/* @__PURE__ */V(_,{children:(jt[kt]||[]).map((e,t)=>/* @__PURE__ */X(k,{onClick:()=>{Ke(null),e.onClick()},children:[e.icon,e.label]},t))}),!(bn&&Oe?.home)&&/* @__PURE__ */X(_,{children:[
101
- /* @__PURE__ */V(E,{}),
102
- /* @__PURE__ */X(k,{danger:!0,onClick:()=>{Ke(null),dr()},children:[
103
- /* @__PURE__ */V(T,{name:"close",className:"h-4 w-4"}),Ne.close]})]})]}),$r=!!ae&&xt.some(e=>e.id===ae),Wr=!Lt||$r||J?null:/* @__PURE__ */X("div",{"data-modal-restore-tab":!0,"data-modal-id":kt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
104
- /* @__PURE__ */V("button",{type:"button",onClick:()=>Kn(kt),title:Ne.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:Se||Ne.windowSuffix}),
105
- /* @__PURE__ */V("button",{type:"button",onClick:()=>Kn(kt),title:Ne.restore,"aria-label":Ne.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
106
- /* @__PURE__ */V("button",{type:"button",onClick:()=>{dr()},title:Ne.close,"aria-label":Ne.close,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return G(
107
- /* @__PURE__ */X(It.Provider,{value:null,children:[Ir,Kr,Wr]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{dr&&"Escape"===e.key&&(Nr(null),pr(!1))});var Ar=100,Dr={past:[],future:[]};function Pr(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>Ar?r.slice(r.length-Ar):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:Dr}}var Ir=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Kr=500,$r=250;function Wr({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=Y(Pr,Dr),s=I(/* @__PURE__ */new Map),[l,c]=$(0),d=l>0,[u,h]=$(0),[m,p]=$(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===u&&(!(n&&n.length>0)||w(n)),g=I(null),b=I(!1),v=O(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=O((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=O(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=O(e=>{h(t=>t+(e?1:-1))},[]),C=O(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=$(0),S=M>0,L=O(e=>{N(t=>t+(e?1:-1))},[]),T=A(be),z=T?.claimReadOnly;K(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const D=T?.claimOwnMount;K(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const P=I({last:0,count:0,tripped:!1}),W=I(!1),R=O((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)||(W.current=!0));if(!y||g.current)return;const r=P.current;if(r.tripped)return;const o=Date.now();if(o-r.last>$r&&(r.count=0),r.last=o,++r.count>Kr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Kr} 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&&a({type:"record",step:e})})},[y,v]),F=O(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),q=O(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};F(e.values),a({type:"undo",redoStep:t})},[o.past,v,F]),j=O(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};F(e.values),a({type:"redo",undoStep:t})},[o.future,v,F]),[H,U]=$(0),_=I(0),G=I(0),J=I(!1),Q=O(()=>{b.current=!0,W.current=!1,g.current=null,_.current+=1,G.current=_.current,U(_.current)},[]),Z=I(void 0),ee=O(e=>{void 0!==e&&(void 0!==Z.current&&e!==Z.current&&(J.current=!0),Z.current=e),Q()},[Q]);K(()=>{b.current&&H===G.current&&(b.current=!1,g.current=null,(W.current||J.current)&&a({type:"clear"}),W.current=!1,J.current=!1)},[H]);const te=O(()=>{J.current=!0,a({type:"clear"}),Q()},[Q]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=cr(r),ie=I({undo:q,redo:j,canUndo:ne,canRedo:re});ie.current={undo:q,redo:j,canUndo:ne,canRedo:re},K(()=>{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&&Ir.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=B(()=>({register:x,unregister:k,record:R,undo:q,redo:j,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:d,handMounted:S,claimOwnMount:L,claimReadOnly:E,declaredEditable:f,claimEditable:C,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,R,q,j,te,ee,ne,re,y,d,S,L,E,f,C,o.past,o.future]),se=""!==Xt(),le=A(Ut)?.footerOpen??!1,ce=se&&y&&d&&!S&&le;/* @__PURE__ */
108
- return X(be.Provider,{value:ae,children:[ce&&/* @__PURE__ */V(_t,{position:"left",quiet:!0,children:/* @__PURE__ */V(xe,{auto:!0})}),e]})}function Or(){const e=A(be),t=O(()=>{},[]);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 Rr(e){const t=A(be),n=t?.claimReadOnly,r=t?.claimEditable;K(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function Fr(e,t,n){const r=A(be),o=H(),i=I(e),a=I(t);a.current=t,K(()=>{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:s,coalesceKey:l=null}=n,c=I(r);c.current=r;const d=I({label:s,coalesceKey:l});d.current={label:s,coalesceKey:l},K(()=>{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 qr(e,t){const[n,r]=$(e);return Fr(n,e=>r(()=>e),t),[n,r]}export{Gt as CancelButton,je as DocFavStar,ze as EntityWindowFallback,Le as EntityWindowLoading,Ae as EntityWindowState,Ot as KEY_ACTIVATED_SELECTOR,Ne as LoadingSpinner,Wt as MODAL_SUBMIT_SELECTOR,zr as Modal,_t as ModalActions,xe as UndoControls,Wr as UndoProvider,oe as WINDOW_REGISTRY,ye as WindowCrashedFallback,ge as WindowErrorBoundary,ct as WindowManagerProvider,Ht as WindowTitle,Xe as activateWindowById,vt as beginWindowGesture,An as cancelWindowFront,ce as client_default,Sr as commitExposeHighlight,xt as drainPerfEvents,wr as exitExposeMode,cn as forgetMaximizedWindowBoxes,ar as getActiveModalId,Je as getActiveWindowRoute,Mr as getExposeHighlight,Dt as getWindowChromeVersion,sn as getWindowPosition,Pe as isDraftEntityId,Ie as isDraftEntityWindow,te as isEntityEntry,ee as isPageEntry,se as isShellApiClientConfigured,Ve as isTabWindow,bt as markMenuOpen,zt as readWindowChrome,zn as requestWindowFront,Nr as setExposeHighlight,gt as setPerfCollecting,ae as setShellApiClient,pe as setShellHomeRoute,re as setShellWindowRegistry,an as setWindowDefaultPosition,ln as setWindowPosition,Ct as splitTitle,Cr as subscribeExposeHighlight,At as subscribeWindowChrome,fr as toggleExposeMode,Nn as useCurrentTabKey,Xt as useEnclosingModalId,cr as useIsActiveWindow,Vt as useModalActive,ue as usePageSearch,Or as useUndo,Rr as useUndoCanEdit,Fr as useUndoable,qr as useUndoableState,qt as useWidgetSettings,We as useWindowDirty,Re as useWindowManager,Bt as useWindowMenuItem,Yt as useWindowTitle};
@@ -1 +0,0 @@
1
- import{formatPlain as e,formatFixed as o,formatGrouped as t,formatPercent as a}from"./chunk-C3QOHMR6.js";import{createContext as i,useContext as n,useMemo as r,useEffect as s}from"react";import{jsx as l}from"react/jsx-runtime";function d(i){const n=o=>e(o,i),r=e=>t(e,i),s=(e,t)=>o(e,t,i),l=(e,o)=>a(e,o,i);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",clearAll:"Clear all",selectedCount:e=>`${n(e)} selected`,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",lastHeading:"Last",last2WeeksShort:"2 weeks",lastMonthShort:"Month",last3MonthsShort:"3 months",last6MonthsShort:"6 months",last12MonthsShort:"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"},transfer:{uploading:"Uploading",error:"Error",retry:"Retry",dismiss:"Dismiss",cancel:"Cancel",cancelVerb:e=>`Cancel ${e}`},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,a)=>`Column ${e} ${l(o,0)}, column ${t} ${l(a,0)}`,dragHint:"Drag to change the widths",hint:(e,o)=>`Type a width or drag a line. 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"}`},textToolbar:{formatting:"Formatting",bold:"Bold",italic:"Italic",underline:"Underline",strike:"Strikethrough",color:"Color",link:"Link",sup:"Superscript",sub:"Subscript",alignment:"Alignment",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",alignJustify:"Justify",bullet:"Bulleted list",number:"Numbered list",letterCase:"Letter case",caseNone:"Normal",caseUpper:"Uppercase",caseLower:"Lowercase"},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`,chordFolded:e=>`+${n(e)} more in Other`,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,a)=>`${e} = ${o} with ${t} locked to ${a}`,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=i(c),u=i(null),m=/* @__PURE__ */new Set;var g=c,w={};function f(){return g}function $({value:e=w,locale:o,children:t}){const a=n(u),i=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?a?.locale:i,$=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 a of Object.keys(o))t[a]={...o[a],...e[a]??{}};return t},[e,f]),v=r(()=>({locale:f}),[f]),y=null!==a;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};
@@ -1,27 +0,0 @@
1
- import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{LoadingSpinner as a}from"./chunk-NVFKXL52.js";import{useDismissPopupsOnOpen as l}from"./chunk-UVBK6YSR.js";import{glassStyle as o}from"./chunk-7IQ3B77H.js";import{Z_LAYERS as s}from"./chunk-FIEA5CGB.js";import{useShellStrings as i}from"./chunk-DBWGMZCY.js";import{useState as c,useEffect as d,useRef as u,useMemo as p,useId as y,useCallback as f}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as b}from"react-dom";var g={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function k(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function w(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function N({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:i,width:u,height:p,decorative:y=!1,fallbackMode:f="monogram",adaptive:h=!1,hasAlpha:b=null,isLight:N=null,treatmentPadding:L=4,treatmentRadius:_=8,className:A="",style:C}){const[$,E]=c(e||t||"");d(()=>{E(e||t||"")},[e,t]);const I=Boolean(t&&$===t&&$!==e),T=(I?a??h:h)?x(I?n:b,I?r:N,s):"bare",j=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==i&&null==u&&null==p?g[o]:"","dark"===s?"text-white":"text-gray-700",v[T],A].filter(Boolean).join(" "),S={...w(T,_,L),...null==i?{width:u,height:p}:{width:i,height:i},...C};return $?/* @__PURE__ */m("span",{className:j,"data-brand-treatment":T,style:S,children:/* @__PURE__ */m("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>E(e=>t&&e!==t?t:"")})}):"none"===f?null:/* @__PURE__ */m("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${j} rounded-md bg-gray-100 font-semibold`,style:S,children:y?null:k(l)})}function L(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&L(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function C(e,t,n){return!!t&&e.some(e=>e.to===t||C(_(e,n),t,n))}var $="__page__";function E(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function I(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])L(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:$,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?$:r.entityType,entity_id:r.entityId})}return n}var j="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e){return e.typeKey??e.type}function M(e,t){return t?.[S(e)]??e.type}function K(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function R(e,t,n,r){return{type:e,label:t,entity_type:$,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function B(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=S(n),r=t.get(e);r?r.results.push(n):t.set(e,{type:n.type,results:[n]})}return Array.from(t,([e,t])=>({key:e,...t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.key}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.key),l=r?a?.listRoutes?.[e.key]:void 0,o=a?.typeLabels?.[e.key]??e.type;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.key}`,label:r,result:R(o,r,l.path,n)})}return{key:`type:${e.key}`,title:o,rows:t,count:e.results.length,truncated:r}}),o=K("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function D(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var P=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function z(e,t,n=8){return[t,...e.filter(e=>!P(e,t))].slice(0,n)}function F(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),"string"==typeof e.typeKey&&(r.typeKey=e.typeKey),t.some(e=>P(e,r))||t.push(r)}return t.slice(0,8)}function H(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var U=[];function W(e,t,n){const[r,a]=c([]),[l,o]=c(U),[s,i]=c(!1),[p,y]=c("none"),m=u(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());d(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(U),y("none"),void i(!1);i(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...H(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),y(0===l.failed?"none":l.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:f(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(U),y("none"),i(!1)},[])}}var G=(e,t)=>`${e}-opt-${t}`;function V(e,t){if("seeAll"===e.kind)return"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3";if("action"===e.kind)return e.icon??j;if(e.icon)return e.icon;const n=t?.[S(e.result)];return n||j}function X({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
2
- return m("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */h("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
3
- /* @__PURE__ */h("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
4
- /* @__PURE__ */m("span",{children:e.title}),
5
- /* @__PURE__ */m("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
6
- return h("div",{id:G(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
7
- /* @__PURE__ */m("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:V(e,a)})}),
8
- /* @__PURE__ */h("div",{className:"flex-1 min-w-0",children:[
9
- /* @__PURE__ */m("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */m("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */m("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var O="react-os-shell:open-global-search";function Y(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(O))}function q({providers:e,typeIcons:t,typeLabels:n,listRoutes:r,placeholder:g,quickActions:k,onSelect:x,recent:v,onRecord:w,favorites:N,hotkey:L=!0}={}){const _=i().search,A=g??_.placeholder,[C,$]=c(!1),[E,I]=c(""),[T,S]=c(0),R=u(null),{results:P,truncatedTypes:z,loading:F,failure:H,reset:U}=W(E,e,2);d(()=>{const e=e=>{L&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),$(e=>!e)),"Escape"===e.key&&C&&$(!1)},t=()=>$(!0);return window.addEventListener("keydown",e),window.addEventListener(O,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(O,t)}},[C,L]),l(C);const[V,Y]=c(!1);C!==V&&(Y(C),C&&(I(""),S(0),U())),d(()=>{C?setTimeout(()=>R.current?.focus(),50):I("")},[C]),d(()=>{S(0)},[P]);const q=E.length>=2,Q=p(()=>q?B(P,k,E,_.actions,{truncatedTypes:z,listRoutes:r,typeLabels:n,seeAllLabel:_.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((t,n)=>({kind:"recent",key:`recent:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:M(t,e.typeLabels),result:t})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((t,n)=>({kind:"favorite",key:`favorite:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:M(t,e.typeLabels)||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:t})),count:e.favorites.length});const r=K("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:v,favorites:N,actions:k,typeLabels:n},_),[q,P,z,r,n,k,E,v,N,_]),Z=p(()=>function(e){return e.flatMap(e=>e.rows)}(Q),[Q]),J=Math.min(T,Math.max(Z.length-1,0)),ee=y(),te=Z.length>0;d(()=>{C&&0!==Z.length&&document.getElementById(G(ee,J))?.scrollIntoView?.({block:"nearest"})},[C,J,Z.length,ee]);const ne=f(e=>{$(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||w?.(e.result),x?.(e.result)):e.action.onSelect()},[x,w]);return C?b(
10
- /* @__PURE__ */h("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:s.overlay},onClick:()=>$(!1),children:[
11
- /* @__PURE__ */m("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
- /* @__PURE__ */h("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:o(),children:[
13
- /* @__PURE__ */h("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
- /* @__PURE__ */m("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:j})}),
15
- /* @__PURE__ */m("input",{ref:R,type:"text",value:E,onChange:e=>{I(e.target.value),S(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),S(D(J,1,Z.length))):"ArrowUp"===e.key?(e.preventDefault(),S(D(J,-1,Z.length))):"Tab"===e.key&&Z.length>0?(e.preventDefault(),S(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(Q.map(e=>e.rows.length),J,e.shiftKey?-1:1))):"Enter"===e.key&&Z[J]&&ne(Z[J])},placeholder:A,role:"combobox","aria-expanded":te,"aria-controls":te?ee:void 0,"aria-activedescendant":te?G(ee,J):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),F&&/* @__PURE__ */m("span",{"data-global-search-spinner":"",role:"status","aria-label":_.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
16
- /* @__PURE__ */m("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-2 py-0.5 text-2xs font-medium text-gray-400",children:_.escBadge})]}),
17
- /* @__PURE__ */h("div",{className:"max-h-[50vh] overflow-y-auto",children:[F&&0===Z.length&&/* @__PURE__ */m(a,{size:"sm",padding:"py-6",label:_.searching}),!F&&"all"===H&&q&&/* @__PURE__ */m("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:_.searchFailed}),!F&&q&&0===Z.length&&"all"!==H&&/* @__PURE__ */m("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:_.noResults}),te&&/* @__PURE__ */m(X,{sections:Q,activeIdx:J,listId:ee,label:_.listLabel,typeIcons:t,groupCount:_.groupCount,groupLabel:_.groupLabel,onHover:S,onPick:ne}),!F&&"some"===H&&q&&/* @__PURE__ */m("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:_.partialFailure}),!F&&!q&&0===Z.length&&/* @__PURE__ */m("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:_.minChars(2)})]}),
18
- /* @__PURE__ */h("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-2xs text-gray-400",children:[
19
- /* @__PURE__ */h("div",{className:"flex items-center gap-3",children:[
20
- /* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
21
- /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
22
- /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${_.navigate}`]}),
23
- /* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
24
- /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.enterKey}),` ${_.open}`]}),Q.length>1&&/* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
25
- /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.tabKey}),` ${_.nextGroup}`]})]}),
26
- /* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
27
- /* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.escKey}),` ${_.close}`]})]})]})]}),document.body):null}export{N as BrandMark,q as GlobalSearch,$ as PAGE_RESULT_ENTITY,T as favoritesToResults,I as navPagesProvider,Y as openGlobalSearch,E as parsePageResultTarget,A as partitionNav,z as pushRecent,x as resolveBrandMarkTreatment,C as rowsContainRoute,F as sanitizeRecent,_ as visibleNavChildren,L as visibleSectionItems};
@@ -1,10 +0,0 @@
1
- import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-DBWGMZCY.js";import{Icon as n}from"./chunk-B427NVDP.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function f(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function m(){return!1}function h(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function w(){return i(h,f,m)}var g={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={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"},y={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
2
- return u(n,{name:"check",...t});case"error":/* @__PURE__ */
3
- return u(n,{name:"close",...t});case"warning":/* @__PURE__ */
4
- return u(n,{name:"error",...t});default:/* @__PURE__ */
5
- return u(n,{name:"info",...t})}}function x({status:e="info",title:t,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const c=g[e],d=r().errors;/* @__PURE__ */
6
- return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
7
- /* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[c]}`,children:i??/* @__PURE__ */u(v,{tone:c})}),
8
- /* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??y[e]?.(d)??""}),n&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}var b="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),_={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"]},D=b?0:1,C=_.MOD[D],S=_.ALT[D],E="⇧",M="⏎",L=_.CMD_ENTER[D],T=_.CMD_S[D],N=_.CMD_K[D],A=_.CMD_DOT[D],k=_.CMD_A[D],I=_.CMD_Z[D],j=_.CMD_SHIFT_Z[D],H=_.ALT_SHIFT_D[D],F=_.ALT_SHIFT_E[D],Z=_.ALT_SHIFT_N[D],P=new Map(b?Object.values(_).map(([e,t])=>[e,t]):[]);function O(t){return e()?t:P.get(t)??t}var K={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},R={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function z({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=O(e);/* @__PURE__ */
9
- return u("kbd",{className:[K[r],R[t],n].filter(Boolean).join(" "),children:o})}var B=o(null);function J({value:e,children:t}){/* @__PURE__ */
10
- return u(B.Provider,{value:e,children:t})}function U(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:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var W={prefs:{},save:()=>{}};function $(){return s(B)??W}function G(){const{prefs:e,save:t}=$(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var V="react-os-shell:stale-chunk-reload-at",Y=3e4,q="vite:preloadError",Q="/_next/static/",X=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ee(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return X.test(t)}function te(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(V),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?Q:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(V),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(V,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;ee(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(q,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(q,s),d&&window.removeEventListener("error",d,!0)}}export{S as ALT,H as ALT_SHIFT_D,F as ALT_SHIFT_E,Z as ALT_SHIFT_N,k as CMD_A,A as CMD_DOT,L as CMD_ENTER,N as CMD_K,T as CMD_S,j as CMD_SHIFT_Z,I as CMD_Z,M as ENTER,z as Kbd,C as MOD,Q as NEXT_CHUNK_PATH_PREFIX,x as Result,E as SHIFT,Y as STALE_CHUNK_RELOAD_COOLDOWN_MS,V as STALE_CHUNK_RELOAD_KEY,J as ShellPrefsProvider,q as VITE_PRELOAD_ERROR_EVENT,te as installStaleChunkReload,b as isMac,ee as isStaleChunkError,w as useIsMobile,U as useLocalStoragePrefs,G as useShellPrefs,$ as useShellPrefsAdapter,O as useShortcutLabel};
@@ -1 +0,0 @@
1
- var r="7.26.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,13 +0,0 @@
1
- import{buttonClasses as t}from"./chunk-K7PQXJO7.js";import{solidSurfaceStyle as e}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as o,escapeSurfaceAbove as i,onOverlayOpen as r,Z_LAYERS as n}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as l,forwardRef as h,useId as s,useState as d,useRef as c,useEffect as m,isValidElement as f,cloneElement as u,useContext as p}from"react";import{createPortal as g}from"react-dom";import{jsxs as b,jsx as x,Fragment as w}from"react/jsx-runtime";var v=448,M=240,N=8,y=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function W(t){const e=y(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var k=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var C={top:"bottom",bottom:"top",left:"right",right:"left"},H={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function B(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var E=(t,e,o)=>Math.max(e,Math.min(t,o));function R(t,e,o){return z(()=>t()?.getBoundingClientRect(),e,o)}function z(t,e,o){let i=NaN,r=NaN,n=NaN,a=NaN,l=NaN;const h=()=>{const e=t();if(!e)return!1;const h=o?o():NaN,s=e.left!==i||e.top!==r||e.right!==n||e.bottom!==a||h!==l&&!(Number.isNaN(h)&&Number.isNaN(l));return i=e.left,r=e.top,n=e.right,a=e.bottom,l=h,s};h();const s=()=>{h(),e()};let d=requestAnimationFrame(function t(){h()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}}function j({trigger:t,menu:e,bounds:o,align:i,side:r}){const n=B(t,o,4),a="bottom"===r?"top":"bottom",l=e.height>n[r]&&(e.height<=n[a]||n[a]>n[r])?a:r,h=Math.max(Math.min(e.height,96),n[l]),s=Math.min(e.height,h),d=E("bottom"===l?t.bottom+4:t.top-4-s,o.top+8,o.bottom-8-s),c=Math.max(0,o.right-o.left-16),m=Math.min(e.width,c);return{left:E("start"===i?t.left:t.right-m,o.left+8,o.right-8-m),top:d,side:l,maxHeight:h,maxWidth:c}}function T(t,e,o={}){const{matchTriggerWidth:i=!1,preferredMaxWidth:r=v,preferredMaxHeight:n=M,popupRef:l}=o,[h,s]=d(null);return a(()=>{if(!e)return void s(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const a=W(e),h=a.bottom-o.bottom-4-8,d=o.top-a.top-4-8,c=h<Math.min(n,160)&&d>h,m=Math.max(96,Math.min(n,c?d:h)),f=Math.max(0,a.right-a.left-16),u={minWidth:o.width,maxWidth:Math.min(r,f),maxHeight:m};if(i){const t=Math.min(o.width,f);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(a.left+8,o.left),a.right-8-t)}else if(l&&a.right-8-o.left<u.maxWidth&&Math.min(o.right,a.right-8)-a.left-8<u.maxWidth){const t=l.current?.offsetWidth??0,e=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(a.left+8,Math.min(o.left,a.right-8-e))}else if(a.right-8-o.left<u.maxWidth){const t=Math.min(o.right,a.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-a.left-8))}else u.left=Math.max(a.left+8,o.left);c?u.bottom=window.innerHeight-o.top+4:u.top=o.bottom+4,s(u)};return o(),R(()=>t.current,o,l?()=>l.current?.offsetWidth??NaN:void 0)},[e,t,i,r,n,l]),h}function F({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},r=o.right-8-t.x,n=t.x-(o.left+8);return j({trigger:i,menu:e,bounds:o,align:e.width<=r||r>=n?"start":"end",side:"bottom"})}var I=l(!1),L=()=>p(I),A={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function P({content:t,side:l="top",delay:h=200,children:p,className:w="relative inline-flex",describe:v=!0}){const[M,N]=d(!1),z=M&&!(null==t||!1===t||""===t),[j,T]=d(null),F=c(void 0),L=c(null),P=c(null),D=s(),S=c(!1),$=()=>{window.clearTimeout(F.current),S.current||(F.current=window.setTimeout(()=>N(!0),h))},q=()=>{window.clearTimeout(F.current),N(!1)},J=()=>{S.current=!0,q()},Q=()=>{S.current=!1,q()};m(()=>()=>window.clearTimeout(F.current),[]),a(()=>{if(!z)return void T(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const o=W(t),i=Math.max(0,o.right-o.left-16),r=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${i}px`,e.style.maxHeight=`${r}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=y(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let r=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==r;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===r&&"static"===t.position)continue;r=t.position;const o=k.has(t.overflowX),n=k.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(i.left=Math.max(i.left,a.left),i.right=Math.min(i.right,a.right)),n&&(i.top=Math.max(i.top,a.top),i.bottom=Math.min(i.bottom,a.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}(t))return void q();const h=function(t,e,o,i,r){const n=B(t,i,r),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),l=[o,C[o],...H[o]],h=l.find(t=>a(t)>=0)??l.reduce((t,e)=>a(e)>a(t)?e:t),s=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let c,m;switch(h){case"top":c=s-e.width/2,m=t.top-r-e.height;break;case"bottom":c=s-e.width/2,m=t.bottom+r;break;case"left":c=t.left-r-e.width,m=d-e.height/2;break;case"right":c=t.right+r,m=d-e.height/2}return{side:h,left:E(c,i.left+8,i.right-8-e.width),top:E(m,i.top+8,i.bottom-8-e.height)}}(a,n,l,o,12),s=function(t,e,o,i,r){const{side:n,left:a,top:l}=e,h=a+o.width,s=l+o.height;if({top:t.top-s,bottom:l-t.bottom,left:t.left-h,right:a-t.right}[n]<r)return null;const d=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),c=(t.left+t.right)/2,m=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(c,a,o.width),y:s};case"bottom":return{side:n,x:d(c,a,o.width),y:l};case"left":return{side:n,x:h,y:d(m,l,o.height)};case"right":return{side:n,x:a,y:d(m,l,o.height)}}}(a,h,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:h.left-a.left,top:h.top-a.top,maxWidth:i,maxHeight:r,side:h.side,arrow:s&&{left:s.x-a.left,top:s.y-a.top}};T(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),R(()=>L.current,t)},[z,l,t]),m(()=>{if(!z)return;const t=o(t=>"Escape"===t.key&&(q(),!i(L.current))),e=r(q);return()=>{t(),e()}},[z]);const X=z&&v?D:void 0,G=f(p)?u(p,{"aria-describedby":[p.props["aria-describedby"],X].filter(Boolean).join(" ")||void 0}):p,K=z?e():void 0;/* @__PURE__ */
2
- return b("span",{ref:L,className:w,"aria-describedby":f(p)?void 0:X,onMouseEnter:$,onMouseLeave:Q,onFocus:$,onBlur:Q,onPointerDown:J,onClick:J,children:[
3
- /* @__PURE__ */x(I.Provider,{value:!0,children:G}),z&&g(
4
- /* @__PURE__ */b("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:n.hint,...j?.anchor},children:[
5
- /* @__PURE__ */x("span",{ref:P,id:D,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${j?"":A[l]}`,style:{...K,...j&&{left:j.left,top:j.top,maxWidth:j.maxWidth,maxHeight:j.maxHeight}},children:t}),(!j||j.arrow)&&
6
- /* @__PURE__ */x("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":j?.side??l,style:{background:K?.background,"--rosh-tooltip-edge":K?.border,...j?.arrow&&{left:j.arrow.left,top:j.arrow.top}}})]}),document.body)]})}var D=t=>!0===t||"true"===t;function S(t){t.preventDefault(),t.stopPropagation()}var $=(t,e)=>[t,e].filter(Boolean).join(" ")||void 0;function q({reason:t,id:e,block:o=!1,children:i}){/* @__PURE__ */
7
- return b(w,{children:[
8
- /* @__PURE__ */x(P,{content:t,describe:!1,className:o?"relative flex w-full":"relative inline-flex",children:i}),
9
- /* @__PURE__ */x("span",{id:e,className:"sr-only",children:t})]})}function J(){/* @__PURE__ */
10
- return b("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
11
- /* @__PURE__ */x("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
12
- /* @__PURE__ */x("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}var Q=h(function({variant:e="primary",size:o="md",loading:i=!1,leftIcon:r,rightIcon:n,block:a=!1,disabled:l,type:h="button",children:d,className:c="",disabledReason:m,onClick:f,pressed:u,"aria-disabled":p,"aria-describedby":g,...w},v){const M=s(),N=l||i,y=null!=m&&""!==m,W=N&&y,k=!N&&D(p),C=k&&y,H=W||C?M:void 0,B=/* @__PURE__ */b("button",{ref:v,type:h,disabled:N,"aria-busy":i||void 0,"aria-disabled":!!k||p,"aria-describedby":$(g,H),onClick:k?S:f,className:t({variant:e,size:o,block:a,pressed:u??(!0===w["aria-pressed"]||"true"===w["aria-pressed"]),className:c}),...w,children:[i?/* @__PURE__ */x(J,{}):r,d,!i&&n]});return C?/* @__PURE__ */x(q,{reason:m,id:M,block:a,children:B}):W?/* @__PURE__ */b("span",{className:a?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[B,
13
- /* @__PURE__ */x("span",{id:H,className:"text-xs text-red-600",children:m})]}):B});export{Q as Button_default,M as MENU_MAX_HEIGHT,q as OffWithReason,v as POPUP_MAX_WIDTH,P as Tooltip,N as VIEWPORT_MARGIN,$ as describedByWith,R as followAnchor,z as followRect,D as isAriaDisabled,F as placeAtPoint,j as placeMenu,W as popupBounds,S as swallowPress,T as useDropdownPosition,L as useInsideTooltip};