efficient-shell 8.11.0 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-KZE4TTPH.js → Browser-OOJUPENB.js} +14 -14
- package/dist/Calculator-PPH3FLQG.js +29 -0
- package/dist/CurrencyConverter-GTICX6V3.js +21 -0
- package/dist/{Documents-CK7XL5CL.js → Documents-RXNGM2OY.js} +12 -12
- package/dist/Files-G2FQ5Z3R.js +87 -0
- package/dist/Notepad-7777T6ES.js +25 -0
- package/dist/PdfViewer-Q7IS273H.js +1 -0
- package/dist/{PomodoroTimer-KUB3JUJO.js → PomodoroTimer-VPRRRXVE.js} +19 -19
- package/dist/{Preview-YPS5O4C7.js → Preview-QBWSY7W7.js} +39 -39
- package/dist/Sidebar-NONBFVWE.js +43 -0
- package/dist/Spreadsheet-JIOTLCIK.js +37 -0
- package/dist/{Stock-DCQEYEND.js → Stock-OIDTOA6E.js} +4 -4
- package/dist/{Weather-UYCFOHGQ.js → Weather-XT3S2O4X.js} +18 -18
- package/dist/{WorldClock-WKMFOBKT.js → WorldClock-QFPWQDD2.js} +6 -6
- package/dist/ai/index.js +13 -13
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-WNJLY7CM.js → chunk-2KOXALIK.js} +11 -11
- package/dist/{chunk-VH3IMIS2.js → chunk-2LTB2DSA.js} +6 -6
- package/dist/chunk-2MBDZMZM.js +2 -0
- package/dist/{chunk-7PCV65OU.js → chunk-37S3WLBL.js} +6 -6
- package/dist/chunk-3UHHKER7.js +2 -0
- package/dist/chunk-4GEAEYKA.js +99 -0
- package/dist/chunk-4LQDWN6L.js +4 -0
- package/dist/chunk-4MHTK3LH.js +4 -0
- package/dist/{chunk-IQDIWKES.js → chunk-55IY2ZJY.js} +1 -1
- package/dist/{chunk-4A2X6KLQ.js → chunk-5GHLKEJQ.js} +1 -1
- package/dist/{chunk-HFEYQVKD.js → chunk-6AB42T2W.js} +1 -1
- package/dist/chunk-6NLKMHX6.js +2 -0
- package/dist/{chunk-2QI3QFX6.js → chunk-76YDO3KA.js} +1 -1
- package/dist/chunk-7F65BNHY.js +2 -0
- package/dist/{chunk-SFNLRK5J.js → chunk-7HPOALEV.js} +5 -5
- package/dist/{chunk-RAHIWTPJ.js → chunk-7IF3RZF3.js} +12 -12
- package/dist/{chunk-KXTR2RPB.js → chunk-7IHH5CDD.js} +3 -3
- package/dist/{chunk-PPROO6JU.js → chunk-7JKFXRAR.js} +5 -5
- package/dist/{chunk-SBHLTCGU.js → chunk-7QLI3HAO.js} +1 -1
- package/dist/chunk-AW7TOB6N.js +1 -0
- package/dist/{chunk-KFMRV3MK.js → chunk-BKWLFZHI.js} +1 -1
- package/dist/chunk-BXDYFSP4.js +2 -0
- package/dist/{chunk-UHW2CFLV.js → chunk-C4YTKSXY.js} +1 -1
- package/dist/{chunk-EPHQ7UQV.js → chunk-CQXV3SJA.js} +1 -1
- package/dist/chunk-D5EXIRJF.js +2 -0
- package/dist/{chunk-US5YOYS3.js → chunk-DKY6X24V.js} +1 -1
- package/dist/{chunk-3OKD2ZZV.js → chunk-DXQCNU5I.js} +9 -9
- package/dist/chunk-EEG3KMP7.js +2 -0
- package/dist/{chunk-TAGZV46K.js → chunk-EK3JM3J2.js} +1 -1
- package/dist/{chunk-AP67GBSX.js → chunk-EXU3ZXKB.js} +8 -8
- package/dist/chunk-F6RM7RLQ.js +1 -0
- package/dist/{chunk-332V47ID.js → chunk-FDIJEOGV.js} +2 -2
- package/dist/{chunk-MTD66C5F.js → chunk-FEAOJLGA.js} +2 -2
- package/dist/{chunk-JK3QY266.js → chunk-G34KXE2L.js} +5 -5
- package/dist/{chunk-US5B4QYS.js → chunk-GLVEL6AQ.js} +15 -15
- package/dist/{chunk-7RDFRWF3.js → chunk-H3XEO4LR.js} +6 -6
- package/dist/{chunk-VUYWYMZZ.js → chunk-H62JMI7C.js} +2 -2
- package/dist/{chunk-7FNZUIXO.js → chunk-HHXP34PV.js} +4 -4
- package/dist/chunk-HJUK5AAM.js +2 -0
- package/dist/chunk-HMMNAJJQ.js +4 -0
- package/dist/{chunk-KIQ2OSPG.js → chunk-HTOZWATN.js} +1 -1
- package/dist/{chunk-IC2YI7WC.js → chunk-HXXUMKTV.js} +1 -1
- package/dist/chunk-I7GWKMYO.js +2 -0
- package/dist/{chunk-P25GL5BQ.js → chunk-J6QU5JTZ.js} +1 -1
- package/dist/{chunk-6L7V25YL.js → chunk-J77ZVPF5.js} +5 -5
- package/dist/{chunk-CJUN2VOD.js → chunk-JF45HC5H.js} +1 -1
- package/dist/chunk-JTPBPEYK.js +2 -0
- package/dist/chunk-JXOBORLD.js +3 -0
- package/dist/{chunk-7MX6CMMN.js → chunk-JZ7NBWGB.js} +1 -1
- package/dist/chunk-KIYTUOVN.js +2 -0
- package/dist/chunk-KO5PBMCF.js +2 -0
- package/dist/chunk-KRWKHI7S.js +2 -0
- package/dist/chunk-KV5VLPII.js +1 -0
- package/dist/chunk-L3VD25XR.js +8 -0
- package/dist/{chunk-3RWLCKSR.js → chunk-L6CG37L3.js} +1 -1
- package/dist/{chunk-3XLVARRX.js → chunk-LKSHI57C.js} +6 -6
- package/dist/{chunk-BXRWPGAT.js → chunk-LR2X6MKB.js} +1 -1
- package/dist/{chunk-S2Q6BOAX.js → chunk-MSCILVJB.js} +6 -6
- package/dist/{chunk-EY74CLGD.js → chunk-NRWIULLI.js} +12 -12
- package/dist/{chunk-O4NTKMC5.js → chunk-O3WSAR62.js} +2 -2
- package/dist/chunk-OJ3RN3BG.js +20 -0
- package/dist/{chunk-XFJRD3HE.js → chunk-OS6GGLQQ.js} +2 -2
- package/dist/{chunk-3GMHX3WX.js → chunk-OSRLZZDO.js} +4 -4
- package/dist/chunk-P5SVBGLG.js +2 -0
- package/dist/{chunk-OIVLPNOR.js → chunk-PDPBIDHF.js} +1 -1
- package/dist/{chunk-GVTWQBRU.js → chunk-PG665FWX.js} +9 -9
- package/dist/chunk-PM2N2ZGV.js +2 -0
- package/dist/chunk-PWONLQFF.js +2 -0
- package/dist/chunk-Q7OGTJET.js +3 -0
- package/dist/chunk-QM5DFN7Z.js +2 -0
- package/dist/chunk-R362N2RJ.js +1 -0
- package/dist/chunk-RA5GR626.js +2 -0
- package/dist/chunk-RNBMWJYM.js +4 -0
- package/dist/{chunk-CP6FITHO.js → chunk-RP4ZLTXA.js} +16 -16
- package/dist/{chunk-XW7KN6HW.js → chunk-SNDYD76W.js} +12 -12
- package/dist/chunk-SXPBOX32.js +1 -0
- package/dist/{chunk-C7PQJOGD.js → chunk-TUT6SGH2.js} +1 -1
- package/dist/{chunk-MXDW5IFQ.js → chunk-U6FORQTI.js} +1 -1
- package/dist/chunk-UAXP4A2A.js +4 -0
- package/dist/{chunk-JWMQEWCV.js → chunk-UONWIAII.js} +15 -15
- package/dist/{chunk-M3DZDBS6.js → chunk-UOOHE3FX.js} +6 -6
- package/dist/chunk-USYTN7PE.js +2 -0
- package/dist/{chunk-TTE3GZWH.js → chunk-UWNL4FO2.js} +1 -1
- package/dist/{chunk-4OYSTWMQ.js → chunk-VANXHWGP.js} +1 -1
- package/dist/chunk-VGX7ODMS.js +4 -0
- package/dist/{chunk-C2HHGLLR.js → chunk-VJPJNCB4.js} +24 -4
- package/dist/{chunk-5J6IC25E.js → chunk-VX4OBI4U.js} +1 -1
- package/dist/{chunk-7A7HRAC6.js → chunk-WAMBQNDN.js} +11 -11
- package/dist/{chunk-QKIVMRK5.js → chunk-WCAQWHFD.js} +5 -5
- package/dist/{chunk-XYA7NPSZ.js → chunk-XF2NZVXW.js} +5 -5
- package/dist/{chunk-BKV6PH3R.js → chunk-XTPDXB4X.js} +1 -1
- package/dist/{chunk-BHGMJBJ2.js → chunk-XZLBPVRH.js} +1 -1
- package/dist/{chunk-VJ56YZY6.js → chunk-Y5W6POQE.js} +5 -5
- package/dist/{chunk-B6FBDJUL.js → chunk-YL44UDNT.js} +6 -6
- package/dist/chunk-Z5UVBCEE.js +9 -0
- package/dist/{chunk-BJKXFEZN.js → chunk-ZEDYXP2J.js} +1 -1
- package/dist/{chunk-N7LV32EQ.js → chunk-ZKRWJILC.js} +1 -1
- package/dist/{chunk-2K76HRXS.js → chunk-ZSTBFMQE.js} +1 -1
- package/dist/chunk-ZZIJFMZG.js +4 -0
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/PositionInput.d.ts +25 -0
- package/dist/forms/PositionInput.js +2 -0
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.d.ts +10 -2
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +8 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +16 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +9 -1
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +8 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/CropBottomIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropBottomIcon.js +1 -0
- package/dist/icons/glyphs/CropLeftIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropLeftIcon.js +1 -0
- package/dist/icons/glyphs/CropLeftRightIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropLeftRightIcon.js +1 -0
- package/dist/icons/glyphs/CropRightIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropRightIcon.js +1 -0
- package/dist/icons/glyphs/CropTopIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropTopIcon.js +1 -0
- package/dist/icons/glyphs/CropYIcon.d.ts +8 -0
- package/dist/icons/glyphs/CropYIcon.js +1 -0
- package/dist/icons/glyphs/NudgeXIcon.d.ts +8 -0
- package/dist/icons/glyphs/NudgeXIcon.js +1 -0
- package/dist/icons/glyphs/NudgeYIcon.d.ts +8 -0
- package/dist/icons/glyphs/NudgeYIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/CropBottomMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropBottomMiniIcon.js +1 -0
- package/dist/icons/looks/CropBottomSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropBottomSolidIcon.js +1 -0
- package/dist/icons/looks/CropLeftMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropLeftMiniIcon.js +1 -0
- package/dist/icons/looks/CropLeftRightMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropLeftRightMiniIcon.js +1 -0
- package/dist/icons/looks/CropLeftRightSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropLeftRightSolidIcon.js +1 -0
- package/dist/icons/looks/CropLeftSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropLeftSolidIcon.js +1 -0
- package/dist/icons/looks/CropRightMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropRightMiniIcon.js +1 -0
- package/dist/icons/looks/CropRightSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropRightSolidIcon.js +1 -0
- package/dist/icons/looks/CropTopMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropTopMiniIcon.js +1 -0
- package/dist/icons/looks/CropTopSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropTopSolidIcon.js +1 -0
- package/dist/icons/looks/CropYMiniIcon.d.ts +8 -0
- package/dist/icons/looks/CropYMiniIcon.js +1 -0
- package/dist/icons/looks/CropYSolidIcon.d.ts +8 -0
- package/dist/icons/looks/CropYSolidIcon.js +1 -0
- package/dist/icons/looks/NudgeXMiniIcon.d.ts +8 -0
- package/dist/icons/looks/NudgeXMiniIcon.js +1 -0
- package/dist/icons/looks/NudgeXSolidIcon.d.ts +8 -0
- package/dist/icons/looks/NudgeXSolidIcon.js +1 -0
- package/dist/icons/looks/NudgeYMiniIcon.d.ts +8 -0
- package/dist/icons/looks/NudgeYMiniIcon.js +1 -0
- package/dist/icons/looks/NudgeYSolidIcon.d.ts +8 -0
- package/dist/icons/looks/NudgeYSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +399 -399
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/names-DcR-HlYV.d.ts +21 -0
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/tokens/spacing.d.ts +5 -5
- package/dist/tokens/spacing.js +1 -1
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +5 -4
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-B44SNFGQ.js +0 -29
- package/dist/CurrencyConverter-QCXULYMM.js +0 -21
- package/dist/Files-PE67UQ33.js +0 -87
- package/dist/Notepad-BOSV536Y.js +0 -25
- package/dist/PdfViewer-IQQM7DOH.js +0 -1
- package/dist/Sidebar-EIGME7VA.js +0 -43
- package/dist/Spreadsheet-3EGY4CEN.js +0 -37
- package/dist/chunk-2355YEWO.js +0 -1
- package/dist/chunk-BEWEQ6BP.js +0 -3
- package/dist/chunk-BXCWPHU6.js +0 -1
- package/dist/chunk-H7BP5LLG.js +0 -99
- package/dist/chunk-MXMBQS75.js +0 -20
- package/dist/chunk-OZ2ALRKX.js +0 -3
- package/dist/chunk-SQFSBXPR.js +0 -1
- package/dist/chunk-SXE6KZBU.js +0 -1
- package/dist/chunk-TKLH7V2R.js +0 -9
- package/dist/chunk-VIJ5BZ5U.js +0 -1
- package/dist/chunk-VLOJ4XJC.js +0 -8
- package/dist/chunk-YVOGWINT.js +0 -4
- package/dist/names-CwL-QSC9.d.ts +0 -21
- /package/dist/{chunk-2CGVDBNO.js → chunk-4MNNVSHD.js} +0 -0
- /package/dist/{chunk-WHTINFQU.js → chunk-A6L6FYG4.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-4CXQX5AX.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-
|
|
2
|
-
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:
|
|
3
|
-
/* @__PURE__ */h("button",{type:"button",onClick:
|
|
4
|
-
/* @__PURE__ */b("span",{children:
|
|
5
|
-
/* @__PURE__ */b("b",{className:"font-medium",children:N(
|
|
6
|
-
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",
|
|
1
|
+
import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-4CXQX5AX.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-VJPJNCB4.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-OVNRVFWS.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),C=S.length?Math.min(...S):x,P=S.length?Math.max(...S):x,D=a(r??null)??C,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),A=(()=>{const e=[R,P,q,D+i];return O||e.push(x),Math.max(...e)})(),T=Math.max(1,Math.round((A-D)/i)),I=a(p??null)??P??D,j=Math.min(Math.max(y??I,D),A),L=t.find(e=>{const t=a(e.date);return null!=t&&t<=j})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>j){$=t[e];break}}const F=(()=>{if(L||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(D).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),J=L??F,V=L?a(L.date):F?D:null,X=$?a($.date):null,z=!!(J&&$&&null!=V&&null!=X&&j>V&&j<X);let B,E;if(z&&null!=V&&null!=X){const e=(j-V)/Math.max(X-V,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of J?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(J?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):J?.est_completion_date||$?.est_completion_date||null,B={id:`interp-${j}`,progress_number:_.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},E=J}else if(B=J??t[t.length-1]??null,B){const e=t.findIndex(e=>e.id===B.id);E=e>=0&&e<t.length-1?t[e+1]:null}else E=null;const G={};for(const e of E?.items??[])G[e.part_number]=e;const H=!(!d||B?.id===d),K=d?Math.min(a(p??null)??A,A):A,Q=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:D,endMs:A,totalLeadDays:T,scrubMs:j,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:J,nextAfter:$,displayed:B,prevReport:E,prevByPN:G,isInterpolated:z,playing:v,startPlay:()=>{if(v)return void N();if(K<=D)return void f(K);M(!0),f(D);let e=performance.now(),t=D;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=K)return f(K),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:Q,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),C=N.map(({ms:e})=>e),P=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:P,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:C,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:C}){const{reports:P,markers:D,poNumber:R,startMs:O,endMs:q,totalLeadDays:A,scrubMs:T,setScrubMs:I,displayed:j,scrubbedAway:L,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:J,estCompletionMs:V}=n,X=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(P.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,C),z=c().production,B=d(),E=_??z.heading,G=e=>o(e,B);if(0===P.length&&0===D.length)return null;const H=D.filter(e=>"shipment"===e.kind),K=D.filter(e=>"inspection"===e.kind),Q=D.filter(e=>"invoice"===e.kind),U=(j?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),W=j?v(j):0,Y=P.find(e=>e.id===F),Z=Y?N(Y):J,ee=
|
|
3
|
+
/* @__PURE__ */h("button",{type:"button",onClick:X.toggle,"aria-pressed":X.playing,title:X.playing?z.pause:z.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[X.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
|
|
4
|
+
/* @__PURE__ */b("span",{children:X.playing?z.pause:z.play})]}),te=L&&(S??Z)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{X.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??z.backTo(String(Z))}):null,[re,ne]=p(z.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:j?/* @__PURE__ */h(y,{children:[e&&re,
|
|
5
|
+
/* @__PURE__ */b("b",{className:"font-medium",children:N(j)}),e&&ne,
|
|
6
|
+
/* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",G(new Date(j.date).getTime())," · ",z.overall(Math.round(W))," · ",z.inStock(U)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:z.noReport})});if("rail"===x){const e=null!=V&&V>=q&&q>O,t=e?{key:"__estimate__",label:z.estimatedCompletion,dateText:G(V)}:null;/* @__PURE__ */
|
|
7
7
|
return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
8
|
-
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:
|
|
8
|
+
/* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:P,markers:D,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??z.start,end:M?.end??(e?z.estDone:void 0)},onDragStart:X.stop,playback:{playing:X.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:X.stop}}),
|
|
9
9
|
/* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
|
|
10
|
-
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:
|
|
11
|
-
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[
|
|
12
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),z.report]}),
|
|
10
|
+
return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:E,subject:R,meta:[`${G(O)} → ${G(q)}`,z.leadTime(A)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
|
|
11
|
+
/* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[P.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
12
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),z.report]}),H.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
13
13
|
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),z.shipment]}),K.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
14
14
|
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),z.inspection]}),Q.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
|
|
15
|
-
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),z.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:
|
|
15
|
+
/* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),z.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:P,markers:D,valueMs:T,activeId:j?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:X.stop,playback:{playing:X.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:X.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-JGZWAEOJ.js";import{Icon as i}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-JGZWAEOJ.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:J,rowRef:P,className:B=""}){const D=x||!!p,A=n(u),$=l(null),C=s(),I=[J?.["aria-describedby"],j?C:void 0].filter(Boolean).join(" ")||void 0,K=J?.tabIndex;a(()=>{const e=$.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===A?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},W=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":
|
|
5
|
-
/* @__PURE__ */c("div",{...
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":D||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-white transition-colors duration-(--motion-fast)",w?"":D?"border-blue-300":"border-gray-200 hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...J,ref:e=>{var r,t;$.current=e,t=e,"function"==typeof(r=P)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":J?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":I,onKeyDown:e=>{if(J?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[W&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[W,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:W})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:C})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as A}from"react/jsx-runtime";function L({size:L=18,...M}){/* @__PURE__ */
|
|
2
|
+
return A("svg",{width:L,height:L,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...M,children:/* @__PURE__ */A("path",{d:"M3.75 4.5L4.75 4.5A0.75 0.75 0 0 1 4.75 3L3.75 3A0.75 0.75 0 0 1 3.75 4.5ZM8.75 4.5L9.75 4.5A0.75 0.75 0 0 1 9.75 3L8.75 3A0.75 0.75 0 0 1 8.75 4.5ZM14.25 4.5L15.25 4.5A0.75 0.75 0 0 1 15.25 3L14.25 3A0.75 0.75 0 0 1 14.25 4.5ZM19.25 4.5L20.25 4.5A0.75 0.75 0 0 1 20.25 3L19.25 3A0.75 0.75 0 0 1 19.25 4.5ZM19.5 3.75L19.5 4.75A0.75 0.75 0 0 1 21 4.75L21 3.75A0.75 0.75 0 0 1 19.5 3.75ZM19.5 8.75L19.5 9.75A0.75 0.75 0 0 1 21 9.75L21 8.75A0.75 0.75 0 0 1 19.5 8.75ZM19.5 14.25L19.5 15.25A0.75 0.75 0 0 1 21 15.25L21 14.25A0.75 0.75 0 0 1 19.5 14.25ZM19.5 19.25L19.5 20.25A0.75 0.75 0 0 1 21 20.25L21 19.25A0.75 0.75 0 0 1 19.5 19.25ZM3.75 21L4.75 21A0.75 0.75 0 0 1 4.75 19.5L3.75 19.5A0.75 0.75 0 0 1 3.75 21ZM8.75 21L9.75 21A0.75 0.75 0 0 1 9.75 19.5L8.75 19.5A0.75 0.75 0 0 1 8.75 21ZM14.25 21L15.25 21A0.75 0.75 0 0 1 15.25 19.5L14.25 19.5A0.75 0.75 0 0 1 14.25 21ZM19.25 21L20.25 21A0.75 0.75 0 0 1 20.25 19.5L19.25 19.5A0.75 0.75 0 0 1 19.25 21ZM3 3.75L3 4.75A0.75 0.75 0 0 1 4.5 4.75L4.5 3.75A0.75 0.75 0 0 1 3 3.75ZM3 8.75L3 9.75A0.75 0.75 0 0 1 4.5 9.75L4.5 8.75A0.75 0.75 0 0 1 3 8.75ZM3 14.25L3 15.25A0.75 0.75 0 0 1 4.5 15.25L4.5 14.25A0.75 0.75 0 0 1 3 14.25ZM3 19.25L3 20.25A0.75 0.75 0 0 1 4.5 20.25L4.5 19.25A0.75 0.75 0 0 1 3 19.25ZM6.75 1.5L6.75 22.5A1.5 1.5 0 0 1 9.75 22.5L9.75 1.5A1.5 1.5 0 0 1 6.75 1.5Z"})})}export{L as CropLeftSolidIcon};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-JGZWAEOJ.js";import{GROUP_COLORS as n}from"./chunk-BOGBLZKS.js";import{OneLineLabel as o}from"./chunk-QMQVOUIV.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-JGZWAEOJ.js";import{GROUP_COLORS as n}from"./chunk-BOGBLZKS.js";import{OneLineLabel as o}from"./chunk-QMQVOUIV.js";import{Icon as i}from"./chunk-VJPJNCB4.js";import{Tooltip as s}from"./chunk-Z3WKHMVB.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-OVNRVFWS.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return g("div",{...n,ref:o,role:"tree","aria-label":r?void 0:e,"aria-labelledby":r,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:t})}function v({children:e,hidden:r,className:t=""}){/* @__PURE__ */
|
|
3
3
|
return g("div",{role:"group",hidden:r,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${t}`.trim(),children:e})}var x=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),k=`${x} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!m(e)&&"label"in e}function N(e){if(null==e||!1===e)return null;const r=Array.isArray(e)&&e.length>0&&e.every(w)?e:w(e)?[e]:null;return r?r.map((e,r)=>/* @__PURE__ */g("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${x} ${n[e.tone]}`:k,children:e.label},r)):/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:e})}function A({children:e,count:r,expanded:t,onToggle:a}){const n=void 0!==t,i=
|
|
4
4
|
/* @__PURE__ */g("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */g(o,{children:e})}),s=null!=r&&!1!==r&&/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:r}),l="text-xs font-semibold uppercase tracking-wide text-gray-500";return n?/* @__PURE__ */g("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */h("button",{type:"button","aria-expanded":t,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",l].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j(!!t)}),i,s]})}):/* @__PURE__ */h("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${l}`,children:[
|
|
6
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,s]})}var j=e=>/* @__PURE__ */g(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),
|
|
7
|
-
return h("div",{...$,role:"treeitem","aria-level":i,"aria-selected":c,"aria-expanded":
|
|
6
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,s]})}var j=e=>/* @__PURE__ */g(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),P={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function D({label:n,level:i=1,icon:s,preview:l,selected:c=!1,expanded:d,onToggle:u,onSelect:m,muted:f=!1,badge:b,actions:y,actionsPinned:v=!1,actionsOverlay:x=!0,rename:k,drop:w,dragging:A=!1,draggable:D=!1,dragHint:C,onMove:K,rowProps:$,className:I=""}){const B=void 0!==d,E=p(),H=[$?.["aria-describedby"],K?E:void 0].filter(Boolean).join(" ")||void 0,O=c?"bg-blue-50 text-blue-700":"into"===w?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
7
|
+
return h("div",{...$,role:"treeitem","aria-level":i,"aria-selected":c,"aria-expanded":B?d:void 0,tabIndex:c?0:-1,"aria-keyshortcuts":$?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":H,"data-drop":w,"data-draggable":D||void 0,onKeyDown:e=>{if($?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!m?("ArrowRight"===e.key&&B&&!d&&u||"ArrowLeft"===e.key&&B&&d&&u)&&(e.preventDefault(),u()):(e.preventDefault(),m())},onClick:e=>{$?.onClick?.(e),e.defaultPrevented||m?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",D?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",O,"into"===w?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",A?"opacity-40":"",I].filter(Boolean).join(" "),children:["before"===w&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===w&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),D&&
|
|
8
8
|
/* @__PURE__ */g(r,{marker:"tree",hint:C,dragging:A,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
-
/* @__PURE__ */g("span",
|
|
9
|
+
/* @__PURE__ */g("span",B?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),u?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!d)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(f?"text-gray-400":""),children:s}),
|
|
10
10
|
/* @__PURE__ */h("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[k??
|
|
11
11
|
/* @__PURE__ */g("span",{className:`flex min-w-0 ${c?"font-semibold":"font-medium"} ${f?"text-gray-400 line-through":""}`,children:/* @__PURE__ */h(o,{children:[n,null!=l&&/* @__PURE__ */g("span",{className:"ml-2 font-normal text-gray-500",children:l})]})}),N(b),null!=y&&!x&&/* @__PURE__ */g("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(v||f?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:y})]}),null!=y&&x&&
|
|
12
|
-
/* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:
|
|
12
|
+
/* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:P,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(v||f||c?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
15
|
/* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:y})]}),K&&/* @__PURE__ */g(t,{id:E})]})}function C({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
@@ -17,4 +17,4 @@ return g("div",{...a,role:"presentation","data-drop":t||void 0,children:e?/* @__
|
|
|
17
17
|
/* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function K({onInsert:e,label:r,drop:t=!1,seamProps:a}){const n=c().tree,o=r??n.insertHere,l=t?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return h("div",{...a,role:"presentation","data-tree-seam":"","data-drop":t||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */g("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,v as TreeGroup,A as TreeGroupLabel,
|
|
20
|
+
/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${l}`}),e&&/* @__PURE__ */g(s,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */g("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(t?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,v as TreeGroup,A as TreeGroupLabel,D as TreeRow,K as TreeSeam};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";function e({size:e=18,...t}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:/* @__PURE__ */r("path",{d:"M11.25 12a0.75 0.75 0 1 0 1.5 0a0.75 0.75 0 1 0 -1.5 0ZM9 12L3.75 12M6 9.75L3.75 12L6 14.25M15 12L20.25 12M18 9.75L20.25 12L18 14.25"})})}export{e as NudgeXIcon};
|
|
@@ -0,0 +1,99 @@
|
|
|
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-TPDOOCFS.js";import{ROW_HEIGHTS as u}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as d}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as h}from"./chunk-JDCM2VHG.js";import{Result as m}from"./chunk-LR2X6MKB.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-Y53KNQKL.js";import{ColoredBadge as w}from"./chunk-JF45HC5H.js";import{CopyButton as y}from"./chunk-5GHLKEJQ.js";import{confirm as g}from"./chunk-RP4ZLTXA.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{useShellPrefs as v}from"./chunk-KC3EX26K.js";import{PopupMenu as x,PopupMenuItem as k,PopupMenuDivider as E,PopupMenuLabel as C}from"./chunk-7IF3RZF3.js";import{useIsMobile as M,useIsPhone as N}from"./chunk-UGTRSRIW.js";import{StatusBadge as S}from"./chunk-BOGBLZKS.js";import{focusableIn as L}from"./chunk-CDAJKLGL.js";import{Button_default as T}from"./chunk-FSP63GKK.js";import{Icon as z}from"./chunk-VJPJNCB4.js";import{LoadingSpinner as A}from"./chunk-Q5MD3VY6.js";import{Z_LAYERS as D}from"./chunk-62LW225J.js";import{runEscapeInterceptors as P}from"./chunk-TWVUQUUD.js";import{useShellStrings as I}from"./chunk-OVNRVFWS.js";import{createContext as K,useContext as R,Component as W,useLayoutEffect as $,useRef as O,useEffect as F,useState as j,useSyncExternalStore as q,useCallback as B,isValidElement as H,Fragment as U,Children as Y,cloneElement as X,useMemo as V,useId as J,useReducer as _,Suspense as G}from"react";import{jsxs as Q,jsx as Z,Fragment as ee}from"react/jsx-runtime";import{createPortal as te}from"react-dom";import{useLocation as ne}from"react-router-dom";import{useQueryClient as re,useQuery as oe}from"@tanstack/react-query";function ie(e){return"component"in e}function ae(e){return"endpoint"in e}var se={};function le(e){se=e}var ce=new Proxy({},{get:(e,t)=>se[t],has:(e,t)=>t in se,ownKeys:()=>Object.keys(se),getOwnPropertyDescriptor(e,t){if(t in se)return{configurable:!0,enumerable:!0,value:se[t]}}}),ue=null;function de(e){ue=e}function he(){return null!==ue}var me=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),pe=new Proxy({},{get:(e,t)=>ue?ue[t]:"string"==typeof t&&me.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),fe=K(null);function we(){return R(fe)?.pageSearch??""}var ye=null,ge=/* @__PURE__ */new Set;function be(e){ye!==e&&(ye=e,ge.forEach(e=>e()))}function ve(){return ye}function xe(e){return ge.add(e),()=>{ge.delete(e)}}function ke({error:e,onReload:t}){const n=h(e);/* @__PURE__ */
|
|
2
|
+
return Q("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
+
/* @__PURE__ */Z(z,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
+
/* @__PURE__ */Q("div",{className:"min-w-0",children:[
|
|
5
|
+
/* @__PURE__ */Z("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__ */Z("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__ */Z("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 Ee=class extends W{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),d(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */Z(ke,{error:e,onReload:this.reset}):this.props.children}},Ce=K(null),Me="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ne({className:e="",auto:t=!1}){const n=R(Ce),r=I().undo,o=n?.claimOwnMount;if($(()=>{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:u}=n;/* @__PURE__ */
|
|
8
|
+
return Q("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",p):r.nothingToUndo,className:Me,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",f):r.nothingToRedo,className:Me,children:r.redo})]})}var Se=/* @__PURE__ */new Set([408,429]);function Le(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Te(e){const t=Le(e);return null!=t&&(t>=400&&t<500&&!Se.has(t))}function ze(e,t){return!Te(t)&&e<3}function Ae(){const e=I().loading;/* @__PURE__ */
|
|
11
|
+
return Z(A,{size:"sm",padding:"p-8",label:e.label})}var De="flex-1 min-h-0";function Pe(){const e=I().record;/* @__PURE__ */
|
|
12
|
+
return Z(A,{label:e.loading,padding:"",className:De})}function Ie(e){return e??void 0}function Ke({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=I().record;if(t||e&&n)/* @__PURE__ */return Z(Pe,{});if(r){const e=Le(r);if(401===e)/* @__PURE__ */
|
|
13
|
+
return Z(m,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:De});if(403===e)/* @__PURE__ */
|
|
14
|
+
return Z(m,{status:"403",className:De});if(404===e||410===e)/* @__PURE__ */
|
|
15
|
+
return Z(m,{status:"404",title:i.notFound,className:De});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
16
|
+
return Z(m,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */Z(T,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:De})}/* @__PURE__ */
|
|
17
|
+
return Z(m,{status:"404",title:i.notFound,className:De})}function Re({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */Z(ee,{children:t(e)}):/* @__PURE__ */Z(Ke,{...n})}var We=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function $e(e){return"string"==typeof e&&(e.startsWith("new-")||We.test(e))}function Oe(e){if($e(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Fe=K({openWindows:[],openEntity:()=>{},openPage:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),je=K(null);function qe(e){const t=R(je),n=O(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),$(()=>{if(t)return t(n.current,e)},[t,e]),F(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function Be(){const e=O(/* @__PURE__ */new Map),[t,n]=j(!1);return{dirty:t,registerDirty:B((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 He(){return R(Fe)}function Ue(e){if("page"!==e.type&&Oe(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 Ye({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=Be(),i=ce[e.route];if(!i||!ie(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
18
|
+
return Z(Or,{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__ */Z(je.Provider,{value:o,children:/* @__PURE__ */Z(G,{fallback:/* @__PURE__ */Z("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */Z(Ae,{})}),children:/* @__PURE__ */Z(s,{})})})})}function Xe({entityType:e,entityId:t,label:n}){const r=I(),o=re(),{data:i}=oe({queryKey:["my-profile-sidebar"],enabled:he(),queryFn:()=>pe.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 Z("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];pe.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__ */Z(z,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var Ve=/* @__PURE__ */new Set;function Je({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ce[e.entityType];if(!o||!ae(o))return null;const i=o,[a,s]=j(!1),{dirty:l,registerDirty:u}=Be(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=$e(e.entityId),p=!i.selfFetching&&!h&&!m&&he(),f=oe({queryKey:[d,e.entityId],queryFn:()=>{return pe.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Ie(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Te(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:ze}),w=f.data,y=f.refetch;F(()=>{var t;if(p)return t=t=>{t!==e.id||Ve.has(t)||y({cancelRefetch:!1})},Bn.add(t),()=>{Bn.delete(t)}},[y,e.id,p]);const g=B(()=>{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__ */Z(G,{fallback:/* @__PURE__ */Z(Ae,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */Z(G,{fallback:/* @__PURE__ */Z(Or,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z(Pe,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */Z(Or,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Z(Ke,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */Z(Or,{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__ */Z(je.Provider,{value:u,children:/* @__PURE__ */Z(G,{fallback:/* @__PURE__ */Z(Pe,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */Z(Re,{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 _e(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function Ge(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function Qe(e){const t=_e(e),n=t??Ge(e);if(!n)return;if(t&&!tr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Hn(o)}function Ze(e){if("page"!==e.type)return!0;const t=e.route?ce[e.route]:void 0;if(!t||!ie(t))return!0;const n=t;return!n.widget&&!n.utility}function et(){const e=fr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var tt=/* @__PURE__ */new Map;function nt(){const e=et();if(e)return tt.get(e)}function rt(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 ot="rosh-peek-style",it=D.peek,at=D.taskbarPreview;function st(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(ot))return;const e=document.createElement("style");e.id=ot,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:${it}!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 lt(){"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 ct({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=I(),l=O(null),[c,u]=j({w:n,h:Math.round(.75*r)}),[d,h]=j(!1);return $(()=>{const o=l.current;if(!o)return;const i=_e(e)??rt(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)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),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.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */Q("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__ */Z("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */Q("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
21
|
+
/* @__PURE__ */Z(z,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
22
|
+
/* @__PURE__ */Z("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */Z("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__ */Z("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__ */Z(z,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function ut({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=I(),s=e.length>1,l=O(null),[c,u]=j({left:-9999,top:-9999,ready:!1}),[d,h]=j(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");$(()=>{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)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),F(()=>lt,[]);const m="top"===d,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 te(
|
|
23
|
+
/* @__PURE__ */Z("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:at,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{lt(),i()},children:e.map(e=>{const t=_e(e.id)??rt(e.label),o=t?function(e){if(tr(e))return null;const t=e.getBoundingClientRect(),n=Jn(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
24
|
+
return Q("div",{className:"group flex flex-col items-center",onMouseEnter:()=>st(t),children:[!m&&/* @__PURE__ */Z("span",{className:p,children:e.label}),
|
|
25
|
+
/* @__PURE__ */Z(ct,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */Z("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */Q("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__ */Z(z,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function dt(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 ht({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=I(),[a,s]=j(null);F(()=>{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=q(wr,fr),[,u]=j(0);F(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=j(0);F(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=rt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=j(null),[f,w]=j(null),[y,g]=j(null),b=O(null),v=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},M=e.filter(e=>!e.route||!ce[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?ce[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 te(
|
|
27
|
+
/* @__PURE__ */Q(ee,{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,u=e.items.some(e=>{const t=_e(e.id)??rt(e.label);return!!t&&!tr(t)});/* @__PURE__ */
|
|
28
|
+
return Q("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&&H(n)?X(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */Z(z,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
29
|
+
/* @__PURE__ */Z("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */Z("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */Z("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__ */Z("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__ */Z(z,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
30
|
+
/* @__PURE__ */Z("div",{className:"flex-1"}),M.length>=2&&/* @__PURE__ */Q("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__ */Z(z,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */Q(x,{portal:!0,minWidth:200,style:dt(y.x,y.y),onClose:()=>g(null),children:[
|
|
32
|
+
/* @__PURE__ */Z(C,{children:y.label}),
|
|
33
|
+
/* @__PURE__ */Q(k,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=An.get(e);t&&Un(t)}(e.id))},children:[
|
|
34
|
+
/* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
35
|
+
/* @__PURE__ */Q(k,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
|
|
36
|
+
/* @__PURE__ */Z("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("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__ */Z(E,{}),
|
|
38
|
+
/* @__PURE__ */Q(k,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
39
|
+
/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */Z(ut,{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 mt=["/login","/forgot-password","/reset-password","/force-change-password"];function pt({children:e,windowAccentForRoute:t}){const n=ne(),r=mt.some(e=>n.pathname.startsWith(e)),[o,i]=j([]),a=O(o);$(()=>{a.current=o},[o]);const s=q(xe,ve,ve),l=O(/* @__PURE__ */new Map),c=e=>{const t=Ze(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};F(()=>{tt.clear();for(const e of o)e.route&&tt.set(e.id,e.route)},[o]);const u=B(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=B(e=>{var t;_e(e)||Ge(e)?(t=e,window.dispatchEvent(new CustomEvent(yr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Nn;t&&Ve.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,(Sn.get(i)??-1)>a)||Hn(o),t&&Ve.delete(e)},50)},m=B((e,t,n,r,o)=>{if(!ce[e]||!ae(ce[e]))return;const a=`${e}:${t}`,s=et();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:Ie(n),openedFrom:s}])})},[]),p=B((e,t={})=>{if(!ce[e]||!ie(ce[e]))return;const n=ce[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l}=t,c=e=>{var t;o?(t=e,Rn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const u=et();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:u,...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:u,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}}]})},[d]),f=B(()=>{},[]),w=B(()=>{},[]),y=d,g=d;/* @__PURE__ */
|
|
40
|
+
return Q(Fe.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__ */Z(ht,{openWindows:o,onRemove:d,onSplitView:Wr,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&&Hn(e)}})},onActivateById:Qe}),
|
|
42
|
+
/* @__PURE__ */Z($r,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
43
|
+
/* @__PURE__ */
|
|
44
|
+
return Z(fe.Provider,{value:c(e),children:/* @__PURE__ */Z(Ee,{fallback:(t,n)=>/* @__PURE__ */Z(Or,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */Z(ke,{error:t,onReload:n})}),children:/* @__PURE__ */Z(Ht,{spec:Ue(e),children:/* @__PURE__ */Z(Yr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Z(Ye,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */Z(Je,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var ft=400;function wt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=O(null),s=O(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=O(!1),c=O(void 0),u=O(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},ft)};F(()=>{n&&!r&&h()},[n,r]),F(()=>{d&&n&&!r&&h()},[d]),F(()=>()=>clearTimeout(c.current),[]),F(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;const s=t.current?L(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),$(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var yt=null,gt=/* @__PURE__ */new Set;function bt(){return yt}function vt(e){if(yt!==e){yt=e;for(const e of gt)e()}}function xt(e){return gt.add(e),()=>{gt.delete(e)}}var kt=!1,Et={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Ct=()=>{};function Mt(e){kt=e,Et={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Nt(e,t){kt&&("submenu"===e?Et.submenus++:Et.menus++,Et.menuKey=t)}function St(e){if(!kt)return Ct;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!kt)return;const r=performance.now()-t;"move"===e?Et.moveMs+=r:Et.resizeMs+=r}}function Lt(){const e=Et;return Et={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Tt=/* @__PURE__ */new Set([S,w]),zt=e=>Tt.has(e)||"function"==typeof e&&"badge"===e.titleRole,At=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Dt=/* @__PURE__ */new Set(["svg"]);function Pt(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return It(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function It(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=>It(e,t,n));if(!H(e))return;const r=e;if(r.type===y)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===U)return void Y.toArray(r.props.children).forEach(e=>It(e,t,n));if("string"==typeof r.type){if(Dt.has(r.type))return;if(!At.has(r.type))return n.push(" "),Y.toArray(r.props.children).forEach(e=>It(e,t,n)),void n.push(" ")}const o=X(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(zt(r.type)?t.badges:t.actions).push(o)}var Kt=/* @__PURE__ */new Map,Rt=/* @__PURE__ */new Set,Wt=0;function $t(){Wt++,Rt.forEach(e=>e())}function Ot(e){return Kt.get(e)}function Ft(e){return Rt.add(e),()=>{Rt.delete(e)}}function jt(){return Wt}var qt=K(""),Bt=K(null);function Ht({spec:e,children:t}){/* @__PURE__ */
|
|
45
|
+
return Z(Bt.Provider,{value:e,children:t})}var Ut=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Yt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Xt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Vt(e){return Jt(e).replace(/\s+/g," ").trim()}function Jt(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(Jt).join("");if(H(e)){const t=e,n="string"==typeof t.type?t.type:"";return Ut.has(n)?"":` ${Jt(t.props?.children)} `}return""}function _t(e){const t=R(qt);F(()=>{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 Gt={};function Qt(e,t,n){const r=R(qt);F(()=>{if(!r)return;Gt[r]||(Gt[r]=[]);const o={label:e,icon:n,onClick:t};return Gt[r].push(o),()=>{Gt[r]=(Gt[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Zt({title:e}){const t=O(null);return F(()=>{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__ */Z("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function en(e){}var tn=K(null);function nn(){return R(qt)}function rn(){const e=q(wr,fr),t=R(tn);return t?.active??(En.length<=1||null!=e)}function on({children:e,position:t="right",quiet:n=!1}){const r=R(tn),[o,i]=j(null);return F(()=>{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?te(e,o):null}function an({onClick:e,children:t,className:n}){const r=R(tn);/* @__PURE__ */
|
|
46
|
+
return Z("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.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 sn="erp_window_positions",ln={};try{const e=localStorage.getItem(sn);e&&(ln=JSON.parse(e))}catch{}var cn=null;function un(){cn&&clearTimeout(cn),cn=setTimeout(()=>{try{localStorage.setItem(sn,JSON.stringify(ln))}catch{}},500)}var dn="erp_activation_order",hn=[];try{const e=localStorage.getItem(dn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(hn=t)}catch{}var mn=null;function pn(){mn&&clearTimeout(mn),mn=setTimeout(()=>{try{localStorage.setItem(dn,JSON.stringify(hn))}catch{}},500)}function fn(e,t){ln[e]||(ln[e]=t,un())}function wn(e){return ln[e]?{...ln[e]}:null}function yn(e,t){ln[e]=t,un()}function gn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(ln))n(ln[e],r,o)&&(delete ln[e],i=!0);i&&un()}var bn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},vn=4e3,xn=()=>{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"},kn={small:.8,medium:1,large:1.25,maximized:1.25},En=[],Cn=/* @__PURE__ */new Set,Mn=/* @__PURE__ */new Set,Nn=0,Sn=/* @__PURE__ */new Map;var Ln=0;function Tn(){return Ln}function zn(){Ln++,Cn.forEach(e=>e())}var An=/* @__PURE__ */new Map,Dn=/* @__PURE__ */new Map,Pn=/* @__PURE__ */new Map;function In(){for(let e=En.length-1;e>=0;e--){const t=Pn.get(En[e]);if(t?.tab)return t.owner}return null}function Kn(){return q(wr,In,()=>null)}var Rn=/* @__PURE__ */new Set;var Wn=null;function $n(e){Wn=null,Hn(e)}function On(e){Wn=e;const t=An.get(e);t&&$n(t)}function Fn(e){Wn===e&&(Wn=null)}function jn(e,t,n){if(n&&Pn.set(e,n),t)if(An.set(t,e),Dn.set(e,t),Rn.delete(t)){En.unshift(e);const n=hn.indexOf(t);-1!==n&&hn.splice(n,1),hn.unshift(t),pn()}else!function(e,t){const n=hn.indexOf(t);if(-1===n)return void En.push(e);let r=En.length;for(let e=0;e<En.length;e++){const t=Dn.get(En[e]);if(t&&hn.indexOf(t)>n){r=e;break}}En.splice(r,0,e)}(e,t),-1===hn.indexOf(t)&&(hn.push(t),pn());else En.push(e);zn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Wn===t&&$n(e)}function qn(e){return e?Pn.get(e)?.owner??Dn.get(e)??null:null}var Bn=/* @__PURE__ */new Set;function Hn(e){const t=qn(fr()),n=En.indexOf(e);-1!==n&&En.splice(n,1),En.push(e);const o=Pn.get(e);if(o?.root&&o.tab&&r()){const e=En.filter(e=>{const t=Pn.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)En.splice(En.indexOf(t),1),En.push(t)}Mn.delete(e);const i=Dn.get(e);if(i){const e=hn.indexOf(i);-1!==e&&hn.splice(e,1),hn.push(i),pn(),Wn&&Wn!==i&&(Wn=null)}zn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=qn(fr());a&&a!==t&&Bn.forEach(e=>e(a))}function Un(e){const t=En.indexOf(e);-1!==t&&En.splice(t,1),Mn.add(e),Sn.set(e,++Nn);const n=Dn.get(e);if(n){const e=hn.indexOf(n);-1!==e&&(hn.splice(e,1),pn())}zn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var Yn=/* @__PURE__ */new Set;var Xn=8,Vn=32;function Jn(){return e()}var _n=u.windowBar,Gn=80,Qn=384,Zn=400;function er(e,t=Jn()){const n=Math.min(Math.max(e.x,t.x+Gn-e.w),t.x+t.w-Gn),r=Math.min(Math.max(e.y,t.y),t.y+t.h-_n);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function tr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Jn();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function nr(e){const t=Jn(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var rr=null;function or(e){const t=(rr||((rr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${D.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(rr)),rr);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 ir(){rr&&(rr.style.opacity="0",rr.style.display="none")}var ar=[{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"}],sr=350,lr=200;function cr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=j(!1),s=O(void 0),l=O(void 0);F(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),sr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),lr)};/* @__PURE__ */
|
|
47
|
+
return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
48
|
+
/* @__PURE__ */Z("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */Z("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,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:ar.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Z("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,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__ */Z("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var ur="rosh-gesture-style";var dr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},hr=4;function mr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(ur))return;const e=document.createElement("style");e.id=ur,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=St(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function pr(e){const t=En.indexOf(e);if(-1===t)return-1;const n=D.window+t*D.windowStep,o=Pn.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of Pn){if(!t.root||t.owner!==o.owner)continue;const n=En.indexOf(e);-1!==n&&(i=Math.max(i,D.window+n*D.windowStep))}return i>=n?i+2+Math.min(t,7):n}function fr(){return En[En.length-1]||null}function wr(e){return Cn.add(e),()=>{Cn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=En.length-1;e>=0;e--)Yn.has(En[e])||En.splice(e,1);hn=hn.filter(e=>{const t=An.get(e);return null!=t&&Yn.has(t)}),pn(),zn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var yr="modal-close-request";function gr(e){q(wr,Tn);const t=R(tn);if(En.length<=1)return!0;if(e){const t=An.get(e);if(null!=t)return fr()===t}return t?.active??null!=fr()}var br=!1,vr=/* @__PURE__ */new Set;function xr(e){return vr.add(e),()=>vr.delete(e)}function kr(){return br}function Er(e){br!==e&&(br=e,vr.forEach(e=>e()))}function Cr(){Er(!br)}function Mr(){Er(!1)}var Nr=null,Sr=/* @__PURE__ */new Set;function Lr(e){return Sr.add(e),()=>Sr.delete(e)}function Tr(){return Nr}function zr(e){Nr!==e&&(Nr=e,Sr.forEach(e=>e()))}var Ar=null,Dr=/* @__PURE__ */new Set;function Pr(e){return Dr.add(e),()=>Dr.delete(e)}function Ir(){return Ar}function Kr(e){Ar!==e&&(Ar=e,Dr.forEach(e=>e()))}function Rr(){if(!Ar)return void Er(!1);zr(Ar),Kr(null),Er(!1)}function Wr(){Er(!br),window.dispatchEvent(new CustomEvent("modal-split-view"))}function $r(){const e=q(xr,kr),[t,n]=j(e),[r,o]=j(e);return F(()=>{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?te(
|
|
49
|
+
/* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Er(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:D.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 Or({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:y,onMinimize:C,initialBox:S,actions:L,actionsLeft:T,editing:A=!1,allowPinOnTop:K,initialPosition:W,widget:U,compact:Y,appStyle:_,flushBody:G,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:ue}){const[de,he]=j(()=>r()),me=M()&&!de,pe=N()&&!!U,[we,ye]=j(0),[ge,be]=j(!1),ve=O(null),xe=O(0);F(()=>{xe.current=we},[we]);const ke=B(e=>{me&&(ve.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},be(!0),vt(le??null))},[me,le]),Me=q(xt,bt);F(()=>{if(!ge)return;const e=e=>{if(!ve.current)return;const t=e.clientX-ve.current.startX;if(Math.abs(e.clientY-ve.current.startY)>Math.abs(t)+12)return ve.current=null,be(!1),ye(0),void vt(null);ye(Math.max(0,t))},t=()=>{if(!ve.current)return;const e=.3*window.innerWidth,t=xe.current>e;ve.current=null,be(!1),t?(ye(window.innerWidth),setTimeout(()=>{i(),ye(0),vt(null)},180)):(ye(0),vt(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)}},[ge]);const[Se,Le]=j(c),Te=I(),ze=Te.window;F(()=>{Le(c)},[c]);const Ae=V(()=>Vt(Se).trim()||void 0,[Se]),De=J(),[Pe,Ie]=j(!1),Ke=O(!1),[Re,We]=j(!1),[$e,Oe]=j(null),Fe=R(Bt),je=R(fe),{prefs:Be,save:Ue}=v(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Ve=!!Fe&&Xe.some(e=>e.entityType===Fe.entityType&&e.entityId===Fe.entityId),Je=B(()=>{if(!Fe)return;const e=Ve?Xe.filter(e=>!(e.entityType===Fe.entityType&&e.entityId===Fe.entityId)):[...Xe,{entityType:Fe.entityType,entityId:Fe.entityId,label:Fe.label}];Ue({favorite_documents:e})},[Fe,Ve,Xe,Ue]),[_e,Ge]=j(null),[Qe,Ze]=j("top-right"===W?"right":"left"),et=O(!1),tt=O(null);$(()=>{const e=tt.current;e&&(ce?e.style.setProperty("--window-accent-rgb",ce):e.style.removeProperty("--window-accent-rgb"))},[ce]);const nt=O(!1),rt=O(null),ot=O(null),it=O(null),[at,st]=j(!1),lt=O(null),ct=!!(w||L||T)||at,ut=R(Ce),dt=""!==R(qt),ht=O(null);ht.current=je?{owner:je.key,tab:je.tab,root:!dt}:null;const mt=se||(je&&!dt?je.key:null),pt=!!ut&&!dt&&ut.enabled&&ut.hasState&&(A||ut.declaredEditable)&&!ut.handMounted&&ct&&!U&&!Y&&!_&&!me,ft=/* @__PURE__ */Z(z,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),yt=u&&H(u)?X(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??ft,gt=()=>/* @__PURE__ */Z("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Oe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:yt}),kt=40,{minimize:Et,items:Ct,restoreIfMinimized:Mt,openWindows:Nt}=He(),St=O(`modal-${Math.random().toString(36).slice(2,8)}`).current;F(()=>{if(U)return Yn.add(St),()=>{Yn.delete(St)}},[U,St]),F(()=>{const e=e=>{const t=e.detail;t?.id===St&&Le(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[St]);const[Lt,Tt]=j(D.window),zt=function(e){const t=q(wr,fr);return En.length<=1||t===e}(St),At=function(e){return q(wr,()=>Mn.has(e))}(St);wt({panelRef:tt,bodyRef:rt,open:t,widget:!!U,active:zt,minimized:At});const Dt=q(xr,kr),It=q(Lr,Tr),Rt=q(Pr,Ir),Wt=!K&&!U,Ot=Dt&&Wt,[Ft,jt]=j(!1),Ht=Ot&&Rt===St,[Ut,Jt]=j(!1),_t=Ut&&Wt&&It===St?"picked":null,Qt=O(Ot);F(()=>{if(Qt.current&&!Ot){Jt(!0);const e=setTimeout(()=>{Jt(!1),Nr===St&&zr(null)},700);return Qt.current=Ot,()=>clearTimeout(e)}Qt.current=Ot},[Ot,St]),F(()=>{Ot||jt(!1)},[Ot]),F(()=>{const e=ot.current,t=it.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>st(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),F(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&tt.current){const t=tt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ot.current,n=it.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const Zt=O(!1),en=B(e,[]),nn=B(()=>{const t=e(),n=ae?ae[0]:bn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=kn[xn()],l=ae?Math.min(ae[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*(En.length-1),u=Math.max(kt,(i-l)/2),d=(o-a)/2,m=t.h-kt-l-u;return"top-right"===W?{x:t.x+t.w-a-kt,y:t.y+kt,w:a,h:l}:"top-left"===W?{x:t.x+kt,y:t.y+kt,w:a,h:l}:{x:t.x+Math.max(kt,(o-a)/2+kt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),rn=O(!1);t||(rn.current=!1);const on=se||d||null;F(()=>{if(!t)return;jn(St,on,ht.current??void 0),se||Hn(St),Zt.current=!1,Tt(pr(St));const e=()=>{Tt(pr(St))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===se;if(!e.label)return!1;const t=tt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Hn(St),yn.current)return;const t=Jn(),n=Math.min(In.current.w,t.w-40),o=Math.min(In.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;cn({x:i,y:a,w:n,h:o}),Tn(!1)},i=e=>{const t=e.detail;r(t)&&(Hn(St),Oe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Hn(St);const t=In.current,n=function(e,t=Jn()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=tt.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)}cn(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=En.indexOf(e);-1!==t&&(En.splice(t,1),zn()),Mn.delete(e),Sn.delete(e),Pn.delete(e);const n=Dn.get(e);n&&(Dn.delete(e),An.delete(n))}(St),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,St,on,en]);const an=!U&&"maximized"===xn(),[sn,cn]=j(()=>{if(on&&ln[on]){const e={...ln[on]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),er(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:an?en():nn()}),[dn,hn]=j(()=>!ne),mn=O(de),pn=O(null);F(()=>{const e=()=>{const e=r();e!==mn.current&&pn.current?.(e),mn.current=e,he(e),Tt(pr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const fn=de&&!!je?.tab&&!dt&&!U&&!me,wn=fn,yn=O(wn);yn.current=wn;const gn=Kn(),Cn=de&&!!je?.tab&&!U&&!me&&!Dt&&gn!==je.key,Nn=!!U&&de&&!Dt&&null!==gn,[Ln,Tn]=j(()=>on&&ln[on]||S?wn:wn||an),In=O(sn);In.current=sn;const Rn=O(Ln);$(()=>{Rn.current=Ln},[Ln]),$(()=>{if(dn||fn)return;const e=tt.current,t=rt.current;if(!e||!t)return;const n=re??(U?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 u=e.offsetHeight-t.offsetHeight,d=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=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,In.current.y)-24),g=w?Math.min(In.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,cn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),U||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&hn(!0)},160)))},l=new ResizeObserver(s);s(),lt.current&&l.observe(lt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[dn,U,re,ct,fn]),$(()=>{if(!ne||!dn||U||!t)return;const e=lt.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||Ln)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=re??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,In.current.y)-24);cn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[ne,dn,U,t,Ln,re]);const Wn=!1!==oe&&!U&&!_&&!me,[$n,On]=j(()=>!Wn);$(()=>{if($n||!t)return;if(!Wn||Ln)return void On(!0);const n=tt.current,r=rt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=In.current.w,c=0;const u=()=>On(!0),d=()=>{c=0;const t=In.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();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),d,kt);b!==t&&(i=b.w,cn(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,vn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[$n,t,Wn,Ln]);const Fn=O(null),qn=!(!je?.tab||dt||U||me);pn.current=t=>{if(!qn)return;if(t)return Fn.current||(Fn.current={box:{...In.current},maximized:Rn.current}),void(Rn.current=!0);const r=Fn.current;Fn.current=null;const o=e();if(r?.maximized)return Rn.current=!0,Tn(!0),void cn(o);const i=r?.box??(on?ln[on]:void 0);if(Rn.current=!1,Tn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(er(e))}else cn(nn())},F(()=>{wn&&(Rn.current=!0,Tn(!0),cn(en()))},[wn,en]),F(()=>{if(U)return;const e=()=>{const e=on?ln[on]:void 0;if(Rn.current=!1,Tn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(er(t))}else cn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[U,nn,on]),F(()=>{t&&on&&!fn&&(ln[on]=sn,un()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,t,on,fn]),F(()=>{if(!t)return;const e=()=>{Rn.current?cn(en()):document.body.classList.contains("rosh-gesturing")||cn(er)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Ln&&(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,Ln,en]),F(()=>{if(t&&(Ie(!1),Ke.current=!1,et.current=!1,On(!Wn),!yn.current)){if(on&&ln[on]){const e=ln[on];return void cn(t=>er({...e,...ne?{h:t.h}:{},...Wn?{x:t.x,w:t.w}:{}}))}S&&(cn({x:S.x,y:S.y,w:S.w,h:S.h}),Tn(S.maximized))}},[t]),F(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!Ke.current&&(Ke.current=!0,e=setTimeout(()=>Ie(!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 Bn="auto"===m?Pe:!0===m,_n=je&&!dt?je.key:null,Gn=V(()=>Pt(Se),[Se]),tr=O({shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar});$(()=>{tr.current={shortcutSpec:Fe,isOnDesktop:Ve,toggleDesktopShortcut:Je,taskbarStrings:Te.taskbar}});const rr=O(null);rr.current||(rr.current={open:(e,t)=>Oe({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 Gt[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),F(()=>{if(t&&_n)return()=>{return e=_n,void(Kt.delete(e)&&$t());var e}},[t,_n]),qe(!(se||!t)&&Bn);const ar=B(async()=>{if(!et.current){if(Bn||"auto"===m&&Ke.current){et.current=!0;const e=Ae,t=await g({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(et.current=!1,!t)return}i()}},[Bn,m,i,Ae]);$(()=>{if(!t||!mt)return;const e=e=>{e.detail?.windowKey===mt&&ar()};return window.addEventListener(yr,e),()=>window.removeEventListener(yr,e)},[t,mt,ar]);const sr=O(null),lr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Oe(null),Hn(St),yn.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=tt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(sr.current){const t=sr.current;sr.current=null,d=t.w,u=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=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:In.current.x,c=s?s.top:In.current.y,u=s?s.height:In.current.h,d=s?s.width:In.current.w;Tn(!1),cn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<hr&&Math.abs(e.clientY-i)<hr)return;r=mr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),In.current={...In.current,x:s,y:u},!U){const t=function(e,t){const n=Jn(),r=e<=n.x+Xn,o=e>=n.x+n.w-Xn,i=t<=n.y+Xn,a=t>=n.y+n.h-Xn,s=e<=n.x+Vn,l=e>=n.x+n.w-Vn,c=t<=n.y+Vn,u=t>=n.y+n.h-Vn;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?or(nr(t)):ir())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),ir();const e=er({...In.current});if(In.current=e,!U&&h){sr.current={x:l,y:c,w:d,h:u};const e=nr(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 cn(e)}if(U){const t=e.x+e.w/2,n=window.innerWidth/2;Ze(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),cn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),ur=B((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=tt.current,l=s?.getBoundingClientRect(),c=l?l.left:In.current.x,u=l?l.top:In.current.y,d=l?l.width:In.current.w,h=l?l.height:In.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;Tn(!1),cn({x:c,y:u,w:d,h:h}),In.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,In.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)<hr&&Math.abs(e.clientY-a)<hr)return;o=mr(n,r,dr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(Qn,d+e)),w&&(i=Math.max(Zn,h+t)),m){const t=Math.max(Qn,d-e);n=c+d-t,o=t}if(p){const e=Math.max(Zn,h-t);r=u+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?.(),cn({...In.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),gr=B(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(),Hn(St),"Enter"===e.key)return void(Ln?(Tn(!1),cn(nn())):(Tn(!0),cn(en())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{sr.current||(sr.current={...In.current})};if(r<0)return e(),Tn(!0),void cn(en());if(r>0){if(Ln)return Tn(!1),void cn(nn());if(sr.current){const e=er(sr.current);return sr.current=null,In.current=e,void cn(e)}return void Un(St)}e(),Tn(!1);const t=nr(n<0?"left":"right");return In.current=t,void cn(t)}if(Ln)return;const o=In.current,i=e.shiftKey?{...o,w:Math.max(Qn,o.w+24*n),h:Math.max(Zn,o.h+24*r)}:er({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});In.current=i,cn(i)},[St,Ln,nn,en]),br=B(e=>{sr.current||(sr.current={...In.current}),Tn(!1);const t=nr(e);In.current=t,cn(t),Hn(St)},[St]),vr=wn||Ot?{}:{tabIndex:0,role:"group","aria-label":Ae?`${Ae} — ${ze.windowSuffix}`:ze.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},Cr=()=>{Tn(!0),cn(en())},Mr=B(()=>{const e=tt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Yt);t&&!t.disabled&&t.click()}},[]);F(()=>{if(!t)return;if(U)return;const e=e=>{if(En[En.length-1]===St&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Mr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&tt.current?.contains(t)))return;if(t.closest(Xt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Mr,St,U]),F(()=>{if(!t)return;const e=e=>{En[En.length-1]===St&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:St}})),Ke.current=!1,Ie(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:St}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),F(()=>{if(!t)return;if(U)return;const e=e=>{if("Escape"===e.key&&En[En.length-1]===St){if(P(e))return e.preventDefault(),void e.stopPropagation();if(fn&&!A)return;e.preventDefault(),e.stopPropagation(),ar()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,ar,St,U,fn,A]);const Sr=t&&(void 0!==p||void 0!==f),[Ar]=j(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),Dr=fn&&!je?.home&&Gn.actions.length>0;F(()=>{t&&_n&&function(e,t){const n=Kt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Kt.set(e,t),$t())}(_n,{title:Gn.text||Ae,dirty:Bn,copy:Gn.copy,actions:Dr&&Ar?Ar:void 0,menu:rr.current??void 0})},[t,_n,Ae,Bn,Gn.text,Gn.copy,Dr,Ar]);const Kr=B(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(F(()=>{if(!t)return;const e=e=>{if(En[En.length-1]!==St)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Sr&&(e.preventDefault(),p?p():Kr("bottom")),"k"===e.key&&Sr&&(e.preventDefault(),f?f():Kr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Sr,Kr,St]),!t||rn.current)return null;const Rr=Ot?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,u=Jn(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(St):null,Wr=Ot&&Rr?Math.min(Rr.w/sn.w,Rr.h/sn.h):1,$r=(()=>{if(Ot&&Rr){const e=Wr,t=sn.w*e,n=sn.h*e,r=Rr.x+(Rr.w-t)/2-sn.x,o=Rr.y+(Rr.h-n)/2-sn.y,i=Ft||Ht;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:D.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(Ut&&Wt){const e="picked"===_t;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:D.expose+30}:{}}}return null})(),Or=b({modal:!1,titleId:!U&&(fn?!je?.home:!me)?De:void 0,label:Gn.text||Ae}),Fr=/* @__PURE__ */Q("div",{children:[
|
|
50
|
+
/* @__PURE__ */Q("div",{ref:tt,"data-modal-panel":!0,"data-modal-id":St,"data-window-key":se||void 0,...K?{"data-utility":""}:{},...Re?{"data-pinned-top":""}:{},...U?{"data-widget":""}:{},...je?{"data-window-owner":je.key}:{},...je&&!dt?{"data-window-root":""}:{},...fn?{"data-window-tab":""}:{},...Or,className:fn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(U?zt?"shadow-xl":"shadow-lg":"border "+(zt?"shadow-xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(nt.current=!1,Ot){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),zr(St),Er(!1),void Hn(St)}if(!zt&&!U&&!Re&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===tt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),nt.current=!0,Oe(null),Hn(St),window.addEventListener("mouseup",()=>{setTimeout(()=>{nt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{nt.current&&(nt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Ot)return;Oe(null);e.target.closest("[data-modal-panel]")===tt.current&&(e.target.closest("button, input, a, select, textarea")||Hn(St))},style:me?{zIndex:Lt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${we}px)`,transition:ge?"none":"transform 180ms ease-out",...U?{display:"none"}:{},...Lt<0?{display:"none"}:{},...zt||Re||Me&&se===Me?{}:{display:"none"}}:{zIndex:Re?D.pinnedWindow:Lt+1,width:sn.w,height:sn.h,top:sn.y,...U&&"right"===Qe?{right:window.innerWidth-sn.x-sn.w}:{left:sn.x},...Lt<0&&!Re?{display:"none"}:{},...pe?{display:"none"}:{},...Cn||Nn?{visibility:"hidden",pointerEvents:"none"}:{},...$r??{}},children:[me&&!U&&/* @__PURE__ */Z("div",{onPointerDown:ke,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),U?null:fn?je?.home?null:/* @__PURE__ */Q(ee,{children:[
|
|
51
|
+
/* @__PURE__ */Z("h2",{id:De,"data-window-title":!0,className:"sr-only",children:Gn.text||Ae}),Dr&&Ar&&te(
|
|
52
|
+
/* @__PURE__ */Z(ee,{children:Gn.actions}),Ar),Gn.badges.length>0&&/* @__PURE__ */Z("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:Gn.badges})]}):me?null:
|
|
53
|
+
/* @__PURE__ */Q("div",Y?{onPointerDown:lr,"data-window-chrome":"",...vr,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 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
54
|
+
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
55
|
+
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>We(e=>!e),title:Re?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Re?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:Re?"currentColor":"none",strokeWidth:1.5})}),
|
|
56
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:ar,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:_?{onPointerDown:lr,"data-window-chrome":"",...vr,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 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
57
|
+
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
58
|
+
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>We(e=>!e),title:Re?ze.unpin:ze.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Re?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3 w-3",fill:Re?"currentColor":"none",strokeWidth:1.5})}),
|
|
59
|
+
/* @__PURE__ */Z("button",{onClick:()=>Un(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!wn&&/* @__PURE__ */Z(cr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):Cr()},onSnap:br,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:ze}),
|
|
60
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:ar,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:lr,"data-window-chrome":"",...vr,className:"flex items-center justify-between h-(--row-height-window-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 "+(zt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:zt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
61
|
+
/* @__PURE__ */Q("div",{"data-window-title":!0,title:Ae,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:zt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Ot&>(),
|
|
62
|
+
/* @__PURE__ */Z("span",{id:De,className:"truncate",children:Ot?Vt(Se):Se})]}),!Ot&&/* @__PURE__ */Q("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[K&&/* @__PURE__ */Z("button",{onClick:()=>We(e=>!e),title:Re?ze.unpin:ze.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Re?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Re?"currentColor":"none",strokeWidth:1.5})}),
|
|
63
|
+
/* @__PURE__ */Z("button",{onClick:()=>Un(St),title:ze.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!wn&&/* @__PURE__ */Z(cr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):Cr()},onSnap:br,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:ze}),
|
|
64
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:ar,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Z(z,{name:"close",className:"h-5 w-5"})})]})]}),ce&&Ye&&!U&&!me&&/* @__PURE__ */Z("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${zt?.9:.55})`}}),
|
|
65
|
+
/* @__PURE__ */Z(qt.Provider,{value:St,children:/* @__PURE__ */Z(tn.Provider,{value:{rightRef:ot,leftRef:it,notify:()=>st(!0),active:zt,isDirty:Bn,footerOpen:ct&&!U&&!Y&&!_&&!me},children:/* @__PURE__ */Z("div",{ref:rt,...U?{onPointerDown:lr,onContextMenu:e=>{e.preventDefault(),Ge({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${U?"p-0 cursor-move":_||G?"p-0":Y?"p-2":"p-4"} ${U||fn?"":"backdrop-blur-sm"} ${!1===y||_||G?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${U?"rounded-2xl select-none":""}`,style:{...U?{touchAction:"none"}:{},backgroundColor:U?"transparent":fn?"rgb(var(--window-content-rgb))":zt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */Z(Ee,{children:ue})})})}),U&&_e&&/* @__PURE__ */Q(x,{minWidth:160,style:{left:_e.x,top:_e.y},onClose:()=>Ge(null),children:[
|
|
66
|
+
/* @__PURE__ */Z(k,{onClick:()=>{Ge(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:St}))},children:"Settings"}),
|
|
67
|
+
/* @__PURE__ */Z(E,{}),ie&&/* @__PURE__ */Q(ee,{children:[ie,
|
|
68
|
+
/* @__PURE__ */Z(E,{})]}),
|
|
69
|
+
/* @__PURE__ */Q(k,{onClick:()=>{Ge(null),We(e=>!e)},children:[
|
|
70
|
+
/* @__PURE__ */Z("span",{className:"flex-1",children:"Always on Top"}),Re&&/* @__PURE__ */Z(z,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
71
|
+
/* @__PURE__ */Z(E,{}),
|
|
72
|
+
/* @__PURE__ */Z(k,{onClick:()=>{Ge(null),ar()},children:"Close"})]}),
|
|
73
|
+
/* @__PURE__ */Q("div",{onPointerDown:lr,ref:lt,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${fn?"":" cursor-move"}${zt&&!fn?" backdrop-blur-sm":""}${U||Y||_||me||!ct?" hidden":""}`,style:{touchAction:"none",backgroundColor:fn?"rgb(var(--window-footer-rgb))":zt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
74
|
+
/* @__PURE__ */Q("div",{className:"flex items-center gap-2 min-w-0",children:[pt&&/* @__PURE__ */Z(Ne,{auto:!0}),T,
|
|
75
|
+
/* @__PURE__ */Z("div",{ref:it,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),w]}),
|
|
76
|
+
/* @__PURE__ */Q("div",{className:"flex items-center gap-2 ml-auto",children:[
|
|
77
|
+
/* @__PURE__ */Z("div",{ref:ot,"data-modal-actions":!0,className:"flex items-center gap-2"}),L]})]}),!U&&!me&&!Ot&&zt&&!wn&&/* @__PURE__ */Q(ee,{children:[
|
|
78
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
82
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
83
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
|
+
/* @__PURE__ */Z("div",{onPointerDown:e=>ur(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Ot&&/* @__PURE__ */Z("div",{className:"absolute inset-0",style:{zIndex:D.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>jt(!0),onMouseLeave:()=>jt(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Hn(St),Er(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:Ft&&/* @__PURE__ */Z("button",{type:"button","data-expose-close":!0,"aria-label":Te.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/Wr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),ar()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Ot&&Rr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Rr.x,top:Rr.y+Rr.h+4,width:Rr.w,zIndex:D.expose+(Ft?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Vt(Se)})]}),jr=$e&&/* @__PURE__ */Q(x,{style:{left:$e.x,top:$e.y},onClose:()=>Oe(null),minWidth:160,children:[!U&&!Y&&!fn&&/* @__PURE__ */Q(ee,{children:[
|
|
86
|
+
/* @__PURE__ */Q(k,{onClick:()=>{Un(St),Oe(null)},children:[
|
|
87
|
+
/* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),ze.minimize]}),!wn&&/* @__PURE__ */Q(k,Ln?{onClick:()=>{Tn(!1),cn(nn()),Oe(null)},children:[
|
|
88
|
+
/* @__PURE__ */Z("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Z("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),ze.windowed]}:{onClick:()=>{Cr(),Oe(null)},children:[
|
|
89
|
+
/* @__PURE__ */Z(z,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),ze.maximize]})]}),K&&!fn&&/* @__PURE__ */Q(k,{onClick:()=>{We(e=>!e),Oe(null)},children:[
|
|
90
|
+
/* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-4 w-4 "+(Re?"text-blue-600":""),fill:Re?"currentColor":"none",strokeWidth:1.5}),Re?ze.unpin:ze.pinOnTop]}),Fe&&/* @__PURE__ */Q(k,{onClick:()=>{Oe(null),Je()},children:[
|
|
91
|
+
/* @__PURE__ */Z(z,{name:"star",className:"h-4 w-4",fill:Ve?"currentColor":"none",strokeWidth:1.5}),Ve?Te.taskbar.removeFromDesktop:Te.taskbar.addToDesktop]}),(Gt[St]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(Gt[St]||[]).map((e,t)=>/* @__PURE__ */Q(k,{onClick:()=>{Oe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(fn&&je?.home)&&/* @__PURE__ */Q(ee,{children:[
|
|
92
|
+
/* @__PURE__ */Z(E,{}),
|
|
93
|
+
/* @__PURE__ */Q(k,{danger:!0,onClick:()=>{Oe(null),ar()},children:[
|
|
94
|
+
/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),ze.close]})]})]}),qr=!!se&&Nt.some(e=>e.id===se),Br=!At||qr||U?null:/* @__PURE__ */Q("div",{"data-modal-restore-tab":!0,"data-modal-id":St,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:[
|
|
95
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:()=>Hn(St),title:ze.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:Ae||ze.windowSuffix}),
|
|
96
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:()=>Hn(St),title:ze.restore,"aria-label":ze.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
97
|
+
/* @__PURE__ */Z("button",{type:"button",onClick:()=>{ar()},title:ze.close,"aria-label":ze.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 te(
|
|
98
|
+
/* @__PURE__ */Q(Bt.Provider,{value:null,children:[Fr,jr,Br]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{br&&"Escape"===e.key&&(Kr(null),Er(!1))});var Fr=100,jr={past:[],future:[]};function qr(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Fr?r.slice(r.length-Fr):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:jr}}var Br=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Hr=500,Ur=250;function Yr({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=_(qr,jr),s=O(/* @__PURE__ */new Map),[l,c]=j(0),u=l>0,[d,h]=j(0),[m,p]=j(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===d&&(!(n&&n.length>0)||w(n)),g=O(null),b=O(!1),v=B(()=>{const e={};for(const[t,n]of s.current)e[t]=n.getLast();return e},[]),x=B((e,t)=>{s.current.has(e)||c(e=>e+1),s.current.set(e,t)},[]),k=B(e=>{s.current.delete(e)&&c(e=>e-1)},[]),E=B(e=>{h(t=>t+(e?1:-1))},[]),C=B(e=>{p(t=>t+(e?1:-1))},[]),[M,N]=j(0),S=M>0,L=B(e=>{N(t=>t+(e?1:-1))},[]),T=R(Ce),z=T?.claimReadOnly;F(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const A=T?.claimOwnMount;F(()=>{if(A&&S)return A(!0),()=>A(!1)},[A,S]);const D=O({last:0,count:0,tripped:!1}),P=O(!1),I=B((e,t,n)=>{if(b.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(P.current=!0));if(!y||g.current)return;const r=D.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Ur&&(r.count=0),r.last=o,++r.count>Hr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Hr} 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]),K=B(e=>{for(const[t,n]of Object.entries(e)){const e=s.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),W=B(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};K(e.values),a({type:"undo",redoStep:t})},[o.past,v,K]),$=B(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};K(e.values),a({type:"redo",undoStep:t})},[o.future,v,K]),[q,H]=j(0),U=O(0),Y=O(0),X=O(!1),J=B(()=>{b.current=!0,P.current=!1,g.current=null,U.current+=1,Y.current=U.current,H(U.current)},[]),G=O(void 0),ee=B(e=>{void 0!==e&&(void 0!==G.current&&e!==G.current&&(X.current=!0),G.current=e),J()},[J]);F(()=>{b.current&&q===Y.current&&(b.current=!1,g.current=null,(P.current||X.current)&&a({type:"clear"}),P.current=!1,X.current=!1)},[q]);const te=B(()=>{X.current=!0,a({type:"clear"}),J()},[J]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=gr(r),ie=O({undo:W,redo:$,canUndo:ne,canRedo:re});ie.current={undo:W,redo:$,canUndo:ne,canRedo:re},F(()=>{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&&Br.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=V(()=>({register:x,unregister:k,record:I,undo:W,redo:$,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:u,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,I,W,$,te,ee,ne,re,y,u,S,L,E,f,C,o.past,o.future]),se=""!==nn(),le=R(tn)?.footerOpen??!1,ce=se&&y&&u&&!S&≤/* @__PURE__ */
|
|
99
|
+
return Q(Ce.Provider,{value:ae,children:[ce&&/* @__PURE__ */Z(on,{position:"left",quiet:!0,children:/* @__PURE__ */Z(Ne,{auto:!0})}),e]})}function Xr(){const e=R(Ce),t=B(()=>{},[]);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 Vr(e){const t=R(Ce),n=t?.claimReadOnly,r=t?.claimEditable;F(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function Jr(e,t,n){const r=R(Ce),o=J(),i=O(e),a=O(t);a.current=t,F(()=>{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=O(r);c.current=r;const u=O({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},F(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function _r(e,t){const[n,r]=j(e);return Jr(n,e=>r(()=>e),t),[n,r]}export{an as CancelButton,Xe as DocFavStar,Ke as EntityWindowFallback,Pe as EntityWindowLoading,Re as EntityWindowState,Xt as KEY_ACTIVATED_SELECTOR,Ae as LoadingSpinner,Yt as MODAL_SUBMIT_SELECTOR,Or as Modal,on as ModalActions,Ne as UndoControls,Yr as UndoProvider,ce as WINDOW_REGISTRY,ke as WindowCrashedFallback,Ee as WindowErrorBoundary,pt as WindowManagerProvider,Zt as WindowTitle,Qe as activateWindowById,St as beginWindowGesture,Fn as cancelWindowFront,pe as client_default,Rr as commitExposeHighlight,Lt as drainPerfEvents,Mr as exitExposeMode,gn as forgetMaximizedWindowBoxes,fr as getActiveModalId,nt as getActiveWindowRoute,Ir as getExposeHighlight,jt as getWindowChromeVersion,wn as getWindowPosition,$e as isDraftEntityId,Oe as isDraftEntityWindow,ae as isEntityEntry,ie as isPageEntry,he as isShellApiClientConfigured,Ze as isTabWindow,Nt as markMenuOpen,Ot as readWindowChrome,On as requestWindowFront,Kr as setExposeHighlight,Mt as setPerfCollecting,de as setShellApiClient,be as setShellHomeRoute,le as setShellWindowRegistry,fn as setWindowDefaultPosition,yn as setWindowPosition,Pt as splitTitle,Pr as subscribeExposeHighlight,Ft as subscribeWindowChrome,Cr as toggleExposeMode,Kn as useCurrentTabKey,nn as useEnclosingModalId,gr as useIsActiveWindow,rn as useModalActive,we as usePageSearch,Xr as useUndo,Vr as useUndoCanEdit,Jr as useUndoable,_r as useUndoableState,_t as useWidgetSettings,qe as useWindowDirty,He as useWindowManager,Qt as useWindowMenuItem,en as useWindowTitle};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...L}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...L,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M3.75 3.75L4.75 3.75M8.75 3.75L9.75 3.75M14.25 3.75L15.25 3.75M19.25 3.75L20.25 3.75L20.25 4.75M20.25 8.75L20.25 9.75M20.25 14.25L20.25 15.25M20.25 19.25L20.25 20.25M3.75 20.25L4.75 20.25M8.75 20.25L9.75 20.25M14.25 20.25L15.25 20.25M19.25 20.25L20.25 20.25M3.75 3.75L3.75 4.75M3.75 8.75L3.75 9.75M3.75 14.25L3.75 15.25M3.75 19.25L3.75 20.25"}),
|
|
4
|
+
/* @__PURE__ */e("path",{strokeWidth:"3",d:"M1.5 15.75L22.5 15.75"})]})}export{t as CropBottomIcon};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsxs as r,jsx as L}from"react/jsx-runtime";function e({size:e=18,...t}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[
|
|
3
|
+
/* @__PURE__ */L("path",{d:"M3.75 3.75L4.75 3.75M8.75 3.75L9.75 3.75M14.25 3.75L15.25 3.75M19.25 3.75L20.25 3.75L20.25 4.75M20.25 8.75L20.25 9.75M20.25 14.25L20.25 15.25M20.25 19.25L20.25 20.25M3.75 20.25L4.75 20.25M8.75 20.25L9.75 20.25M14.25 20.25L15.25 20.25M19.25 20.25L20.25 20.25M3.75 3.75L3.75 4.75M3.75 8.75L3.75 9.75M3.75 14.25L3.75 15.25M3.75 19.25L3.75 20.25"}),
|
|
4
|
+
/* @__PURE__ */L("path",{strokeWidth:"3",d:"M8.25 1.5L8.25 22.5M15.75 1.5L15.75 22.5"})]})}export{e as CropLeftRightIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-UWNL4FO2.js";import{Button_default as t}from"./chunk-FSP63GKK.js";import{useShellStrings as n}from"./chunk-OVNRVFWS.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-VJPJNCB4.js";import{useShellStrings as t}from"./chunk-OVNRVFWS.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-4GEAEYKA.js";import{keepsNativeMenu as a}from"./chunk-GZCAFWWB.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as A}from"react/jsx-runtime";function L({size:L=18,...M}){/* @__PURE__ */
|
|
2
|
+
return A("svg",{width:L,height:L,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...M,children:/* @__PURE__ */A("path",{d:"M3.75 4.5L4.75 4.5A0.75 0.75 0 0 1 4.75 3L3.75 3A0.75 0.75 0 0 1 3.75 4.5ZM8.75 4.5L9.75 4.5A0.75 0.75 0 0 1 9.75 3L8.75 3A0.75 0.75 0 0 1 8.75 4.5ZM14.25 4.5L15.25 4.5A0.75 0.75 0 0 1 15.25 3L14.25 3A0.75 0.75 0 0 1 14.25 4.5ZM19.25 4.5L20.25 4.5A0.75 0.75 0 0 1 20.25 3L19.25 3A0.75 0.75 0 0 1 19.25 4.5ZM19.5 3.75L19.5 4.75A0.75 0.75 0 0 1 21 4.75L21 3.75A0.75 0.75 0 0 1 19.5 3.75ZM19.5 8.75L19.5 9.75A0.75 0.75 0 0 1 21 9.75L21 8.75A0.75 0.75 0 0 1 19.5 8.75ZM19.5 14.25L19.5 15.25A0.75 0.75 0 0 1 21 15.25L21 14.25A0.75 0.75 0 0 1 19.5 14.25ZM19.5 19.25L19.5 20.25A0.75 0.75 0 0 1 21 20.25L21 19.25A0.75 0.75 0 0 1 19.5 19.25ZM3.75 21L4.75 21A0.75 0.75 0 0 1 4.75 19.5L3.75 19.5A0.75 0.75 0 0 1 3.75 21ZM8.75 21L9.75 21A0.75 0.75 0 0 1 9.75 19.5L8.75 19.5A0.75 0.75 0 0 1 8.75 21ZM14.25 21L15.25 21A0.75 0.75 0 0 1 15.25 19.5L14.25 19.5A0.75 0.75 0 0 1 14.25 21ZM19.25 21L20.25 21A0.75 0.75 0 0 1 20.25 19.5L19.25 19.5A0.75 0.75 0 0 1 19.25 21ZM3 3.75L3 4.75A0.75 0.75 0 0 1 4.5 4.75L4.5 3.75A0.75 0.75 0 0 1 3 3.75ZM3 8.75L3 9.75A0.75 0.75 0 0 1 4.5 9.75L4.5 8.75A0.75 0.75 0 0 1 3 8.75ZM3 14.25L3 15.25A0.75 0.75 0 0 1 4.5 15.25L4.5 14.25A0.75 0.75 0 0 1 3 14.25ZM3 19.25L3 20.25A0.75 0.75 0 0 1 4.5 20.25L4.5 19.25A0.75 0.75 0 0 1 3 19.25ZM1.5 9.75L22.5 9.75A1.5 1.5 0 0 1 22.5 6.75L1.5 6.75A1.5 1.5 0 0 1 1.5 9.75ZM1.5 17.25L22.5 17.25A1.5 1.5 0 0 1 22.5 14.25L1.5 14.25A1.5 1.5 0 0 1 1.5 17.25Z"})})}export{L as CropYSolidIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Icon as r}from"./chunk-VJPJNCB4.js";import{useShellStrings as t}from"./chunk-OVNRVFWS.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var a=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,l=r=>e(r.trim());function c(e){const r=[];let t,c=0,o=0;for(a.lastIndex=0;null!==(t=a.exec(e));)t.index>c&&r.push(e.slice(c,t.index)),void 0!==t[1]?r.push(
|
|
2
2
|
/* @__PURE__ */s("span",{className:"text-gray-400",children:["[",t[1],"]"]},o++)):void 0!==t[3]?r.push(
|
|
3
3
|
/* @__PURE__ */n("a",{href:l(t[4])?t[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:t[3]},o++)):void 0!==t[5]?r.push(
|
|
4
4
|
/* @__PURE__ */n("strong",{className:"font-semibold text-gray-900",children:t[5]},o++)):void 0!==t[6]?r.push(
|