efficient-shell 8.18.0 → 8.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{Browser-H5OJL6TK.js → Browser-EE7TUWTN.js} +14 -14
  2. package/dist/{Calculator-VHXRKH2M.js → Calculator-YTIRFXXR.js} +21 -21
  3. package/dist/{CurrencyConverter-5AIXDNF6.js → CurrencyConverter-NDMWLX7M.js} +6 -6
  4. package/dist/{Documents-352IGNWY.js → Documents-XSDBD4T7.js} +1 -1
  5. package/dist/{Files-ODENHLKQ.js → Files-B5HKRQN3.js} +18 -18
  6. package/dist/{Notepad-DWPTCM2I.js → Notepad-2SXHFPFX.js} +10 -10
  7. package/dist/{PomodoroTimer-YWR6X3FT.js → PomodoroTimer-L72X22QZ.js} +37 -37
  8. package/dist/{Preview-LMUHIWNB.js → Preview-DJHBCRKW.js} +33 -33
  9. package/dist/{Sidebar-ZIHLBHKR.js → Sidebar-YCSGGCLW.js} +1 -1
  10. package/dist/{Spreadsheet-DAZUBPFY.js → Spreadsheet-VHFYYFLK.js} +11 -11
  11. package/dist/{Stock-C2EQYFNA.js → Stock-C3DDF3V3.js} +3 -3
  12. package/dist/{Weather-EZU5A7JW.js → Weather-2XG5AIW2.js} +15 -15
  13. package/dist/{WorldClock-SKUEYQXU.js → WorldClock-2MU5CFUN.js} +6 -6
  14. package/dist/ai/index.js +1 -1
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/{chunk-7F5FURAC.js → chunk-2MMEGCYI.js} +1 -1
  19. package/dist/chunk-EUFALBK3.js +1 -0
  20. package/dist/{chunk-EJNFOBE3.js → chunk-FJ72DO6A.js} +4 -4
  21. package/dist/{chunk-HAZLMRTT.js → chunk-KAELFRN4.js} +1 -1
  22. package/dist/{chunk-ZSRYQW64.js → chunk-MVYOBV4I.js} +3 -3
  23. package/dist/{chunk-6YPZHG7O.js → chunk-MWGVFDEV.js} +2 -2
  24. package/dist/{chunk-XINUGME7.js → chunk-R6WJ2NTT.js} +27 -27
  25. package/dist/{chunk-6OPAUSMV.js → chunk-ZQGPJZY4.js} +2 -2
  26. package/dist/{chunk-M7JJOCBU.js → chunk-ZXI4CWTI.js} +1 -1
  27. package/dist/data/ListLoadError.js +1 -1
  28. package/dist/format/index.js +1 -1
  29. package/dist/forms/BorderInput.js +1 -1
  30. package/dist/forms/BrandAssetEditor.js +1 -1
  31. package/dist/forms/ColorPicker.js +1 -1
  32. package/dist/forms/ComposerAttachments.js +1 -1
  33. package/dist/forms/CornersInput.js +1 -1
  34. package/dist/forms/DisplayChips.js +1 -1
  35. package/dist/forms/IconPicker.js +1 -1
  36. package/dist/forms/InputNumber.js +1 -1
  37. package/dist/forms/LinkPicker.js +1 -1
  38. package/dist/forms/MediaUsedInList.js +1 -1
  39. package/dist/forms/PositionInput.js +1 -1
  40. package/dist/forms/SidesInput.js +1 -1
  41. package/dist/forms/Slider.js +1 -1
  42. package/dist/forms/Snippet.js +1 -1
  43. package/dist/forms/SplitButton.js +1 -1
  44. package/dist/forms/TextToolbar.js +1 -1
  45. package/dist/forms/WidthsBar.js +1 -1
  46. package/dist/index.d.ts +10 -1
  47. package/dist/index.js +170 -170
  48. package/dist/map/index.js +1 -1
  49. package/dist/shell/AppUpdateBanner.js +1 -1
  50. package/dist/shell/ImageLightbox.js +1 -1
  51. package/dist/shell/LanguageSelect.js +1 -1
  52. package/dist/shell/SearchableSelect.js +1 -1
  53. package/dist/shell/SettingReset.js +1 -1
  54. package/dist/telemetry/index.js +1 -1
  55. package/dist/templates/ChatTemplate.js +1 -1
  56. package/dist/templates/CheckoutTemplate.js +1 -1
  57. package/dist/templates/DataTablePage.js +1 -1
  58. package/dist/templates/EmailTemplate.js +1 -1
  59. package/dist/templates/FormLayoutPage.js +1 -1
  60. package/dist/ui/index.js +1 -1
  61. package/dist/version.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/chunk-AJOWAZ46.js +0 -1
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-AJOWAZ46.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],A=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},P=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var O=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,W=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&U.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&O.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();A(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,P,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,P,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),A(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(W,"[url]").replace(V,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-EUFALBK3.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},F=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{F(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],U=e=>{document.prerendering?C(()=>U(e)):"complete"!==document.readyState?addEventListener("load",()=>U(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},K=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;F(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);U(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(K,"[redacted]").replace(J,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -0,0 +1 @@
1
+ var r="8.18.1",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,5 +1,5 @@
1
- import{OneLineLabel as e}from"./chunk-7T3COEQK.js";import{Icon as r}from"./chunk-42BBJJDP.js";import{swallowPress as i,describedByWith as a,OffWithReason as o}from"./chunk-4TL3MRRE.js";import{Tooltip as s}from"./chunk-2LXTJXWC.js";import{useShellStrings as l}from"./chunk-GTRUBA2R.js";import{useId as n,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":p,"aria-describedby":f}){const w=l().displayChips,g=n();/* @__PURE__ */
2
- return t("div",{role:"group","aria-label":p?void 0:m,"aria-labelledby":p,"aria-describedby":f,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((l,n)=>{const b=`${g}-${n}-state`,m=`${g}-${n}-reason`,u=Boolean(l.disabled)&&null!=l.disabledReason&&""!==l.disabledReason,p=/* @__PURE__ */c("button",{type:"button","aria-pressed":l.shown,disabled:!(!l.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":a(b,u?m:void 0),onClick:u?i:()=>h(l.id,!l.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(l.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
3
- /* @__PURE__ */t(r,{name:l.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
1
+ import{OneLineLabel as e}from"./chunk-7T3COEQK.js";import{swallowPress as r,describedByWith as i,OffWithReason as a}from"./chunk-4TL3MRRE.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{Tooltip as s}from"./chunk-2LXTJXWC.js";import{useShellStrings as l}from"./chunk-GTRUBA2R.js";import{useId as n,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":p,"aria-describedby":f}){const w=l().displayChips,g=n();/* @__PURE__ */
2
+ return t("div",{role:"group","aria-label":p?void 0:m,"aria-labelledby":p,"aria-describedby":f,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((l,n)=>{const b=`${g}-${n}-state`,m=`${g}-${n}-reason`,u=Boolean(l.disabled)&&null!=l.disabledReason&&""!==l.disabledReason,p=/* @__PURE__ */c("button",{type:"button","aria-pressed":l.shown,disabled:!(!l.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?r:()=>h(l.id,!l.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(l.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
3
+ /* @__PURE__ */t(o,{name:l.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
4
4
  /* @__PURE__ */t(e,{children:l.label})]}),f=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:l.shown?w.shown:w.hidden});/* @__PURE__ */
5
- return c(d,{children:[u?/* @__PURE__ */t(o,{reason:l.disabledReason,id:m,children:p}):/* @__PURE__ */t(s,{content:l.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:p}),f]},l.id)})})}export{b as DisplayChips};
5
+ return c(d,{children:[u?/* @__PURE__ */t(a,{reason:l.disabledReason,id:m,children:p}):/* @__PURE__ */t(s,{content:l.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:p}),f]},l.id)})})}export{b as DisplayChips};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-XINUGME7.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-R6WJ2NTT.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,4 +1,4 @@
1
- import{ColorPicker as e}from"./chunk-KIYO4U4T.js";import{InputNumber_default as t}from"./chunk-EO2XHSIK.js";import{Segmented as l}from"./chunk-CHNYSP6K.js";import{Icon as r}from"./chunk-42BBJJDP.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const S=e=>"number"==typeof d[e]?d[e]:null,j=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===S(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},k=(e,l,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(t,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":l})}),C=n.map(S),O="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,H=null===O&&C.some(e=>null!==e),I=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",K=e=>S(e)??("number"==typeof d.width?d.width:null),z=d.style??u.style;/* @__PURE__ */
2
- return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,K("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,K("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,K("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,K("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,O,H?"–":I,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(l,{block:!0,size:"sm",label:b.style,value:z,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
1
+ import{Segmented as e}from"./chunk-CHNYSP6K.js";import{ColorPicker as t}from"./chunk-KIYO4U4T.js";import{InputNumber_default as l}from"./chunk-EO2XHSIK.js";import{Icon as r}from"./chunk-42BBJJDP.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const S=e=>"number"==typeof d[e]?d[e]:null,j=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===S(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},k=(e,t,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(l,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":t})}),C=n.map(S),O="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,H=null===O&&C.some(e=>null!==e),I=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",K=e=>S(e)??("number"==typeof d.width?d.width:null),z=d.style??u.style;/* @__PURE__ */
2
+ return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,K("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,K("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,K("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,K("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,O,H?"–":I,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{block:!0,size:"sm",label:b.style,value:z,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
3
3
  /* @__PURE__ */s("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
4
- /* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(e,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
4
+ /* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
@@ -1,2 +1,2 @@
1
- import{toast_default as t}from"./chunk-HIDOSOI4.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,q=[],H=!1,J=null,L=/* @__PURE__ */new Set;function X(){for(const t of L)t()}function $(t){q=t,X()}function z(){const t=W;return t?J=t.list().then(e=>{W===t&&(q=e,H=!0,X())}).catch(()=>{W===t&&(H=!0,X())}).finally(()=>{J=null}):(q=[],H=!0,X(),Promise.resolve())}function Q(t){W=t,q=[],H=!1,t?z():X()}function U(t){return L.add(t),!W||H||J||z(),()=>{L.delete(t)}}function Y(){return q}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+E(),a=K(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);$(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:K()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=W;if(!n)return t.removeTask(e);const o=q;$(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!W)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,Q as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
1
+ import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-HIDOSOI4.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var W=null,q=[],H=!1,J=null,L=/* @__PURE__ */new Set;function X(){for(const t of L)t()}function $(t){q=t,X()}function z(){const t=W;return t?J=t.list().then(e=>{W===t&&(q=e,H=!0,X())}).catch(()=>{W===t&&(H=!0,X())}).finally(()=>{J=null}):(q=[],H=!0,X(),Promise.resolve())}function Q(t){W=t,q=[],H=!1,t?z():X()}function U(t){return L.add(t),!W||H||J||z(),()=>{L.delete(t)}}function Y(){return q}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(t=>{const n=W;if(!n)return e.addTask(t);const o="tmp-"+E(),a=K(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...t,name:t.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=W;if(!o)return e.updateTask(t,n);$(q.map(e=>e.id===t?{...e,...n,id:t,updatedAt:K()}:e)),o.update(t,n).catch(()=>{z()})},[e]),l=o(t=>{const n=W;if(!n)return e.removeTask(t);const o=q;$(q.filter(e=>e.id!==t)),n.remove(t).catch(()=>$(o))},[e]),s=o(t=>{if(!W)return e.toggleDone(t);const n=q.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{W||e.setAllTasks(t)},[e]);return null===W?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,Q as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -1,4 +1,4 @@
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-SS7BG7BS.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-Y53KNQKL.js";import{CopyButton as w}from"./chunk-O5PJELY7.js";import{confirm as y}from"./chunk-SGVIMTN6.js";import{dialogA11y as g}from"./chunk-VWGWZY7A.js";import{PopupMenu as b,PopupMenuItem as v,PopupMenuDivider as x,PopupMenuLabel as k}from"./chunk-UPHXYWL6.js";import{useIsMobile as E,useIsPhone as C}from"./chunk-UGTRSRIW.js";import{ColoredBadge as M}from"./chunk-LWGNNVDA.js";import{useShellPrefs as N}from"./chunk-KC3EX26K.js";import{focusableIn as S}from"./chunk-CDAJKLGL.js";import{StatusBadge as L}from"./chunk-5SULG7D5.js";import{Button_default as T}from"./chunk-UDD7GB4F.js";import{Icon as z}from"./chunk-42BBJJDP.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-GTRUBA2R.js";import{createContext as W,useContext as $,Component as R,useLayoutEffect as K,useRef as O,useEffect as j,useState as F,useSyncExternalStore as q,useCallback as B,isValidElement as H,Fragment as U,Children as Y,cloneElement as X,useMemo as V,useId as G,useReducer as _,Suspense as J}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=W(null);function we(){return $(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__ */
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-SS7BG7BS.js";import{CMD_Z as p,CMD_SHIFT_Z as f}from"./chunk-Y53KNQKL.js";import{CopyButton as w}from"./chunk-O5PJELY7.js";import{confirm as y}from"./chunk-SGVIMTN6.js";import{dialogA11y as g}from"./chunk-VWGWZY7A.js";import{useShellPrefs as b}from"./chunk-KC3EX26K.js";import{PopupMenu as v,PopupMenuItem as x,PopupMenuDivider as k,PopupMenuLabel as E}from"./chunk-UPHXYWL6.js";import{ColoredBadge as C}from"./chunk-LWGNNVDA.js";import{useIsMobile as M,useIsPhone as N}from"./chunk-UGTRSRIW.js";import{StatusBadge as S}from"./chunk-5SULG7D5.js";import{focusableIn as L}from"./chunk-CDAJKLGL.js";import{Button_default as T}from"./chunk-UDD7GB4F.js";import{Icon as z}from"./chunk-42BBJJDP.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-GTRUBA2R.js";import{createContext as W,useContext as $,Component as R,useLayoutEffect as K,useRef as O,useEffect as j,useState as F,useSyncExternalStore as q,useCallback as B,isValidElement as H,Fragment as U,Children as Y,cloneElement as X,useMemo as V,useId as G,useReducer as _,Suspense as J}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=W(null);function we(){return $(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
2
  return Q("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
3
  /* @__PURE__ */Z(z,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
4
4
  /* @__PURE__ */Q("div",{className:"min-w-0",children:[
@@ -23,30 +23,30 @@ return Z("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.enti
23
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(or(e))return null;const t=e.getBoundingClientRect(),n=Qn(),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
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
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]=F(null);j(()=>{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(br,gr),[,u]=F(0);j(()=>{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]=F(0);j(()=>{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]=F(null),[f,w]=F(null),[y,g]=F(null),E=O(null),C=()=>{E.current&&(clearTimeout(E.current),E.current=null),E.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(
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]=F(null);j(()=>{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(br,gr),[,u]=F(0);j(()=>{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]=F(0);j(()=>{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]=F(null),[f,w]=F(null),[y,g]=F(null),b=O(null),C=()=>{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
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&&!or(t)});/* @__PURE__ */
28
- return Q("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(E.current&&(clearTimeout(E.current),E.current=null),E.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:C,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),E.current&&(clearTimeout(E.current),E.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}),
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:C,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),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
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
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(b,{portal:!0,minWidth:200,style:dt(y.x,y.y),onClose:()=>g(null),children:[
32
- /* @__PURE__ */Z(k,{children:y.label}),
33
- /* @__PURE__ */Q(v,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=An.get(e);t&&Vn(t)}(e.id))},children:[
31
+ /* @__PURE__ */Z(z,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */Q(v,{portal:!0,minWidth:200,style:dt(y.x,y.y),onClose:()=>g(null),children:[
32
+ /* @__PURE__ */Z(E,{children:y.label}),
33
+ /* @__PURE__ */Q(x,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=An.get(e);t&&Vn(t)}(e.id))},children:[
34
34
  /* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
35
- /* @__PURE__ */Q(v,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
35
+ /* @__PURE__ */Q(x,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
36
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(x,{}),
38
- /* @__PURE__ */Q(v,{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:()=>{E.current&&(clearTimeout(E.current),E.current=null)},onMouseLeave:C})]}),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]=F([]),a=O(o);K(()=>{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};j(()=>{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)||Je(e)?(t=e,window.dispatchEvent(new CustomEvent(vr,{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)||Xn(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,$n.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__ */
37
+ /* @__PURE__ */Z(k,{}),
38
+ /* @__PURE__ */Q(x,{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:C})]}),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]=F([]),a=O(o);K(()=>{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};j(()=>{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)||Je(e)?(t=e,window.dispatchEvent(new CustomEvent(vr,{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)||Xn(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,$n.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
40
  return Q(je.Provider,{value:{openWindows:o,openEntity:m,openPage:p,closeEntity:y,minimize:f,items:[],openItems:o,restore:w,remove:g,restoreIfMinimized:()=>!1},children:[e,
41
41
  /* @__PURE__ */Z(ht,{openWindows:o,onRemove:d,onSplitView:jr,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&&Xn(e)}})},onActivateById:Qe}),
42
42
  /* @__PURE__ */Z(Fr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
43
43
  /* @__PURE__ */
44
- return Z(fe.Provider,{value:c(e),children:/* @__PURE__ */Z(Ee,{fallback:(t,n)=>/* @__PURE__ */Z(qr,{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(Gr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Z(Ye,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */Z(Ge,{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)};j(()=>{n&&!r&&h()},[n,r]),j(()=>{d&&n&&!r&&h()},[d]),j(()=>()=>clearTimeout(c.current),[]),j(()=>{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?S(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),K(()=>{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([L,M]),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===w)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 Wt=/* @__PURE__ */new Map,$t=/* @__PURE__ */new Set,Rt=0;function Kt(){Rt++,$t.forEach(e=>e())}function Ot(e){return Wt.get(e)}function jt(e){return $t.add(e),()=>{$t.delete(e)}}function Ft(){return Rt}var qt=W(""),Bt=W(null);function Ht({spec:e,children:t}){/* @__PURE__ */
44
+ return Z(fe.Provider,{value:c(e),children:/* @__PURE__ */Z(Ee,{fallback:(t,n)=>/* @__PURE__ */Z(qr,{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(Gr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Z(Ye,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */Z(Ge,{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)};j(()=>{n&&!r&&h()},[n,r]),j(()=>{d&&n&&!r&&h()},[d]),j(()=>()=>clearTimeout(c.current),[]),j(()=>{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]),K(()=>{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,C]),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===w)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 Wt=/* @__PURE__ */new Map,$t=/* @__PURE__ */new Set,Rt=0;function Kt(){Rt++,$t.forEach(e=>e())}function Ot(e){return Wt.get(e)}function jt(e){return $t.add(e),()=>{$t.delete(e)}}function Ft(){return Rt}var qt=W(""),Bt=W(null);function Ht({spec:e,children:t}){/* @__PURE__ */
45
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 Gt(e).replace(/\s+/g," ").trim()}function Gt(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(Gt).join("");if(H(e)){const t=e,n="string"==typeof t.type?t.type:"";return Ut.has(n)?"":` ${Gt(t.props?.children)} `}return""}function _t(e){const t=$(qt);j(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var Jt={};function Qt(e,t,n){const r=$(qt);j(()=>{if(!r)return;Jt[r]||(Jt[r]=[]);const o={label:e,icon:n,onClick:t};return Jt[r].push(o),()=>{Jt[r]=(Jt[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Zt({title:e}){const t=O(null);return j(()=>{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=W(null);function nn(){return $(qt)}function rn(){const e=q(br,gr),t=$(tn);return t?.active??(En.length<=1||null!=e)}function on({children:e,position:t="right",quiet:n=!1}){const r=$(tn),[o,i]=F(null);return j(()=>{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=$(tn);/* @__PURE__ */
46
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 Wn(){return q(br,In,()=>null)}var $n=/* @__PURE__ */new Set;var Rn=null;function Kn(e){Rn=null,Xn(e)}function On(e){Rn=e;const t=An.get(e);t&&Kn(t)}var jn=/* @__PURE__ */new Map;function Fn(e){return jn.get(e)?.holdsChanges()??!1}function qn(e){const t=jn.get(e);return t?t.ask():Promise.resolve(!0)}function Bn(e){Rn===e&&(Rn=null)}function Hn(e,t,n){if(n&&Pn.set(e,n),t)if(An.set(t,e),Dn.set(e,t),$n.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&&Rn===t&&Kn(e)}function Un(e){return e?Pn.get(e)?.owner??Dn.get(e)??null:null}var Yn=/* @__PURE__ */new Set;function Xn(e){const t=Un(gr()),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(),Rn&&Rn!==i&&(Rn=null)}zn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Un(gr());a&&a!==t&&Yn.forEach(e=>e(a))}function Vn(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 Gn=/* @__PURE__ */new Set;var _n=8,Jn=32;function Qn(){return e()}var Zn=u.windowBar,er=80,tr=384,nr=400;function rr(e,t=Qn()){const n=Math.min(Math.max(e.x,t.x+er-e.w),t.x+t.w-er),r=Math.min(Math.max(e.y,t.y),t.y+t.h-Zn);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function or(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Qn();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 ir(e){const t=Qn(),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 ar=null;function sr(e){const t=(ar||((ar=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(ar)),ar);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 lr(){ar&&(ar.style.opacity="0",ar.style.display="none")}var cr=[{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"}],ur=350,dr=200;function hr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=F(!1),s=O(void 0),l=O(void 0);j(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),ur)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),dr)};/* @__PURE__ */
47
47
  return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
48
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:cr.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 mr="rosh-gesture-style";var pr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},fr=4;function wr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(mr))return;const e=document.createElement("style");e.id=mr,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 yr(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 gr(){return En[En.length-1]||null}function br(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--)Gn.has(En[e])||En.splice(e,1);hn=hn.filter(e=>{const t=An.get(e);return null!=t&&Gn.has(t)}),pn(),zn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var vr="modal-close-request";function xr(e){q(br,Tn);const t=$(tn);if(En.length<=1)return!0;if(e){const t=An.get(e);if(null!=t)return gr()===t}return t?.active??null!=gr()}var kr=!1,Er=/* @__PURE__ */new Set;function Cr(e){return Er.add(e),()=>Er.delete(e)}function Mr(){return kr}function Nr(e){kr!==e&&(kr=e,Er.forEach(e=>e()))}function Sr(){Nr(!kr)}function Lr(){Nr(!1)}var Tr=null,zr=/* @__PURE__ */new Set;function Ar(e){return zr.add(e),()=>zr.delete(e)}function Dr(){return Tr}function Pr(e){Tr!==e&&(Tr=e,zr.forEach(e=>e()))}var Ir=null,Wr=/* @__PURE__ */new Set;function $r(e){return Wr.add(e),()=>Wr.delete(e)}function Rr(){return Ir}function Kr(e){Ir!==e&&(Ir=e,Wr.forEach(e=>e()))}function Or(){if(!Ir)return void Nr(!1);Pr(Ir),Kr(null),Nr(!1)}function jr(){Nr(!kr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Fr(){const e=q(Cr,Mr),[t,n]=F(e),[r,o]=F(e);return j(()=>{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(),Nr(!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 qr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:k,onMinimize:M,initialBox:S,actions:L,actionsLeft:T,editing:A=!1,allowPinOnTop:W,initialPosition:R,widget:U,compact:Y,appStyle:_,flushBody:J,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:ue}){const[de,he]=F(()=>r()),me=E()&&!de,pe=C()&&!!U,[we,ye]=F(0),[ge,be]=F(!1),ve=O(null),xe=O(0);j(()=>{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);j(()=>{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]=F(c),Te=I(),ze=Te.window;j(()=>{Le(c)},[c]);const Ae=V(()=>Vt(Se).trim()||void 0,[Se]),De=G(),[Pe,Ie]=F(!1),We=O(!1),[$e,Re]=F(!1),[Ke,Oe]=F(null),je=$(Bt),Fe=$(fe),{prefs:Be,save:Ue}=N(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Ve=!!je&&Xe.some(e=>e.entityType===je.entityType&&e.entityId===je.entityId),Ge=B(()=>{if(!je)return;const e=Ve?Xe.filter(e=>!(e.entityType===je.entityType&&e.entityId===je.entityId)):[...Xe,{entityType:je.entityType,entityId:je.entityId,label:je.label}];Ue({favorite_documents:e})},[je,Ve,Xe,Ue]),[_e,Je]=F(null),[Qe,Ze]=F("top-right"===R?"right":"left"),et=O(!1),tt=O(null);K(()=>{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]=F(!1),lt=O(null),ct=!!(w||L||T)||at,ut=$(Ce),dt=""!==$(qt),ht=O(null);ht.current=Fe?{owner:Fe.key,tab:Fe.tab,root:!dt}:null;const mt=se||(Fe&&!dt?Fe.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;j(()=>{if(U)return Gn.add(St),()=>{Gn.delete(St)}},[U,St]),j(()=>{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]=F(D.window),zt=function(e){const t=q(br,gr);return En.length<=1||t===e}(St),At=function(e){return q(br,()=>Mn.has(e))}(St);wt({panelRef:tt,bodyRef:rt,open:t,widget:!!U,active:zt,minimized:At});const Dt=q(Cr,Mr),It=q(Ar,Dr),$t=q($r,Rr),Rt=!W&&!U,Ot=Dt&&Rt,[jt,Ft]=F(!1),Ht=Ot&&$t===St,[Ut,Gt]=F(!1),_t=Ut&&Rt&&It===St?"picked":null,Qt=O(Ot);j(()=>{if(Qt.current&&!Ot){Gt(!0);const e=setTimeout(()=>{Gt(!1),Tr===St&&Pr(null)},700);return Qt.current=Ot,()=>clearTimeout(e)}Qt.current=Ot},[Ot,St]),j(()=>{Ot||Ft(!1)},[Ot]),j(()=>{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]),j(()=>{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"===R?{x:t.x+t.w-a-kt,y:t.y+kt,w:a,h:l}:"top-left"===R?{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;j(()=>{if(!t)return;Hn(St,on,ht.current??void 0),se||Xn(St),Zt.current=!1,Tt(yr(St));const e=()=>{Tt(yr(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(Xn(St),yn.current)return;const t=Qn(),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)&&(Xn(St),Oe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Xn(St);const t=In.current,n=function(e,t=Qn()){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]=F(()=>{if(on&&ln[on]){const e={...ln[on]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),rr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:an?en():nn()}),[dn,hn]=F(()=>!ne),mn=O(de),pn=O(null);j(()=>{const e=()=>{const e=r();e!==mn.current&&pn.current?.(e),mn.current=e,he(e),Tt(yr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const fn=de&&!!Fe?.tab&&!dt&&!U&&!me,wn=fn,yn=O(wn);yn.current=wn;const gn=Wn(),Cn=de&&!!Fe?.tab&&!U&&!me&&!Dt&&gn!==Fe.key,Nn=!!U&&de&&!Dt&&null!==gn,[Ln,Tn]=F(()=>on&&ln[on]||S?wn:wn||an),In=O(sn);In.current=sn;const $n=O(Ln);K(()=>{$n.current=Ln},[Ln]),K(()=>{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]),K(()=>{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 Rn=!1!==oe&&!U&&!_&&!me,[Kn,On]=F(()=>!Rn);K(()=>{if(Kn||!t)return;if(!Rn||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)}},[Kn,t,Rn,Ln]);const Fn=O(null),qn=!(!Fe?.tab||dt||U||me);pn.current=t=>{if(!qn)return;if(t)return Fn.current||(Fn.current={box:{...In.current},maximized:$n.current}),void($n.current=!0);const r=Fn.current;Fn.current=null;const o=e();if(r?.maximized)return $n.current=!0,Tn(!0),void cn(o);const i=r?.box??(on?ln[on]:void 0);if($n.current=!1,Tn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(rr(e))}else cn(nn())},j(()=>{wn&&($n.current=!0,Tn(!0),cn(en()))},[wn,en]),j(()=>{if(U)return;const e=()=>{const e=on?ln[on]:void 0;if($n.current=!1,Tn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(rr(t))}else cn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[U,nn,on]),j(()=>{t&&on&&!fn&&(ln[on]=sn,un()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,t,on,fn]),j(()=>{if(!t)return;const e=()=>{$n.current?cn(en()):document.body.classList.contains("rosh-gesturing")||cn(rr)};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]),j(()=>{if(t&&(Ie(!1),We.current=!1,et.current=!1,On(!Rn),!yn.current)){if(on&&ln[on]){const e=ln[on];return void cn(t=>rr({...e,...ne?{h:t.h}:{},...Rn?{x:t.x,w:t.w}:{}}))}S&&(cn({x:S.x,y:S.y,w:S.w,h:S.h}),Tn(S.maximized))}},[t]),j(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!We.current&&(We.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,Un=Fe&&!dt?Fe.key:null,Yn=V(()=>Pt(Se),[Se]),Zn=O({shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:Ge,taskbarStrings:Te.taskbar});K(()=>{Zn.current={shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:Ge,taskbarStrings:Te.taskbar}});const er=O(null);er.current||(er.current={open:(e,t)=>Oe({x:e,y:t}),items:()=>{const e=Zn.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Jt[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),j(()=>{if(t&&Un)return()=>{return e=Un,void(Wt.delete(e)&&Kt());var e}},[t,Un]),qe(!(se||!t)&&Bn);const or=B(()=>Bn||"auto"===m&&We.current,[Bn,m]),ar=B(async e=>{if(et.current)return!1;if(!or())return!0;et.current=!0;const t=Ae,n="close"===e?"Are you sure you want to close?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return et.current=!1,r},[or,Ae]),cr=B(()=>et.current?Promise.resolve():or()?ar("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[or,ar,i]),ur=B(async()=>{const e=await ar("switch");return e&&(We.current=!1,Ie(!1)),e},[ar]),dr=O(()=>!1);K(()=>{dr.current=or}),K(()=>{if(!t||!se)return;const e={holdsChanges:()=>dr.current(),ask:ur};return jn.set(se,e),()=>{jn.get(se)===e&&jn.delete(se)}},[t,se,ur]),K(()=>{if(!t||!mt)return;const e=e=>{e.detail?.windowKey===mt&&cr()};return window.addEventListener(vr,e),()=>window.removeEventListener(vr,e)},[t,mt,cr]);const mr=O(null),xr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Oe(null),Xn(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(mr.current){const t=mr.current;mr.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)<fr&&Math.abs(e.clientY-i)<fr)return;r=wr(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=Qn(),r=e<=n.x+_n,o=e>=n.x+n.w-_n,i=t<=n.y+_n,a=t>=n.y+n.h-_n,s=e<=n.x+Jn,l=e>=n.x+n.w-Jn,c=t<=n.y+Jn,u=t>=n.y+n.h-Jn;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?sr(ir(t)):lr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),lr();const e=rr({...In.current});if(In.current=e,!U&&h){mr.current={x:l,y:c,w:d,h:u};const e=ir(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)},[]),kr=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)<fr&&Math.abs(e.clientY-a)<fr)return;o=wr(n,r,pr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(tr,d+e)),w&&(i=Math.max(nr,h+t)),m){const t=Math.max(tr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(nr,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)},[]),Er=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(),Xn(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=()=>{mr.current||(mr.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(mr.current){const e=rr(mr.current);return mr.current=null,In.current=e,void cn(e)}return void Vn(St)}e(),Tn(!1);const t=ir(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(tr,o.w+24*n),h:Math.max(nr,o.h+24*r)}:rr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});In.current=i,cn(i)},[St,Ln,nn,en]),Sr=B(e=>{mr.current||(mr.current={...In.current}),Tn(!1);const t=ir(e);In.current=t,cn(t),Xn(St)},[St]),Lr=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:Er},zr=()=>{Tn(!0),cn(en())},Ir=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()}},[]);j(()=>{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(),Ir();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,Ir,St,U]),j(()=>{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}})),We.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]),j(()=>{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(),cr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,cr,St,U,fn,A]);const Wr=t&&(void 0!==p||void 0!==f),[Kr]=F(()=>{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}),Or=fn&&!Fe?.home&&Yn.actions.length>0;j(()=>{t&&Un&&function(e,t){const n=Wt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Wt.set(e,t),Kt())}(Un,{title:Yn.text||Ae,dirty:Bn,copy:Yn.copy,actions:Or&&Kr?Kr:void 0,menu:er.current??void 0})},[t,Un,Ae,Bn,Yn.text,Yn.copy,Or,Kr]);const jr=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(j(()=>{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&&Wr&&(e.preventDefault(),p?p():jr("bottom")),"k"===e.key&&Wr&&(e.preventDefault(),f?f():jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Wr,jr,St]),!t||rn.current)return null;const Fr=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=Qn(),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,qr=Ot&&Fr?Math.min(Fr.w/sn.w,Fr.h/sn.h):1,Br=(()=>{if(Ot&&Fr){const e=qr,t=sn.w*e,n=sn.h*e,r=Fr.x+(Fr.w-t)/2-sn.x,o=Fr.y+(Fr.h-n)/2-sn.y,i=jt||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&&Rt){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})(),Hr=g({modal:!1,titleId:!U&&(fn?!Fe?.home:!me)?De:void 0,label:Yn.text||Ae}),Ur=/* @__PURE__ */Q("div",{children:[
49
+ /* @__PURE__ */Z("div",{onMouseDown:e=>{e.stopPropagation(),Nr(!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 qr({open:t,onClose:i,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:w,bodyScroll:E,onMinimize:C,initialBox:S,actions:L,actionsLeft:T,editing:A=!1,allowPinOnTop:W,initialPosition:R,widget:U,compact:Y,appStyle:_,flushBody:J,autoHeight:ne,autoMinHeight:re,autoWidth:oe,widgetMenu:ie,dimensions:ae,windowKey:se,openedFromKey:le,accentRgb:ce,children:ue}){const[de,he]=F(()=>r()),me=M()&&!de,pe=N()&&!!U,[we,ye]=F(0),[ge,be]=F(!1),ve=O(null),xe=O(0);j(()=>{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);j(()=>{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]=F(c),Te=I(),ze=Te.window;j(()=>{Le(c)},[c]);const Ae=V(()=>Vt(Se).trim()||void 0,[Se]),De=G(),[Pe,Ie]=F(!1),We=O(!1),[$e,Re]=F(!1),[Ke,Oe]=F(null),je=$(Bt),Fe=$(fe),{prefs:Be,save:Ue}=b(),Ye=!!Be.window_accent_stripe,Xe=Be.favorite_documents||[],Ve=!!je&&Xe.some(e=>e.entityType===je.entityType&&e.entityId===je.entityId),Ge=B(()=>{if(!je)return;const e=Ve?Xe.filter(e=>!(e.entityType===je.entityType&&e.entityId===je.entityId)):[...Xe,{entityType:je.entityType,entityId:je.entityId,label:je.label}];Ue({favorite_documents:e})},[je,Ve,Xe,Ue]),[_e,Je]=F(null),[Qe,Ze]=F("top-right"===R?"right":"left"),et=O(!1),tt=O(null);K(()=>{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]=F(!1),lt=O(null),ct=!!(w||L||T)||at,ut=$(Ce),dt=""!==$(qt),ht=O(null);ht.current=Fe?{owner:Fe.key,tab:Fe.tab,root:!dt}:null;const mt=se||(Fe&&!dt?Fe.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;j(()=>{if(U)return Gn.add(St),()=>{Gn.delete(St)}},[U,St]),j(()=>{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]=F(D.window),zt=function(e){const t=q(br,gr);return En.length<=1||t===e}(St),At=function(e){return q(br,()=>Mn.has(e))}(St);wt({panelRef:tt,bodyRef:rt,open:t,widget:!!U,active:zt,minimized:At});const Dt=q(Cr,Mr),It=q(Ar,Dr),$t=q($r,Rr),Rt=!W&&!U,Ot=Dt&&Rt,[jt,Ft]=F(!1),Ht=Ot&&$t===St,[Ut,Gt]=F(!1),_t=Ut&&Rt&&It===St?"picked":null,Qt=O(Ot);j(()=>{if(Qt.current&&!Ot){Gt(!0);const e=setTimeout(()=>{Gt(!1),Tr===St&&Pr(null)},700);return Qt.current=Ot,()=>clearTimeout(e)}Qt.current=Ot},[Ot,St]),j(()=>{Ot||Ft(!1)},[Ot]),j(()=>{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]),j(()=>{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"===R?{x:t.x+t.w-a-kt,y:t.y+kt,w:a,h:l}:"top-left"===R?{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;j(()=>{if(!t)return;Hn(St,on,ht.current??void 0),se||Xn(St),Zt.current=!1,Tt(yr(St));const e=()=>{Tt(yr(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(Xn(St),yn.current)return;const t=Qn(),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)&&(Xn(St),Oe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==se)return;Xn(St);const t=In.current,n=function(e,t=Qn()){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]=F(()=>{if(on&&ln[on]){const e={...ln[on]};return ae&&(e.w=ae[0],ne||(e.h=ae[1])),rr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:an?en():nn()}),[dn,hn]=F(()=>!ne),mn=O(de),pn=O(null);j(()=>{const e=()=>{const e=r();e!==mn.current&&pn.current?.(e),mn.current=e,he(e),Tt(yr(St))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[St]);const fn=de&&!!Fe?.tab&&!dt&&!U&&!me,wn=fn,yn=O(wn);yn.current=wn;const gn=Wn(),Cn=de&&!!Fe?.tab&&!U&&!me&&!Dt&&gn!==Fe.key,Nn=!!U&&de&&!Dt&&null!==gn,[Ln,Tn]=F(()=>on&&ln[on]||S?wn:wn||an),In=O(sn);In.current=sn;const $n=O(Ln);K(()=>{$n.current=Ln},[Ln]),K(()=>{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]),K(()=>{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 Rn=!1!==oe&&!U&&!_&&!me,[Kn,On]=F(()=>!Rn);K(()=>{if(Kn||!t)return;if(!Rn||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)}},[Kn,t,Rn,Ln]);const Fn=O(null),qn=!(!Fe?.tab||dt||U||me);pn.current=t=>{if(!qn)return;if(t)return Fn.current||(Fn.current={box:{...In.current},maximized:$n.current}),void($n.current=!0);const r=Fn.current;Fn.current=null;const o=e();if(r?.maximized)return $n.current=!0,Tn(!0),void cn(o);const i=r?.box??(on?ln[on]:void 0);if($n.current=!1,Tn(!1),i&&!n(i,o,!1)){const e={...i};ae&&(e.w=ae[0],ne||(e.h=ae[1])),cn(rr(e))}else cn(nn())},j(()=>{wn&&($n.current=!0,Tn(!0),cn(en()))},[wn,en]),j(()=>{if(U)return;const e=()=>{const e=on?ln[on]:void 0;if($n.current=!1,Tn(!1),e){const t={...e};ae&&(t.w=ae[0],ne||(t.h=ae[1])),cn(rr(t))}else cn(nn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[U,nn,on]),j(()=>{t&&on&&!fn&&(ln[on]=sn,un()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[sn,t,on,fn]),j(()=>{if(!t)return;const e=()=>{$n.current?cn(en()):document.body.classList.contains("rosh-gesturing")||cn(rr)};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]),j(()=>{if(t&&(Ie(!1),We.current=!1,et.current=!1,On(!Rn),!yn.current)){if(on&&ln[on]){const e=ln[on];return void cn(t=>rr({...e,...ne?{h:t.h}:{},...Rn?{x:t.x,w:t.w}:{}}))}S&&(cn({x:S.x,y:S.y,w:S.w,h:S.h}),Tn(S.maximized))}},[t]),j(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{tt.current?.contains(t.target)&&!We.current&&(We.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,Un=Fe&&!dt?Fe.key:null,Yn=V(()=>Pt(Se),[Se]),Zn=O({shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:Ge,taskbarStrings:Te.taskbar});K(()=>{Zn.current={shortcutSpec:je,isOnDesktop:Ve,toggleDesktopShortcut:Ge,taskbarStrings:Te.taskbar}});const er=O(null);er.current||(er.current={open:(e,t)=>Oe({x:e,y:t}),items:()=>{const e=Zn.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Jt[St]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),j(()=>{if(t&&Un)return()=>{return e=Un,void(Wt.delete(e)&&Kt());var e}},[t,Un]),qe(!(se||!t)&&Bn);const or=B(()=>Bn||"auto"===m&&We.current,[Bn,m]),ar=B(async e=>{if(et.current)return!1;if(!or())return!0;et.current=!0;const t=Ae,n="close"===e?"Are you sure you want to close?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return et.current=!1,r},[or,Ae]),cr=B(()=>et.current?Promise.resolve():or()?ar("close").then(e=>{e&&i()}):(i(),Promise.resolve()),[or,ar,i]),ur=B(async()=>{const e=await ar("switch");return e&&(We.current=!1,Ie(!1)),e},[ar]),dr=O(()=>!1);K(()=>{dr.current=or}),K(()=>{if(!t||!se)return;const e={holdsChanges:()=>dr.current(),ask:ur};return jn.set(se,e),()=>{jn.get(se)===e&&jn.delete(se)}},[t,se,ur]),K(()=>{if(!t||!mt)return;const e=e=>{e.detail?.windowKey===mt&&cr()};return window.addEventListener(vr,e),()=>window.removeEventListener(vr,e)},[t,mt,cr]);const mr=O(null),xr=B(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Oe(null),Xn(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(mr.current){const t=mr.current;mr.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)<fr&&Math.abs(e.clientY-i)<fr)return;r=wr(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=Qn(),r=e<=n.x+_n,o=e>=n.x+n.w-_n,i=t<=n.y+_n,a=t>=n.y+n.h-_n,s=e<=n.x+Jn,l=e>=n.x+n.w-Jn,c=t<=n.y+Jn,u=t>=n.y+n.h-Jn;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?sr(ir(t)):lr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),lr();const e=rr({...In.current});if(In.current=e,!U&&h){mr.current={x:l,y:c,w:d,h:u};const e=ir(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)},[]),kr=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)<fr&&Math.abs(e.clientY-a)<fr)return;o=wr(n,r,pr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(tr,d+e)),w&&(i=Math.max(nr,h+t)),m){const t=Math.max(tr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(nr,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)},[]),Er=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(),Xn(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=()=>{mr.current||(mr.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(mr.current){const e=rr(mr.current);return mr.current=null,In.current=e,void cn(e)}return void Vn(St)}e(),Tn(!1);const t=ir(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(tr,o.w+24*n),h:Math.max(nr,o.h+24*r)}:rr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});In.current=i,cn(i)},[St,Ln,nn,en]),Sr=B(e=>{mr.current||(mr.current={...In.current}),Tn(!1);const t=ir(e);In.current=t,cn(t),Xn(St)},[St]),Lr=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:Er},zr=()=>{Tn(!0),cn(en())},Ir=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()}},[]);j(()=>{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(),Ir();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,Ir,St,U]),j(()=>{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}})),We.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]),j(()=>{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(),cr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,cr,St,U,fn,A]);const Wr=t&&(void 0!==p||void 0!==f),[Kr]=F(()=>{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}),Or=fn&&!Fe?.home&&Yn.actions.length>0;j(()=>{t&&Un&&function(e,t){const n=Wt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Wt.set(e,t),Kt())}(Un,{title:Yn.text||Ae,dirty:Bn,copy:Yn.copy,actions:Or&&Kr?Kr:void 0,menu:er.current??void 0})},[t,Un,Ae,Bn,Yn.text,Yn.copy,Or,Kr]);const jr=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(j(()=>{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&&Wr&&(e.preventDefault(),p?p():jr("bottom")),"k"===e.key&&Wr&&(e.preventDefault(),f?f():jr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Wr,jr,St]),!t||rn.current)return null;const Fr=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=Qn(),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,qr=Ot&&Fr?Math.min(Fr.w/sn.w,Fr.h/sn.h):1,Br=(()=>{if(Ot&&Fr){const e=qr,t=sn.w*e,n=sn.h*e,r=Fr.x+(Fr.w-t)/2-sn.x,o=Fr.y+(Fr.h-n)/2-sn.y,i=jt||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&&Rt){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})(),Hr=g({modal:!1,titleId:!U&&(fn?!Fe?.home:!me)?De:void 0,label:Yn.text||Ae}),Ur=/* @__PURE__ */Q("div",{children:[
50
50
  /* @__PURE__ */Q("div",{ref:tt,"data-modal-panel":!0,"data-modal-id":St,"data-window-key":se||void 0,...W?{"data-utility":""}:{},...$e?{"data-pinned-top":""}:{},...U?{"data-widget":""}:{},...Fe?{"data-window-owner":Fe.key}:{},...Fe&&!dt?{"data-window-root":""}:{},...fn?{"data-window-tab":""}:{},...Hr,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(),Pr(St),Nr(!1),void Xn(St)}if(!zt&&!U&&!$e&&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),Xn(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")||Xn(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||$e||Me&&se===Me?{}:{display:"none"}}:{zIndex:$e?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&&!$e?{display:"none"}:{},...pe?{display:"none"}:{},...Cn||Nn?{visibility:"hidden",pointerEvents:"none"}:{},...Br??{}},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?Fe?.home?null:/* @__PURE__ */Q(ee,{children:[
51
51
  /* @__PURE__ */Z("h2",{id:De,"data-window-title":!0,className:"sr-only",children:Yn.text||Ae}),Or&&Kr&&te(
52
52
  /* @__PURE__ */Z(ee,{children:Yn.actions}),Kr),Yn.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:Yn.badges})]}):me?null:
@@ -62,14 +62,14 @@ return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,
62
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:[W&&/* @__PURE__ */Z("button",{onClick:()=>Re(e=>!e),title:$e?ze.unpin:ze.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+($e?"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:$e?"currentColor":"none",strokeWidth:1.5})}),
63
63
  /* @__PURE__ */Z("button",{onClick:()=>Vn(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(hr,{maximized:Ln,onToggleMax:()=>{Ln?(Tn(!1),cn(nn())):zr()},onSnap:Sr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:ze}),
64
64
  /* @__PURE__ */Z("button",{type:"button",onClick:cr,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:xr,onContextMenu:e=>{e.preventDefault(),Je({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${U?"p-0 cursor-move":_||J?"p-0":Y?"p-2":"p-4"} ${U||fn?"":"backdrop-blur-sm"} ${!1===k||_||J?"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(b,{minWidth:160,style:{left:_e.x,top:_e.y},onClose:()=>Je(null),children:[
66
- /* @__PURE__ */Z(v,{onClick:()=>{Je(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:St}))},children:"Settings"}),
67
- /* @__PURE__ */Z(x,{}),ie&&/* @__PURE__ */Q(ee,{children:[ie,
68
- /* @__PURE__ */Z(x,{})]}),
69
- /* @__PURE__ */Q(v,{onClick:()=>{Je(null),Re(e=>!e)},children:[
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:xr,onContextMenu:e=>{e.preventDefault(),Je({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${U?"p-0 cursor-move":_||J?"p-0":Y?"p-2":"p-4"} ${U||fn?"":"backdrop-blur-sm"} ${!1===E||_||J?"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(v,{minWidth:160,style:{left:_e.x,top:_e.y},onClose:()=>Je(null),children:[
66
+ /* @__PURE__ */Z(x,{onClick:()=>{Je(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:St}))},children:"Settings"}),
67
+ /* @__PURE__ */Z(k,{}),ie&&/* @__PURE__ */Q(ee,{children:[ie,
68
+ /* @__PURE__ */Z(k,{})]}),
69
+ /* @__PURE__ */Q(x,{onClick:()=>{Je(null),Re(e=>!e)},children:[
70
70
  /* @__PURE__ */Z("span",{className:"flex-1",children:"Always on Top"}),$e&&/* @__PURE__ */Z(z,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
71
- /* @__PURE__ */Z(x,{}),
72
- /* @__PURE__ */Z(v,{onClick:()=>{Je(null),cr()},children:"Close"})]}),
71
+ /* @__PURE__ */Z(k,{}),
72
+ /* @__PURE__ */Z(x,{onClick:()=>{Je(null),cr()},children:"Close"})]}),
73
73
  /* @__PURE__ */Q("div",{onPointerDown:xr,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
74
  /* @__PURE__ */Q("div",{className:"flex items-center gap-2 min-w-0",children:[pt&&/* @__PURE__ */Z(Ne,{auto:!0}),T,
75
75
  /* @__PURE__ */Z("div",{ref:it,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),w]}),
@@ -82,15 +82,15 @@ return Q("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,
82
82
  /* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
83
83
  /* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
84
84
  /* @__PURE__ */Z("div",{onPointerDown:e=>kr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
85
- /* @__PURE__ */Z("div",{onPointerDown:e=>kr(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:()=>Ft(!0),onMouseLeave:()=>Ft(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Xn(St),Nr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:jt&&/* @__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/qr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),cr()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Ot&&Fr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Fr.x,top:Fr.y+Fr.h+4,width:Fr.w,zIndex:D.expose+(jt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Vt(Se)})]}),Yr=Ke&&/* @__PURE__ */Q(b,{style:{left:Ke.x,top:Ke.y},onClose:()=>Oe(null),minWidth:160,children:[!U&&!Y&&!fn&&/* @__PURE__ */Q(ee,{children:[
86
- /* @__PURE__ */Q(v,{onClick:()=>{Vn(St),Oe(null)},children:[
87
- /* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),ze.minimize]}),!wn&&/* @__PURE__ */Q(v,Ln?{onClick:()=>{Tn(!1),cn(nn()),Oe(null)},children:[
85
+ /* @__PURE__ */Z("div",{onPointerDown:e=>kr(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:()=>Ft(!0),onMouseLeave:()=>Ft(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Xn(St),Nr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:jt&&/* @__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/qr})`,transformOrigin:"top right",zIndex:D.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),cr()},children:/* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),Ot&&Fr&&/* @__PURE__ */Z("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Fr.x,top:Fr.y+Fr.h+4,width:Fr.w,zIndex:D.expose+(jt?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Vt(Se)})]}),Yr=Ke&&/* @__PURE__ */Q(v,{style:{left:Ke.x,top:Ke.y},onClose:()=>Oe(null),minWidth:160,children:[!U&&!Y&&!fn&&/* @__PURE__ */Q(ee,{children:[
86
+ /* @__PURE__ */Q(x,{onClick:()=>{Vn(St),Oe(null)},children:[
87
+ /* @__PURE__ */Z(z,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),ze.minimize]}),!wn&&/* @__PURE__ */Q(x,Ln?{onClick:()=>{Tn(!1),cn(nn()),Oe(null)},children:[
88
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:()=>{zr(),Oe(null)},children:[
89
- /* @__PURE__ */Z(z,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),ze.maximize]})]}),W&&!fn&&/* @__PURE__ */Q(v,{onClick:()=>{Re(e=>!e),Oe(null)},children:[
90
- /* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-4 w-4 "+($e?"text-blue-600":""),fill:$e?"currentColor":"none",strokeWidth:1.5}),$e?ze.unpin:ze.pinOnTop]}),je&&/* @__PURE__ */Q(v,{onClick:()=>{Oe(null),Ge()},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]}),(Jt[St]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(Jt[St]||[]).map((e,t)=>/* @__PURE__ */Q(v,{onClick:()=>{Oe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(fn&&Fe?.home)&&/* @__PURE__ */Q(ee,{children:[
92
- /* @__PURE__ */Z(x,{}),
93
- /* @__PURE__ */Q(v,{danger:!0,onClick:()=>{Oe(null),cr()},children:[
89
+ /* @__PURE__ */Z(z,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),ze.maximize]})]}),W&&!fn&&/* @__PURE__ */Q(x,{onClick:()=>{Re(e=>!e),Oe(null)},children:[
90
+ /* @__PURE__ */Z(z,{name:"bookmark-square",className:"h-4 w-4 "+($e?"text-blue-600":""),fill:$e?"currentColor":"none",strokeWidth:1.5}),$e?ze.unpin:ze.pinOnTop]}),je&&/* @__PURE__ */Q(x,{onClick:()=>{Oe(null),Ge()},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]}),(Jt[St]||[]).length>0&&/* @__PURE__ */Z(ee,{children:(Jt[St]||[]).map((e,t)=>/* @__PURE__ */Q(x,{onClick:()=>{Oe(null),e.onClick()},children:[e.icon,e.label]},t))}),!(fn&&Fe?.home)&&/* @__PURE__ */Q(ee,{children:[
92
+ /* @__PURE__ */Z(k,{}),
93
+ /* @__PURE__ */Q(x,{danger:!0,onClick:()=>{Oe(null),cr()},children:[
94
94
  /* @__PURE__ */Z(z,{name:"close",className:"h-4 w-4"}),ze.close]})]})]}),Xr=!!se&&Nt.some(e=>e.id===se),Vr=!At||Xr||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
95
  /* @__PURE__ */Z("button",{type:"button",onClick:()=>Xn(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
96
  /* @__PURE__ */Z("button",{type:"button",onClick:()=>Xn(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:"▴"}),
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-XINUGME7.js";import{navIcons as r}from"./chunk-TPDOOCFS.js";import{VERSION as s}from"./chunk-AJOWAZ46.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as i,splitAround as a}from"./chunk-GTRUBA2R.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var u=n.aboutApp,f={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:u.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:u.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:u.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:u.preview},files:{name:"Files",version:"1.1.3",route:"/files",description:u.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:u.browser}},x=/* @__PURE__ */p(o,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(o,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:o}){const n=f[o],[u,w]=m(!1),N=c(()=>w(!0),[]),g=i().aboutApp,b=g.title(n.name);if(e(b,N,x),!u)return null;const y=r[n.route],k=l(y)?d(y,{className:"h-9 w-9"}):v,[j,A]=a(g.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-R6WJ2NTT.js";import{navIcons as r}from"./chunk-TPDOOCFS.js";import{VERSION as s}from"./chunk-EUFALBK3.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as i,splitAround as a}from"./chunk-GTRUBA2R.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var u=n.aboutApp,f={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:u.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:u.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:u.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:u.preview},files:{name:"Files",version:"1.1.3",route:"/files",description:u.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:u.browser}},x=/* @__PURE__ */p(o,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(o,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:o}){const n=f[o],[u,w]=m(!1),N=c(()=>w(!0),[]),g=i().aboutApp,b=g.title(n.name);if(e(b,N,x),!u)return null;const y=r[n.route],k=l(y)?d(y,{className:"h-9 w-9"}):v,[j,B]=a(g.partOf);/* @__PURE__ */
2
2
  return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:k}),
4
4
  /* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:n.name}),
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:b,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:g[o]}),
7
7
  /* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */h("p",{className:"text-2xs text-gray-500",children:[j,
9
- /* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-gray-400",children:g.shellVersion(s)})]})]})})}export{w as AboutApp,f as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),B]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-gray-400",children:g.shellVersion(s)})]})]})})}export{w as AboutApp,f as BUILTIN_APP_INFO};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-XINUGME7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.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__ */
1
+ import{Modal as e}from"./chunk-R6WJ2NTT.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.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"}),