efficient-shell 4.164.0 → 4.166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -4
- package/dist/{Browser-AZSXQEJ2.js → Browser-2MBG34IR.js} +13 -13
- package/dist/Calculator-R3WJTNZ6.js +29 -0
- package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
- package/dist/{CurrencyConverter-VT2SZDA3.js → CurrencyConverter-PEXSQQUK.js} +7 -7
- package/dist/{Documents-WIYSUFCQ.js → Documents-YL4RIOZO.js} +10 -10
- package/dist/{Files-FAO4MFCO.js → Files-3ZRUTRSB.js} +30 -30
- package/dist/Notepad-3ZM2FR6C.js +25 -0
- package/dist/PdfViewer-S2B2DZYB.js +1 -0
- package/dist/{PomodoroTimer-4JBDIQZK.js → PomodoroTimer-5QHA5UOY.js} +40 -40
- package/dist/{Preview-FBVFDTPN.js → Preview-32F4DTCK.js} +23 -23
- package/dist/Sidebar-QQSRLMJG.js +44 -0
- package/dist/Spreadsheet-GOZI7I4L.js +37 -0
- package/dist/{Stock-NIM7MAYG.js → Stock-XJFITZZA.js} +4 -4
- package/dist/{Weather-RLISJWFA.js → Weather-BDC633GV.js} +18 -18
- package/dist/{WorldClock-G4L5OLOT.js → WorldClock-ROOVRRCJ.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-6ZUAHFK3.js → chunk-3U47BTEV.js} +14 -14
- package/dist/{chunk-6NG4TM3E.js → chunk-4P3IWZUC.js} +14 -14
- package/dist/{chunk-Z43BI2JI.js → chunk-5J2TKKGH.js} +1 -1
- package/dist/{chunk-XY25UBVS.js → chunk-7TQ7NMT3.js} +1 -1
- package/dist/{chunk-YLJ7AZON.js → chunk-7YFAFXQG.js} +8 -8
- package/dist/chunk-AFYQTVZO.js +1 -0
- package/dist/chunk-BKDE67DB.js +12 -0
- package/dist/{chunk-T7DDT2Z6.js → chunk-CRI4UFBU.js} +6 -6
- package/dist/{chunk-DGWWPVEQ.js → chunk-DTRXR6JQ.js} +11 -11
- package/dist/{chunk-J5E4VMLJ.js → chunk-FZRQBHTK.js} +1 -1
- package/dist/chunk-G5J6YSN5.js +5 -0
- package/dist/{chunk-I3CQI462.js → chunk-HA2WG27U.js} +2 -2
- package/dist/{chunk-RKOTKWWU.js → chunk-HGG5M5AB.js} +1 -1
- package/dist/chunk-HZZNJHRH.js +1 -0
- package/dist/chunk-JKVDTKBE.js +988 -0
- package/dist/{chunk-IY4CP2HO.js → chunk-KSSAVLO7.js} +1 -1
- package/dist/chunk-M4DB7UBZ.js +29 -0
- package/dist/{chunk-YS57MJFM.js → chunk-NCQLGQYR.js} +1 -1
- package/dist/{chunk-U7ZDZXOJ.js → chunk-QASZIYLG.js} +1 -1
- package/dist/{chunk-37QZZRDT.js → chunk-QZG72OVX.js} +1 -1
- package/dist/chunk-SOI4LR67.js +27 -0
- package/dist/chunk-UVZIPXIA.js +10 -0
- package/dist/chunk-VRHUY4P4.js +1 -0
- package/dist/{chunk-TJ4YXVQQ.js → chunk-VXBJNMAA.js} +94 -94
- package/dist/chunk-X4FJ54PP.js +1 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-CFLEu3eh.d.ts → index-DcLqfJX3.d.ts} +285 -16
- package/dist/index.d.ts +3 -13
- package/dist/index.js +114 -114
- package/dist/map/index.js +6 -6
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-GRNWTZIZ.js +0 -29
- package/dist/ConfirmDialog-LSFNIGKM.js +0 -1
- package/dist/Notepad-APW5DX37.js +0 -25
- package/dist/PdfViewer-3NWOBXPP.js +0 -1
- package/dist/Sidebar-KRN5ZV3F.js +0 -44
- package/dist/Spreadsheet-IQF6QAWU.js +0 -37
- package/dist/chunk-4UCRT4ST.js +0 -5
- package/dist/chunk-ELSUXC3N.js +0 -1
- package/dist/chunk-HQREOTKI.js +0 -9
- package/dist/chunk-L2W5XPZ3.js +0 -1
- package/dist/chunk-LZIS72CF.js +0 -9
- package/dist/chunk-MAIHBBWT.js +0 -1
- package/dist/chunk-MHGFTCEA.js +0 -971
- package/dist/chunk-NNUE7M5G.js +0 -29
- package/dist/chunk-SVJN7WWF.js +0 -27
package/dist/chunk-NNUE7M5G.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{useDismissPopupsOnOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-ELSUXC3N.js";import{useShellStrings as r,splitAround as o}from"./chunk-YS57MJFM.js";import{createContext as l,useEffect as i,useRef as a,useId as s,useContext as c,useState as d,useCallback as u}from"react";import{jsxs as m,jsx as f,Fragment as h}from"react/jsx-runtime";var b=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function g(e){return Array.from(e.querySelectorAll(b)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var p=[];function v(e){const t=p.findIndex(t=>t!==e&&e.contains(t));-1===t?p.push(e):p.splice(t,0,e)}function x(e){const t=p.lastIndexOf(e);-1!==t&&p.splice(t,1)}var y=/* @__PURE__ */new WeakSet;function w(e){return g(e)}function N(e,t){i(()=>{if(!t)return;const n=e.current;return n?(y.add(n),v(n),()=>{x(n),y.delete(n)}):void 0},[e,t])}function k(e,t){const n=p.lastIndexOf(t),r=n>0?p[n-1]:-1===n?p[p.length-1]??null:null,o=g(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!y.has(r)?o[0]??null:null)}function C(e,t,n){i(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??g(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(p[p.length-1]!==r)return;const t=g(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return v(r),document.addEventListener("keydown",i,!0),()=>{x(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var L=0,E=null;function P(e){i(()=>{if(!e)return;const t=document.body;if(0===L){E={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return L+=1,()=>{0===(L-=1)&&E&&(t.style.overflow=E.overflow,t.style.paddingRight=E.paddingRight,E=null)}},[e])}var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function M({open:o,onClose:l,title:c,description:d,role:u="dialog",children:h,footer:b,blocking:g=!1,size:p="md",initialFocus:v,"aria-label":x,"aria-labelledby":y,"aria-describedby":w,className:N=""}){const k=a(null),L=s(),E=s(),M=!g&&!b,D=s(),F=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0),()=>k.current)},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
|
|
2
|
-
/* @__PURE__ */f("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
3
|
-
/* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?D:y,"aria-label":c||y?void 0:x,"aria-describedby":w??(d?E:h?L:void 0),className:`relative max-h-full w-full ${j[p]} overflow-y-auto overscroll-contain rounded-lg bg-white p-6 shadow-xl ${N}`.trim(),children:[c&&/* @__PURE__ */f("h2",{id:D,className:(M?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":M?"pr-8":"")+" text-sm text-gray-500").trim(),children:d}),h&&/* @__PURE__ */f("div",{id:L,className:"mt-2 text-sm text-gray-600",children:h}),b&&/* @__PURE__ */f("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:b}),M&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":F.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var D=l(()=>Promise.resolve(!1)),F=()=>c(D),T=()=>Promise.resolve(!1),W=e=>T(e),I=()=>Promise.resolve(!1),O=e=>I(e),$=()=>Promise.resolve(null),R=e=>$(e),S={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},z="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function A(){/* @__PURE__ */
|
|
4
|
-
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}function K(){/* @__PURE__ */
|
|
5
|
-
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function B({children:e}){const[t,n]=d(!1),[l,s]=d({message:""}),[c,b]=d(0),g=a(),p=a(null),v=a(0),x=a([]),y=a(null),w=a(null),N=u(e=>{p.current=e.id,g.current=e.resolve,b(e.id),s(e.options),n(!0)},[]),k=u(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):x.current.push(n)})},[N]),[C,L]=d(!1),[E,P]=d({message:""}),[j,F]=d(""),W=a(),O=u(e=>(P(e),F(""),L(!0),new Promise(e=>{W.current=e})),[]),[R,B]=d(!1),[U,_]=d({}),[q,G]=d(""),H=a(),J=u(e=>{const t="string"==typeof e?{message:e}:e;return _(t),G(t.defaultValue??""),B(!0),new Promise(e=>{H.current=e})},[]);i(()=>{T=k,I=O,$=J},[k,O,J]);const V=(e,t)=>{if(p.current!==e)return;const r=g.current,o=x.current.shift();o?N(o):(p.current=null,g.current=void 0,n(!1)),r?.(t)},X=e=>{L(!1),F(""),W.current?.(e)},Y=e=>{if(e){const e=q.trim();if(!e&&!U.allowEmpty)return B(!1),void H.current?.(null);B(!1),H.current?.(e)}else B(!1),H.current?.(null)},Q=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Z=S[Q],ee=S["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=r().dialog,[oe,le]=o(re.typeToConfirm);/* @__PURE__ */
|
|
6
|
-
return m(D.Provider,{value:k,children:[e,
|
|
7
|
-
/* @__PURE__ */f(M,{open:t,onClose:()=>V(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
|
|
8
|
-
/* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>V(c,!1),className:z,children:l.cancelLabel||re.cancel}),
|
|
9
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>V(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Z.button}`,children:l.confirmLabel||re.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
10
|
-
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${Z.icon}`,children:/* @__PURE__ */f(A,{})}),
|
|
11
|
-
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
12
|
-
/* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900",children:l.title||re.confirmTitle}),
|
|
13
|
-
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:l.message})]})]})}),
|
|
14
|
-
/* @__PURE__ */m(M,{open:C,onClose:()=>X(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
|
|
15
|
-
/* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>X(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
|
|
16
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>X(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
|
|
17
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>X(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */f(K,{})}),
|
|
18
|
-
/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
19
|
-
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */f(A,{})}),
|
|
20
|
-
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
21
|
-
/* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:E.title||re.destructiveTitle}),
|
|
22
|
-
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */m(h,{children:[
|
|
23
|
-
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
|
|
24
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),le]}),
|
|
25
|
-
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&X(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
|
|
26
|
-
/* @__PURE__ */m(M,{open:R,onClose:()=>Y(!1),title:U.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
|
|
27
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>Y(!1),className:z,children:U.cancelLabel||re.cancel}),
|
|
28
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>Y(!0),disabled:!U.allowEmpty&&!q.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:U.confirmLabel||re.ok})]}),children:[U.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:U.message}),
|
|
29
|
-
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:q,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?Y(!0):"Escape"===e.key&&Y(!1)},onFocus:e=>e.target.select(),placeholder:U.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{B as ConfirmProvider,M as Dialog,W as confirm,O as confirmDestructive,w as focusableIn,R as prompt,k as stopAfter,F as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};
|
package/dist/chunk-SVJN7WWF.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{glassStyle as a}from"./chunk-HQREOTKI.js";import{useDismissPopupsOnOpen as l,Z_LAYERS as o}from"./chunk-ELSUXC3N.js";import{useShellStrings as s}from"./chunk-YS57MJFM.js";import{useState as i,useEffect as c,useRef as d,useMemo as u,useId as p,useCallback as y}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";var b={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function g(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function k(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function w({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:d,width:u,height:p,decorative:y=!1,fallbackMode:m="monogram",adaptive:h=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:_=4,treatmentRadius:A=8,className:L="",style:C}){const[E,$]=i(e||t||"");c(()=>{$(e||t||"")},[e,t]);const T=Boolean(t&&E===t&&E!==e),I=(T?a??h:h)?x(T?n:w,T?r:N,s):"bare",S=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==d&&null==u&&null==p?b[o]:"","dark"===s?"text-white":"text-gray-700",v[I],L].filter(Boolean).join(" "),M={...k(I,A,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return E?/* @__PURE__ */f("span",{className:S,"data-brand-treatment":I,style:M,children:/* @__PURE__ */f("img",{src:E,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>$(e=>t&&e!==t?t:"")})}):"none"===m?null:/* @__PURE__ */f("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${S} rounded-md bg-gray-100 font-semibold`,style:M,children:y?null:g(l)})}function N(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&N(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function L(e,t,n){return!!t&&e.some(e=>e.to===t||L(_(e,n),t,n))}var C="__page__";function E(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function $(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])N(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:C,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?C:r.entityType,entity_id:r.entityId})}return n}var I="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function M(e,t,n,r){return{type:e,label:t,entity_type:C,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function j(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=t.get(n.type);e?e.push(n):t.set(n.type,[n])}return Array.from(t,([e,t])=>({type:e,results:t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.type}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.type),l=r?a?.listRoutes?.[e.type]:void 0;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.type}`,label:r,result:M(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=S("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function R(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var D=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function K(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function B(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),t.some(e=>D(e,r))||t.push(r)}return t.slice(0,8)}function P(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var z=[];function H(e,t,n){const[r,a]=i([]),[l,o]=i(z),[s,u]=i(!1),[p,f]=i("none"),m=d(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());c(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(z),f("none"),void u(!1);u(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...P(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),f(0===l.failed?"none":l.failed>=t.length?"all":"some"),u(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:y(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(z),f("none"),u(!1)},[])}}var U=(e,t)=>`${e}-opt-${t}`;function F(e,t){return"seeAll"===e.kind?"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3":"action"===e.kind?e.icon??I:e.icon?e.icon:t?.[e.result.type]?t[e.result.type]:I}function O({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
|
-
return f("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */m("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
|
|
3
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
|
-
/* @__PURE__ */f("span",{children:e.title}),
|
|
5
|
-
/* @__PURE__ */f("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
|
|
6
|
-
return m("div",{id:U(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
|
|
7
|
-
/* @__PURE__ */f("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:F(e,a)})}),
|
|
8
|
-
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
-
/* @__PURE__ */f("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */f("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */f("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var W="react-os-shell:open-global-search";function X(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(W))}function q({providers:e,typeIcons:t,listRoutes:n,placeholder:r,quickActions:b,onSelect:g,recent:x,onRecord:v,favorites:k}={}){const w=s().search,N=r??w.placeholder,[_,A]=i(!1),[L,C]=i(""),[E,$]=i(0),T=d(null),{results:M,truncatedTypes:D,loading:K,failure:B,reset:P}=H(L,e,2);c(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),A(e=>!e)),"Escape"===e.key&&_&&A(!1)},t=()=>A(!0);return window.addEventListener("keydown",e),window.addEventListener(W,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(W,t)}},[_]),l(_);const[z,F]=i(!1);_!==z&&(F(_),_&&(C(""),$(0),P())),c(()=>{_?setTimeout(()=>T.current?.focus(),50):C("")},[_]),c(()=>{$(0)},[M]);const X=L.length>=2,q=u(()=>X?j(M,b,L,w.actions,{truncatedTypes:D,listRoutes:n,seeAllLabel:w.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((e,t)=>({kind:"recent",key:`recent:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type,result:e})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((e,t)=>({kind:"favorite",key:`favorite:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:e})),count:e.favorites.length});const r=S("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[X,M,D,n,b,L,x,k,w]),G=u(()=>function(e){return e.flatMap(e=>e.rows)}(q),[q]),J=Math.min(E,Math.max(G.length-1,0)),Q=p(),V=G.length>0;c(()=>{_&&0!==G.length&&document.getElementById(U(Q,J))?.scrollIntoView?.({block:"nearest"})},[_,J,G.length,Q]);const Y=y(e=>{A(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||v?.(e.result),g?.(e.result)):e.action.onSelect()},[g,v]);return _?h(
|
|
10
|
-
/* @__PURE__ */m("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>A(!1),children:[
|
|
11
|
-
/* @__PURE__ */f("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
-
/* @__PURE__ */m("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:a(),children:[
|
|
13
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
|
-
/* @__PURE__ */f("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:I})}),
|
|
15
|
-
/* @__PURE__ */f("input",{ref:T,type:"text",value:L,onChange:e=>{C(e.target.value),$(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),$(R(J,1,G.length))):"ArrowUp"===e.key?(e.preventDefault(),$(R(J,-1,G.length))):"Tab"===e.key&&G.length>0?(e.preventDefault(),$(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(q.map(e=>e.rows.length),J,e.shiftKey?-1:1))):"Enter"===e.key&&G[J]&&Y(G[J])},placeholder:N,role:"combobox","aria-expanded":V,"aria-controls":V?Q:void 0,"aria-activedescendant":V?U(Q,J):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),K&&/* @__PURE__ */f("span",{"data-global-search-spinner":"",role:"status","aria-label":w.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
|
|
16
|
-
/* @__PURE__ */f("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:w.escBadge})]}),
|
|
17
|
-
/* @__PURE__ */m("div",{className:"max-h-[50vh] overflow-y-auto",children:[K&&0===G.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!K&&"all"===B&&X&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!K&&X&&0===G.length&&"all"!==B&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),V&&/* @__PURE__ */f(O,{sections:q,activeIdx:J,listId:Q,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:$,onPick:Y}),!K&&"some"===B&&X&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!K&&!X&&0===G.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.minChars(2)})]}),
|
|
18
|
-
/* @__PURE__ */m("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
|
|
19
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[
|
|
20
|
-
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
21
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${w.navigate}`]}),
|
|
23
|
-
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
24
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.enterKey}),` ${w.open}`]}),q.length>1&&/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
25
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.tabKey}),` ${w.nextGroup}`]})]}),
|
|
26
|
-
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
27
|
-
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.escKey}),` ${w.close}`]})]})]})]}),document.body):null}export{w as BrandMark,q as GlobalSearch,C as PAGE_RESULT_ENTITY,T as favoritesToResults,$ as navPagesProvider,X as openGlobalSearch,E as parsePageResultTarget,A as partitionNav,K as pushRecent,x as resolveBrandMarkTreatment,L as rowsContainRoute,B as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};
|