efficient-shell 4.155.1 → 4.156.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 +1 -1
- package/dist/{Browser-HNSQP7PK.js → Browser-UT55GS2Q.js} +14 -14
- package/dist/{Calculator-PWWTNCT7.js → Calculator-5DF4PSEG.js} +23 -23
- package/dist/ConfirmDialog-7Q2OOU4W.js +1 -0
- package/dist/{CurrencyConverter-OH4WAA74.js → CurrencyConverter-BEI6UUDD.js} +5 -5
- package/dist/{Documents-HG6NJCIB.js → Documents-CFKC6E56.js} +5 -5
- package/dist/{Files-22E36TVC.js → Files-A5PJMN3R.js} +82 -82
- package/dist/Notepad-LLYR2OFZ.js +25 -0
- package/dist/PdfViewer-VIT7Y55M.js +1 -0
- package/dist/{PomodoroTimer-BXJZKA4W.js → PomodoroTimer-3BDFGHC6.js} +26 -26
- package/dist/{Preview-6X5QAHHR.js → Preview-YH5VHR7Q.js} +6 -6
- package/dist/{Sidebar-44I3DD2U.js → Sidebar-H6R3AK5G.js} +24 -24
- package/dist/{Spreadsheet-K6QSHFVS.js → Spreadsheet-2ZQYF6H3.js} +14 -14
- package/dist/{Stock-HGSIZXAT.js → Stock-PEZB3WXV.js} +3 -3
- package/dist/{Weather-3VS65TQO.js → Weather-6EJFJQIX.js} +19 -19
- package/dist/{WorldClock-NI5OTEBV.js → WorldClock-5BMGEL2A.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-NSXQF4YC.js → chunk-26RS37FG.js} +1 -1
- package/dist/{chunk-RGFEKAPC.js → chunk-36QR65KW.js} +2 -2
- package/dist/{chunk-VGTI3BJ4.js → chunk-B2TBCVHH.js} +1 -1
- package/dist/{chunk-AC54EYVA.js → chunk-DRN636EP.js} +1 -1
- package/dist/{chunk-O35K6ZWH.js → chunk-ELCH5NDO.js} +3 -3
- package/dist/{chunk-4DT7B7GZ.js → chunk-FHIF6IUV.js} +1 -1
- package/dist/{chunk-ZVAQKPRB.js → chunk-HF4IZFFX.js} +11 -11
- package/dist/chunk-KAESEFKM.js +1 -0
- package/dist/{chunk-MXLPLKRG.js → chunk-KASHUEJV.js} +4 -4
- package/dist/{chunk-C47EJ4MB.js → chunk-KOUCDWJR.js} +1 -1
- package/dist/{chunk-JHXGBYJO.js → chunk-LGDG4YMF.js} +6 -6
- package/dist/{chunk-ZYUWLZUG.js → chunk-PDTZTADH.js} +15 -15
- package/dist/{chunk-V73HRX73.js → chunk-SYMCTL7Q.js} +471 -474
- package/dist/{chunk-ZTXFXS6V.js → chunk-T6MKFQRH.js} +6 -6
- package/dist/{chunk-TULPGC2I.js → chunk-UPI2GKKD.js} +9 -9
- package/dist/chunk-VVI77XNV.js +1 -0
- package/dist/{chunk-DRRIYS3R.js → chunk-XC64WV33.js} +60 -60
- package/dist/{chunk-ZP2V72LB.js → chunk-XN76YBX3.js} +8 -8
- package/dist/{chunk-JLSOLX5J.js → chunk-ZJ66QFOH.js} +1 -1
- package/dist/chunk-ZQMUHLYL.js +1 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-ak9Cps7c.d.ts → index-C-inEe7F.d.ts} +5 -43
- package/dist/index.d.ts +2 -2
- package/dist/index.js +645 -645
- package/dist/map/index.js +1 -1
- 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/ConfirmDialog-UVIZK7EY.js +0 -1
- package/dist/Notepad-YHSWKS4C.js +0 -25
- package/dist/PdfViewer-W65LHKXZ.js +0 -1
- package/dist/chunk-FEWQDVQJ.js +0 -1
- package/dist/chunk-YIXQGB75.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useShellStrings as e}from"./chunk-VVI77XNV.js";import{useHydrated as t,useBrowserState as r}from"./chunk-D65T4H6J.js";import{createContext as n,useSyncExternalStore as o,useCallback as i,useContext as a,useMemo as s}from"react";import{jsxs as l,jsx as c}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function u(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function f(){return!1}function m(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function h(){return o(m,u,f)}var w={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},g={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
2
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});case"error":/* @__PURE__ */
|
|
3
3
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});case"warning":/* @__PURE__ */
|
|
4
4
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})});default:/* @__PURE__ */
|
|
5
|
-
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:
|
|
5
|
+
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:t="info",title:r,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const d=w[t],u=e().errors;/* @__PURE__ */
|
|
6
6
|
return l("div",{role:"error"===d?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
|
|
7
7
|
/* @__PURE__ */c("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[d]}`,children:i??/* @__PURE__ */c(v,{tone:d})}),
|
|
8
|
-
/* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:
|
|
9
|
-
/* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},_=L?0:1,
|
|
10
|
-
return c("kbd",{className:[P,$[t],r].filter(Boolean).join(" "),children:n})}var
|
|
11
|
-
return c(
|
|
8
|
+
/* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:r??g[t]?.(u)??""}),n&&/* @__PURE__ */c("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */c("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */c("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function x({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */c("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */c("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */l("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
|
|
9
|
+
/* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},_=L?0:1,N=M.MOD[_],b=M.ALT[_],C="⇧",S="⏎",D=M.CMD_ENTER[_],E=M.CMD_S[_],T=M.CMD_K[_],k=M.CMD_DOT[_],A=M.CMD_A[_],j=M.CMD_Z[_],I=M.CMD_SHIFT_Z[_],H=M.ALT_SHIFT_D[_],F=M.ALT_SHIFT_E[_],z=M.ALT_SHIFT_N[_],Z=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function O(e){return t()?e:Z.get(e)??e}var P="inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",$={sm:"px-1 py-0.5 text-[10px]",md:"px-1.5 py-0.5 text-[11px]"};function K({keys:e,size:t="md",className:r=""}){const n=O(e);/* @__PURE__ */
|
|
10
|
+
return c("kbd",{className:[P,$[t],r].filter(Boolean).join(" "),children:n})}var R=n(null);function V({value:e,children:t}){/* @__PURE__ */
|
|
11
|
+
return c(R.Provider,{value:e,children:t})}function J(e="react-os-shell:prefs",t){const[n,o]=r(()=>{try{const r=JSON.parse(localStorage.getItem(e)||"{}");return{...t??{},...r}}catch{return{...t??{}}}},{...t??{}});return{prefs:n,save:i(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var U={prefs:{},save:()=>{}};function B(){return a(R)??U}function W(){const{prefs:e,save:t}=B(),r=i(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return s(()=>({prefs:e,save:r}),[e,r])}var X="react-os-shell:stale-chunk-reload-at",q=3e4,G="vite:preloadError",Q="/_next/static/",Y=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ee(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return Y.test(t)}function te(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(X),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?Q:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(X),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(X,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ee(t)&&a(t)&&(e.preventDefault(),r())};let l=!0,c=!1;const d=/* @__PURE__ */new Set,u=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||c||d.has(t)||(d.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{d.delete(t),e&&l&&!c&&a(t)&&(c=!0,r())}))};return window.addEventListener(G,s),u&&window.addEventListener("error",u,!0),()=>{l=!1,window.removeEventListener(G,s),u&&window.removeEventListener("error",u,!0)}}export{b as ALT,H as ALT_SHIFT_D,F as ALT_SHIFT_E,z as ALT_SHIFT_N,A as CMD_A,k as CMD_DOT,D as CMD_ENTER,T as CMD_K,E as CMD_S,I as CMD_SHIFT_Z,j as CMD_Z,S as ENTER,K as Kbd,x as LoadingSpinner,N as MOD,Q as NEXT_CHUNK_PATH_PREFIX,y as Result,C as SHIFT,q as STALE_CHUNK_RELOAD_COOLDOWN_MS,X as STALE_CHUNK_RELOAD_KEY,V as ShellPrefsProvider,G as VITE_PRELOAD_ERROR_EVENT,te as installStaleChunkReload,L as isMac,ee as isStaleChunkError,h as useIsMobile,J as useLocalStoragePrefs,W as useShellPrefs,B as useShellPrefsAdapter,O as useShortcutLabel};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
1
|
+
import{toast_default as e}from"./chunk-B2TBCVHH.js";import{forwardRef as t,useRef as r,useState as n,useMemo as o,useEffect as i,useImperativeHandle as a}from"react";import{jsx as l,jsxs as s,Fragment as c}from"react/jsx-runtime";var d=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",label:"System",css:"-apple-system, system-ui, sans-serif"},{id:"serif",label:"Serif",css:'Georgia, "Times New Roman", serif'},{id:"mono",label:"Mono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",label:"Cursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],u=()=>Math.random().toString(36).slice(2,9),p=t(function({src:t,filename:p,onApply:x,onCancel:m},M){const N=r(null),L=r(null),D=r(null),z=r(null),[P,E]=n("select"),[$,I]=n(d[0]),[W,B]=n(4),[S,R]=n(24),[T,j]=n(h[0].id),[A,H]=n(!0),[F,U]=n(!1),[O,Z]=n(!1),[K,V]=n(null),[X,q]=n(null),[G,Y]=n(6),[_,J]=n(12),[Q,ee]=n([]),[te,re]=n(null),[ne,oe]=n(null),[ie,ae]=n(null),[le,se]=n(1),[ce,de]=n(null),[he,ue]=n(null),[pe,ye]=n(null),xe=r(null),[me,ge]=n(!1),we=o(()=>ie?{w:ie.w*le,h:ie.h*le}:null,[ie,le]),fe=we&&ne?we.w/ne.w:1,be=o(()=>Q.find(e=>e.id===te)??null,[Q,te]);i(()=>{"select"===P&&be&&("color"in be&&I(be.color),"stroke"in be&&B(be.stroke),"rect"===be.type&&J(be.radius),"text"===be.type&&(R(be.size),j(be.font),H(be.bold),U(be.italic),Z(be.underline),V(be.borderColor),q(be.background),Y(be.padding)))},[te]),i(()=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{z.current=r,oe({w:r.naturalWidth,h:r.naturalHeight}),ee([]),re(null)},r.onerror=()=>e.error("Failed to load image"),r.src=t},[t]),i(()=>{if(!ne)return;const e=()=>{const e=N.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ne.w/ne.h;let i=ne.w,a=ne.h;i>r&&(i=r,a=i/o),a>n&&(a=n,i=a*o),ae({w:i,h:a})};e();const t=new ResizeObserver(e);return N.current&&t.observe(N.current),()=>t.disconnect()},[ne]);const ve=o(()=>Q.filter(e=>"mosaic"===e.type),[Q]);i(()=>{const e=z.current,t=L.current;if(!e||!t||!ne)return;t.width=ne.w,t.height=ne.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of ve)C(r,e)},[ne,ve,ie]);const ke=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Me=e=>{xe.current=e,ge(!0)};i(()=>{if(!me)return;const e=e=>{const t=xe.current;if(!t)return;const r=ke(e);if("draw"===t.kind)de(f(P,t.start,r,$,W,_));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),de({id:"",type:"draw",points:t.points.slice(),color:$,stroke:W}))}else if("crop"===t.kind)ye(k(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ee(r=>r.map(r=>r.id===t.id?b(t.original,e,n):r))}else"resize"===t.kind&&ee(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=k({x:l,y:s},{x:c,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=xe.current;if(xe.current=null,ge(!1),"draw"===e?.kind)de(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const r={...e,id:u()};return ee(e=>[...e,r]),re(r.id),E("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void de(null);const t={id:u(),type:"draw",points:e.points,color:$,stroke:W};ee(e=>[...e,t]),re(t.id),E("select"),de(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)}},[me,P,$,W,_]);i(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(te&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),ee(e=>e.filter(e=>e.id!==te)),re(null)):"Escape"===e.key&&re(null))):(e.preventDefault(),ee(e=>e.slice(0,-1)),void re(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[te]);const Ce=e=>{const t=!{bold:A,italic:F,underline:O}[e];"bold"===e&&H(t),"italic"===e&&U(t),"underline"===e&&Z(t),te&&ee(r=>r.map(r=>r.id===te&&"text"===r.type?{...r,[e]:t}:r))},Ne=e=>{V(e),te&&ee(t=>t.map(t=>t.id===te&&"text"===t.type?{...t,borderColor:e}:t))},Le=e=>{q(e),te&&ee(t=>t.map(t=>t.id===te&&"text"===t.type?{...t,background:e}:t))},De=e=>{if(!he)return;const t=e??he.value;if(!t.trim())return he.editingId&&ee(e=>e.filter(e=>e.id!==he.editingId)),void ue(null);if(he.editingId)ee(e=>e.map(e=>e.id===he.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:u(),type:"text",x:he.x,y:he.y,text:t,color:$,size:S,font:T,bold:A,italic:F,underline:O,borderColor:K,background:X,padding:G};ee(t=>[...t,e]),re(e.id),E("select")}ue(null)},ze=async()=>{const e=L.current,t=D.current;if(!e||!t||!ne)return null;const r=document.createElement("canvas");r.width=ne.w,r.height=ne.h;const n=r.getContext("2d");n.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,0,0,ne.w,ne.h),URL.revokeObjectURL(l),r};a(M,()=>({save:async()=>{const t=await ze();t&&t.toBlob(t=>{if(!t)return void e.error("Failed to export");const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=p.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error("Clipboard images not supported in this browser");const t=await ze();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success("Copied to clipboard")}catch{e.error("Copy failed (clipboard permission?)")}else e.error("Failed to copy")},"image/png")}}),[ne,p]);const Pe=o(()=>[{id:"select",label:"Select / Move",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:"Pen / Draw",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:"Rectangle",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:"Ellipse",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:"Arrow",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:"Mosaic",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:"Text",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:"Crop",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[]),Ee=e=>"p-1.5 rounded transition-colors "+(e?"bg-blue-500 text-white":"text-gray-700 hover:bg-gray-200"),$e=be?.type??("select"===P?null:P),Ie="rect"===$e||"circle"===$e||"arrow"===$e||"draw"===$e,We="rect"===$e,Be="text"===$e;/* @__PURE__ */
|
|
2
2
|
return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
3
|
/* @__PURE__ */s("div",{className:"flex items-center gap-1.5 px-3 py-2 border-b border-gray-200 bg-white shrink-0 flex-wrap text-[12px]",children:[Pe.map(e=>/* @__PURE__ */l("button",{onClick:()=>{E(e.id),re(null)},title:e.label,className:Ee(P===e.id),children:e.icon},e.id)),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
5
|
-
/* @__PURE__ */l("div",{className:"flex items-center gap-1",children:d.map(e=>/* @__PURE__ */l("button",{onClick:()=>(e=>{
|
|
5
|
+
/* @__PURE__ */l("div",{className:"flex items-center gap-1",children:d.map(e=>/* @__PURE__ */l("button",{onClick:()=>(e=>{I(e),te&&ee(t=>t.map(t=>t.id!==te||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+($===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Ie&&/* @__PURE__ */s(c,{children:[
|
|
6
6
|
/* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
7
7
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
|
|
8
8
|
/* @__PURE__ */l("span",{children:"Weight"}),
|
|
@@ -16,7 +16,7 @@ return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
|
16
16
|
/* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
17
17
|
/* @__PURE__ */l("select",{value:T,onChange:e=>{return t=e.target.value,j(t),void(te&&ee(e=>e.map(e=>e.id===te&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */l("option",{value:e.id,children:e.label},e.id))}),
|
|
18
18
|
/* @__PURE__ */l("button",{onClick:()=>Ce("bold"),className:Ee(A),title:"Bold",children:/* @__PURE__ */l("span",{className:"font-bold",children:"B"})}),
|
|
19
|
-
/* @__PURE__ */l("button",{onClick:()=>Ce("italic"),className:Ee(
|
|
19
|
+
/* @__PURE__ */l("button",{onClick:()=>Ce("italic"),className:Ee(F),title:"Italic",children:/* @__PURE__ */l("span",{className:"italic",children:"I"})}),
|
|
20
20
|
/* @__PURE__ */l("button",{onClick:()=>Ce("underline"),className:Ee(O),title:"Underline",children:/* @__PURE__ */l("span",{className:"underline",children:"U"})}),
|
|
21
21
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
|
|
22
22
|
/* @__PURE__ */l("span",{children:"Size"}),
|
|
@@ -25,15 +25,15 @@ return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
|
25
25
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
26
|
/* @__PURE__ */l("span",{children:"Border"}),K?/* @__PURE__ */s(c,{children:[
|
|
27
27
|
/* @__PURE__ */l("input",{type:"color",value:K,onChange:e=>Ne(e.target.value),title:"Text-box border color",className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
28
|
-
/* @__PURE__ */l("button",{onClick:()=>Ne(null),title:"Remove border",className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */l("button",{onClick:()=>Ne(
|
|
28
|
+
/* @__PURE__ */l("button",{onClick:()=>Ne(null),title:"Remove border",className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */l("button",{onClick:()=>Ne($),title:"Add a border",className:"px-1.5 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Add"})]}),
|
|
29
29
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
30
|
-
/* @__PURE__ */l("span",{children:"Fill"}),
|
|
31
|
-
/* @__PURE__ */l("input",{type:"color",value:
|
|
30
|
+
/* @__PURE__ */l("span",{children:"Fill"}),X?/* @__PURE__ */s(c,{children:[
|
|
31
|
+
/* @__PURE__ */l("input",{type:"color",value:X,onChange:e=>Le(e.target.value),title:"Text-box background color",className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
32
|
/* @__PURE__ */l("button",{onClick:()=>Le(null),title:"Remove fill",className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */l("button",{onClick:()=>Le("#ffffff"),title:"Add a background fill",className:"px-1.5 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Add"})]}),
|
|
33
33
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
|
|
34
34
|
/* @__PURE__ */l("span",{children:"Pad"}),
|
|
35
|
-
/* @__PURE__ */l("input",{type:"range",min:0,max:40,step:1,value:
|
|
36
|
-
/* @__PURE__ */l("span",{className:"tabular-nums w-6 text-right",children:
|
|
35
|
+
/* @__PURE__ */l("input",{type:"range",min:0,max:40,step:1,value:G,onChange:e=>{return t=Number(e.target.value),Y(t),void(te&&ee(e=>e.map(e=>e.id===te&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
|
|
36
|
+
/* @__PURE__ */l("span",{className:"tabular-nums w-6 text-right",children:G})]})]}),
|
|
37
37
|
/* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
38
38
|
/* @__PURE__ */l("button",{onClick:()=>se(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:"Zoom out",children:"−"}),
|
|
39
39
|
/* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*le),"%"]}),
|
|
@@ -47,7 +47,7 @@ return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
|
47
47
|
/* @__PURE__ */l("button",{onClick:async()=>{const t=await ze();t?t.toBlob(t=>{t?x(t):e.error("Failed to export")},"image/png"):e.error("Failed to export")},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:"Apply"})]})]})]}),
|
|
48
48
|
/* @__PURE__ */l("div",{ref:N,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:we&&ne&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:we.w,height:we.h},children:[
|
|
49
49
|
/* @__PURE__ */l("canvas",{ref:L,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
|
|
50
|
-
/* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ne.w} ${ne.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===P?"default":"text"===P?"text":"crosshair"},onPointerDown:e=>{if("select"===P)return void re(null);if("text"===P){if(he)return void De();const t=ke(e);return void ue({x:t.x,y:t.y,value:""})}const t=ke(e);if("crop"!==P){if("draw"===P)return Me({kind:"pen",points:[t]}),void de({id:"",type:"draw",points:[t],color
|
|
50
|
+
/* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ne.w} ${ne.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===P?"default":"text"===P?"text":"crosshair"},onPointerDown:e=>{if("select"===P)return void re(null);if("text"===P){if(he)return void De();const t=ke(e);return void ue({x:t.x,y:t.y,value:""})}const t=ke(e);if("crop"!==P){if("draw"===P)return Me({kind:"pen",points:[t]}),void de({id:"",type:"draw",points:[t],color:$,stroke:W});de(f(P,t,t,$,W,_)),Me({kind:"draw",start:t})}else Me({kind:"crop",start:t})},children:[Q.map(e=>/* @__PURE__ */l(y,{anno:e,selected:te===e.id,zoom:le,onPointerDown:t=>((e,t)=>{"select"===P&&(e.stopPropagation(),re(t.id),Me({kind:"move",id:t.id,start:ke(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ue({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Me({kind:"resize",id:t.id,corner:r,start:ke(e),original:t})})(t,e,r)},e.id)),ce&&/* @__PURE__ */l(y,{anno:{...ce,id:"__preview"},preview:!0}),pe&&/* @__PURE__ */l(g,{rect:pe,imageSize:ne})]}),he&&/* @__PURE__ */l(w,{pendingText:he,color:$,size:S,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:F,underline:O,borderColor:K,background:X,padding:G,scale:fe,onChange:e=>ue({...he,value:e}),onCommit:De,onCancel:()=>ue(null)})]})}),
|
|
51
51
|
/* @__PURE__ */l("div",{className:"px-3 py-1.5 border-t border-gray-200 bg-white text-[11px] text-gray-500 shrink-0",children:"select"===P?te?"Drag to move. Drag a corner to resize. Delete / Backspace removes. Click outside to deselect.":"Tap a shape to select. Double-click text to edit.":"text"===P?"Click to drop a text label.":"crop"===P?"Drag a rectangle to set the crop region.":"draw"===P?"Drag to draw freehand.":"Drag on the image to draw."})]})});function y({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const d=v(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__PURE__ */l("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)y=/* @__PURE__ */l("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)y=/* @__PURE__ */l(m,{anno:e,interactive:u});else if("draw"===e.type)y=/* @__PURE__ */l("path",{d:M(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)y=/* @__PURE__ */l("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=v(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */s("g",{...u,...p,children:[n&&/* @__PURE__ */l("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
52
52
|
/* @__PURE__ */l("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,r)=>/* @__PURE__ */l("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
|
|
53
53
|
return s("g",{children:[y,t&&!r&&/* @__PURE__ */s(c,{children:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,useContext as o,useMemo as t,useEffect as a}from"react";import{jsx as n}from"react/jsx-runtime";var i=/* @__PURE__ */new Map;function r(e,o){const t=`${e}|${JSON.stringify(o)}`;let a=i.get(t);return a||(a=new Intl.NumberFormat(e,o),i.set(t,a)),a}function s(e,o){return o?r(o,{maximumFractionDigits:20}).format(e):String(e)}function l(e,o,t){return t?r(t,{minimumFractionDigits:o,maximumFractionDigits:o}).format(e):e.toFixed(o)}function d(e,o,t){return t?r(t,{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(e/100):`${e.toFixed(o)}%`}function c(e){const o=o=>s(o,e),t=o=>function(e,o){return o?r(o,{}).format(e):e.toLocaleString()}(o,e),a=(o,t)=>l(o,t,e);return{window:{minimize:"Minimize",restore:"Restore",maximize:"Maximize",windowed:"Windowed",pinOnTop:"Pin on top",unpin:"Unpin from top",close:"Close",windowSuffix:"window",prev:"Prev",next:"Next",snapLayouts:"Snap layouts",snapLeft:"Snap left half",snapRight:"Snap right half",snapTopLeft:"Snap top-left quarter",snapTopRight:"Snap top-right quarter",snapBottomLeft:"Snap bottom-left quarter",snapBottomRight:"Snap bottom-right quarter"},taskbar:{closeWindow:"Close window",offscreenHint:"This window is off screen — click to bring it back",offscreenDot:"Off screen — click to bring this window back",expose:"Exposé — show all open windows as thumbnails",addToDesktop:"Add to desktop",removeFromDesktop:"Remove from desktop",minimizeAllWindows:"Minimize all",restoreAllWindows:"Restore all",closeAllWindows:"Close all"},logout:{goodbye:"Goodbye",seeYou:"See you next time"},about:{aboutPrefix:"About",thisApp:"this app",openSourceLicenses:"Open Source Licenses",whatsNew:"What's New",noChangelog:"No changelog available."},table:{empty:"Nothing to show",loading:"Loading",selectAll:"Select all rows",selectRow:"Select row"},select:{none:"— None —",noMatches:"No matches",allSelected:"All options selected",clear:"Clear selection",remove:"Remove"},notifications:{title:"Notifications",markAllRead:"Mark all read",dnd:"Do not disturb",dndOn:"Do not disturb is on",caughtUp:"All caught up",empty:"No notifications yet",viewAll:"View all notifications",cardLabel:"Notification",dismiss:"Dismiss notification"},form:{errorSummaryTitle:"There is a problem"},help:{title:"Help",searchPlaceholder:"Search help…",empty:"No help articles yet.",noResults:"No articles match your search.",loading:"Loading…",pickArticle:"Pick a help article from the left.",noBody:"This article has no body yet.",draft:"Draft",newArticle:"+ New",edit:"Edit"},update:{available:"A new version is available.",refreshNow:"Refresh now"},pageTabs:{label:"Open pages",close:"Close",closeOthers:"Close other tabs",closeRight:"Close tabs to the right",closeAll:"Close all tabs",unsaved:"Unsaved changes",discardTitle:"Discard unsaved changes?",discardOne:"This page has changes that have not been saved. Close it anyway?",discardMany:"pages have changes that have not been saved. Close them anyway?",discardConfirm:"Discard and close",keepEditing:"Keep editing"},dialog:{close:"Close",cancel:"Cancel",ok:"OK",confirmTitle:"Confirm",destructiveTitle:"Confirm Action",destructiveCancel:"Dismiss",destructiveConfirm:"Delete",typeToConfirm:e=>`Type ${e} to confirm:`,promptTitle:"Enter a value"},calendar:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",monthPanel:"Choose a month",yearPanel:"Choose a year",chooseMonth:e=>`Choose a month, currently ${e}`,chooseYear:e=>`Choose a year, currently ${e}`},datePicker:{placeholder:"Select a date",dialog:"Choose a date",clear:"Clear",today:"Today",required:"Required"},dateRange:{placeholder:"Date Range",clearRange:"Clear date range",dialog:"Date range",from:"From",to:"To",start:"Start",end:"End",fromOnly:e=>`From ${e}`,toOnly:e=>`To ${e}`,range:(e,o)=>`${e} to ${o}`,required:"Required",last2Weeks:"Last 2 Weeks",lastMonth:"Last Month",last3Months:"Last 3 Months",last6Months:"Last 6 Months",last12Months:"Last 12 Months",custom:"Custom",clear:"Clear",cancel:"Cancel",apply:"Apply"},pagination:{label:"Pagination",first:"First page",previous:"Previous page",next:"Next page",last:"Last page"},list:{selected:e=>`${o(e)} selected`,selectedNotShown:(e,t)=>`${o(e)} selected, ${o(t)} not shown`,allLoaded:(e,o)=>`All ${t(e)} ${o} loaded`,count:(e,o)=>`${t(e)} ${o}`,loadedOf:(e,o,a)=>`${t(e)} of ${t(o)} ${a}`,loadingMore:"Loading more...",loadError:"Couldn't load this list",loadErrorMessage:"Something went wrong fetching these records. Check your connection and try again.",retry:"Try again"},kanban:{loading:"Loading…",empty:"No items.",dropHere:"Drop here",addItem:"Add item"},files:{attach:"Attach files",drop:"Drop files to attach",remove:e=>`Remove ${e}`,chooseMany:"Choose files",chooseOne:"Choose a file",dragMany:"or drag them here",dragOne:"or drag it here",notAccepted:(e,o)=>`${e} is not an accepted file type${o?` (${o})`:""}`,tooLarge:(e,o,t)=>`${e} is ${o} — the limit is ${t}`,tooMany:(e,t)=>`${e} was not added — ${o(t)} ${1===t?"file":"files"} is the limit`,bytes:e=>`${o(e)} B`,kilobytes:e=>`${o(e)} KB`,megabytes:e=>`${a(e,1)} MB`},media:{uploadImage:"Upload an image",uploadVideo:"Upload a video",uploadFile:"Upload a file",upload:"Upload media",cta:"Choose from library or upload",replace:"Replace",remove:"Remove",uploading:"Uploading…",cover:"Cover",add:"Add",addMedia:"Add media",empty:"No media.",removeItem:e=>`Remove ${e}`,reorder:(e,t,a)=>`${e}, item ${o(t)} of ${o(a)}. Use arrow keys to reorder.`},brandAsset:{save:e=>`Save ${e}`,remove:e=>`Remove ${e}`,discard:"Discard change",saveFailed:e=>`Could not save ${e}.`,removeFailed:e=>`Could not remove ${e}.`,region:(e,o)=>`${e} for ${o}`,usedFor:e=>`Used for ${e}.`,previews:e=>`${e} previews`,preview:"Preview",alt:(e,o)=>`${e} ${o}`},copy:{copy:"Copy",copyLabel:e=>`Copy ${e}`,copied:"Copied",copiedLabel:e=>`${e} copied`,failed:"Could not copy to the clipboard"},keypad:{backspace:"Backspace",enter:"Enter"},banner:{dismiss:"Dismiss"},badge:{remove:"Remove",removeItem:e=>`Remove ${e}`},breadcrumbs:{label:"Breadcrumb",hidden:"Hidden crumbs"},emptyState:{message:"Nothing here yet."},errors:{notFound:"Page not found",notFoundBody:"The page you're looking for doesn't exist or was moved.",forbidden:"Access denied",forbiddenBody:"You don't have permission to view this page.",noAccess:"You don't have access to this",serverError:"Something went wrong",serverErrorBody:"An unexpected error occurred. Please try again.",retry:"Try again",details:"Error details"},search:{placeholder:"Search...",escBadge:"ESC",searching:"Searching...",noResults:"No results found.",minChars:e=>`Type at least ${o(e)} characters to search...`,navigate:"navigate",open:"open",close:"close",enterKey:"Enter",escKey:"Esc"},grid:{selectAll:"Select all",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:e=>`Delete row ${e}`,insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:e=>`Delete column ${e}`,resize:"Drag to resize · double-click to auto-fit",fill:"Drag to fill"},sidebar:{resize:"Drag to resize · double-click to reset"},layout:{desktop:"Desktop",sidebar:"Sidebar",switchToDesktop:"Switch to Desktop",switchToSidebar:"Switch to Sidebar",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",search:"Search…",navLabel:"Main menu",openWindows:"Open windows",pageResult:"Page",accountMenu:e=>`Account menu for ${e}`,profile:"My Profile",notifications:"Notifications",reportIssue:"Suggestion or Bug",signOut:"Sign Out",signOutTitle:"Sign Out",signOutMessage:"Do you want to log out? All windows will reopen when you log back in."},markdown:{screenshot:"Screenshot"},severity:{success:"ok",warning:"warning",danger:"critical",unrecognised:e=>`unrecognised severity ${e}`},meter:{noData:"no data",warningAt:e=>`warning ≥ ${o(e)}`,criticalAt:e=>`critical ≥ ${o(e)}`,noReading:"no reading",noBudget:"no budget",ofBudget:e=>`${e} of budget`,budget:"budget",hoursMinutes:(e,t)=>`${o(e)}h ${o(t)}m`,minutesSeconds:(e,t)=>`${o(e)}m ${o(t)}s`,seconds:e=>`${o(e)}s`},charts:{showTable:"Show the data as a table",loading:"Loading chart data",noData:"No data in this window.",windowStart:"Window start",windowEnd:"Window end",window:(e,t,a)=>`Time window — showing ${e} to ${t} of ${o(a)} intervals`,overIntervals:(e,t)=>`${e.join(", ")} over ${o(t)} intervals`,acrossCategories:(e,t)=>`${e.join(", ")} across ${o(t)} categories`,acrossMeasures:(e,t)=>`${e.join(", ")} across ${o(t)} measures`,breakdown:(e,t)=>`Breakdown of ${e} across ${o(t)} segments`,funnel:(e,t,a)=>`Funnel of ${o(e)} stages, ${t} down to ${a}`,radialTrack:e=>`${o(e)} categories, as concentric proportions`,radialCycle:e=>`${o(e)} categories, around a cycle`,tableFrom:"From",tableTo:"To",tableItem:"Item",tableLevel:"Level",tableSeries:"Series",inBucket:e=>`${e} in this bucket`,inCategory:e=>`${e} in this category`,value:"Value",share:"Share",count:"Count",flow:"Flow",totalFlow:"Total flow",throughput:"Throughput",open:"Open",high:"High",low:"Low",close:"Close",maximum:"Maximum",q3:"Q3",median:"Median",q1:"Q1",minimum:"Minimum",distribution:"Distribution",fiveNumber:(e,t)=>`${e}: five-number summary for ${o(t)} categories`,outliers:e=>`${o(e)} outlier${e>1?"s":""} beyond the whiskers`,price:"Price",ohlc:(e,t)=>`${e}: open, high, low and close across ${o(t)} periods`,closedAbove:"Closed above its open",closedBelow:"Closed below its open",noFlows:"No flows to chart.",chord:e=>`Flows between ${o(e)} participants`,noStages:"No stages to chart.",ofFirstStage:"Of first stage",droppedHere:"Dropped here",intensity:"Intensity",noActivity:"No activity in this window.",heatmap:(e,t,a)=>`${e} across ${o(t)} rows and ${o(a)} columns`,countAxis:"count",histogram:(e,t,a)=>`${e}: ${o(t)} bins over ${o(a)} observations`,observations:"Observations",notEnough:"Not enough eligible requests to judge.",objectiveMet:e=>`objective ${e} met`,objectiveMissed:e=>`objective ${e} missed`,nothingToPlot:"Nothing to plot.",nothingToCompare:"Nothing to compare.",other:"Other",nothingToBreakDown:"Nothing to break down.",range:"Range",rangeLabel:(e,t)=>`${e}: low and high across ${o(t)} categories`,nothingToRank:"Nothing to rank in this window.",emphasised:"(emphasised)",sankey:(e,t)=>`Flow between ${o(e)} nodes over ${o(t)} links`,noObservations:"No observations in this window.",xAxis:"x",yAxis:"y",size:"Size",scatter:(e,o,t)=>`${e.join(", ")}: ${o} against ${t}`,outsideRange:e=>`${o(e)} ${1===e?"point":"points"} outside the shown range`,waterfall:(e,t,a)=>`Waterfall of ${o(e)} steps from ${t} to ${a}`,balance:"Balance",increase:"Increase",decrease:"Decrease",runningTotal:"Running total",sunburst:(e,t)=>`Hierarchy of ${e} across ${o(t)} levels`,treemap:e=>`Treemap of ${o(e)} items`,trendUp:"up",trendDown:"down",trendFlat:"flat"},timeline:{days:e=>`${t(e)} days`,daysToToday:e=>`${t(e)} days to today`,notReached:"Not yet reached",next:"Next",more:e=>`+${o(e)} more`,today:"Today",todayTitle:e=>`Today — ${e}`,open:e=>`Open ${e}`,openButton:"Open",scrub:"Scrub the timeline",alsoToCome:e=>`Also to come: ${e.join(", ")}`,start:e=>`Start · ${e}`,events:(e,t)=>`${o(e)} events · ${t.join(", ")}`,started:e=>`started ${e}`,duration:e=>`${t(e)} day${1===e?"":"s"}`,reached:(e,t)=>`${o(e)} of ${o(t)} milestones`,milestones:e=>`${e} milestones`},production:{heading:"Production progress",start:"Start",estimated:"Estimated",estimatedCompletion:"Estimated completion",estDone:"Est. done",play:"Play",pause:"Pause",playTitle:"Play the timeline, report by report",backTo:e=>`Back to ${e}`,showing:e=>`Showing ${e}`,overall:o=>`${((o,t)=>d(o,t,e))(o,0)} overall`,inStock:e=>`${t(e)} pc in stock`,noReport:"No production report filed yet",leadTime:e=>`${t(e)} day${1===e?"":"s"} lead time`,report:"Production report",shipment:"Shipment",inspection:"Inspection",invoice:"Invoice",scrub:"Scrub the production timeline",label:(e,o)=>`Production reports and events, ${e} to ${o}`},containers:{items:e=>`${o(e)} items`,pieces:e=>`${o(e)} pcs`,split:(e,t)=>`(${o(e)} instr / ${o(t)} loaded)`,added:(e,t)=>`${o(e)} new (${o(t)} pcs)`,fill:(e,t)=>`${a(e,1)} / ${o(t)} m³`,total:"Total:",instructed:e=>`${a(e,2)} m³ instruction`,loaded:e=>`${a(e,2)} m³ loaded`,volume:e=>`${a(e,2)} m³`,noVolume:"Volume: N/A (no volume data for these part numbers)"},toast:{notification:"Notification"},map:{failed:"The map could not be drawn here. The list has everything it shows.",approximate:e=>`${e}, approximate location`,approximateTitle:e=>`${e} (approximate)`,places:e=>1===e?"place":"places",group:(e,t)=>`${o(e)} ${t} here`,stops:e=>`Stops ${e}`,closeBy:(e,t)=>`${o(e)} more ${t} close by, drawn when the map is closer`,spread:"Press to see them apart",cycle:"They stand on one spot: press for the next of them",fullScreen:"Full screen",leaveFullScreen:"Leave full screen",chosen:e=>`${e}, chosen on the map`,closeCard:"Close",openRecord:"Open"},pdf:{previousPage:"Previous page",nextPage:"Next page",pageOf:(e,t)=>`${o(e)} / ${o(t)}`,zoomOut:"Zoom out",zoomIn:"Zoom in",zoom:"Zoom",fitWidth:"Fit width",fitPage:"Fit page",fit:"Fit",fitHint:"Fit to the pane: follows its size until you zoom by hand",print:"Print",download:"Download",email:"Email",loading:"Loading PDF…",loadFailed:"Failed to load PDF",allowPopups:"Allow popups to print"}}}var p=c(),u=/* @__PURE__ */new Map;var m=e(p),h=e(null),g=/* @__PURE__ */new Set;var $=p,f={};function w(){return $}function v({value:e=f,locale:i,children:r}){const s=o(h),l=t(()=>function(e){if(e)try{return Intl.getCanonicalLocales(e)[0]}catch{return void(g.has(e)||(g.add(e),console.error(`[efficient-shell] ShellStringsProvider: locale="${e}" is not a BCP 47 language tag, so it is ignored and numbers and dates keep their default formatting. Pass a tag such as "de-DE" or "ja".`)))}}(i),[i]),d=void 0===i?s?.locale:l,w=t(()=>{const o=function(e){if(!e)return p;let o=u.get(e);return o||(o=c(e),u.set(e,o)),o}(d),t={};for(const a of Object.keys(o))t[a]={...o[a],...e[a]??{}};return t},[e,d]),v=t(()=>({locale:d}),[d]),y=null!==s;return a(()=>{if(!y)return $=w,()=>{$===w&&($=p)}},[w,y]),/* @__PURE__ */n(h.Provider,{value:v,children:/* @__PURE__ */n(m.Provider,{value:w,children:r})})}function y(){return o(m)}function b(){return o(h)?.locale}function S(e){const[o="",...t]=e("\0").split("\0");return[o,t.join("")]}export{p as DEFAULT_SHELL_STRINGS,v as ShellStringsProvider,w as currentShellStrings,l as formatFixed,d as formatPercent,s as formatPlain,S as splitAround,b as useShellLocale,y as useShellStrings};
|