efficient-shell 4.157.0 → 4.160.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +41 -5
  2. package/dist/{Browser-PP7VID3N.js → Browser-3KOGROX7.js} +10 -10
  3. package/dist/{Calculator-5DF4PSEG.js → Calculator-QLJJ3ICT.js} +22 -22
  4. package/dist/{CurrencyConverter-BEI6UUDD.js → CurrencyConverter-3GTKDKHH.js} +6 -6
  5. package/dist/{Documents-CP2XWF7D.js → Documents-FDGF7QBQ.js} +1 -1
  6. package/dist/Files-TTSYOPVB.js +89 -0
  7. package/dist/Notepad-ITHIATP2.js +25 -0
  8. package/dist/{PomodoroTimer-3BDFGHC6.js → PomodoroTimer-CRKL26PP.js} +25 -25
  9. package/dist/{Preview-5ANRQG57.js → Preview-GZTTEZWS.js} +5 -5
  10. package/dist/{Sidebar-H6R3AK5G.js → Sidebar-ECJEQXFK.js} +19 -19
  11. package/dist/{Spreadsheet-SRQT2MJP.js → Spreadsheet-PFKZTLSI.js} +12 -12
  12. package/dist/{Stock-PEZB3WXV.js → Stock-NAHSVLAJ.js} +3 -3
  13. package/dist/{Weather-6EJFJQIX.js → Weather-AY3QWBQT.js} +9 -9
  14. package/dist/{WorldClock-5BMGEL2A.js → WorldClock-AXNMA4PG.js} +6 -6
  15. package/dist/apps/index.js +1 -1
  16. package/dist/brand.css +1 -1
  17. package/dist/{chunk-ZHPA74NY.js → chunk-A6FPBD7W.js} +1 -1
  18. package/dist/chunk-GF2XCISN.js +1 -0
  19. package/dist/{chunk-KAESEFKM.js → chunk-HQTSPK5Q.js} +1 -1
  20. package/dist/{chunk-ELCH5NDO.js → chunk-JK3IIJN5.js} +6 -6
  21. package/dist/chunk-LCB4IVEL.js +942 -0
  22. package/dist/chunk-S2AZZGFF.js +1 -0
  23. package/dist/chunk-VNEH2Y6H.js +9 -0
  24. package/dist/{chunk-LGDG4YMF.js → chunk-VRW5JNMR.js} +6 -6
  25. package/dist/{chunk-XC64WV33.js → chunk-X6E6UULK.js} +75 -75
  26. package/dist/{chunk-DRN636EP.js → chunk-XPSADW6W.js} +1 -1
  27. package/dist/chunk-YKZGKYVT.js +2 -0
  28. package/dist/format/index.d.ts +1 -0
  29. package/dist/format/index.js +1 -0
  30. package/dist/{index-Cap9oGrA.d.ts → index-Brl0XepS.d.ts} +49 -43
  31. package/dist/index-DCUzlKPZ.d.ts +194 -0
  32. package/dist/index.d.ts +25 -3
  33. package/dist/index.js +645 -645
  34. package/dist/page-tabs/index.js +5 -5
  35. package/dist/ui/index.d.ts +2 -1
  36. package/dist/ui/index.js +1 -1
  37. package/dist/ui.css +7 -0
  38. package/package.json +6 -1
  39. package/dist/Files-ZSAHZBB5.js +0 -89
  40. package/dist/Notepad-AUHWLOXO.js +0 -25
  41. package/dist/chunk-ARMUS5GB.js +0 -1
  42. package/dist/chunk-J7LKJIZC.js +0 -9
  43. package/dist/chunk-MVLIXV7C.js +0 -2
  44. package/dist/chunk-WWRFM2YF.js +0 -940
@@ -0,0 +1 @@
1
+ var e="—",t=[{key:"DD/MM/YYYY",example:"24/04/2026"},{key:"MM/DD/YYYY",example:"04/24/2026"},{key:"YYYY-MM-DD",example:"2026-04-24"},{key:"DD-MM-YYYY",example:"24-04-2026"},{key:"MM-DD-YYYY",example:"04-24-2026"},{key:"DD.MM.YYYY",example:"24.04.2026"},{key:"YYYY.MM.DD",example:"2026.04.24"},{key:"YYYY/MM/DD",example:"2026/04/24"},{key:"DD/MM/YY",example:"24/04/26"},{key:"MM/DD/YY",example:"04/24/26"},{key:"DD/MMM/YYYY",example:"24/Apr/2026"},{key:"DD/MMM/YY",example:"24/Apr/26"},{key:"DD MMM YYYY",example:"24 Apr 2026"},{key:"MMM DD, YYYY",example:"Apr 24, 2026"},{key:"DD MMMM YYYY",example:"24 April 2026"},{key:"MMMM DD, YYYY",example:"April 24, 2026"}],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=["January","February","March","April","May","June","July","August","September","October","November","December"];function o(e){return r[parseInt(e,10)-1]??e}function a(e){return n[parseInt(e,10)-1]??e}function u(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}function i(e){localStorage.setItem("user_date_format",e)}var Y="user_timezone",c="auto";function m(){if("undefined"!=typeof window)try{const e=localStorage.getItem(Y);return e&&e!==c?e:void 0}catch{return}}function s(e){e&&e!==c?localStorage.setItem(Y,e):localStorage.removeItem(Y)}function M(e){e&&localStorage.setItem(Y,e)}var l={dateStyle:"medium"},D=/* @__PURE__ */new Map;function f(e,t){const r=`${e}|${JSON.stringify(t)}`;let n=D.get(r);return n||(n=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),D.set(r,n)),n}var $=/* @__PURE__ */new Map;function y(e,t){const r=function(e){const t=e??"";let r=$.get(t);if(!r){const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",calendar:"gregory"};try{r=new Intl.DateTimeFormat("en-GB",{...n,timeZone:e})}catch{r=new Intl.DateTimeFormat("en-GB",n)}$.set(t,r)}return r}(t).formatToParts(e),n=e=>r.find(t=>t.type===e)?.value??"";return{y:n("year"),m:n("month"),d:n("day"),hh:n("hour"),mm:n("minute")}}var d=/^(\d{4})-(\d{1,2})-(\d{1,2})$/;function g(t,r){const n=function(e,t){if(!e)return null;const r=d.exec(e);if(r){const[e,t,n]=r.slice(1).map(Number);return t<1||t>12||n<1||n>31?null:{y:String(e),m:String(t).padStart(2,"0"),d:String(n).padStart(2,"0")}}const n=new Date(e);return Number.isNaN(n.getTime())?null:y(n,t)}(t,r?.timeZone||m());return n?r?.locale?f(r.locale,r.style??l).format(new Date(Date.UTC(Number(n.y),Number(n.m)-1,Number(n.d)))):function(e,t,r){switch(u()){case"MM/DD/YYYY":return`${t}/${r}/${e}`;case"YYYY-MM-DD":return`${e}-${t}-${r}`;case"DD-MM-YYYY":return`${r}-${t}-${e}`;case"MM-DD-YYYY":return`${t}-${r}-${e}`;case"DD.MM.YYYY":return`${r}.${t}.${e}`;case"YYYY.MM.DD":return`${e}.${t}.${r}`;case"YYYY/MM/DD":return`${e}/${t}/${r}`;case"DD/MM/YY":return`${r}/${t}/${e.slice(-2)}`;case"MM/DD/YY":return`${t}/${r}/${e.slice(-2)}`;case"DD/MMM/YYYY":return`${r}/${o(t)}/${e}`;case"DD/MMM/YY":return`${r}/${o(t)}/${e.slice(-2)}`;case"DD MMM YYYY":return`${r} ${o(t)} ${e}`;case"MMM DD, YYYY":return`${o(t)} ${r}, ${e}`;case"DD MMMM YYYY":return`${r} ${a(t)} ${e}`;case"MMMM DD, YYYY":return`${a(t)} ${r}, ${e}`;default:return`${r}/${t}/${e}`}}(n.y,n.m,n.d):e}function h(t,r){if(!t||d.test(t))return e;const n=new Date(t);if(Number.isNaN(n.getTime()))return e;const o=r?.timeZone||m();if(r?.locale)return function(e,t,r){const n={hour:"numeric",minute:"2-digit"};try{return e.toLocaleTimeString(t,{...n,timeZone:r})}catch{return e.toLocaleTimeString(t,n)}}(n,r.locale,o);const{hh:a,mm:u}=y(n,o);return function(e,t){const r=Number(e);return`${r%12||12}:${t} ${r<12?"am":"pm"}`}(a,u)}function p(t,r){const n=h(t,r);return n===e?e:`${g(t,r)}, ${n}`}var w={months:n,monthsShort:r,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${n[t]} ${e}`,shortMonthYear:(e,t)=>`${r[t]} ${e}`,longDate:(e,t,r)=>`${r} ${n[t]} ${e}`},S=/* @__PURE__ */new Map;function k(e){if(!e)return w;const t=S.get(e);if(t)return t;const r=t=>f(e,t),n=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),o=r({month:"long"}),a=r({month:"short"}),u=r({weekday:"long"}),i=r({weekday:"short"}),Y=r({month:"long",year:"numeric"}),c=r({month:"short",year:"numeric"}),m=r({day:"numeric",month:"long",year:"numeric"}),s=Array.from({length:12},(e,t)=>t),M=Array.from({length:7},(e,t)=>t),l={months:s.map(e=>o.format(n(2e3,e))),monthsShort:s.map(e=>a.format(n(2e3,e))),weekdays:M.map(e=>u.format(n(2e3,0,2+e))),weekdaysShort:M.map(e=>i.format(n(2e3,0,2+e))),monthYear:(e,t)=>Y.format(n(e,t)),shortMonthYear:(e,t)=>c.format(n(e,t)),longDate:(e,t,r)=>m.format(n(e,t,r))};return S.set(e,l),l}var b=/* @__PURE__ */new Map;function x(e){if(!e)return 0;let t=b.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),n="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===n?.firstDay&&(t=1)}catch{}b.set(e,t)}return t}var N=6e4,T=36e5,v=24*T;function I(e){if(null==e||""===e)return null;const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t}function A(t,r){const n=I(t);if(!n)return e;const o=Date.now()-n.getTime();return o<0?"just now":o<N?r?.precise&&o>=1e3?`${Math.floor(o/1e3)}s ago`:"just now":o<T?`${Math.floor(o/N)}m ago`:o<v?`${Math.floor(o/T)}h ago`:o<7*v?`${Math.floor(o/v)}d ago`:g(n.toISOString())}var F=null;function B(e){if(!e)return void(F=null);const t={};for(const[r,n]of Object.entries(e))t[r.toUpperCase()]=n;F=t}function C(e){const t=e.toUpperCase();return F?.[t]?.symbol||t}function J(e){return e?F?.[e.toUpperCase()]?.decimals??2:2}function U(t,r,n){if(null==t||""===t)return e;const o="string"==typeof t?Number(t):t;if(!Number.isFinite(o))return e;const a=n?.whole?0:J(r),u=Math.abs(o).toLocaleString("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}),i=o<0&&/[1-9]/.test(u)?"-":"";if(!r)return`${i}${u}`;const Y=C(r);return`${i}${/^[A-Za-z]+$/.test(Y)?`${Y} `:Y}${u}`}var Z=["KB","MB","GB","TB"];function O(t){if(null==t||!Number.isFinite(t)||t<0)return e;if(t<1024)return`${Math.round(t)} B`;let r=t/1024,n=0;for(;n<Z.length-1&&Number(r.toFixed(1))>=1024;)r/=1024,n++;return`${r.toFixed(1)} ${Z[n]}`}export{t as DATE_FORMAT_OPTIONS,e as EMPTY_VALUE,c as TZ_AUTO,k as calendarNames,J as currencyDecimals,C as currencySymbol,x as firstDayOfWeek,O as formatBytes,g as formatDate,p as formatDateTime,U as formatMoney,h as formatTime,u as getUserDateFormat,m as getUserTimezone,B as setCurrencyFormats,i as setUserDateFormat,s as setUserTimezone,M as syncTimezoneFromProfile,A as timeAgo,I as toInstant};
@@ -0,0 +1,9 @@
1
+ import{onOverlayOpen as e,Z_LAYERS as t,registerModalEscapeInterceptor as n}from"./chunk-OSJ3ADF2.js";import{rootIsDark as r}from"./chunk-MAIHBBWT.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{createContext as a,forwardRef as s,useContext as l,useRef as u,useId as c,useState as d,useEffect as p,useMemo as m,useCallback as h}from"react";import{createPortal as f}from"react-dom";import{jsx as g,jsxs as y,Fragment as b}from"react/jsx-runtime";function x(){try{const e=getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();if(e)return parseFloat(e)}catch{}return.95}var w=r;function v(){try{return document.documentElement.classList.contains("rosh-reduce-transparency")}catch{return!1}}function k(e,t){return`color-mix(in srgb, ${e} ${+(Math.round(255*Math.min(1,Math.max(0,t)))/255*100).toFixed(4)}%, transparent)`}function C(e,t={}){const n=e??x();if(v()&&"light"===t.ink)return{background:"var(--rosh-glass-light-ink-surface)",border:"1px solid var(--rosh-glass-light-ink-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};if(v())return{background:"var(--rosh-glass-surface)",border:"1px solid var(--rosh-glass-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};const r="var(--rosh-glass-surface)",o="var(--rosh-glass-surface-mid)";return w()?{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.75*n)} 50%, ${k(r,.85*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.6)",WebkitBackdropFilter:"blur(40px) saturate(1.6)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}:{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.65*n)} 50%, ${k(r,.75*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}}function $(e){return v()?"var(--rosh-glass-surface)":k("var(--rosh-glass-surface)",.85*(e??x()))}var M="border-white/20",N="glass-input-bg",L=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),B="data-native-context-menu";function E(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function T(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(E(t,`[${B}]`))return!0;if(E(t,"textarea"))return!0;if(E(t,"img, picture, canvas, video, audio"))return!0;const n=E(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(L.has(e))return!0}const r=E(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var W=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function A(e,t,n){const r=E(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return W.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function F(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function S(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function R(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function D(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function H(e,t,n,r,o,i=!1,a=8){const s=t+o,l=e-o-n,u=l>=a;return i&&u?{left:l,flipped:!0}:s+n<=r-a?{left:s,flipped:!1}:u?{left:l,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function P(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var I=a(null);function j({children:n,style:r,className:i="",onClose:a,minWidth:s=180,portal:l=!1}){const h=u(null),y=c(),[b,x]=d([]),w=u();p(()=>()=>clearTimeout(w.current),[]);const v=o(),k=m(()=>{const e=()=>clearTimeout(w.current);return{id:y,depth:0,path:b,open:(t,n)=>{e(),x(e=>F(e,t,n))},scheduleClose:t=>{e(),w.current=setTimeout(()=>x(e=>S(e,t)),200)},closeBelow:t=>{e(),x(e=>S(e,t))},cancelClose:e,closeTree:()=>{e(),x([]),a?.()},root:h}},[y,b,a]);p(()=>{if(!a)return;const t=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${y}"]`)||h.current&&!h.current.contains(e.target)&&a()},n=e=>{"Escape"===e.key&&a()};window.addEventListener("pointerdown",t),window.addEventListener("keydown",n);const r=e(a);return()=>{window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",n),r()}},[a,y]),p(()=>{const e=h.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const $=P(),M=/(^|[\s:])!?z-/.test(i),N=/* @__PURE__ */g("div",{ref:h,"data-popup-menu-tree":y,className:`fixed rounded-2xl ${"tight"===$?"py-1":"large"===$?"py-2":"py-1.5"} ${i}`,onContextMenu:e=>{T(e.target)||e.preventDefault()},style:{...M?{}:{zIndex:t.menu},minWidth:s,animation:"popup-in 0.12s ease-out",...C(),...r},children:/* @__PURE__ */g(I.Provider,{value:k,children:n})});return l?v?f(N,document.body):null:N}function z(e,t,n,r=!1){const o=P(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var q=s(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:a,id:s,onMouseEnter:u},c){const d=l(I),p=z(r,o,n);/* @__PURE__ */
2
+ return g("button",{ref:c,id:s,role:i,tabIndex:a,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:p.className,style:p.style,children:t})}),U=/* @__PURE__ */g("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function J(e){let n=t.menu;for(let t=e;t&&t!==document.body;t=t.parentElement){const e=parseInt(getComputedStyle(t).zIndex,10);Number.isNaN(e)||(n=e)}return n}function K(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function O({label:e,icon:t,children:r,disabled:o,className:a="",minWidth:s=180,maxHeight:d}){const x=l(I),w=c(),v=u(null),k=u(null),$=u(),M=u(!1),N=`${w}-menu`;p(()=>()=>clearTimeout($.current),[]);const L=x?.depth??0,B=x?.path[L],E=!!B&&B.key===w&&!o,W=h(e=>{if(!x||o||!v.current)return;clearTimeout($.current),M.current=e;const t=v.current.getBoundingClientRect(),n=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=L>0&&(x.path[L-1]?.flipped??!1),a=H(r.left,r.right,s,window.innerWidth,4,i);x.open(L,{key:w,y:t.top,...a})},[x,o,L,w,s]),A=e=>{x?.closeBelow(L),v.current?.focus()};p(()=>{if(E)return n(e=>"Escape"===e.key&&(!(x&&x.path.length>L+1)&&(A(),!0)))}),i(()=>{if(!E||!B)return;const e=()=>{const e=k.current;if(!e||!v.current)return;const t=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??v.current.getBoundingClientRect(),r=L>0&&(x?.path[L-1]?.flipped??!1),o=e.offsetWidth||s,i=H(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=D(v.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),p(()=>{E&&M.current&&(M.current=!1,K(k.current)[0]?.focus())},[E]);const F=m(()=>x&&{...x,depth:L+1},[x,L]);if(!x)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=z(!1,o,a,E),R=P();/* @__PURE__ */
3
+ return y(b,{children:[
4
+ /* @__PURE__ */y("button",{ref:v,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":E,"aria-controls":E?N:void 0,disabled:o,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;E?t&&K(k.current)[0]?.focus():W(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),W(!0))},onMouseEnter:()=>{o||(x.cancelClose(),E?x.closeBelow(L+1):(clearTimeout($.current),$.current=setTimeout(()=>W(!1),120)))},onMouseLeave:()=>{clearTimeout($.current),x.scheduleClose(L)},children:[t,
5
+ /* @__PURE__ */g("span",{className:"min-w-0 flex-1 truncate",children:e}),U]}),E&&f(
6
+ /* @__PURE__ */g("div",{ref:k,id:N,role:"menu","data-popup-menu-tree":x.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===R?"py-1":"large"===R?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:J(x.root.current)+L+1,animation:(B.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...C()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=K(k.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),A())},onMouseEnter:()=>{x.cancelClose(),clearTimeout($.current)},onMouseLeave:()=>x.scheduleClose(L+1),onContextMenu:e=>{T(e.target)||e.preventDefault()},children:/* @__PURE__ */g(I.Provider,{value:F,children:r})}),document.body)]})}function V(){const e=P();/* @__PURE__ */
7
+ return g("div",{className:`border-t ${M} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function G({children:e}){const t=P(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
8
+ return g("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function Q({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
9
+ return g("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{M as GLASS_DIVIDER,N as GLASS_INPUT_BG,Q as MenuIcon,B as NATIVE_MENU_ATTR,j as PopupMenu,V as PopupMenuDivider,q as PopupMenuItem,G as PopupMenuLabel,O as PopupSubmenu,D as clampMenuTop,S as closeMenuBelow,A as describeContextTarget,$ as glassFill,C as glassStyle,z as itemLook,T as keepsNativeMenu,H as menuPanelLeft,F as openMenuLevel,R as resolveMenuLevels};
@@ -1,5 +1,5 @@
1
- import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-J7LKJIZC.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
- return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},I=N?m.find(e=>e.key===N.key):void 0,D=I?m.indexOf(I):-1,L=e=>e.some(e=>!e.pinned),A=e=>()=>{C(null),e()};/* @__PURE__ */
1
+ import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-VNEH2Y6H.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
+ return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},I=N?m.find(e=>e.key===N.key):void 0,D=I?m.indexOf(I):-1,A=e=>e.some(e=>!e.pinned),E=e=>()=>{C(null),e()};/* @__PURE__ */
3
3
  return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
4
4
  /* @__PURE__ */s("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
5
5
  /* @__PURE__ */s("div",{role:"tablist","aria-label":x,onKeyDown:e=>{const r=m.findIndex(r=>document.getElementById(h(r.key,"tab"))===e.target);if(!(r<0)){if("ArrowRight"===e.key)z(r+1);else if("ArrowLeft"===e.key)z(r-1);else if("Home"===e.key)z(0);else if("End"===e.key)z(m.length-1);else{if("Delete"!==e.key||m[r].pinned)return;f(m[r].key)}e.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:m.map((e,r)=>{const n=e.key===u,t=!!e.dirty,l=e.icon,i=n?k??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",g=r>0&&!n&&m[r-1].key!==u,x={type:"button",role:"tab",id:h(e.key,"tab"),"aria-selected":n,"aria-controls":y?.(e.key)?h(e.key,"panel"):void 0,tabIndex:e.key===j?0:-1,title:e.title,onClick:()=>p(e.key)},b={onContextMenu:r=>((e,r)=>{e.preventDefault(),C({x:e.clientX,y:e.clientY,key:r.key})})(r,e),onAuxClick:r=>((e,r)=>{1!==e.button||r.pinned||(e.preventDefault(),f(r.key))})(r,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=l&&
@@ -11,8 +11,8 @@ return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gra
11
11
  /* @__PURE__ */s("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(l?n?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:e.title})]}),
12
12
  /* @__PURE__ */o("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(n?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[t&&/* @__PURE__ */s("span",{role:"img","aria-label":w.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
13
13
  /* @__PURE__ */s("button",{type:"button",tabIndex:-1,"aria-label":w.closeTab?.(e.title)??`${w.close} ${e.title}`,onClick:()=>f(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(t?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */s(c,{})})]})]})]},e.key)})}),v&&/* @__PURE__ */s("div",{className:"flex shrink-0 items-center gap-2 self-center",children:v}),N&&I&&/* @__PURE__ */o(e,{portal:!0,style:{left:N.x,top:N.y},onClose:()=>C(null),children:[
14
- /* @__PURE__ */s(r,{disabled:I.pinned,onClick:A(()=>f(I.key)),children:w.close}),
14
+ /* @__PURE__ */s(r,{disabled:I.pinned,onClick:E(()=>f(I.key)),children:w.close}),
15
15
  /* @__PURE__ */s(n,{}),
16
- /* @__PURE__ */s(r,{disabled:!L(m.filter(e=>e.key!==I.key)),onClick:A(()=>g("others",I.key)),children:w.closeOthers}),
17
- /* @__PURE__ */s(r,{disabled:!L(m.slice(D+1)),onClick:A(()=>g("right",I.key)),children:w.closeRight}),
18
- /* @__PURE__ */s(r,{disabled:!L(m),onClick:A(()=>g("all",null)),children:w.closeAll})]})]})}export{m as TabStrip};
16
+ /* @__PURE__ */s(r,{disabled:!A(m.filter(e=>e.key!==I.key)),onClick:E(()=>g("others",I.key)),children:w.closeOthers}),
17
+ /* @__PURE__ */s(r,{disabled:!A(m.slice(D+1)),onClick:E(()=>g("right",I.key)),children:w.closeRight}),
18
+ /* @__PURE__ */s(r,{disabled:!A(m),onClick:E(()=>g("all",null)),children:w.closeAll})]})]})}export{m as TabStrip};