efficient-shell 7.18.1 → 7.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -2
- package/dist/{Browser-K4DQBJWS.js → Browser-MGN247WU.js} +15 -15
- package/dist/Calculator-QLVWIU4C.js +29 -0
- package/dist/{ConfirmDialog-JMQI6CGW.js → ConfirmDialog-AVFQGXKL.js} +1 -1
- package/dist/{CurrencyConverter-PICVES6A.js → CurrencyConverter-7UT6W5OA.js} +6 -6
- package/dist/{Documents-QEPM2X7B.js → Documents-B5YGM7XF.js} +13 -13
- package/dist/Files-J7S5TI5N.js +87 -0
- package/dist/{Notepad-XEROGOZT.js → Notepad-EZDWJGSM.js} +11 -11
- package/dist/{PomodoroTimer-OCAJKGQU.js → PomodoroTimer-3OJYMVX7.js} +45 -45
- package/dist/{Preview-S4UIOU43.js → Preview-JASABTYI.js} +17 -17
- package/dist/Spreadsheet-ZHNUUC72.js +37 -0
- package/dist/{Stock-74K5L75A.js → Stock-5RQ2JXWL.js} +7 -7
- package/dist/{Weather-QTRJYIPS.js → Weather-3AMX2QSU.js} +16 -16
- package/dist/{WorldClock-L6PSFBLE.js → WorldClock-JNHPO3ZQ.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-NXYHRDRD.js → chunk-46NGPIEZ.js} +4 -4
- package/dist/{chunk-BIYMQKF3.js → chunk-5V3IFQ7F.js} +1 -1
- package/dist/chunk-76VCH7N6.js +29 -0
- package/dist/chunk-7LRJBINZ.js +108 -0
- package/dist/chunk-BVYOUFSW.js +19 -0
- package/dist/{chunk-23C25QZV.js → chunk-FVU7WDST.js} +1 -1
- package/dist/{chunk-VFBUDSMF.js → chunk-GIWC2ZTG.js} +2 -2
- package/dist/{chunk-QWSVX6OP.js → chunk-HMCE2MKM.js} +1 -1
- package/dist/chunk-IJ7RXIWX.js +13 -0
- package/dist/chunk-P7IKSYFJ.js +1 -0
- package/dist/chunk-QKMXKK6P.js +1027 -0
- package/dist/chunk-VOFDPOB6.js +1 -0
- package/dist/{index-C4iOtAIZ.d.ts → index-DsObAHbf.d.ts} +37 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +631 -631
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/telemetry/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-NGSHZWOR.js +0 -29
- package/dist/Files-S45MKBYC.js +0 -87
- package/dist/Spreadsheet-L7QG3LGD.js +0 -37
- package/dist/chunk-7BX3JQBP.js +0 -19
- package/dist/chunk-ERDQLQVK.js +0 -1
- package/dist/chunk-IBGEW3OA.js +0 -108
- package/dist/chunk-L5YNA4NS.js +0 -1025
- package/dist/chunk-QBXX5A7U.js +0 -29
- package/dist/chunk-WYNQLAKD.js +0 -13
package/dist/map/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{Button_default as e}from"../chunk-WYNQLAKD.js";import"../chunk-JTNKC4CR.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-7IQ3B77H.js";import"../chunk-FIEA5CGB.js";import"../chunk-D65T4H6J.js";import{useShellStrings as r}from"../chunk-QRCDQPJA.js";import"../chunk-C3QOHMR6.js";import{Icon as o}from"../chunk-ZGUQLVY4.js";import{useRef as a,useState as l,useEffect as i,useCallback as s,useMemo as c,useSyncExternalStore as u}from"react";import{createPortal as d}from"react-dom";import{jsxs as p,jsx as m,Fragment as h}from"react/jsx-runtime";import{useQuery as g}from"@tanstack/react-query";var f="maplibregl-compact-show";function y(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(f)&&(e.classList.remove(f),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var b=20,x=12,v=480,w={center:[0,0],left:[b,0],right:[-20,0],top:[0,b],"top-left":[0,b],"top-right":[0,b],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},k=(e,t=12)=>Math.max(0,Math.floor(e-t-x-b-10-16));function N(e,t,n,r=12){const o=e.y-b-r,a=n.height-e.y-b-x,l=t.height<=o||t.height>a&&o>=a,i=l?Math.max(0,t.height-o):-Math.max(0,t.height-a);let s="",c=0;return e.x-t.width/2<x?(s="-left",c=Math.max(0,x-e.x)):e.x+t.width/2>n.width-x&&(s="-right",c=-Math.max(0,e.x-(n.width-x))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var C="maplibre-gl-worker.mjs",M=e=>`/maplibre-gl/${e}/${C}`,L=null;function $(){return L??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(M(e.getVersion())),e)).catch(e=>{throw L=null,e}),L}var E=24,S=28,j=29;function A(e){const t=[...e].sort((e,t)=>e-t),n=[];for(let e=0;e<t.length;){let r=e;for(;r+1<t.length&&t[r+1]===t[r]+1;)r++;n.push(r===e?String(t[e]):`${t[e]}–${t[r]}`),e=r+1}return n.join(", ")}function z(e){const t=Math.max(S,12+8*e.length);return t+t%2}var R=(e,t,n,r)=>({left:e-n/2,top:t-r/2,right:e+n/2,bottom:t+r/2});function B(e,t){return e.left<t.right+1&&t.left<e.right+1&&e.top<t.bottom+1&&t.top<e.bottom+1}var T=e=>R(e.x,e.y,e.width,e.height);function O(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(T(e[t]),T(e[n])))return[e[t],e[n]];return null}function W(e,t=[]){const n=[],r=e=>t.some(t=>B(t,e));let o=e.filter(e=>null!==e.stop).sort((e,t)=>e.stop-t.stop).map(e=>({keys:[e.key],stops:[e.stop],x:e.x,y:e.y,width:S,height:S,under:0}));for(let e=O(o);e;e=O(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=z(A(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(T(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=R(t.x,t.y,E,E),l=o.find(t=>B(T(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(T(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:E,height:E,under:0})}return{groups:[...o,...a],hidden:n}}function K(e,t,n){let r=-1/0;for(const o of t){const t=Math.max(Math.abs(o.x-e.x),Math.abs(o.y-e.y));r=Math.max(r,0===t?1/0:n+Math.log2(29/t))}return r}function F(e){const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:n}),()=>t.disconnect()}var q=t;var _="routes",P=["routes-road","routes-estimate"];function H(e){const t=document.createElement("span");t.style.display="none",t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color||"#2563eb";return t.remove(),I(n)}function I(e){const t=document.createElement("canvas").getContext("2d");if(!t)return"#2563eb";t.fillStyle="#2563eb",t.fillStyle=e,t.fillRect(0,0,1,1);const[n,r,o]=t.getImageData(0,0,1,1).data;return`rgb(${n}, ${r}, ${o})`}var D={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},Q={center:[30,20],zoom:1},Z="ring-2 ring-gray-900 ring-offset-2";var G="var(--color-gray-600, #4b5563)",J="http://www.w3.org/2000/svg",U=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,V=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function Y(e){return e.split(/\s+/).some(e=>{const t=e.search(/[[(]/),n=t<0?e:e.slice(0,t),r=e.slice(n.lastIndexOf(":")+1);return r.startsWith("border-")&&!V.test(r.slice(7))})}var X=(...e)=>e.filter(Boolean).join(" ");function ee(e){const t=document.createElementNS(J,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("aria-hidden","true");for(const n of e){const e=document.createElementNS(J,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function te(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var ne=(e,t)=>X("relative grid place-items-center rounded-full cursor-pointer",t&&(null!=e.stop?"h-7 w-7":"h-6 w-6"));function re(e,t,n,r){const o=t&&!r&&null==e.stop&&!e.dot;return X("grid place-items-center rounded-full border-2 font-semibold leading-none shadow-sm transition-transform motion-reduce:transition-none",!Y(e.tone)&&"border-white",e.tone,e.dot?"h-4 w-4 opacity-80":null!=e.stop?"h-7 w-7 text-xs ring-2 ring-gray-900":o?"h-8 w-8 text-xs [&_svg]:h-4 [&_svg]:w-4":"h-6 w-6 text-2xs [&_svg]:h-3.5 [&_svg]:w-3.5",t&&(o?"ring-2 ring-gray-900 ring-offset-1":Z),e.approximate&&"border-dashed opacity-80",e.faded&&!t&&"opacity-40",n&&"scale-125 opacity-100")}var oe=e=>X("grid place-items-center border-2 px-0.5 text-xs font-semibold leading-none shadow-sm",e.stop?"h-7 min-w-7":"h-6 min-w-6",!Y(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function ae({pins:t,selectedKey:n,focus:o,onSelect:c,ariaLabel:h,className:g="",children:f,routes:b,fitTo:x,attribution:v,marks:C,groupCrowded:M=!1,noun:L,highlightKey:j=null,picking:z=!1,onPick:R,card:B,cardMinMapWidth:T=480,fullScreen:O,initialView:J=Q,cooperativeGestures:V=!1}){const Y=r().map,ae=a(null),se=a(null),ce=a(null),ue=a(null),de=a([]),pe=a(/* @__PURE__ */new Map),me=a(/* @__PURE__ */new Map),he=a(/* @__PURE__ */new Map),ge=a(null),fe=a(/* @__PURE__ */new Map),ye=a(""),[be,xe]=l(!1),[ve,we]=l(!1),ke=u(F,q,()=>!1)?"dark":"light",Ne=a({onSelect:c,onPick:R,picking:z,pins:t,selectedKey:n,highlightKey:j,groupCrowded:M,strings:Y,noun:L});i(()=>{Ne.current={onSelect:c,onPick:R,picking:z,pins:t,selectedKey:n,highlightKey:j,groupCrowded:M,strings:Y,noun:L}});const Ce=s(()=>{const e=ce.current,{pins:t,selectedKey:n}=Ne.current,r=n?t.find(e=>e.key===n):void 0;e&&r&&!e.getBounds().contains([r.lng,r.lat])&&e.easeTo({center:[r.lng,r.lat],duration:U()?0:400})},[]),Me=a(!1),Le=s((e,t)=>{const n=ce.current,r=ue.current;if(!n||!r)return;const o=n.getZoom();if(o>=17.5){const t=e.indexOf(Ne.current.selectedKey??"");return void Ne.current.onSelect(e[(t+1)%e.length])}const a=e.map(e=>pe.current.get(e).pin),l=new r.LngLatBounds([a[0].lng,a[0].lat],[a[0].lng,a[0].lat]);for(const e of a)l.extend([e.lng,e.lat]);const i=a.map(e=>n.project([e.lng,e.lat])),s=Math.max(...i.map((e,t)=>K(e,i.filter((e,n)=>n!==t),o))),{clientWidth:c,clientHeight:u}=n.getContainer(),d=n.cameraForBounds(l,{padding:Math.min(64,c/4,u/4)})?.zoom??18,p=document.activeElement===t;Me.current=!0,n.once("moveend",()=>{if(Me.current=!1,!p)return;const e=a[0].key,t=pe.current.get(e)?.button,n=t&&"none"!==t.style.display?t:[...me.current.values()].find(t=>t.keys.includes(e))?.button;n?.focus({preventScroll:!0})}),n.easeTo({center:l.getCenter(),zoom:Math.min(18,Math.max(o+1,Math.min(d,s))),duration:U()?0:600})},[]),$e=s(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ae.current||Me.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Ne.current;for(const[e,t]of pe.current){const a=re(t.pin,e===n,e===r,o);t.mark.className!==a&&(t.mark.className=a);const l=e===n?"1":"";t.button.style.zIndex!==l&&(t.button.style.zIndex=l)}let i=null;if(o){const r=e.getContainer().getBoundingClientRect(),o=[...ae.current.querySelectorAll("a[href], button, input, select, textarea, summary, [role='button'], [tabindex]:not([tabindex='-1'])")].filter(e=>!e.closest("[data-pin], [data-pin-group], .maplibregl-canvas")).map(e=>{const t=e.getBoundingClientRect(),n=e.closest("[data-map-card]")?.getBoundingClientRect()??t;return{left:Math.max(t.left,n.left)-r.left,top:Math.max(t.top,n.top)-r.top,right:Math.min(t.right,n.right)-r.left,bottom:Math.min(t.bottom,n.bottom)-r.top}}).filter(e=>e.right>e.left&&e.bottom>e.top);i=W([...pe.current.values()].map(({pin:t})=>{const n=e.project([t.lng,t.lat]);return{key:t.key,x:n.x,y:n.y,stop:t.stop??null}}),o);const s=e=>(l??a.places)(e),c=e.getZoom()<17.5?a.spread:a.cycle,u=(e,t)=>{const n=t?"":"none";e.style.display!==n&&(e.style.display=n)},d=/* @__PURE__ */new Map;for(const r of i.groups){const o=r.under>0?a.closeBy(r.under,s(r.under)):null,l=1===r.keys.length?pe.current.get(r.keys[0]):null;if(l){u(l.button,!0),l.button.setAttribute("aria-label",o?`${l.name}; ${o}`:l.name),l.button.title=o?`${l.title}\n${o}`:l.title;continue}for(const e of r.keys)u(pe.current.get(e).button,!1);const i=r.keys.join(" ");let p=me.current.get(i);if(!p){const n=document.createElement("button");n.type="button",n.dataset.pinGroup="",n.className="grid place-items-center rounded-full cursor-pointer",n.append(document.createElement("span"));const o=pe.current.get(r.keys[0]).pin,a={button:n,keys:r.keys,marker:new t.Marker({element:n,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)};n.addEventListener("click",e=>{e.stopPropagation(),Le(a.keys,n)}),p=a}p.keys=r.keys;const m=r.keys.map(e=>pe.current.get(e)),h=r.stops.length>0?A(r.stops):String(m.length),g=r.stops.length>0?a.stops(h):a.group(m.length,s(m.length));p.button.style.width=`${r.width}px`,p.button.style.height=`${r.height}px`,p.button.setAttribute("aria-label",`${g}: ${m.map(e=>e.pin.label).join("; ")}. ${c}${o?`; ${o}`:""}.`),p.button.title=[`${g}:`,...m.map(e=>e.title),...o?[o]:[],c].join("\n");const f=p.button.firstElementChild;f.textContent=h;const y=X("grid place-items-center rounded-full border-2 border-gray-700 bg-white font-semibold leading-none text-gray-900 shadow-sm",r.stops.length>0?"h-7 w-full px-1 text-xs ring-2 ring-gray-900":m.every(e=>e.pin.dot)?"h-5 w-5 text-3xs":"h-6 w-6 text-2xs",null!=n&&r.keys.includes(n)&&Z);f.className!==y&&(f.className=y),d.set(i,p)}for(const e of i.hidden)u(pe.current.get(e).button,!1);for(const[e,t]of me.current)d.has(e)||t.marker.remove();me.current=d}if(ge.current){const e=r&&i?i.groups.find(e=>e.keys.includes(r)&&e.keys.length>1):void 0,t=r?pe.current.get(r):void 0,n=r?he.current.get(r):void 0,o=e?{at:pe.current.get(e.keys[0]).pin,width:e.width,height:e.height}:t?{at:t.pin,width:t.button.offsetWidth||(null!=t.pin.stop?S:E),height:t.button.offsetHeight||(null!=t.pin.stop?S:E)}:n?{at:n.mark,width:n.element.offsetWidth||S,height:n.element.offsetHeight||S}:null,a=ge.current.getElement();a.style.display=o?"":"none",o&&(ge.current.setLngLat([o.at.lng,o.at.lat]),a.style.width=`${o.width+22}px`,a.style.height=`${o.height+22}px`)}},[Le]);i(()=>{if($e(),!ae.current)return;const e=new ResizeObserver(()=>$e());e.observe(ae.current);for(const t of ae.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),i(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await $();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:D[ke],center:J.center,zoom:J.zoom,attributionControl:v?{compact:!0,customAttribution:v}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===V?window.matchMedia("(pointer: coarse)").matches:V}),t.touchZoomRotate.disableRotation(),t.keyboard.disableRotation(),t.addControl(new o.NavigationControl({showCompass:!1}),"top-right");const a=document.createElement("div");a.dataset.pinRing="",a.setAttribute("aria-hidden","true"),a.className="pointer-events-none rounded-full border-2 border-gray-900 bg-gray-900/15 shadow-[0_0_0_2px_var(--color-white,#fff)]",a.style.display="none",ge.current=new o.Marker({element:a,anchor:"center"}).setLngLat(J.center).addTo(t),t.on("click",e=>{Ne.current.picking&&Ne.current.onPick?.({lat:e.lngLat.lat,lng:e.lngLat.lng})}),t.on("move",$e),t.on("moveend",$e),t.on("resize",$e),t.on("error",e=>console.warn("[map]",e.error?.message)),r=y(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ce()}),n.observe(se.current),ce.current=t,xe(!0)}catch(t){console.error("[map] could not start",t),e||we(!0)}})(),()=>{e=!0,n?.disconnect(),r(),de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),ge.current?.remove(),ge.current=null,t?.remove(),ce.current=null}},[]);const Ee=a(ke);i(()=>{be&&ce.current&&Ee.current!==ke&&(Ee.current=ke,ce.current.setStyle(D[ke]))},[be,ke]),i(()=>{const e=ce.current,n=ue.current;if(!be||!e||!n)return;de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),pe.current.clear(),he.current.clear();for(const e of fe.current.keys())t.some(t=>t.key===e)||fe.current.delete(e);const r=Ne.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=ne(o,M);const a=o.approximate?r.approximate(o.label):o.label,l=o.title??(o.approximate?r.approximateTitle(o.label):o.label);t.setAttribute("aria-label",a),t.title=l;const i=document.createElement("span");if(te(i,o.data),o.dot);else if(null!=o.iconNode){const e=fe.current.get(o.key);e&&i.append(e)}else o.icon?.length?i.append(ee(o.icon)):i.textContent=null!=o.stop?String(o.stop):o.glyph;if(t.append(i),o.badge){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className=X("absolute -right-2 -top-2 grid h-4 min-w-4 place-items-center rounded-full px-0.5 text-3xs font-semibold leading-none shadow",o.badgeTone??"bg-white text-gray-900"),e.textContent=o.badge,t.appendChild(e)}t.addEventListener("click",e=>{e.stopPropagation(),Ne.current.onSelect(o.key)}),de.current.push(new n.Marker({element:t,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)),pe.current.set(o.key,{pin:o,button:t,mark:i,name:a,title:l})}for(const t of C??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,te(r,t.data),r.className=oe(t),r.textContent=t.text,r.title=t.title??t.label,r.setAttribute("role","img"),r.setAttribute("aria-label",t.label),de.current.push(new n.Marker({element:r,anchor:"center"}).setLngLat([t.lng,t.lat]).addTo(e)),he.current.set(t.key,{mark:t,element:r})}$e()},[be,t,C,M,$e]),i(()=>{be&&$e()},[be,n,j,$e]),i(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ce);return()=>cancelAnimationFrame(e)},[be,n,Ce]),i(()=>{const e=ce.current,n=ue.current,r=x?[...t,...C??[]].filter(e=>x.includes(e.key)):t;if(!be||!e||!n||0===r.length)return;const o=r.map(e=>`${e.key}@${e.lat},${e.lng}`).sort().join("|");if(ye.current===o)return;const a=""===ye.current;if(ye.current=o,1===r.length)return void e.jumpTo({center:[r[0].lng,r[0].lat],zoom:13});const l=new n.LngLatBounds([r[0].lng,r[0].lat],[r[0].lng,r[0].lat]);for(const e of r)l.extend([e.lng,e.lat]);e.fitBounds(l,{padding:48,maxZoom:14,animate:!a})},[be,t,C,x]),i(()=>{const e=ce.current;if(!be||!e)return;const t=(b??[]).filter(e=>e.coordinates.length>=2),n=[...new Set(t.flatMap(e=>e.attribution?[e.attribution]:[]))].join(" · "),r=()=>{const r=function(){const e=document.createElement("span");e.className="text-blue-600",e.style.display="none",document.body.appendChild(e);const t=getComputedStyle(e).color||"#2563eb";return e.remove(),I(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?H(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(_);if(i&&(i.attribution||"")!==n){for(const t of P)e.getLayer(t)&&e.removeLayer(t);e.removeSource(_)}const s=e.getSource(_);s?s.setData(o):e.addSource(_,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:_,filter:["!",["get","estimate"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":4,"line-opacity":a}}),e.getLayer("routes-estimate")||e.addLayer({id:"routes-estimate",type:"line",source:_,filter:["get","estimate"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":3,"line-dasharray":[1.5,1.5],"line-opacity":a}})},o=()=>{try{r()}catch(e){console.debug("[map] routes wait for the style",e)}};return o(),e.on("style.load",o),e.once("idle",o),()=>{e.off("style.load",o),e.off("idle",o)}},[be,b,ke]),i(()=>{const e=ce.current;if(!be||!e||!o)return;const n=t.find(e=>e.key===o.key);if(!n)return;const r=e.getZoom(),a=M?K(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,l={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,a))};U()?e.jumpTo(l):e.flyTo({...l,duration:600})},[be,o?.n]);const[Se,je]=l(!1);i(()=>{const e=ae.current;if(!e)return;const t=()=>je(e.clientWidth<T);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[T]);const Ae=n?t.find(e=>e.key===n)??null:null,ze=Ae?.key??null,Re=Ae?.lng??0,Be=Ae?.lat??0,Te=be&&!Se&&null!=B&&!!Ae,[Oe,We]=l(null);i(()=>{const e=ce.current,t=ue.current;if(!(Te&&e&&t&&ze))return;const n=document.createElement("div");n.dataset.mapCard="",n.className="w-[26rem] overflow-y-auto overscroll-contain";const r=new t.Popup({anchor:"bottom",offset:w,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Re,Be]).setDOMContent(n).addTo(e),o=r.getElement(),a=o.querySelector(".maplibregl-popup-content");a&&Object.assign(a.style,{padding:"0",background:"transparent",borderRadius:"0",boxShadow:"none"});const l=o.querySelector(".maplibregl-popup-tip");l&&Object.assign(l.style,{borderTopColor:G,borderBottomColor:G}),We(n);let i=!1,s=!1;const c=(t=!0)=>{if(s)return;if(e.isMoving())return void(i||(i=!0,e.once("moveend",()=>{i=!1,c()})));const{clientWidth:o,clientHeight:a}=e.getContainer(),l=function(e,t){const n=e.getBoundingClientRect().top,r=[...e.querySelectorAll(".maplibregl-ctrl-top-left > *, .maplibregl-ctrl-top-right > *"),...t?.querySelectorAll(":scope > [data-map-control]")??[]];let o=0;for(const e of r){const t=e.getBoundingClientRect();t.height>0&&(o=Math.max(o,t.bottom-n))}return o}(e.getContainer(),ae.current)+8,u=`${k(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=N(e.project(p),{width:d.offsetWidth,height:d.offsetHeight},{width:o,height:a},l);r.options.anchor!==m&&(r.options.anchor=m,r.setLngLat(p)),!t||0===h.x&&0===h.y||e.panBy([-h.x,-h.y],{duration:U()?0:250}),$e()},u=new ResizeObserver(()=>c());u.observe(n);const d=()=>c(),p=()=>{i||c(!1)};e.on("resize",d),e.on("moveend",p);let m=!1;const h=pe.current,g=e=>{m=n.contains(e.target)};return document.addEventListener("focusin",g),()=>{if(s=!0,u.disconnect(),e.off("resize",d),e.off("moveend",p),document.removeEventListener("focusin",g),r.remove(),We(null),m&&(!document.activeElement||document.activeElement===document.body)){const e=h.get(ze)?.button;e&&"none"!==e.style.display&&e.focus({preventScroll:!0})}}},[Te,ze,Re,Be,$e]);const Ke=O?.active??!1,Fe=a(O?.onChange);i(()=>{Fe.current=O?.onChange}),i(()=>{if(!O)return;const e=document.documentElement;Ke&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!Ke&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Ke]);const qe=!!O;return i(()=>{if(!qe)return;const e=()=>{document.fullscreenElement||Fe.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[qe]),/* @__PURE__ */p("div",{ref:ae,className:X("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",z&&"[&_canvas]:cursor-crosshair",g),children:[
|
|
3
|
-
/* @__PURE__ */m("div",{className:"absolute inset-0",children:/* @__PURE__ */m("div",{ref:se,className:"h-full w-full",role:"region","aria-label":h})}),ve&&/* @__PURE__ */m("p",{className:"absolute inset-0 grid place-items-center p-6 text-center text-sm text-gray-500",children:
|
|
2
|
+
import{Button_default as e}from"../chunk-IJ7RXIWX.js";import"../chunk-JTNKC4CR.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-7IQ3B77H.js";import"../chunk-FIEA5CGB.js";import"../chunk-D65T4H6J.js";import{useShellStrings as r}from"../chunk-QRCDQPJA.js";import"../chunk-C3QOHMR6.js";import{Icon as o}from"../chunk-ZGUQLVY4.js";import{useRef as a,useState as l,useEffect as i,useCallback as s,useMemo as c,useSyncExternalStore as u}from"react";import{createPortal as d}from"react-dom";import{jsxs as p,jsx as m,Fragment as h}from"react/jsx-runtime";import{useQuery as g}from"@tanstack/react-query";var f="maplibregl-compact-show";function y(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(f)&&(e.classList.remove(f),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var b=20,x=12,v=480,w={center:[0,0],left:[b,0],right:[-20,0],top:[0,b],"top-left":[0,b],"top-right":[0,b],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},k=(e,t=12)=>Math.max(0,Math.floor(e-t-x-b-10-16));function N(e,t,n,r=12){const o=e.y-b-r,a=n.height-e.y-b-x,l=t.height<=o||t.height>a&&o>=a,i=l?Math.max(0,t.height-o):-Math.max(0,t.height-a);let s="",c=0;return e.x-t.width/2<x?(s="-left",c=Math.max(0,x-e.x)):e.x+t.width/2>n.width-x&&(s="-right",c=-Math.max(0,e.x-(n.width-x))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var C="maplibre-gl-worker.mjs",M=e=>`/maplibre-gl/${e}/${C}`,L=null;function $(){return L??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(M(e.getVersion())),e)).catch(e=>{throw L=null,e}),L}var E=24,S=28,j=29;function A(e){const t=[...e].sort((e,t)=>e-t),n=[];for(let e=0;e<t.length;){let r=e;for(;r+1<t.length&&t[r+1]===t[r]+1;)r++;n.push(r===e?String(t[e]):`${t[e]}–${t[r]}`),e=r+1}return n.join(", ")}function z(e){const t=Math.max(S,12+8*e.length);return t+t%2}var R=(e,t,n,r)=>({left:e-n/2,top:t-r/2,right:e+n/2,bottom:t+r/2});function B(e,t){return e.left<t.right+1&&t.left<e.right+1&&e.top<t.bottom+1&&t.top<e.bottom+1}var T=e=>R(e.x,e.y,e.width,e.height);function O(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(T(e[t]),T(e[n])))return[e[t],e[n]];return null}function W(e,t=[]){const n=[],r=e=>t.some(t=>B(t,e));let o=e.filter(e=>null!==e.stop).sort((e,t)=>e.stop-t.stop).map(e=>({keys:[e.key],stops:[e.stop],x:e.x,y:e.y,width:S,height:S,under:0}));for(let e=O(o);e;e=O(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=z(A(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(T(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=R(t.x,t.y,E,E),l=o.find(t=>B(T(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(T(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:E,height:E,under:0})}return{groups:[...o,...a],hidden:n}}function F(e,t,n){let r=-1/0;for(const o of t){const t=Math.max(Math.abs(o.x-e.x),Math.abs(o.y-e.y));r=Math.max(r,0===t?1/0:n+Math.log2(29/t))}return r}function K(e){const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:n}),()=>t.disconnect()}var q=t;var _="routes",P=["routes-road","routes-estimate"];function H(e){const t=document.createElement("span");t.style.display="none",t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color||"#2563eb";return t.remove(),I(n)}function I(e){const t=document.createElement("canvas").getContext("2d");if(!t)return"#2563eb";t.fillStyle="#2563eb",t.fillStyle=e,t.fillRect(0,0,1,1);const[n,r,o]=t.getImageData(0,0,1,1).data;return`rgb(${n}, ${r}, ${o})`}var D={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},Z={center:[30,20],zoom:1},G="ring-2 ring-gray-900 ring-offset-2";var Q="var(--color-gray-600, #4b5563)",J="http://www.w3.org/2000/svg",U=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,V=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function X(e){return e.split(/\s+/).some(e=>{const t=e.search(/[[(]/),n=t<0?e:e.slice(0,t),r=e.slice(n.lastIndexOf(":")+1);return r.startsWith("border-")&&!V.test(r.slice(7))})}var Y=(...e)=>e.filter(Boolean).join(" ");function ee(e){const t=document.createElementNS(J,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("aria-hidden","true");for(const n of e){const e=document.createElementNS(J,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function te(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var ne=(e,t)=>Y("relative grid place-items-center rounded-full cursor-pointer",t&&(null!=e.stop?"h-7 w-7":"h-6 w-6"));function re(e,t,n,r){const o=t&&!r&&null==e.stop&&!e.dot;return Y("grid place-items-center rounded-full border-2 font-semibold leading-none shadow-sm transition-transform motion-reduce:transition-none",!X(e.tone)&&"border-white",e.tone,e.dot?"h-4 w-4 opacity-80":null!=e.stop?"h-7 w-7 text-xs ring-2 ring-gray-900":o?"h-8 w-8 text-xs [&_svg]:h-4 [&_svg]:w-4":"h-6 w-6 text-2xs [&_svg]:h-3.5 [&_svg]:w-3.5",t&&(o?"ring-2 ring-gray-900 ring-offset-1":G),e.approximate&&"border-dashed opacity-80",e.faded&&!t&&"opacity-40",n&&"scale-125 opacity-100")}var oe=e=>Y("grid place-items-center border-2 px-0.5 text-xs font-semibold leading-none shadow-sm",e.stop?"h-7 min-w-7":"h-6 min-w-6",!X(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function ae({pins:t,selectedKey:n,focus:o,onSelect:c,ariaLabel:h,className:g="",children:f,routes:b,fitTo:x,attribution:v,marks:C,groupCrowded:M=!1,noun:L,highlightKey:j=null,picking:z=!1,onPick:R,card:B,cardMinMapWidth:T=480,fullScreen:O,initialView:J=Z,cooperativeGestures:V=!1}){const X=r().map,ae=a(null),se=a(null),ce=a(null),ue=a(null),de=a([]),pe=a(/* @__PURE__ */new Map),me=a(/* @__PURE__ */new Map),he=a(/* @__PURE__ */new Map),ge=a(null),fe=a(/* @__PURE__ */new Map),ye=a(""),[be,xe]=l(!1),[ve,we]=l(!1),ke=u(K,q,()=>!1)?"dark":"light",Ne=a({onSelect:c,onPick:R,picking:z,pins:t,selectedKey:n,highlightKey:j,groupCrowded:M,strings:X,noun:L});i(()=>{Ne.current={onSelect:c,onPick:R,picking:z,pins:t,selectedKey:n,highlightKey:j,groupCrowded:M,strings:X,noun:L}});const Ce=s(()=>{const e=ce.current,{pins:t,selectedKey:n}=Ne.current,r=n?t.find(e=>e.key===n):void 0;e&&r&&!e.getBounds().contains([r.lng,r.lat])&&e.easeTo({center:[r.lng,r.lat],duration:U()?0:400})},[]),Me=a(!1),Le=s((e,t)=>{const n=ce.current,r=ue.current;if(!n||!r)return;const o=n.getZoom();if(o>=17.5){const t=e.indexOf(Ne.current.selectedKey??"");return void Ne.current.onSelect(e[(t+1)%e.length])}const a=e.map(e=>pe.current.get(e).pin),l=new r.LngLatBounds([a[0].lng,a[0].lat],[a[0].lng,a[0].lat]);for(const e of a)l.extend([e.lng,e.lat]);const i=a.map(e=>n.project([e.lng,e.lat])),s=Math.max(...i.map((e,t)=>F(e,i.filter((e,n)=>n!==t),o))),{clientWidth:c,clientHeight:u}=n.getContainer(),d=n.cameraForBounds(l,{padding:Math.min(64,c/4,u/4)})?.zoom??18,p=document.activeElement===t;Me.current=!0,n.once("moveend",()=>{if(Me.current=!1,!p)return;const e=a[0].key,t=pe.current.get(e)?.button,n=t&&"none"!==t.style.display?t:[...me.current.values()].find(t=>t.keys.includes(e))?.button;n?.focus({preventScroll:!0})}),n.easeTo({center:l.getCenter(),zoom:Math.min(18,Math.max(o+1,Math.min(d,s))),duration:U()?0:600})},[]),$e=s(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ae.current||Me.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Ne.current;for(const[e,t]of pe.current){const a=re(t.pin,e===n,e===r,o);t.mark.className!==a&&(t.mark.className=a);const l=e===n?"1":"";t.button.style.zIndex!==l&&(t.button.style.zIndex=l)}let i=null;if(o){const r=e.getContainer().getBoundingClientRect(),o=[...ae.current.querySelectorAll("a[href], button, input, select, textarea, summary, [role='button'], [tabindex]:not([tabindex='-1'])")].filter(e=>!e.closest("[data-pin], [data-pin-group], .maplibregl-canvas")).map(e=>{const t=e.getBoundingClientRect(),n=e.closest("[data-map-card]")?.getBoundingClientRect()??t;return{left:Math.max(t.left,n.left)-r.left,top:Math.max(t.top,n.top)-r.top,right:Math.min(t.right,n.right)-r.left,bottom:Math.min(t.bottom,n.bottom)-r.top}}).filter(e=>e.right>e.left&&e.bottom>e.top);i=W([...pe.current.values()].map(({pin:t})=>{const n=e.project([t.lng,t.lat]);return{key:t.key,x:n.x,y:n.y,stop:t.stop??null}}),o);const s=e=>(l??a.places)(e),c=e.getZoom()<17.5?a.spread:a.cycle,u=(e,t)=>{const n=t?"":"none";e.style.display!==n&&(e.style.display=n)},d=/* @__PURE__ */new Map;for(const r of i.groups){const o=r.under>0?a.closeBy(r.under,s(r.under)):null,l=1===r.keys.length?pe.current.get(r.keys[0]):null;if(l){u(l.button,!0),l.button.setAttribute("aria-label",o?`${l.name}; ${o}`:l.name),l.button.title=o?`${l.title}\n${o}`:l.title;continue}for(const e of r.keys)u(pe.current.get(e).button,!1);const i=r.keys.join(" ");let p=me.current.get(i);if(!p){const n=document.createElement("button");n.type="button",n.dataset.pinGroup="",n.className="grid place-items-center rounded-full cursor-pointer",n.append(document.createElement("span"));const o=pe.current.get(r.keys[0]).pin,a={button:n,keys:r.keys,marker:new t.Marker({element:n,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)};n.addEventListener("click",e=>{e.stopPropagation(),Le(a.keys,n)}),p=a}p.keys=r.keys;const m=r.keys.map(e=>pe.current.get(e)),h=r.stops.length>0?A(r.stops):String(m.length),g=r.stops.length>0?a.stops(h):a.group(m.length,s(m.length));p.button.style.width=`${r.width}px`,p.button.style.height=`${r.height}px`,p.button.setAttribute("aria-label",`${g}: ${m.map(e=>e.pin.label).join("; ")}. ${c}${o?`; ${o}`:""}.`),p.button.title=[`${g}:`,...m.map(e=>e.title),...o?[o]:[],c].join("\n");const f=p.button.firstElementChild;f.textContent=h;const y=Y("grid place-items-center rounded-full border-2 border-gray-700 bg-white font-semibold leading-none text-gray-900 shadow-sm",r.stops.length>0?"h-7 w-full px-1 text-xs ring-2 ring-gray-900":m.every(e=>e.pin.dot)?"h-5 w-5 text-3xs":"h-6 w-6 text-2xs",null!=n&&r.keys.includes(n)&&G);f.className!==y&&(f.className=y),d.set(i,p)}for(const e of i.hidden)u(pe.current.get(e).button,!1);for(const[e,t]of me.current)d.has(e)||t.marker.remove();me.current=d}if(ge.current){const e=r&&i?i.groups.find(e=>e.keys.includes(r)&&e.keys.length>1):void 0,t=r?pe.current.get(r):void 0,n=r?he.current.get(r):void 0,o=e?{at:pe.current.get(e.keys[0]).pin,width:e.width,height:e.height}:t?{at:t.pin,width:t.button.offsetWidth||(null!=t.pin.stop?S:E),height:t.button.offsetHeight||(null!=t.pin.stop?S:E)}:n?{at:n.mark,width:n.element.offsetWidth||S,height:n.element.offsetHeight||S}:null,a=ge.current.getElement();a.style.display=o?"":"none",o&&(ge.current.setLngLat([o.at.lng,o.at.lat]),a.style.width=`${o.width+22}px`,a.style.height=`${o.height+22}px`)}},[Le]);i(()=>{if($e(),!ae.current)return;const e=new ResizeObserver(()=>$e());e.observe(ae.current);for(const t of ae.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),i(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await $();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:D[ke],center:J.center,zoom:J.zoom,attributionControl:v?{compact:!0,customAttribution:v}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===V?window.matchMedia("(pointer: coarse)").matches:V}),t.touchZoomRotate.disableRotation(),t.keyboard.disableRotation(),t.addControl(new o.NavigationControl({showCompass:!1}),"top-right");const a=document.createElement("div");a.dataset.pinRing="",a.setAttribute("aria-hidden","true"),a.className="pointer-events-none rounded-full border-2 border-gray-900 bg-gray-900/15 shadow-[0_0_0_2px_var(--color-white,#fff)]",a.style.display="none",ge.current=new o.Marker({element:a,anchor:"center"}).setLngLat(J.center).addTo(t),t.on("click",e=>{Ne.current.picking&&Ne.current.onPick?.({lat:e.lngLat.lat,lng:e.lngLat.lng})}),t.on("move",$e),t.on("moveend",$e),t.on("resize",$e),t.on("error",e=>console.warn("[map]",e.error?.message)),r=y(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ce()}),n.observe(se.current),ce.current=t,xe(!0)}catch(t){console.error("[map] could not start",t),e||we(!0)}})(),()=>{e=!0,n?.disconnect(),r(),de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),ge.current?.remove(),ge.current=null,t?.remove(),ce.current=null}},[]);const Ee=a(ke);i(()=>{be&&ce.current&&Ee.current!==ke&&(Ee.current=ke,ce.current.setStyle(D[ke]))},[be,ke]),i(()=>{const e=ce.current,n=ue.current;if(!be||!e||!n)return;de.current.forEach(e=>e.remove()),de.current=[],me.current.forEach(e=>e.marker.remove()),me.current.clear(),pe.current.clear(),he.current.clear();for(const e of fe.current.keys())t.some(t=>t.key===e)||fe.current.delete(e);const r=Ne.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=ne(o,M);const a=o.approximate?r.approximate(o.label):o.label,l=o.title??(o.approximate?r.approximateTitle(o.label):o.label);t.setAttribute("aria-label",a),t.title=l;const i=document.createElement("span");if(te(i,o.data),o.dot);else if(null!=o.iconNode){const e=fe.current.get(o.key);e&&i.append(e)}else o.icon?.length?i.append(ee(o.icon)):i.textContent=null!=o.stop?String(o.stop):o.glyph;if(t.append(i),o.badge){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className=Y("absolute -right-2 -top-2 grid h-4 min-w-4 place-items-center rounded-full px-0.5 text-3xs font-semibold leading-none shadow",o.badgeTone??"bg-white text-gray-900"),e.textContent=o.badge,t.appendChild(e)}t.addEventListener("click",e=>{e.stopPropagation(),Ne.current.onSelect(o.key)}),de.current.push(new n.Marker({element:t,anchor:"center"}).setLngLat([o.lng,o.lat]).addTo(e)),pe.current.set(o.key,{pin:o,button:t,mark:i,name:a,title:l})}for(const t of C??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,te(r,t.data),r.className=oe(t),r.textContent=t.text,r.title=t.title??t.label,r.setAttribute("role","img"),r.setAttribute("aria-label",t.label),de.current.push(new n.Marker({element:r,anchor:"center"}).setLngLat([t.lng,t.lat]).addTo(e)),he.current.set(t.key,{mark:t,element:r})}$e()},[be,t,C,M,$e]),i(()=>{be&&$e()},[be,n,j,$e]),i(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ce);return()=>cancelAnimationFrame(e)},[be,n,Ce]),i(()=>{const e=ce.current,n=ue.current,r=x?[...t,...C??[]].filter(e=>x.includes(e.key)):t;if(!be||!e||!n||0===r.length)return;const o=r.map(e=>`${e.key}@${e.lat},${e.lng}`).sort().join("|");if(ye.current===o)return;const a=""===ye.current;if(ye.current=o,1===r.length)return void e.jumpTo({center:[r[0].lng,r[0].lat],zoom:13});const l=new n.LngLatBounds([r[0].lng,r[0].lat],[r[0].lng,r[0].lat]);for(const e of r)l.extend([e.lng,e.lat]);e.fitBounds(l,{padding:48,maxZoom:14,animate:!a})},[be,t,C,x]),i(()=>{const e=ce.current;if(!be||!e)return;const t=(b??[]).filter(e=>e.coordinates.length>=2),n=[...new Set(t.flatMap(e=>e.attribution?[e.attribution]:[]))].join(" · "),r=()=>{const r=function(){const e=document.createElement("span");e.className="text-blue-600",e.style.display="none",document.body.appendChild(e);const t=getComputedStyle(e).color||"#2563eb";return e.remove(),I(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?H(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(_);if(i&&(i.attribution||"")!==n){for(const t of P)e.getLayer(t)&&e.removeLayer(t);e.removeSource(_)}const s=e.getSource(_);s?s.setData(o):e.addSource(_,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:_,filter:["!",["get","estimate"]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":4,"line-opacity":a}}),e.getLayer("routes-estimate")||e.addLayer({id:"routes-estimate",type:"line",source:_,filter:["get","estimate"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":l,"line-width":3,"line-dasharray":[1.5,1.5],"line-opacity":a}})},o=()=>{try{r()}catch(e){console.debug("[map] routes wait for the style",e)}};return o(),e.on("style.load",o),e.once("idle",o),()=>{e.off("style.load",o),e.off("idle",o)}},[be,b,ke]),i(()=>{const e=ce.current;if(!be||!e||!o)return;const n=t.find(e=>e.key===o.key);if(!n)return;const r=e.getZoom(),a=M?F(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,l={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,a))};U()?e.jumpTo(l):e.flyTo({...l,duration:600})},[be,o?.n]);const[Se,je]=l(!1);i(()=>{const e=ae.current;if(!e)return;const t=()=>je(e.clientWidth<T);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[T]);const Ae=n?t.find(e=>e.key===n)??null:null,ze=Ae?.key??null,Re=Ae?.lng??0,Be=Ae?.lat??0,Te=be&&!Se&&null!=B&&!!Ae,[Oe,We]=l(null);i(()=>{const e=ce.current,t=ue.current;if(!(Te&&e&&t&&ze))return;const n=document.createElement("div");n.dataset.mapCard="",n.className="w-[26rem] overflow-y-auto overscroll-contain";const r=new t.Popup({anchor:"bottom",offset:w,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Re,Be]).setDOMContent(n).addTo(e),o=r.getElement(),a=o.querySelector(".maplibregl-popup-content");a&&Object.assign(a.style,{padding:"0",background:"transparent",borderRadius:"0",boxShadow:"none"});const l=o.querySelector(".maplibregl-popup-tip");l&&Object.assign(l.style,{borderTopColor:Q,borderBottomColor:Q}),We(n);let i=!1,s=!1;const c=(t=!0)=>{if(s)return;if(e.isMoving())return void(i||(i=!0,e.once("moveend",()=>{i=!1,c()})));const{clientWidth:o,clientHeight:a}=e.getContainer(),l=function(e,t){const n=e.getBoundingClientRect().top,r=[...e.querySelectorAll(".maplibregl-ctrl-top-left > *, .maplibregl-ctrl-top-right > *"),...t?.querySelectorAll(":scope > [data-map-control]")??[]];let o=0;for(const e of r){const t=e.getBoundingClientRect();t.height>0&&(o=Math.max(o,t.bottom-n))}return o}(e.getContainer(),ae.current)+8,u=`${k(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=N(e.project(p),{width:d.offsetWidth,height:d.offsetHeight},{width:o,height:a},l);r.options.anchor!==m&&(r.options.anchor=m,r.setLngLat(p)),!t||0===h.x&&0===h.y||e.panBy([-h.x,-h.y],{duration:U()?0:250}),$e()},u=new ResizeObserver(()=>c());u.observe(n);const d=()=>c(),p=()=>{i||c(!1)};e.on("resize",d),e.on("moveend",p);let m=!1;const h=pe.current,g=e=>{m=n.contains(e.target)};return document.addEventListener("focusin",g),()=>{if(s=!0,u.disconnect(),e.off("resize",d),e.off("moveend",p),document.removeEventListener("focusin",g),r.remove(),We(null),m&&(!document.activeElement||document.activeElement===document.body)){const e=h.get(ze)?.button;e&&"none"!==e.style.display&&e.focus({preventScroll:!0})}}},[Te,ze,Re,Be,$e]);const Fe=O?.active??!1,Ke=a(O?.onChange);i(()=>{Ke.current=O?.onChange}),i(()=>{if(!O)return;const e=document.documentElement;Fe&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!Fe&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Fe]);const qe=!!O;return i(()=>{if(!qe)return;const e=()=>{document.fullscreenElement||Ke.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[qe]),/* @__PURE__ */p("div",{ref:ae,className:Y("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",z&&"[&_canvas]:cursor-crosshair",g),children:[
|
|
3
|
+
/* @__PURE__ */m("div",{className:"absolute inset-0",children:/* @__PURE__ */m("div",{ref:se,className:"h-full w-full",role:"region","aria-label":h})}),ve&&/* @__PURE__ */m("p",{className:"absolute inset-0 grid place-items-center p-6 text-center text-sm text-gray-500",children:X.failed}),O&&/* @__PURE__ */m(e,{"data-map-control":"",variant:"secondary",size:"sm",className:"absolute left-3 top-3 z-10",onClick:()=>O.onChange(!O.active),leftIcon:/* @__PURE__ */m(ie,{leave:O.active}),children:O.active?X.leaveFullScreen:X.fullScreen}),f,null!=B&&!Te&&/* @__PURE__ */m("div",{"data-map-card":"",className:"absolute bottom-3 left-3 right-3 z-10 max-h-[calc(100%-1.5rem)] max-w-md overflow-y-auto overscroll-contain",children:B}),Te&&Oe?d(B,Oe):null,be&&/* @__PURE__ */m(le,{pins:t,hosts:fe.current})]})}function le({pins:e,hosts:t}){/* @__PURE__ */
|
|
4
4
|
return m(h,{children:e.map(e=>{if(null==e.iconNode||e.dot)return null;let n=t.get(e.key);return n||(n=document.createElement("span"),n.className="contents",t.set(e.key,n)),d(e.iconNode,n,e.key)})})}function ie({leave:e}){/* @__PURE__ */
|
|
5
5
|
return m(o,e?{name:"collapse","aria-hidden":"true",className:"h-4 w-4",strokeWidth:2}:{name:"expand","aria-hidden":"true",className:"h-4 w-4",strokeWidth:2})}function se(){const[e,t]=l(null);return{highlightKey:e,pointAt:s(e=>{const n=()=>t(e),r=()=>t(t=>t===e?null:t);return{onMouseEnter:n,onMouseLeave:r,onFocus:n,onBlur:r}},[])}}var ce=3e3,ue=e=>!!e?.pending&&3e3,de=e=>`${e.kind}:${e.id}`,pe=e=>("located"===e.placement||"approximate"===e.placement)&&null!=e.lat&&null!=e.lng;function me(e){switch(e){case"located":return null;case"approximate":return"Approximate: only the suburb or postcode matched";case"pending":return"Locating…";case"not_found":return"Not on the map: address not found";case"failed":return"Not on the map: the map service could not be reached";case"no_address":return"Not on the map: no city or postcode"}}var he={importer:{label:"Importer",tone:"bg-sky-600 text-white"},dealer:{label:"Dealer",tone:"bg-purple-600 text-white"},retail:{label:"Retail",tone:"bg-green-600 text-white"},supplier:{label:"Supplier",tone:"bg-sky-600 text-white"},delivery_location:{label:"Delivery location",tone:"bg-amber-600 text-white"},warehouse:{label:"Warehouse",tone:"bg-amber-600 text-white"}},ge=["importer","dealer","retail","supplier","delivery_location","warehouse"];function fe(e){return"supplier"===e.kind?"supplier":"customer"===e.kind?e.category||"importer":e.kind}var ye=(e,t=he)=>t[e]?.tone??"bg-gray-700 text-white",be=(e,t=he)=>t[e]?.label??e,xe=(e,t)=>ye(fe(e),t);function ve(e,t,n=he){return null!=t?String(t):(n[fe(e)]?.label??"").charAt(0).toUpperCase()}var we=["delivery_location","warehouse"];function ke(e,t=we){const n=/* @__PURE__ */new Map;let r=0;for(const o of e)t.includes(o.kind)&&n.set(de(o),++r);return n}function Ne(e){const t={onMap:0,approximate:0,pending:0,off:0};for(const n of e)pe(n)?(t.onMap+=1,"approximate"===n.placement&&(t.approximate+=1)):"pending"===n.placement?t.pending+=1:t.off+=1;return t}function Ce(e){const t=[`${e.onMap} on the map`];return e.approximate&&t.push(`${e.approximate} approximate`),e.pending&&t.push(`${e.pending} locating`),e.off&&t.push(`${e.off} not on the map`),t.join(" · ")}function Me(e){const t=[...new Set(e.filter(pe).map(fe))];return[...ge.filter(e=>t.includes(e)),...t.filter(e=>!ge.includes(e))]}function Le(e,t){return e.filter(e=>!pe(e)&&"pending"!==e.placement).map(e=>{const n=t?.get(de(e)),r=me(e.placement)?.replace(/^Not on the map: /,"")??"";return{key:de(e),text:`${null!=n?`${n}. `:""}${e.label}: ${r}`}})}function $e({categories:e,palette:t=he,floating:n=!0}){return e.length<2?null:/* @__PURE__ */m("div",{className:(n?"absolute left-3 top-3 z-10 ":"")+"flex flex-wrap gap-x-3 gap-y-1 rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs text-gray-600 shadow-sm",children:e.map(e=>/* @__PURE__ */p("span",{className:"inline-flex items-center gap-2",children:[
|
|
6
6
|
/* @__PURE__ */m("span",{"aria-hidden":!0,className:`h-2.5 w-2.5 rounded-full ${ye(e,t)}`}),be(e,t)]},e))})}function Ee({point:t,number:n,onOpen:a,onClose:l,palette:i=he}){const s=me(t.placement),c=fe(t),u=r().map;/* @__PURE__ */
|
|
@@ -20,4 +20,4 @@ return p("section",{"aria-label":s,className:`flex min-w-0 flex-col ${h}`,childr
|
|
|
20
20
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>{b()},className:"font-medium text-blue-600 hover:text-blue-800 hover:underline",children:"Try again"})]}),!y&&($>0||M.length>0)&&/* @__PURE__ */p("div",{className:"max-w-full space-y-0.5 rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs shadow-sm","aria-live":"polite",children:[$>0&&/* @__PURE__ */p("p",{className:"flex items-center gap-2 text-gray-500",children:[
|
|
21
21
|
/* @__PURE__ */p("svg",{className:"h-3 w-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[
|
|
22
22
|
/* @__PURE__ */m("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
23
|
-
/* @__PURE__ */m("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Locating ",$," address",1===$?"":"es","…"]}),M.slice(0,3).map(e=>/* @__PURE__ */m("p",{className:"truncate text-amber-700",title:e.text,children:e.text},e.key)),M.length>3&&/* @__PURE__ */p("p",{className:"text-gray-500",children:["+",M.length-3," more not on the map"]})]})]}),E&&/* @__PURE__ */m(Ee,{point:E,number:N.get(de(E))??null,onOpen:S,onClose:()=>w(null),palette:u})]})]})}export{v as CARD_MIN_MAP_WIDTH,f as COMPACT_SHOW,ae as EntityMap,je as LocationsMap,C as MAPLIBRE_WORKER_FILE,j as MAP_APART_PX,he as MAP_CATEGORIES,S as MAP_STOP_PX,E as MAP_TARGET_PX,$e as MapLegend,ce as PENDING_POLL_MS,we as SECONDARY_KINDS,Ee as SelectedCard,k as cardMaxHeight,be as categoryLabel,ye as categoryTone,y as foldAttributionOnce,pe as isOnMap,W as layoutPins,Me as legendCategories,$ as loadMapLibre,ke as locationNumbers,M as mapLibreWorkerUrl,ue as mapPointsRefetchInterval,Le as offMapNotes,fe as pinCategory,ve as pinGlyph,xe as pinTone,N as placeCard,me as placementNote,de as pointKey,A as stopsLabel,Ne as summarize,Ce as summaryText,se as useMapHighlight,Se as useMapPoints,
|
|
23
|
+
/* @__PURE__ */m("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Locating ",$," address",1===$?"":"es","…"]}),M.slice(0,3).map(e=>/* @__PURE__ */m("p",{className:"truncate text-amber-700",title:e.text,children:e.text},e.key)),M.length>3&&/* @__PURE__ */p("p",{className:"text-gray-500",children:["+",M.length-3," more not on the map"]})]})]}),E&&/* @__PURE__ */m(Ee,{point:E,number:N.get(de(E))??null,onOpen:S,onClose:()=>w(null),palette:u})]})]})}export{v as CARD_MIN_MAP_WIDTH,f as COMPACT_SHOW,ae as EntityMap,je as LocationsMap,C as MAPLIBRE_WORKER_FILE,j as MAP_APART_PX,he as MAP_CATEGORIES,S as MAP_STOP_PX,E as MAP_TARGET_PX,$e as MapLegend,ce as PENDING_POLL_MS,we as SECONDARY_KINDS,Ee as SelectedCard,k as cardMaxHeight,be as categoryLabel,ye as categoryTone,y as foldAttributionOnce,pe as isOnMap,W as layoutPins,Me as legendCategories,$ as loadMapLibre,ke as locationNumbers,M as mapLibreWorkerUrl,ue as mapPointsRefetchInterval,Le as offMapNotes,fe as pinCategory,ve as pinGlyph,xe as pinTone,N as placeCard,me as placementNote,de as pointKey,A as stopsLabel,Ne as summarize,Ce as summaryText,se as useMapHighlight,Se as useMapPoints,F as zoomApart};
|
package/dist/page-tabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{TabStrip as e}from"../chunk-GNCH3JEH.js";import{useShellLanguage as t}from"../chunk-RBKIYZ7H.js";import"../chunk-SCJT2XXU.js";import{confirm as n}from"../chunk-
|
|
3
|
-
return v(K.Provider,{value:le,children:e})}var
|
|
4
|
-
return v("div",{ref:y,role:c?"tabpanel":void 0,id:c,"aria-labelledby":a,hidden:!t,style:t?void 0:{display:"none"},className:l,"data-page-tab":e,children:/* @__PURE__ */v(
|
|
5
|
-
return v("div",{className:t,children:e(r)},D);const{state:i,currentKey:l,locationFor:c,idFor:a}=n,s=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!s.includes(l)&&s.push(l),/* @__PURE__ */g(h,{children:[s.map(n=>{const i=n===l,s=i?r:c(n);return s?/* @__PURE__ */v(S,{tabKey:n,active:i,location:s,render:e,className:t,panelId:a(n,"panel"),tabId:a(n,"tab")},n):null}),!l&&/* @__PURE__ */v(S,{tabKey:D,active:!0,location:r,render:e,className:t},D)]})}function
|
|
6
|
-
return v(e,{tabs:a.map(e=>({key:e.key,title:e.title,pinned:e.pinned,dirty:s.dirty.includes(e.key),copy:l.copies[e.key],icon:f(x(e.path))?.icon})),activeKey:l.currentKey??null,idFor:o,panelMounted:e=>s.mounted.includes(e),onActivate:u,onClose:e=>{y(e)},onCloseMany:(e,t)=>{d(e,t)},label:c.label,className:t,activeClassName:n,end:r})}var
|
|
2
|
+
import{TabStrip as e}from"../chunk-GNCH3JEH.js";import{useShellLanguage as t}from"../chunk-RBKIYZ7H.js";import"../chunk-SCJT2XXU.js";import{confirm as n}from"../chunk-76VCH7N6.js";import"../chunk-IQDY2YFN.js";import"../chunk-UVBK6YSR.js";import"../chunk-JTNKC4CR.js";import"../chunk-7IQ3B77H.js";import"../chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as r}from"../chunk-D65T4H6J.js";import{useShellStrings as i}from"../chunk-QRCDQPJA.js";import"../chunk-C3QOHMR6.js";import"../chunk-ZGUQLVY4.js";import*as l from"react";import{createContext as c,memo as a,useRef as s,useEffect as o,useMemo as u,useId as y,useCallback as d,useReducer as f,useState as p,useContext as k}from"react";import{useLocation as m,useNavigate as b}from"react-router-dom";import{jsx as v,Fragment as h,jsxs as g}from"react/jsx-runtime";var K=c(null),C=c(null),F=12;var N=(e,t)=>e.filter(e=>e!==t);function T(e,t){return[...t.map(t=>e.find(e=>e.key===t)).filter(e=>Boolean(e)),...e.filter(e=>!t.includes(e.key))]}function I(e,t,n=12){const r=e.clock+1;let i;i=e.tabs.find(e=>e.key===t.key)?e.tabs.map(e=>e.key===t.key?{...e,path:t.path,title:"page"===e.titleFrom?e.title:t.title||e.title,lastActive:r}:e):[...e.tabs,{key:t.key,path:t.path,title:t.title,titleFrom:"route",pinned:!1,lastActive:r}];let l={...e,tabs:i,activeKey:t.key,mounted:(c=e.mounted,a=t.key,c.includes(a)?c:[...c,a]),clock:r};var c,a;return l.closing&&l.closing!==t.key?l=A(l,l.closing):l.closing===t.key&&(l={...l,closing:null}),function(e,t){let n=e;for(;n.tabs.length>t;){const e=n.tabs.filter(e=>!e.pinned&&e.key!==n.activeKey&&!n.dirty.includes(e.key)&&e.key!==n.closing).sort((e,t)=>e.lastActive-t.lastActive);if(0===e.length)break;n=A(n,e[0].key)}return n}(l,n)}function j(e){let t={...e,activeKey:null};return t.closing&&(t=A(t,t.closing)),t}function A(e,t){return{...e,tabs:e.tabs.filter(e=>e.key!==t),mounted:N(e.mounted,t),dirty:N(e.dirty,t),activeKey:e.activeKey===t?null:e.activeKey,closing:e.closing===t?null:e.closing}}function w(e,t){switch(t.type){case"visit":return I(e,t.entry,t.maxTabs);case"transient":return j(e);case"close":{let n=e;for(const e of t.keys)n=A(n,e);return t.closing?function(e,t){return{...e,closing:t}}(n,t.closing):n}case"title":return function(e,t,n){const r=e.tabs.find(e=>e.key===t);return!r||!n||r.title===n&&"page"===r.titleFrom?e:{...e,tabs:e.tabs.map(e=>e.key===t?{...e,title:n,titleFrom:"page"}:e)}}(e,t.key,t.title);case"dirty":return function(e,t,n){return n===e.dirty.includes(t)?e:{...e,dirty:n?[...e.dirty,t]:N(e.dirty,t)}}(e,t.key,t.dirty)}}var M=e=>`${e.pathname}${e.search}`;function x(e){const t=e.indexOf("#"),n=t>=0?e.slice(t):"",r=t>=0?e.slice(0,t):e,i=r.indexOf("?");return{pathname:i>=0?r.slice(0,i):r,search:i>=0?r.slice(i):"",hash:n}}function L({children:e,resolve:l,pinned:c=[],storageKey:a,maxTabs:k=12,enabled:h=!0,confirmDiscard:g}){const C=m(),F=b(),N=i().pageTabs,A=y(),L=s(l);L.current=l;const O=d(e=>{const t=L.current(e);return t?{key:t.key??e.pathname,path:M(e),title:t.title}:null},[]),{language:R}=t(),[B,S]=f(w,void 0,()=>{const e=function(e,t,n){if(!e)return[];let r;try{r=JSON.parse(e)}catch{return[]}const i=r;if(!i||1!==i.v||!Array.isArray(i.tabs))return[];const l=Boolean(n&&"string"==typeof i.lang&&i.lang!==n),c=[];for(const e of i.tabs){if(!e||"string"!=typeof e.path||!e.path.startsWith("/")||e.path.startsWith("//"))continue;const n=e.path.indexOf("#"),r=n>=0?e.path.slice(0,n):e.path,i=t(r);if(!i||c.some(e=>e.key===i.key))continue;const a=!l&&"page"===e.titleFrom&&"string"==typeof e.title&&e.title;c.push({key:i.key,path:r,title:a||i.title,titleFrom:a?"page":"route",pinned:!1,lastActive:0})}return c}(function(e){if(!e)return null;try{return localStorage.getItem(e)}catch{return null}}(a),e=>O(x(e)),R);let t=function(e,t){const n=t.map(e=>e.key);let r=e.tabs.map(e=>({...e,pinned:n.includes(e.key)}));for(const e of t)r.some(t=>t.key===e.key)||(r=[...r,{key:e.key,path:e.path,title:e.title,titleFrom:"route",pinned:!0,lastActive:0}]);return{...e,tabs:T(r,n)}}({tabs:[],activeKey:null,mounted:[],dirty:[],closing:null,clock:0,tabs:e},c.map(e=>O(x(e))).filter(e=>Boolean(e)));const n=h?O(C):null;return t=n?I(t,n,k):j(t),t}),D=s(B);D.current=B;const E=s(/* @__PURE__ */new Map),H=h?O(C):null,J=H?.key??null;r(()=>{if(!h)return;const e=O(C);e?(E.current.set(e.key,C),S({type:"visit",entry:e,maxTabs:k})):S({type:"transient"})},[C,h,k,O]),o(()=>{const e=new Set(B.tabs.map(e=>e.key));for(const t of E.current.keys())e.has(t)||E.current.delete(t)},[B.tabs]);const $=u(()=>function(e,t){const n={v:1,...t?{lang:t}:{},tabs:e.tabs.filter(t=>t.key!==e.closing).map(({key:e,path:t,title:n,titleFrom:r})=>({key:e,path:t,title:n,titleFrom:r}))};return JSON.stringify(n)}(B,R),[B,R]);o(()=>{if(a)try{localStorage.setItem(a,$)}catch{}},[$,a]);const Q=B.dirty.length>0;o(()=>{if(!Q)return;const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[Q]);const Y=s(/* @__PURE__ */new Map),V=d((e,t)=>{let n=Y.current.get(e);return void 0===n&&(n=Y.current.size,Y.current.set(e,n)),`${A}-page-${t}-${n}`},[A]),G=d(e=>g?g(e):n({title:N.discardTitle,message:1===e.length?N.discardOne:N.discardCount?.(e.length)??`${e.length} ${N.discardMany}`,confirmLabel:N.discardConfirm,cancelLabel:N.keepEditing,variant:"warning"}),[g,N]),P=d(()=>{const e=D.current;return e.tabs.find(e=>e.pinned)?.path??"/"},[]),U=d((e,t,n)=>{const r=D.current,i=r.activeKey;if(!i||!e.includes(i))return void S({type:"close",keys:e,closing:null});let l=t;if(!l){const t={...r,tabs:r.tabs.filter(t=>t.key===i||!e.includes(t.key))},c=n?r.tabs.find(t=>t.key===n&&!e.includes(t.key)):void 0;l=(c??function(e,t){const n=e.tabs.filter(n=>n.key!==e.closing||n.key===t),r=n.findIndex(e=>e.key===t);return r<0?null:n[r+1]??n[r-1]??null}(t,i))?.path??P()}S({type:"close",keys:e.filter(e=>e!==i),closing:i}),F(l)},[F,P]),W=d(async(e,t={})=>{const n=D.current.tabs.find(t=>t.key===e);return!n||n.pinned?(t.to&&F(t.to),!1):!(!t.force&&D.current.dirty.includes(e)&&!await G([n]))&&(!!D.current.tabs.some(t=>t.key===e)&&(U([e],t.to),!0))},[G,U,F]),X=d(async(e,t)=>{let n=function(e,t,n){const r=e.tabs.filter(e=>!e.pinned);if("all"===t)return r.map(e=>e.key);if("others"===t)return r.filter(e=>e.key!==n).map(e=>e.key);const i=e.tabs.findIndex(e=>e.key===n);return i<0?[]:e.tabs.slice(i+1).filter(e=>!e.pinned).map(e=>e.key)}(D.current,e,t);const r=D.current.tabs.filter(e=>n.includes(e.key)&&D.current.dirty.includes(e.key));r.length&&!await G(r)&&(n=n.filter(e=>!r.some(t=>t.key===e)));const i=new Set(D.current.tabs.map(e=>e.key));n=n.filter(e=>i.has(e)),n.length&&U(n,void 0,"all"===e?null:t)},[G,U]),Z=d(e=>{const t=D.current.tabs.find(t=>t.key===e);t&&e!==D.current.activeKey&&F(t.path)},[F]),z=d((e,t)=>S({type:"title",key:e,title:t}),[]),q=d((e,t)=>S({type:"dirty",key:e,dirty:t}),[]),[_,ee]=p({}),te=d((e,t)=>{ee(n=>{if((n[e]??null)===t)return n;const r={...n};return t?r[e]=t:delete r[e],r})},[]),ne=d(e=>O(e)?.key??null,[O]),re=d(e=>E.current.get(e),[]),ie=u(()=>h?B.tabs.filter(e=>e.key!==B.closing):[],[h,B.tabs,B.closing]),le=u(()=>({enabled:h,state:B,currentKey:J,resolve:l,keyFor:ne,locationFor:re,idFor:V,activate:Z,close:W,closeMany:X,setTitle:z,setDirty:q,copies:_,setCopy:te,visibleTabs:ie}),[h,B,J,l,ne,re,V,Z,W,X,z,q,_,te,ie]);/* @__PURE__ */
|
|
3
|
+
return v(K.Provider,{value:le,children:e})}var O=l.Activity,R=Boolean(O);function B({active:e,children:t}){return O?/* @__PURE__ */v(O,{mode:e?"visible":"hidden",children:t}):/* @__PURE__ */v(h,{children:t})}var S=a(function({tabKey:e,active:t,location:n,render:i,className:l,panelId:c,tabId:a}){const y=s(null),d=s(t),f=s(/* @__PURE__ */new Map);r(()=>{const e=d.current;if(d.current=t,t&&!e)for(const[e,[t,n]]of f.current)e.isConnected?(e.scrollTop=t,e.scrollLeft=n):f.current.delete(e)},[t]),o(()=>{const e=y.current;if(!e)return;const t=e=>{if(!d.current)return;const t=e.target;t&&"number"==typeof t.scrollTop&&f.current.set(t,[t.scrollTop,t.scrollLeft])};return e.addEventListener("scroll",t,!0),()=>e.removeEventListener("scroll",t,!0)},[]);const p=u(()=>({key:e,activeRef:d}),[e]);/* @__PURE__ */
|
|
4
|
+
return v("div",{ref:y,role:c?"tabpanel":void 0,id:c,"aria-labelledby":a,hidden:!t,style:t?void 0:{display:"none"},className:l,"data-page-tab":e,children:/* @__PURE__ */v(C.Provider,{value:p,children:/* @__PURE__ */v(B,{active:t,children:i(n)})})})},(e,t)=>e.active===t.active&&e.location===t.location&&e.className===t.className&&e.panelId===t.panelId&&e.tabId===t.tabId&&(!t.active||e.render===t.render)),D="\0transient";function E({children:e,frameClassName:t}){const n=k(K),r=m();if(!n||!n.enabled)/* @__PURE__ */
|
|
5
|
+
return v("div",{className:t,children:e(r)},D);const{state:i,currentKey:l,locationFor:c,idFor:a}=n,s=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!s.includes(l)&&s.push(l),/* @__PURE__ */g(h,{children:[s.map(n=>{const i=n===l,s=i?r:c(n);return s?/* @__PURE__ */v(S,{tabKey:n,active:i,location:s,render:e,className:t,panelId:a(n,"panel"),tabId:a(n,"tab")},n):null}),!l&&/* @__PURE__ */v(S,{tabKey:D,active:!0,location:r,render:e,className:t},D)]})}function H({className:t,activeClassName:n,end:r}){const l=k(K),c=i().pageTabs;if(!l||!l.enabled)return null;const{visibleTabs:a,state:s,idFor:o,activate:u,close:y,closeMany:d,resolve:f}=l;/* @__PURE__ */
|
|
6
|
+
return v(e,{tabs:a.map(e=>({key:e.key,title:e.title,pinned:e.pinned,dirty:s.dirty.includes(e.key),copy:l.copies[e.key],icon:f(x(e.path))?.icon})),activeKey:l.currentKey??null,idFor:o,panelMounted:e=>s.mounted.includes(e),onActivate:u,onClose:e=>{y(e)},onCloseMany:(e,t)=>{d(e,t)},label:c.label,className:t,activeClassName:n,end:r})}var J={enabled:!1,tabs:[],activeKey:null,activate:()=>{},close:async()=>!1,closeOthers:async()=>{},closeRight:async()=>{},closeAll:async()=>{}};function $(){const e=k(K);return e&&e.enabled?{enabled:!0,tabs:e.visibleTabs,activeKey:e.currentKey,activate:e.activate,close:e.close,closeOthers:t=>e.closeMany("others",t),closeRight:t=>e.closeMany("right",t),closeAll:()=>e.closeMany("all",null)}:J}function Q(){const e=k(K),t=k(C),n=b();return{key:e?.enabled&&t?t.key:null,close:d(async(r={})=>e?.enabled&&t&&e.state.tabs.some(e=>e.key===t.key)?e.close(t.key,r):(r.to&&n(r.to),!1),[e,t,n])}}function Y(e){const t=k(K),n=k(C),r=t?.enabled?t.setTitle:void 0,i=n?.key;o(()=>{r&&i&&e&&r(i,e)},[r,i,e])}function V(e){const t=k(K),n=k(C),r=t?.enabled?t.setCopy:void 0,i=n?.key;o(()=>{if(r&&i)return r(i,e||null),()=>r(i,null)},[r,i,e])}function G(e){const t=k(K),n=k(C),r=t?.enabled?t.setDirty:void 0;o(()=>{if(r&&n)return r(n.key,e),()=>{n.activeRef.current&&r(n.key,!1)}},[r,n,e])}export{F as DEFAULT_MAX_TABS,R as PAGE_TABS_PAUSE_HIDDEN,H as PageTabBar,E as PageTabsOutlet,L as PageTabsProvider,x as parseTabPath,Q as usePageTab,V as usePageTabCopy,G as usePageTabDirty,Y as usePageTabTitle,$ as usePageTabs};
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{startClientTelemetry}from"../chunk-
|
|
1
|
+
export{startClientTelemetry}from"../chunk-FVU7WDST.js";import"../chunk-P7IKSYFJ.js";import"../chunk-KNUR2UEG.js";
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ALT, b as ALT_SHIFT_D, c as ALT_SHIFT_E, d as ALT_SHIFT_N, e as APP_UPDATE_POLL_MS, f as Accordion, g as AccordionItem, h as AccordionProps, i as Align, j as AlignmentGrid, k as AlignmentGridProps, l as AlignmentPoint, m as AngleScale, n as AppUpdateBanner, o as AppUpdateBannerProps, p as AttachButton, q as AttachButtonProps, r as AttachmentDropZone, s as AttachmentDropZoneProps, t as AttachmentList, u as AttachmentListProps, v as AuthScreen, w as AuthScreenProps, x as Avatar, y as AvatarGroup, z as AvatarGroupProps, B as AvatarProps, D as AvatarSize, E as AvatarStatus, F as BORDER_WIDTHS, G as BackgroundVariant, H as BandScale, I as Banner, J as BannerEmphasis, K as BannerProps, L as BannerTone, M as BorderRole, N as BoxPlotBox, O as BoxPlotChart, Q as BoxPlotChartProps, R as BrandAssetEditor, T as BrandAssetEditorProps, U as BrandAssetPreview, V as BrandMark, W as BrandMarkProps, X as BrandMarkSlot, Y as BrandMarkSurface, Z as BrandMarkTreatment, _ as BreadcrumbItem, $ as Breadcrumbs, a0 as BreadcrumbsProps, a1 as BudgetBar, a2 as BudgetBarProps, a3 as BudgetState, a4 as Button, a5 as ButtonClassesOptions, a6 as ButtonProps, a7 as ButtonSize, a8 as ButtonVariant, a9 as CHART_INK, aa as CMD_A, ab as CMD_DOT, ac as CMD_ENTER, ad as CMD_K, ae as CMD_S, af as COLUMN_COUNT_MAX, ag as COLUMN_COUNT_WIDTHS, ah as COLUMN_SHARES_EQUAL, ai as COLUMN_SHARE_MIN, aj as CONTROL_HEIGHTS, ak as CORNERS, al as Calendar, am as CalendarMode, an as CalendarProps, ao as Candle, ap as CandlestickChart, aq as CandlestickChartProps, ar as Card, as as CardPadding, at as CardProps, au as CardTone, av as CartesianPlot, aw as CartesianPlotProps, ax as CellStyle, ay as ChartBackgroundVariant, az as ChartBrush, aA as ChartBrushProps, aB as ChartCurve, aC as ChartDefs, aD as ChartDefsProps, aE as ChartDot, aF as ChartDotProps, aG as ChartDotVariant, aH as ChartFillVariant, aI as ChartFrame, aJ as ChartFrameProps, aK as ChartHighlightProvider, aL as ChartLegendEntry, aM as ChartLegendSwatch, aN as ChartRange, aO as ChartReferenceLine, aP as ChartRevealDirection, aQ as ChartSkeleton, aR as ChartSkeletonProps, aS as ChartStatusTone, aT as ChartStrokeVariant, aU as ChartTooltip, aV as ChartTooltipProps, aW as ChartTooltipRow, aX as ChatTemplate, aY as Checkbox, aZ as CheckboxProps, a_ as CheckoutTemplate, a$ as ChordChart, b0 as ChordChartProps, b1 as ColorPicker, b2 as ColorPickerPanel, b3 as ColorPickerPanelProps, b4 as ColorPickerProps, b5 as ColorPreset, b6 as ColorSwatch, b7 as ColorSwatchProps, b8 as ColorSwatchSize, b9 as ColoredBadge, ba as ColoredBadgeProps, bb as ColumnChart, bc as ColumnChartProps, C as ColumnDef, bd as ColumnSeries, be as ColumnShares, bf as ComposerAttachments, bg as ComposerAttachmentsProps, bh as ConfirmProvider, bi as ContainerFillChart, bj as ContainerFillChartProps, bk as ContainerFillItem, bl as ContextMenu, bm as ContextMenuPoint, bn as ContextMenuProps, bo as ContextMenuState, bp as ControlSize, bq as CornerOption, br as Corners, bs as CornersInput, bt as CornersInputProps, bu as CountBadge, bv as CountBadgeProps, bw as CountBadgeTone, bx as Curve, by as DAY_MS, bz as DashboardTemplate, bA as DataTable, bB as DataTableColumn, bC as DataTableColumnGroup, bD as DataTableHeader, bE as DataTablePage, bF as DataTableProps, bG as DataTableRowLink, bH as DataTableRowProps, bI as DatePicker, bJ as DatePickerProps, bK as DateRangePicker, bL as DateRangePickerProps, bM as DateTimePicker, bN as DateTimePickerProps, bO as DescriptionColumns, bP as DescriptionItem, bQ as DescriptionList, bR as DescriptionListProps, bS as Dialog, bT as DialogProps, bU as DialogSize, bV as DisplayChipItem, bW as DisplayChips, bX as DisplayChipsProps, bY as Divider, bZ as DividerProps, b_ as DividerSpacing, b$ as Drawer, c0 as DrawerProps, c1 as DrawerSide, c2 as DrawerSize, c3 as DropdownMenu, c4 as DropdownMenuAlign, c5 as DropdownMenuCheckboxItem, c6 as DropdownMenuDividerItem, c7 as DropdownMenuEntry, c8 as DropdownMenuItem, c9 as DropdownMenuLabelItem, ca as DropdownMenuLinkItem, cb as DropdownMenuProps, cc as DropdownMenuRadioItem, cd as DropdownMenuSide, ce as DropdownPositionOptions, cf as ELEVATION_LEVELS, cg as ENGLISH, ch as ENTER, ci as EditableGrid, cj as EditableGridProps, ck as ElevationLevel, cl as EmailTemplate, cm as EmptyState, cn as EmptyStateProps, co as EmptyValue, cp as EmptyValueProps, cq as ErrorBoundary, cr as ErrorBoundaryProps, cs as ErrorPage, ct as ErrorPageProps, cu as FONT_WEIGHTS, cv as FileIntake, cw as FilePicker, cx as FilePickerProps, cy as FillVariant, cz as FontWeightRole, cA as FormError, cB as FormErrorSummary, cC as FormErrorSummaryProps, cD as FormField, cE as FormFieldProps, cF as FormLayoutPage, cG as FunnelChart, cH as FunnelChartProps, cI as FunnelStage, cJ as GLASS_DIVIDER, cL as GROUP_COLORS, cM as GROUP_COLORS_SOLID, cN as GalleryTemplate, cO as Gap, cP as GlassOptions, cQ as GlobalSearch, cR as GlobalSearchProps, cS as Grid, cT as GridCols, cU as GridColumn, cV as GridProps, cW as HeatmapChart, cX as HeatmapChartProps, cY as HelpCenter, cZ as HelpCenterDoc, c_ as HelpCenterProps, c$ as HexInput, d0 as HistogramBin, d1 as HistogramChart, d2 as HistogramChartProps, d3 as Hsv, d4 as INPUT_BASE, d5 as INPUT_SIZES, d6 as IconButton, d7 as IconButtonClassesOptions, d8 as IconButtonProps, d9 as IconRail, da as IconRailButton, db as IconRailButtonProps, dc as IconRailLabels, dd as IconRailLabelsShown, de as IconRailOrientation, df as IconRailProps, dg as ImageFocusPoint, dh as ImageFocusPointProps, di as Inline, dj as InlineProps, dk as Input, dl as InputNumber, dm as InputNumberProps, dn as InputProps, dp as InputSize, dq as Justify, dr as Kanban, ds as KanbanColumn, dt as KanbanProps, du as Kbd, dv as KbdProps, dw as KbdSize, dx as KbdTone, dy as Label, dz as LabelClassesOptions, dA as LabelProps, dB as LadderScale, dC as LanguagePanel, dD as LanguagePanelProps, dE as LanguageSelect, dF as LanguageSelectProps, dG as LinearScale, dH as LinkFilter, dI as LinkFilterField, dJ as LinkKindChoice, dK as LinkOption, dL as LinkOptionGroup, dM as LinkPicker, dN as LinkPickerFieldProps, dO as LinkPickerProps, dP as LinkPickerWindowProps, dQ as LinkRules, dR as LinkTarget, dS as ListDrop, dT as ListFooter, dU as ListLoadError, dV as ListLoadErrorProps, dW as ListMove, dX as ListRow, dY as ListRowProps, dZ as LoadingSpinner, d_ as LoadingSpinnerProps, d$ as MAX_FRACTION_DIGITS, e0 as MENU_MAX_HEIGHT, e1 as MOD, e2 as MOTION, e3 as MOTION_DURATIONS, e4 as Markdown, e4 as MarkdownLite, e5 as MarkdownLiteProps, e5 as MarkdownProps, e6 as MediaUploadField, e7 as MediaUploadFieldProps, e8 as MediaUploadGrid, e9 as MediaUploadGridItem, ea as MediaUploadGridProps, eb as MenuPos, ec as Meter, ed as MeterProps, ee as MetricBar, ef as MetricBarProps, eg as Milestone, eh as MilestoneKind, ei as MilestoneTimeline, ej as MilestoneTimelineProps, ek as MotionSpeed, em as NEXT_CHUNK_PATH_PREFIX, en as NativeSelect, eo as NiceAxis, ep as NumericKeypad, eq as NumericKeypadProps, er as OVERLAY_OPEN_EVENT, es as PLACEHOLDER_INK, et as POPUP_MAX_WIDTH, eu as POST_PRODUCTION_STATUSES, ev as PageHeader, ew as PageHeaderProps, P as PaginatedResponse, ex as Pagination, ey as PaginationProps, ez as PaperclipGlyph, eA as Paragraph, eB as ParagraphProps, eC as PieChart, eD as PieChartProps, eE as PieSegment, eF as PlotGeometry, eG as Point, eH as Popover, eI as PopoverAlign, eJ as PopoverProps, eK as PopoverRenderProps, eL as PopoverSide, eM as PopupMenu, eN as PopupMenuDivider, eO as PopupMenuItem, eP as PopupMenuItemProps, eQ as PopupMenuLabel, eR as PopupMenuProps, eS as PopupSubmenu, eT as PopupSubmenuProps, eU as PortalBrandingContextValue, eV as PortalBrandingProvider, eW as PortalBrandingProviderProps, eX as ProductionTimeline, eY as ProductionTimelineProps, eZ as ProductionTimelineSnapshot, e_ as ProgressItem, e$ as PublicPortal, f0 as PublicPortalBranding, f1 as RADAR_SERIES_CAP, f2 as RADIUS_ROLES, f3 as ROW_HEIGHTS, f4 as RadarAxis, f5 as RadarChart, f6 as RadarChartProps, f7 as RadarSeries, f8 as RadialBarChart, f9 as RadialBarChartProps, fa as RadialBarRow, fb as Radio, fc as RadioGroup, fd as RadioGroupOption, fe as RadioGroupOrientation, ff as RadioGroupProps, fg as RadioProps, fh as RadiusRole, fi as Range, fj as RangeChart, fk as RangeChartProps, fl as RangeRow, fm as RankedBars, fn as RankedBarsProps, fo as RankedBarsRow, fp as ResizeHandle, fq as ResizeHandleOrientation, fr as ResizeHandleProps, fs as ResizeHandleSide, ft as ResizeHandleStackSide, fu as ResolvedPortalBrandAsset, fv as Result, fw as ResultProps, fx as ResultStatus, fy as RevealDirection, fz as SCATTER_SERIES_CAP, fA as SERIES_SLOT_COUNT, fB as SERIES_VARS, fC as SHELL_LANGUAGE_STORAGE_KEY, fD as SHIFT, fE as SPACING_ROLES, fF as SPACING_SCALE, fG as STAGES, fH as STALE_CHUNK_RELOAD_COOLDOWN_MS, fI as STALE_CHUNK_RELOAD_KEY, fJ as STATUS_VARS, fK as SankeyChart, fL as SankeyChartProps, fM as SankeyLink, fN as SankeyNode, fO as ScatterChart, fP as ScatterChartProps, fQ as ScatterPoint, fR as ScatterSeries, S as SearchConfig, fS as SearchListRoute, fT as SearchProvider, fU as SearchQuickAction, fV as SearchResponse, fW as SearchResult, fX as SearchableItem, fY as SearchableOption, fZ as SearchableOptionGroup, f_ as SearchableSelect, f$ as SearchableSelectBaseProps, g0 as SearchableSelectMultipleProps, g1 as SearchableSelectProps, g2 as Segmented, g3 as SegmentedOption, g4 as SegmentedProps, g5 as SegmentedSize, g6 as Select, g7 as SelectBaseProps, g8 as SelectItem, g9 as SelectMultipleProps, ga as SelectOption, gb as SelectOptionGroup, gc as SelectProps, gd as SemanticGroup, ge as SeriesSlots, gf as SettingRow, gg as SettingRowProps, gh as SeverityTone, gk as ShellLanguage, gl as ShellLanguageProvider, gm as ShellLanguageState, gn as ShellPrefsAdapter, go as ShellPrefsProvider, gp as SidebarActionButton, gq as SidebarActionButtonProps, gr as SidebarGroupLabel, gs as SidebarGroupLabelProps, gt as SidebarLayout, gu as SidebarLayoutProps, gv as SidebarNavGroup, gw as SidebarNavGroupProps, gx as SidebarNavItem, gy as SidebarNavItemProps, gz as Skeleton, gA as SkeletonProps, gB as SkeletonVariant, gC as Slider, gD as SliderGroup, gE as SliderProps, gF as SliderSize, gG as Snippet, gH as SnippetProps, gI as SnippetSize, gJ as SnippetVariant, a as SortState, gK as SortableList, gL as SortableListProps, gM as SortableListSpacing, gN as SpacingRole, gO as SpacingStep, gP as Sparkline, gQ as SparklineProps, gR as Stack, gS as StackProps, gT as StaleChunkReloadOptions, gU as StatCard, gV as StatCardProps, gW as StatTile, gX as StatTileProps, gY as Statistic, gZ as StatisticProps, g_ as StatisticSize, g$ as StatisticTone, h0 as StatusBadge, h1 as StatusBadgeProvider, h2 as StatusEmphasis, h3 as StepItem, h4 as Stepper, h5 as StepperProps, h6 as StrokeVariant, h7 as SunburstChart, h8 as SunburstChartProps, h9 as SunburstNode, ha as Switch, hb as SwitchProps, hc as SwitchSize, hd as TYPE_SCALE, he as TabItem, hf as Tabs, hg as TabsProps, hh as TagInput, hi as TagInputOption, hj as TagInputProps, hk as TagInputTone, hl as Text, hm as TextLinkField, hn as TextLinkFieldProps, ho as TextProps, hp as TextSize, hq as TextTone, hr as TextWeight, hs as Textarea, ht as TextareaProps, hu as Theme, hv as TileButton, hw as TileButtonProps, hx as TileSize, hy as TimeAgo, hz as TimeAgoProps, hA as TimePicker, hB as TimePickerProps, hC as TimeSeriesChart, hD as TimeSeriesChartProps, hE as TimeSeriesSeries, hF as TimelineMarker, hG as TimelineMarkerKind, hH as TimelineReport, hI as TimelineScrubProgress, hJ as TimelineTrack, hK as TimelineTrackItem, hL as TimelineTrackKind, hM as TimelineTrackPending, hN as TimelineTrackPhase, hO as TimelineTrackPlayback, hP as TimelineTrackProps, hQ as TimelineTrackThumb, hR as Title, hS as TitleLevel, hT as TitleProps, hU as ToastOptions, hV as ToastPlacement, hW as Tooltip, hX as TooltipProps, hY as TopNav, hZ as TopNavItem, h_ as TopNavProps, h$ as Tree, i0 as TreeDrop, i1 as TreeEmptySlot, i2 as TreeEmptySlotProps, i3 as TreeGroup, i4 as TreeGroupLabel, i5 as TreeGroupProps, i6 as TreeMove, i7 as TreeProps, i8 as TreeRow, i9 as TreeRowProps, ia as TreeSeam, ib as TreeSeamProps, ic as TreemapChart, id as TreemapChartProps, ie as TreemapItem, ig as TreemapTile, ih as TypeStep, ii as UseAppUpdateOptions, ij as UseContextMenu, ik as UseProductionTimelineOpts, il as VERSION, im as VITE_PRELOAD_ERROR_EVENT, io as WaterfallChart, ip as WaterfallChartProps, iq as WaterfallStep, ir as WidthsBar, is as WidthsBarProps, it as ZLayer, iu as Z_LAYERS, iv as angleScale, iw as appendKey, ix as applyCorners, iy as applyIconSet, iz as applyThemePrefs, iA as arcPath, iB as areaBetween, iC as areaFrom, iD as assignSeriesSlots, iE as autoHighlightIndex, iF as backspace, iG as bandScale, iH as binValues, iI as budgetState, iJ as bumpPath, iK as buttonClasses, iL as calcOverall, iM as calcReportOverall, iN as colorFill, iO as colorSwatchClasses, iP as columnSharesWidths, iQ as confirm, iR as confirmDestructive, iS as curvePath, iT as dashFor, iV as dismissPopups, iW as fillFor, iX as fillId, iY as fmtSliderDate, iZ as fromDateKey, i_ as glassStyle, i$ as glowId, j0 as groundId, j1 as groupColors, j2 as hexToHsv, j3 as highlightOpacity, j4 as hsvToHex, j5 as iconButtonClasses, j6 as inputClasses, j7 as installStaleChunkReload, j8 as isMac, j9 as isSeverityTone, ja as isSpacingStep, jb as isStaleChunkError, jd as labelClasses, je as ladderScale, jf as languageSelectWidth, jg as leavesContextMenuAlone, jh as linearPath, ji as linearScale, jj as logScale, jk as maskId, jl as matchShellLanguage, jm as mediaFileName, jn as monotonePath, jo as niceAxis, jp as niceMax, jq as openGlobalSearch, jr as parseHexColor, js as polygonPoints, jt as popupBounds, ju as prompt, jv as pushRecentSearch, jw as radiusScale, jx as readSavedShellLanguage, jy as registerModalEscapeInterceptor, jz as resolveBrandMarkTreatment, jA as resolveColumnShares, jB as resolveColumnWidths, jC as resolveCorners, jD as resolvePortalBrandAsset, jE as resolveSeriesColor, jF as resolveSeriesColorWithin, jG as resolveShellLanguage, jH as resolveTheme, jI as sanitizeRecentSearches, jJ as saveShellLanguage, jK as seriesColor, jL as severityOf, jM as splinePath, jN as squarify, jO as stagger, jP as stepPath, jQ as tabButtonId, jR as tabPanelId, jS as toDateKey, jT as toDayMs, jU as toISODate, jV as toast, jW as toggleSeriesSlot, jX as useAppUpdate, jY as useClickOutside, jZ as useConfirm, j_ as useContextMenu, j$ as useDebouncedValue, k0 as useDropdownPosition, k1 as useFocusTrap, k2 as useHighlight, k3 as useIsMobile, k4 as useLocalStoragePrefs, k5 as usePlotWidth, k6 as usePortalBranding, k7 as useProductionTimeline, k8 as useScrollLock, k9 as useShellLanguage, ka as useShellPrefs, kb as useStatusLabel, kc as useTheme } from '../index-C4iOtAIZ.js';
|
|
1
|
+
export { A as ALT, b as ALT_SHIFT_D, c as ALT_SHIFT_E, d as ALT_SHIFT_N, e as APP_UPDATE_POLL_MS, f as Accordion, g as AccordionItem, h as AccordionProps, i as Align, j as AlignmentGrid, k as AlignmentGridProps, l as AlignmentPoint, m as AngleScale, n as AppUpdateBanner, o as AppUpdateBannerProps, p as AttachButton, q as AttachButtonProps, r as AttachmentDropZone, s as AttachmentDropZoneProps, t as AttachmentList, u as AttachmentListProps, v as AuthScreen, w as AuthScreenProps, x as Avatar, y as AvatarGroup, z as AvatarGroupProps, B as AvatarProps, D as AvatarSize, E as AvatarStatus, F as BORDER_WIDTHS, G as BackgroundVariant, H as BandScale, I as Banner, J as BannerEmphasis, K as BannerProps, L as BannerTone, M as BorderRole, N as BoxPlotBox, O as BoxPlotChart, Q as BoxPlotChartProps, R as BrandAssetEditor, T as BrandAssetEditorProps, U as BrandAssetPreview, V as BrandMark, W as BrandMarkProps, X as BrandMarkSlot, Y as BrandMarkSurface, Z as BrandMarkTreatment, _ as BreadcrumbItem, $ as Breadcrumbs, a0 as BreadcrumbsProps, a1 as BudgetBar, a2 as BudgetBarProps, a3 as BudgetState, a4 as Button, a5 as ButtonClassesOptions, a6 as ButtonProps, a7 as ButtonSize, a8 as ButtonVariant, a9 as CHART_INK, aa as CMD_A, ab as CMD_DOT, ac as CMD_ENTER, ad as CMD_K, ae as CMD_S, af as COLUMN_COUNT_MAX, ag as COLUMN_COUNT_WIDTHS, ah as COLUMN_SHARES_EQUAL, ai as COLUMN_SHARE_MIN, aj as CONTROL_HEIGHTS, ak as CORNERS, al as Calendar, am as CalendarMode, an as CalendarProps, ao as Candle, ap as CandlestickChart, aq as CandlestickChartProps, ar as Card, as as CardPadding, at as CardProps, au as CardTone, av as CartesianPlot, aw as CartesianPlotProps, ax as CellStyle, ay as ChartBackgroundVariant, az as ChartBrush, aA as ChartBrushProps, aB as ChartCurve, aC as ChartDefs, aD as ChartDefsProps, aE as ChartDot, aF as ChartDotProps, aG as ChartDotVariant, aH as ChartFillVariant, aI as ChartFrame, aJ as ChartFrameProps, aK as ChartHighlightProvider, aL as ChartLegendEntry, aM as ChartLegendSwatch, aN as ChartRange, aO as ChartReferenceLine, aP as ChartRevealDirection, aQ as ChartSkeleton, aR as ChartSkeletonProps, aS as ChartStatusTone, aT as ChartStrokeVariant, aU as ChartTooltip, aV as ChartTooltipProps, aW as ChartTooltipRow, aX as ChatTemplate, aY as Checkbox, aZ as CheckboxProps, a_ as CheckoutTemplate, a$ as ChordChart, b0 as ChordChartProps, b1 as ColorPicker, b2 as ColorPickerPanel, b3 as ColorPickerPanelProps, b4 as ColorPickerProps, b5 as ColorPreset, b6 as ColorSwatch, b7 as ColorSwatchProps, b8 as ColorSwatchSize, b9 as ColoredBadge, ba as ColoredBadgeProps, bb as ColumnChart, bc as ColumnChartProps, C as ColumnDef, bd as ColumnSeries, be as ColumnShares, bf as ComposerAttachments, bg as ComposerAttachmentsProps, bh as ConfirmProvider, bi as ContainerFillChart, bj as ContainerFillChartProps, bk as ContainerFillItem, bl as ContextMenu, bm as ContextMenuPoint, bn as ContextMenuProps, bo as ContextMenuState, bp as ControlSize, bq as CornerOption, br as Corners, bs as CornersInput, bt as CornersInputProps, bu as CountBadge, bv as CountBadgeProps, bw as CountBadgeTone, bx as Curve, by as DAY_MS, bz as DashboardTemplate, bA as DataTable, bB as DataTableColumn, bC as DataTableColumnGroup, bD as DataTableHeader, bE as DataTablePage, bF as DataTableProps, bG as DataTableRowLink, bH as DataTableRowProps, bI as DatePicker, bJ as DatePickerProps, bK as DateRangePicker, bL as DateRangePickerProps, bM as DateTimePicker, bN as DateTimePickerProps, bO as DescriptionColumns, bP as DescriptionItem, bQ as DescriptionList, bR as DescriptionListProps, bS as Dialog, bT as DialogProps, bU as DialogSize, bV as DisplayChipItem, bW as DisplayChips, bX as DisplayChipsProps, bY as Divider, bZ as DividerProps, b_ as DividerSpacing, b$ as Drawer, c0 as DrawerProps, c1 as DrawerSide, c2 as DrawerSize, c3 as DropdownMenu, c4 as DropdownMenuAlign, c5 as DropdownMenuCheckboxItem, c6 as DropdownMenuDividerItem, c7 as DropdownMenuEntry, c8 as DropdownMenuItem, c9 as DropdownMenuLabelItem, ca as DropdownMenuLinkItem, cb as DropdownMenuProps, cc as DropdownMenuRadioItem, cd as DropdownMenuSide, ce as DropdownPositionOptions, cf as ELEVATION_LEVELS, cg as ENGLISH, ch as ENTER, ci as EditableGrid, cj as EditableGridProps, ck as ElevationLevel, cl as EmailTemplate, cm as EmptyState, cn as EmptyStateProps, co as EmptyValue, cp as EmptyValueProps, cq as ErrorBoundary, cr as ErrorBoundaryProps, cs as ErrorPage, ct as ErrorPageProps, cu as FONT_WEIGHTS, cv as FileIntake, cw as FilePicker, cx as FilePickerProps, cy as FillVariant, cz as FloatingBar, cA as FloatingBarAlign, cB as FloatingBarProps, cC as FloatingBarSide, cD as FontWeightRole, cE as FormError, cF as FormErrorSummary, cG as FormErrorSummaryProps, cH as FormField, cI as FormFieldProps, cJ as FormLayoutPage, cK as FunnelChart, cL as FunnelChartProps, cM as FunnelStage, cN as GLASS_DIVIDER, cP as GROUP_COLORS, cQ as GROUP_COLORS_SOLID, cR as GalleryTemplate, cS as Gap, cT as GlassOptions, cU as GlobalSearch, cV as GlobalSearchProps, cW as Grid, cX as GridCols, cY as GridColumn, cZ as GridProps, c_ as HeatmapChart, c$ as HeatmapChartProps, d0 as HelpCenter, d1 as HelpCenterDoc, d2 as HelpCenterProps, d3 as HexInput, d4 as HistogramBin, d5 as HistogramChart, d6 as HistogramChartProps, d7 as Hsv, d8 as INPUT_BASE, d9 as INPUT_SIZES, da as IconButton, db as IconButtonClassesOptions, dc as IconButtonProps, dd as IconRail, de as IconRailButton, df as IconRailButtonProps, dg as IconRailLabels, dh as IconRailLabelsShown, di as IconRailOrientation, dj as IconRailProps, dk as ImageFocusPoint, dl as ImageFocusPointProps, dm as Inline, dn as InlineProps, dp as Input, dq as InputNumber, dr as InputNumberProps, ds as InputProps, dt as InputSize, du as Justify, dv as Kanban, dw as KanbanColumn, dx as KanbanProps, dy as Kbd, dz as KbdProps, dA as KbdSize, dB as KbdTone, dC as Label, dD as LabelClassesOptions, dE as LabelProps, dF as LadderScale, dG as LanguagePanel, dH as LanguagePanelProps, dI as LanguageSelect, dJ as LanguageSelectProps, dK as LinearScale, dL as LinkFilter, dM as LinkFilterField, dN as LinkKindChoice, dO as LinkOption, dP as LinkOptionGroup, dQ as LinkPicker, dR as LinkPickerFieldProps, dS as LinkPickerProps, dT as LinkPickerWindowProps, dU as LinkRules, dV as LinkTarget, dW as ListDrop, dX as ListFooter, dY as ListLoadError, dZ as ListLoadErrorProps, d_ as ListMove, d$ as ListRow, e0 as ListRowProps, e1 as LoadingSpinner, e2 as LoadingSpinnerProps, e3 as MAX_FRACTION_DIGITS, e4 as MENU_MAX_HEIGHT, e5 as MOD, e6 as MOTION, e7 as MOTION_DURATIONS, e8 as Markdown, e8 as MarkdownLite, e9 as MarkdownLiteProps, e9 as MarkdownProps, ea as MediaUploadField, eb as MediaUploadFieldProps, ec as MediaUploadGrid, ed as MediaUploadGridItem, ee as MediaUploadGridProps, ef as MenuPos, eg as Meter, eh as MeterProps, ei as MetricBar, ej as MetricBarProps, ek as Milestone, el as MilestoneKind, em as MilestoneTimeline, en as MilestoneTimelineProps, eo as MotionSpeed, eq as NEXT_CHUNK_PATH_PREFIX, er as NativeSelect, es as NiceAxis, et as NumericKeypad, eu as NumericKeypadProps, ev as OVERLAY_OPEN_EVENT, ew as PLACEHOLDER_INK, ex as POPUP_MAX_WIDTH, ey as POST_PRODUCTION_STATUSES, ez as PageHeader, eA as PageHeaderProps, P as PaginatedResponse, eB as Pagination, eC as PaginationProps, eD as PaperclipGlyph, eE as Paragraph, eF as ParagraphProps, eG as PieChart, eH as PieChartProps, eI as PieSegment, eJ as PlotGeometry, eK as Point, eL as Popover, eM as PopoverAlign, eN as PopoverProps, eO as PopoverRenderProps, eP as PopoverSide, eQ as PopupMenu, eR as PopupMenuDivider, eS as PopupMenuItem, eT as PopupMenuItemProps, eU as PopupMenuLabel, eV as PopupMenuProps, eW as PopupSubmenu, eX as PopupSubmenuProps, eY as PortalBrandingContextValue, eZ as PortalBrandingProvider, e_ as PortalBrandingProviderProps, e$ as ProductionTimeline, f0 as ProductionTimelineProps, f1 as ProductionTimelineSnapshot, f2 as ProgressItem, f3 as PublicPortal, f4 as PublicPortalBranding, f5 as RADAR_SERIES_CAP, f6 as RADIUS_ROLES, f7 as ROW_HEIGHTS, f8 as RadarAxis, f9 as RadarChart, fa as RadarChartProps, fb as RadarSeries, fc as RadialBarChart, fd as RadialBarChartProps, fe as RadialBarRow, ff as Radio, fg as RadioGroup, fh as RadioGroupOption, fi as RadioGroupOrientation, fj as RadioGroupProps, fk as RadioProps, fl as RadiusRole, fm as Range, fn as RangeChart, fo as RangeChartProps, fp as RangeRow, fq as RankedBars, fr as RankedBarsProps, fs as RankedBarsRow, ft as ResizeHandle, fu as ResizeHandleOrientation, fv as ResizeHandleProps, fw as ResizeHandleSide, fx as ResizeHandleStackSide, fy as ResolvedPortalBrandAsset, fz as Result, fA as ResultProps, fB as ResultStatus, fC as RevealDirection, fD as SCATTER_SERIES_CAP, fE as SERIES_SLOT_COUNT, fF as SERIES_VARS, fG as SHELL_LANGUAGE_STORAGE_KEY, fH as SHIFT, fI as SPACING_ROLES, fJ as SPACING_SCALE, fK as STAGES, fL as STALE_CHUNK_RELOAD_COOLDOWN_MS, fM as STALE_CHUNK_RELOAD_KEY, fN as STATUS_VARS, fO as SankeyChart, fP as SankeyChartProps, fQ as SankeyLink, fR as SankeyNode, fS as ScatterChart, fT as ScatterChartProps, fU as ScatterPoint, fV as ScatterSeries, S as SearchConfig, fW as SearchListRoute, fX as SearchProvider, fY as SearchQuickAction, fZ as SearchResponse, f_ as SearchResult, f$ as SearchableItem, g0 as SearchableOption, g1 as SearchableOptionGroup, g2 as SearchableSelect, g3 as SearchableSelectBaseProps, g4 as SearchableSelectMultipleProps, g5 as SearchableSelectProps, g6 as Segmented, g7 as SegmentedOption, g8 as SegmentedProps, g9 as SegmentedSize, ga as Select, gb as SelectBaseProps, gc as SelectItem, gd as SelectMultipleProps, ge as SelectOption, gf as SelectOptionGroup, gg as SelectProps, gh as SemanticGroup, gi as SeriesSlots, gj as SettingRow, gk as SettingRowProps, gl as SeverityTone, go as ShellLanguage, gp as ShellLanguageProvider, gq as ShellLanguageState, gr as ShellPrefsAdapter, gs as ShellPrefsProvider, gt as SidebarActionButton, gu as SidebarActionButtonProps, gv as SidebarGroupLabel, gw as SidebarGroupLabelProps, gx as SidebarLayout, gy as SidebarLayoutProps, gz as SidebarNavGroup, gA as SidebarNavGroupProps, gB as SidebarNavItem, gC as SidebarNavItemProps, gD as Skeleton, gE as SkeletonProps, gF as SkeletonVariant, gG as Slider, gH as SliderGroup, gI as SliderProps, gJ as SliderSize, gK as Snippet, gL as SnippetProps, gM as SnippetSize, gN as SnippetVariant, a as SortState, gO as SortableList, gP as SortableListProps, gQ as SortableListSpacing, gR as SpacingRole, gS as SpacingStep, gT as Sparkline, gU as SparklineProps, gV as Stack, gW as StackProps, gX as StaleChunkReloadOptions, gY as StatCard, gZ as StatCardProps, g_ as StatTile, g$ as StatTileProps, h0 as Statistic, h1 as StatisticProps, h2 as StatisticSize, h3 as StatisticTone, h4 as StatusBadge, h5 as StatusBadgeProvider, h6 as StatusEmphasis, h7 as StepItem, h8 as Stepper, h9 as StepperProps, ha as StrokeVariant, hb as SunburstChart, hc as SunburstChartProps, hd as SunburstNode, he as Switch, hf as SwitchProps, hg as SwitchSize, hh as TYPE_SCALE, hi as TabItem, hj as Tabs, hk as TabsProps, hl as TagInput, hm as TagInputOption, hn as TagInputProps, ho as TagInputTone, hp as Text, hq as TextLinkField, hr as TextLinkFieldProps, hs as TextProps, ht as TextSize, hu as TextTone, hv as TextWeight, hw as Textarea, hx as TextareaProps, hy as Theme, hz as TileButton, hA as TileButtonProps, hB as TileSize, hC as TimeAgo, hD as TimeAgoProps, hE as TimePicker, hF as TimePickerProps, hG as TimeSeriesChart, hH as TimeSeriesChartProps, hI as TimeSeriesSeries, hJ as TimelineMarker, hK as TimelineMarkerKind, hL as TimelineReport, hM as TimelineScrubProgress, hN as TimelineTrack, hO as TimelineTrackItem, hP as TimelineTrackKind, hQ as TimelineTrackPending, hR as TimelineTrackPhase, hS as TimelineTrackPlayback, hT as TimelineTrackProps, hU as TimelineTrackThumb, hV as Title, hW as TitleLevel, hX as TitleProps, hY as ToastOptions, hZ as ToastPlacement, h_ as Tooltip, h$ as TooltipProps, i0 as TopNav, i1 as TopNavItem, i2 as TopNavProps, i3 as Tree, i4 as TreeDrop, i5 as TreeEmptySlot, i6 as TreeEmptySlotProps, i7 as TreeGroup, i8 as TreeGroupLabel, i9 as TreeGroupProps, ia as TreeMove, ib as TreeProps, ic as TreeRow, id as TreeRowProps, ie as TreeSeam, ig as TreeSeamProps, ih as TreemapChart, ii as TreemapChartProps, ij as TreemapItem, ik as TreemapTile, il as TypeStep, im as UseAppUpdateOptions, io as UseContextMenu, ip as UseProductionTimelineOpts, iq as VERSION, ir as VITE_PRELOAD_ERROR_EVENT, is as WaterfallChart, it as WaterfallChartProps, iu as WaterfallStep, iv as WidthsBar, iw as WidthsBarProps, ix as ZLayer, iy as Z_LAYERS, iz as angleScale, iA as appendKey, iB as applyCorners, iC as applyIconSet, iD as applyThemePrefs, iE as arcPath, iF as areaBetween, iG as areaFrom, iH as assignSeriesSlots, iI as autoHighlightIndex, iJ as backspace, iK as bandScale, iL as binValues, iM as budgetState, iN as bumpPath, iO as buttonClasses, iP as calcOverall, iQ as calcReportOverall, iR as colorFill, iS as colorSwatchClasses, iT as columnSharesWidths, iU as confirm, iV as confirmDestructive, iW as curvePath, iX as dashFor, iZ as dismissPopups, i_ as fillFor, i$ as fillId, j0 as fmtSliderDate, j1 as fromDateKey, j2 as glassStyle, j3 as glowId, j4 as groundId, j5 as groupColors, j6 as hexToHsv, j7 as highlightOpacity, j8 as hsvToHex, j9 as iconButtonClasses, ja as inputClasses, jb as installStaleChunkReload, jc as isMac, jd as isSeverityTone, je as isSpacingStep, jf as isStaleChunkError, jh as labelClasses, ji as ladderScale, jj as languageSelectWidth, jk as leavesContextMenuAlone, jl as linearPath, jm as linearScale, jn as logScale, jo as maskId, jp as matchShellLanguage, jq as mediaFileName, jr as monotonePath, js as niceAxis, jt as niceMax, ju as openGlobalSearch, jv as parseHexColor, jw as polygonPoints, jx as popupBounds, jy as prompt, jz as pushRecentSearch, jA as radiusScale, jB as readSavedShellLanguage, jC as registerModalEscapeInterceptor, jD as resolveBrandMarkTreatment, jE as resolveColumnShares, jF as resolveColumnWidths, jG as resolveCorners, jH as resolvePortalBrandAsset, jI as resolveSeriesColor, jJ as resolveSeriesColorWithin, jK as resolveShellLanguage, jL as resolveTheme, jM as sanitizeRecentSearches, jN as saveShellLanguage, jO as seriesColor, jP as severityOf, jQ as solidSurfaceStyle, jR as splinePath, jS as squarify, jT as stagger, jU as stepPath, jV as tabButtonId, jW as tabPanelId, jX as toDateKey, jY as toDayMs, jZ as toISODate, j_ as toast, j$ as toggleSeriesSlot, k0 as useAppUpdate, k1 as useClickOutside, k2 as useConfirm, k3 as useContextMenu, k4 as useDebouncedValue, k5 as useDropdownPosition, k6 as useFocusTrap, k7 as useHighlight, k8 as useIsMobile, k9 as useLocalStoragePrefs, ka as usePlotWidth, kb as usePortalBranding, kc as useProductionTimeline, kd as useScrollLock, ke as useShellLanguage, kf as useShellPrefs, kg as useStatusLabel, kh as useTheme } from '../index-DsObAHbf.js';
|
|
2
2
|
export { C as CurrencyFormat, D as DATE_FORMAT_OPTIONS, a as DateFormatKey, E as EMPTY_VALUE, F as FOCAL_DEFAULT, b as FOCAL_NUDGE_COARSE, c as FOCAL_NUDGE_STEP, d as FocalPoint, e as FormatDateOptions, f as FormatMoneyOptions, T as TZ_AUTO, g as TimeAgoOptions, h as currencyDecimals, i as currencySymbol, j as firstDayOfWeek, k as focalFromRect, l as formatBytes, m as formatDate, n as formatDateTime, o as formatFocal, p as formatMoney, q as formatTime, r as getUserDateFormat, s as getUserTimezone, t as nudgeFocal, u as parseFocal, v as setCurrencyFormats, w as setUserDateFormat, x as setUserTimezone, y as syncTimezoneFromProfile, z as timeAgo } from '../index-CHufemKB.js';
|
|
3
3
|
export { isSafeLinkHref } from '../markup/index.js';
|
|
4
4
|
export { FileIntakeAlert, FileIntakeLimits, FileIntakeOptions, FileRejection, FileRejectionReason, acceptsFile, useFileIntake } from '../file-intake/index.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{APP_UPDATE_POLL_MS,Accordion,AlignmentGrid,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,BORDER_WIDTHS,Banner,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,COLUMN_COUNT_MAX,COLUMN_COUNT_WIDTHS,COLUMN_SHARES_EQUAL,COLUMN_SHARE_MIN,CONTROL_HEIGHTS,CORNERS,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CornersInput,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,DisplayChips,Divider,Drawer,DropdownMenu,ELEVATION_LEVELS,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FONT_WEIGHTS,FilePicker_default as FilePicker,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,IconButton_default as IconButton,IconRail,IconRailButton,ImageFocusPoint,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LanguagePanel,LanguageSelect,LinkPicker,ListFooter,ListLoadError,ListRow,MAX_FRACTION_DIGITS,MOTION,MOTION_DURATIONS,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RADIUS_ROLES,ROW_HEIGHTS,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,SPACING_ROLES,SPACING_SCALE,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,Skeleton,Slider,SliderGroup,Snippet,SortableList,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,TYPE_SCALE,Tabs,TagInput,Text,TextLinkField,Textarea_default as Textarea,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,WidthsBar,angleScale,appendKey,applyCorners,applyIconSet,applyThemePrefs,arcPath,areaBetween,areaFrom,assignSeriesSlots,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,columnSharesWidths,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,groupColors,hexToHsv,highlightOpacity,hsvToHex,isSeverityTone,isSpacingStep,labelClasses,ladderScale,languageSelectWidth,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceAxis,niceMax,parseHexColor,polygonPoints,radiusScale,resolveColumnShares,resolveColumnWidths,resolveCorners,resolvePortalBrandAsset,resolveSeriesColor,resolveSeriesColorWithin,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,toggleSeriesSlot,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useStatusLabel,useTheme}from"../chunk-
|
|
2
|
+
export{APP_UPDATE_POLL_MS,Accordion,AlignmentGrid,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,BORDER_WIDTHS,Banner,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,COLUMN_COUNT_MAX,COLUMN_COUNT_WIDTHS,COLUMN_SHARES_EQUAL,COLUMN_SHARE_MIN,CONTROL_HEIGHTS,CORNERS,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColorPicker,ColorPickerPanel,ColorSwatch,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,ContextMenu,CornersInput,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,DisplayChips,Divider,Drawer,DropdownMenu,ELEVATION_LEVELS,EmailTemplate,EmptyState,EmptyValue,ErrorBoundary,ErrorPage,FONT_WEIGHTS,FilePicker_default as FilePicker,FloatingBar,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HexInput,HistogramChart,IconButton_default as IconButton,IconRail,IconRailButton,ImageFocusPoint,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LanguagePanel,LanguageSelect,LinkPicker,ListFooter,ListLoadError,ListRow,MAX_FRACTION_DIGITS,MOTION,MOTION_DURATIONS,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RADIUS_ROLES,ROW_HEIGHTS,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,SPACING_ROLES,SPACING_SCALE,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavGroup,SidebarNavItem,Skeleton,Slider,SliderGroup,Snippet,SortableList,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,TYPE_SCALE,Tabs,TagInput,Text,TextLinkField,Textarea_default as Textarea,TileButton_default as TileButton,TimeAgo,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,TopNav,Tree,TreeEmptySlot,TreeGroup,TreeGroupLabel,TreeRow,TreeSeam,TreemapChart,WaterfallChart,WidthsBar,angleScale,appendKey,applyCorners,applyIconSet,applyThemePrefs,arcPath,areaBetween,areaFrom,assignSeriesSlots,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,colorFill,colorSwatchClasses,columnSharesWidths,curvePath,dashFor,fillFor,fillId,fmtSliderDate,fromKey as fromDateKey,glowId,groundId,groupColors,hexToHsv,highlightOpacity,hsvToHex,isSeverityTone,isSpacingStep,labelClasses,ladderScale,languageSelectWidth,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceAxis,niceMax,parseHexColor,polygonPoints,radiusScale,resolveColumnShares,resolveColumnWidths,resolveCorners,resolvePortalBrandAsset,resolveSeriesColor,resolveSeriesColorWithin,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,toggleSeriesSlot,useAppUpdate,useClickOutside,useContextMenu,useDebouncedValue,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useStatusLabel,useTheme}from"../chunk-QKMXKK6P.js";export{Breadcrumbs}from"../chunk-Z2TTHY7G.js";export{ResizeHandle,SidebarLayout}from"../chunk-GIWC2ZTG.js";export{BrandMark,GlobalSearch,openGlobalSearch,pushRecent as pushRecentSearch,resolveBrandMarkTreatment,sanitizeRecent as sanitizeRecentSearches}from"../chunk-BQ7GR7H6.js";export{EditableGrid}from"../chunk-BVYOUFSW.js";import"../chunk-BR22X7E5.js";import"../chunk-VOFDPOB6.js";export{INPUT_BASE,INPUT_SIZES,PLACEHOLDER_INK,inputClasses}from"../chunk-HJQAE6SP.js";export{isSafeLinkHref}from"../chunk-PJPK2ADX.js";export{ENGLISH,SHELL_LANGUAGE_STORAGE_KEY,ShellLanguageProvider,matchShellLanguage,readSavedShellLanguage,resolveShellLanguage,saveShellLanguage,useShellLanguage}from"../chunk-RBKIYZ7H.js";export{toast_default as toast}from"../chunk-RUHUTZN4.js";export{ALT,ALT_SHIFT_D,ALT_SHIFT_E,ALT_SHIFT_N,CMD_A,CMD_DOT,CMD_ENTER,CMD_K,CMD_S,ENTER,Kbd,LoadingSpinner,MOD,NEXT_CHUNK_PATH_PREFIX,Result,SHIFT,STALE_CHUNK_RELOAD_COOLDOWN_MS,STALE_CHUNK_RELOAD_KEY,ShellPrefsProvider,VITE_PRELOAD_ERROR_EVENT,installStaleChunkReload,isMac,isStaleChunkError,useIsMobile,useLocalStoragePrefs,useShellPrefs}from"../chunk-ZRU5F2XT.js";import"../chunk-5A7MWTXX.js";export{Button_default as Button,MENU_MAX_HEIGHT,POPUP_MAX_WIDTH,Tooltip,popupBounds,useDropdownPosition}from"../chunk-IJ7RXIWX.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-76VCH7N6.js";export{PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,leavesContextMenuAlone}from"../chunk-IQDY2YFN.js";import"../chunk-UVBK6YSR.js";export{buttonClasses,iconButtonClasses}from"../chunk-JTNKC4CR.js";export{GLASS_DIVIDER,glassStyle,solidSurfaceStyle}from"../chunk-7IQ3B77H.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups,registerModalEscapeInterceptor}from"../chunk-FIEA5CGB.js";import"../chunk-D65T4H6J.js";export{VERSION}from"../chunk-P7IKSYFJ.js";import"../chunk-KNUR2UEG.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-M4TRVJTO.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-QRCDQPJA.js";import"../chunk-C3QOHMR6.js";export{FOCAL_DEFAULT,FOCAL_NUDGE_COARSE,FOCAL_NUDGE_STEP,focalFromRect,formatFocal,nudgeFocal,parseFocal}from"../chunk-AP2QEJXQ.js";export{DATE_FORMAT_OPTIONS,EMPTY_VALUE,TZ_AUTO,currencyDecimals,currencySymbol,firstDayOfWeek,formatBytes,formatDate,formatDateTime,formatMoney,formatTime,getUserDateFormat,getUserTimezone,setCurrencyFormats,setUserDateFormat,setUserTimezone,syncTimezoneFromProfile,timeAgo}from"../chunk-W32SKK3D.js";export{ICON_NAMES,isIconName}from"../chunk-KBOYLXAT.js";export{Icon,activeIconSet,iconSets,iconsVersion,registerIconSet,registerIcons,resolveIcon,setDefaultIconSet,setIconSet,subscribeIcons}from"../chunk-ZGUQLVY4.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-shell",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.20.1",
|
|
4
4
|
"description": "Desktop-style React UI shell — windows, taskbar, start menu, sticky notes, frosted glass theming, and bundled apps.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-QWSVX6OP.js";import{useWidgetSettings as n}from"./chunk-IBGEW3OA.js";import"./chunk-DSSLOQDW.js";import"./chunk-SCJT2XXU.js";import"./chunk-ZRU5F2XT.js";import"./chunk-5A7MWTXX.js";import"./chunk-WYNQLAKD.js";import"./chunk-QBXX5A7U.js";import"./chunk-IQDY2YFN.js";import"./chunk-UVBK6YSR.js";import"./chunk-JTNKC4CR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-D65T4H6J.js";import"./chunk-KNUR2UEG.js";import"./chunk-QRCDQPJA.js";import"./chunk-C3QOHMR6.js";import{Icon as r}from"./chunk-ZGUQLVY4.js";import{useState as l,useRef as c,useCallback as i,useEffect as a}from"react";import{jsxs as o,Fragment as s,jsx as u}from"react/jsx-runtime";var d="calc_appearance";function h(){const[h,m]=l("0"),[b,k]=l(null),[p,g]=l(null),[N,y]=l(!1),[x,f]=l(""),[v,C]=l([]),[$,j]=l(!1),[w,E]=l(()=>e(d)),[S,T]=l(!1),[A,Q]=l(w),W=c(null);n(i(()=>{Q({...w}),T(!0)},[w]));const X=i(e=>{f(""),m(t=>N||"0"===t?(y(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),B=i(()=>{m("0"),k(null),g(null),y(!1)},[]),D=i((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),F=i(e=>{const t=parseFloat(h);if(null!==b&&p&&!N){const e=D(b,t,p);m(String(e)),k(e),C(n=>[`${b} ${p} ${t} = ${e}`,...n].slice(0,20))}else k(t);g(e),y(!0)},[h,b,p,N,D]),U=i(()=>{if(null===b||!p)return;const e=parseFloat(h),t=D(b,e,p),n=`${b} ${p} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),f(n),m(String(t)),k(null),g(null),y(!0)},[h,b,p,D]),R=i(()=>{m(e=>String(parseFloat(e)/100))},[]),I=i(()=>{m(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);a(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?X(e.key):"."===e.key?X("."):"+"===e.key?F("+"):"-"===e.key?F("-"):"*"===e.key?F("×"):"/"===e.key?(e.preventDefault(),F("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&W.current?.contains(e.target)&&e.preventDefault(),U()):"Escape"===e.key?B():"Backspace"===e.key?m(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&R())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[X,F,U,B,R]);const L="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",O=`${L} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,J=`${L} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Y=`${L} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,G=`${L} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
-
return o(s,{children:[
|
|
3
|
-
/* @__PURE__ */o("div",{ref:W,className:"flex flex-col h-full",style:{opacity:w.activeOpacity/100,backdropFilter:w.activeBlur>0?`blur(${w.activeBlur}px)`:void 0},children:[
|
|
4
|
-
/* @__PURE__ */o("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:v.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(x||p&&null!==b)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${b} ${p} ${N?"":h}`}),
|
|
6
|
-
/* @__PURE__ */o("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(h),j(!0),setTimeout(()=>j(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,$?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(h)})]})]}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
-
/* @__PURE__ */u("button",{onClick:B,className:Y,children:"AC"}),
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:I,className:Y,children:"+/−"}),
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:R,className:Y,children:"%"}),
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>F("÷"),className:`${J} ${"÷"===p?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>X("7"),className:O,children:"7"}),
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>X("8"),className:O,children:"8"}),
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>X("9"),className:O,children:"9"}),
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>F("×"),className:`${J} ${"×"===p?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>X("4"),className:O,children:"4"}),
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>X("5"),className:O,children:"5"}),
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>X("6"),className:O,children:"6"}),
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>F("-"),className:`${J} ${"-"===p?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>X("1"),className:O,children:"1"}),
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>X("2"),className:O,children:"2"}),
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>X("3"),className:O,children:"3"}),
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>F("+"),className:`${J} ${"+"===p?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>X("0"),className:`${O} col-span-2`,children:"0"}),
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>X("."),className:O,children:"."}),
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:U,className:G,children:"="})]})]}),
|
|
29
|
-
/* @__PURE__ */u(t,{open:S,onClose:()=>T(!1),title:"Calculator Settings",appearance:A,onAppearanceChange:Q,onSave:()=>{E(A),localStorage.setItem(d,JSON.stringify(A)),T(!1)}})]})}export{h as default};
|
package/dist/Files-S45MKBYC.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import{openPreviewFile as e}from"./chunk-B4PGVDB6.js";import{Breadcrumbs as t}from"./chunk-Z2TTHY7G.js";import{SidebarLayout as a}from"./chunk-VFBUDSMF.js";import{getFilesDemoTree as r}from"./chunk-7HLTPMQV.js";import{AboutApp as n}from"./chunk-NXYHRDRD.js";import{peekFilesViewRequest as s,consumeFilesViewRequest as i,FILES_SHOW_TRASH_EVENT as l,FILES_OPEN_DESKTOP_FOLDER_EVENT as o,subscribeDesktopFolders as d,getDesktopFoldersSnapshot as c,FolderGlyph as m,DesktopItemMiniIcon as h,desktopItemTypeLabel as p}from"./chunk-XN7CAWSZ.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as u,WindowTitle as f}from"./chunk-IBGEW3OA.js";import"./chunk-DSSLOQDW.js";import"./chunk-SCJT2XXU.js";import{toast_default as x}from"./chunk-RUHUTZN4.js";import"./chunk-ZRU5F2XT.js";import"./chunk-5A7MWTXX.js";import"./chunk-WYNQLAKD.js";import{confirm as g,prompt as y}from"./chunk-QBXX5A7U.js";import"./chunk-IQDY2YFN.js";import"./chunk-UVBK6YSR.js";import"./chunk-JTNKC4CR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-D65T4H6J.js";import"./chunk-ERDQLQVK.js";import"./chunk-KNUR2UEG.js";import"./chunk-QRCDQPJA.js";import"./chunk-C3QOHMR6.js";import{formatBytes as b}from"./chunk-W32SKK3D.js";import{Icon as N}from"./chunk-ZGUQLVY4.js";import{useState as k,useEffect as w,useSyncExternalStore as v,useRef as j,useCallback as C}from"react";import{jsxs as $,jsx as D,Fragment as L}from"react/jsx-runtime";var T="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",E={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function R(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function S(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function F(){const F=T.replace(/\/$/,""),U=null!==r(),[P,W]=k("/"),[A,I]=k([]),[M,O]=k([]),[B,V]=k(null),[Q,H]=k(!0),[K,X]=k(!1),[z,_]=k(null),[J,Y]=k(!1),[G,Z]=k(()=>{const e=s();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});w(()=>{i()},[]);const[q,ee]=k([]);w(()=>{const e=()=>{i(),Z("trash")},t=e=>{i();const t=e.detail?.folderId;t&&Z({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(o,t),()=>{window.removeEventListener(l,e),window.removeEventListener(o,t)}},[]);const te=v(d,c,c),ae="object"==typeof G?G.desktopFolderId:null,re=ae?te?.folders.find(e=>e.id===ae)??null:null,ne=ae&&te?.itemsByFolder[ae]||[];w(()=>{ae&&te&&!te.folders.some(e=>e.id===ae)&&Z("files")},[ae,te]);const se=j(0),ie=j(null),{openPage:le,openEntity:oe}=u(),de=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>le(e)}):"page"===t.entityType?le(t.entityId):oe(t.entityType,t.entityId,null,t.label)},ce=C((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),me=C(async()=>{try{const e=await ce(`${F}/api/quota`);if(e.ok){const t=await e.json();_({used:t.used,limit:t.limit})}}catch{}},[ce,F]),he=C(async e=>{if(V(null),U){const t=function(e){const t=r();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return I(t),W(e),X(!1),H(!1),void("/"===e&&O(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}H(!0);try{const t=await ce(`${F}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void x.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),r=a.entries||[];I(r),W(a.path||e),X(!1),"/"===(a.path||e)&&O(r.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){X(!0)}finally{H(!1)}me()},[ce,F,me,U]),pe=C(async()=>{if(U)return ee([]),void H(!1);H(!0),V(null);try{const e=await ce(`${F}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void x.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ee(t.entries||[]),X(!1)}catch{X(!0)}finally{H(!1)}me()},[ce,F,me,U]);w(()=>{"files"===G?he(P):"trash"===G&&pe()},[P,G]);const ue=async e=>{const t=R(P,e.name);try{const a=await ce(`${F}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void x.error(`Download failed (${a.status})`);const r=await a.blob(),n=URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){x.error(e?.message||"Download failed")}},fe=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await ce(`${F}/api/upload?path=${encodeURIComponent(P)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));x.error(`Quota exceeded — ${b(a)} free, ${e.name} is ${b(t.attempted||e.size)}`)}else x.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){x.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}he(P)},xe=()=>{se.current=0,Y(!1)};if(w(()=>{const e=()=>xe();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),K)/* @__PURE__ */
|
|
2
|
-
return $("div",{className:"flex flex-col h-full bg-white",children:[
|
|
3
|
-
/* @__PURE__ */D(f,{title:"Files - offline"}),
|
|
4
|
-
/* @__PURE__ */D("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */$("div",{className:"max-w-md",children:[
|
|
5
|
-
/* @__PURE__ */D(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
|
|
6
|
-
/* @__PURE__ */D("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
|
|
7
|
-
/* @__PURE__ */$("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
|
|
8
|
-
/* @__PURE__ */D("span",{className:"font-mono",children:F}),". Make sure the server is running — see ",
|
|
9
|
-
/* @__PURE__ */D("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
|
|
10
|
-
/* @__PURE__ */D("button",{onClick:()=>he(P),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const ge="/"===P?[]:P.split("/").filter(Boolean),ye=z&&z.limit>0?Math.min(100,Math.round(z.used/z.limit*100)):0,be=ye>90?"bg-red-500":ye>75?"bg-amber-500":"bg-blue-500",Ne=[{label:"My files",onClick:()=>W("/")},...ge.map((e,t)=>({label:e,onClick:()=>W("/"+ge.slice(0,t+1).join("/"))}))],ke=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),we=e=>/* @__PURE__ */D("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */D("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),ve=/* @__PURE__ */$("nav",{className:"p-2",children:[
|
|
11
|
-
/* @__PURE__ */D("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
|
|
12
|
-
/* @__PURE__ */$("button",{onClick:()=>{Z("files"),W("/")},className:ke("files"===G&&"/"===P),children:[we("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),M.map(e=>/* @__PURE__ */$("button",{onClick:()=>{Z("files"),W("/"+e)},className:ke("files"===G&&P==="/"+e),children:[we("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
|
|
13
|
-
/* @__PURE__ */D("span",{className:"truncate",children:e})]},e)),!U&&/* @__PURE__ */$("button",{onClick:()=>Z("trash"),className:ke("trash"===G),children:[we("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),te&&te.folders.length>0&&/* @__PURE__ */$(L,{children:[
|
|
14
|
-
/* @__PURE__ */D("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),te.folders.map(e=>/* @__PURE__ */$("button",{onClick:()=>Z({desktopFolderId:e.id}),className:ke(ae===e.id),children:[
|
|
15
|
-
/* @__PURE__ */D(m,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
16
|
-
/* @__PURE__ */D("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */D("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
|
|
17
|
-
return $("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{U||"object"==typeof G||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),se.current++,J||Y(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{se.current>0&&se.current--,0===se.current&&Y(!1)},onDrop:e=>{e.preventDefault(),xe(),U||"object"==typeof G||e.dataTransfer.files?.length&&fe(e.dataTransfer.files)},children:[
|
|
18
|
-
/* @__PURE__ */D(f,{title:re?`Files - ${re.name}`:"Files"+("/"===P?"":" - "+P)}),
|
|
19
|
-
/* @__PURE__ */D(n,{app:"files"}),
|
|
20
|
-
/* @__PURE__ */D("input",{ref:ie,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&fe(e.target.files),ie.current&&(ie.current.value="")}}),
|
|
21
|
-
/* @__PURE__ */D("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */D(a,{sidebar:ve,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */$("div",{className:"flex h-full min-w-0 flex-col",children:[
|
|
22
|
-
/* @__PURE__ */$("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */$(L,"files"===G?{children:[
|
|
23
|
-
/* @__PURE__ */D("button",{onClick:()=>W(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(P)),disabled:"/"===P,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */D(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
24
|
-
/* @__PURE__ */D("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */D(t,{items:Ne,maxItems:5})}),
|
|
25
|
-
/* @__PURE__ */D("button",{onClick:()=>he(P),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */D(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!U&&/* @__PURE__ */$(L,{children:[
|
|
26
|
-
/* @__PURE__ */$("button",{onClick:()=>Z("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
|
|
27
|
-
/* @__PURE__ */D(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
|
|
28
|
-
/* @__PURE__ */$("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void x.error("Folder names cannot contain slashes");const t=R(P,e),a=await ce(`${F}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void x.error(e.error||`Create folder failed (${a.status})`)}he(P)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
|
|
29
|
-
/* @__PURE__ */D(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
|
|
30
|
-
/* @__PURE__ */$("button",{onClick:()=>ie.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
|
|
31
|
-
/* @__PURE__ */D(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===G?{children:[
|
|
32
|
-
/* @__PURE__ */D("button",{onClick:()=>Z("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */D(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
33
|
-
/* @__PURE__ */D("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
|
|
34
|
-
/* @__PURE__ */D("button",{onClick:pe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */D(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
|
|
35
|
-
/* @__PURE__ */D("button",{onClick:async()=>{if(0===q.length)return;if(!await g({title:"Empty trash",message:`${q.length} item${1===q.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await ce(`${F}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void x.error(t.error||`Empty trash failed (${e.status})`)}pe()},disabled:0===q.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
|
|
36
|
-
/* @__PURE__ */D("button",{onClick:()=>Z("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */D(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
37
|
-
/* @__PURE__ */D(m,{className:"h-4 w-4 text-amber-500 ml-1"}),
|
|
38
|
-
/* @__PURE__ */D("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:re?.name??"Desktop folder"}),
|
|
39
|
-
/* @__PURE__ */D("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),z&&/* @__PURE__ */$(L,{children:[
|
|
40
|
-
/* @__PURE__ */D("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
|
-
/* @__PURE__ */$("div",{className:"flex items-center gap-2",title:`${b(z.used)} of ${b(z.limit)} used`,children:[
|
|
42
|
-
/* @__PURE__ */D("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */D("div",{className:`h-full ${be} transition-all`,style:{width:`${ye}%`}})}),
|
|
43
|
-
/* @__PURE__ */$("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[b(z.used)," / ",b(z.limit)]})]})]})]}),
|
|
44
|
-
/* @__PURE__ */D("div",{className:"flex-1 overflow-auto",children:"object"==typeof G?0===ne.length?/* @__PURE__ */D("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */$("table",{className:"w-full text-sm",children:[
|
|
45
|
-
/* @__PURE__ */D("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */$("tr",{children:[
|
|
46
|
-
/* @__PURE__ */D("th",{className:"text-left font-medium px-3 h-8",children:"Name"}),
|
|
47
|
-
/* @__PURE__ */D("th",{className:"text-left font-medium px-3 h-8 w-28",children:"Type"}),
|
|
48
|
-
/* @__PURE__ */D("th",{className:"w-56"})]})}),
|
|
49
|
-
/* @__PURE__ */D("tbody",{children:ne.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
|
|
50
|
-
return $("tr",{onClick:()=>V(t),onDoubleClick:()=>de(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
51
|
-
/* @__PURE__ */$("td",{className:"px-3 h-8 flex items-center gap-2",children:[
|
|
52
|
-
/* @__PURE__ */D(h,{item:e}),
|
|
53
|
-
/* @__PURE__ */D("span",{className:"truncate",title:e.label,children:e.label})]}),
|
|
54
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-xs text-gray-500",children:p(e)}),
|
|
55
|
-
/* @__PURE__ */$("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
56
|
-
/* @__PURE__ */D("button",{onClick:t=>{t.stopPropagation(),de(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
|
|
57
|
-
/* @__PURE__ */D("button",{onClick:t=>{t.stopPropagation(),te?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
|
|
58
|
-
/* @__PURE__ */D("button",{onClick:t=>{t.stopPropagation(),te?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===G?Q&&0===q.length?/* @__PURE__ */D("div",{className:"p-6 text-center text-sm text-gray-400",children:"Loading…"}):0===q.length?/* @__PURE__ */D("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */$("table",{className:"w-full text-sm",children:[
|
|
59
|
-
/* @__PURE__ */D("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */$("tr",{children:[
|
|
60
|
-
/* @__PURE__ */D("th",{className:"text-left font-medium px-3 h-8",children:"Name"}),
|
|
61
|
-
/* @__PURE__ */D("th",{className:"text-left font-medium px-3 h-8",children:"Original location"}),
|
|
62
|
-
/* @__PURE__ */D("th",{className:"text-right font-medium px-3 h-8 w-24",children:"Size"}),
|
|
63
|
-
/* @__PURE__ */D("th",{className:"text-right font-medium px-3 h-8 w-40",children:"Deleted"}),
|
|
64
|
-
/* @__PURE__ */D("th",{className:"w-44"})]})}),
|
|
65
|
-
/* @__PURE__ */D("tbody",{children:q.map(e=>/* @__PURE__ */$("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
|
|
66
|
-
/* @__PURE__ */$("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */D(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */D(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
|
|
67
|
-
/* @__PURE__ */D("span",{className:"truncate",title:e.name,children:e.name})]}),
|
|
68
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
69
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:b(e.size)}),
|
|
70
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?S(e.deletedAt):"—"}),
|
|
71
|
-
/* @__PURE__ */$("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
|
|
72
|
-
/* @__PURE__ */D("button",{onClick:()=>(async e=>{const t=await ce(`${F}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void x.error(e.error||`Restore failed (${t.status})`)}x.success(`Restored "${e.name}"`),pe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
|
|
73
|
-
/* @__PURE__ */D("button",{onClick:()=>(async e=>{if(!await g({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await ce(`${F}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void x.error(e.error||`Delete failed (${t.status})`)}pe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):Q&&0===A.length?/* @__PURE__ */D("div",{className:"p-6 text-center text-sm text-gray-400",children:"Loading…"}):0===A.length?/* @__PURE__ */$("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!U&&/* @__PURE__ */$(L,{children:[" Drop files here or click ",
|
|
74
|
-
/* @__PURE__ */D("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */$("table",{className:"w-full text-sm",children:[
|
|
75
|
-
/* @__PURE__ */D("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */$("tr",{children:[
|
|
76
|
-
/* @__PURE__ */D("th",{className:"text-left font-medium px-3 h-8",children:"Name"}),
|
|
77
|
-
/* @__PURE__ */D("th",{className:"text-right font-medium px-3 h-8 w-24",children:"Size"}),
|
|
78
|
-
/* @__PURE__ */D("th",{className:"text-right font-medium px-3 h-8 w-40",children:"Modified"}),
|
|
79
|
-
/* @__PURE__ */D("th",{className:"w-32"})]})}),
|
|
80
|
-
/* @__PURE__ */D("tbody",{children:A.map(t=>/* @__PURE__ */$("tr",{onClick:()=>V(t.name),onDoubleClick:()=>{"folder"===t.kind?W(R(P,t.name)):(async t=>{if(U)return;const a=R(P,t.name),r=(t.name.split(".").pop()||"").toLowerCase(),n=E[r];n?await e({filePath:a,filename:t.name,kind:n,onStaged:e=>le(e)}):ue(t)})(t)},className:"cursor-default border-b border-gray-100 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
81
|
-
/* @__PURE__ */$("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */D(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */D(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
|
|
82
|
-
/* @__PURE__ */D("span",{className:"truncate",title:t.name,children:t.name})]}),
|
|
83
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":b(t.size)}),
|
|
84
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:S(t.modifiedAt)}),
|
|
85
|
-
/* @__PURE__ */D("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!U&&/* @__PURE__ */$(L,{children:["file"===t.kind&&/* @__PURE__ */D("button",{onClick:e=>{e.stopPropagation(),ue(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
|
|
86
|
-
/* @__PURE__ */D("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void x.error("Names cannot contain slashes");const a=R(P,e.name),r=R(P,t),n=await ce(`${F}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:r})});if(!n.ok){const e=await n.json().catch(()=>({}));return void x.error(e.error||`Rename failed (${n.status})`)}he(P)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
|
|
87
|
-
/* @__PURE__ */D("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=R(P,e.name),a=await ce(`${F}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void x.error(e.error||`Delete failed (${a.status})`)}he(P)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),J&&/* @__PURE__ */D("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */D("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{F as default};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{EditableGrid as e}from"./chunk-7BX3JQBP.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-NXYHRDRD.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import{WindowTitle as a}from"./chunk-IBGEW3OA.js";import"./chunk-DSSLOQDW.js";import"./chunk-SCJT2XXU.js";import"./chunk-ZRU5F2XT.js";import"./chunk-5A7MWTXX.js";import"./chunk-WYNQLAKD.js";import"./chunk-QBXX5A7U.js";import"./chunk-IQDY2YFN.js";import"./chunk-UVBK6YSR.js";import"./chunk-JTNKC4CR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-D65T4H6J.js";import"./chunk-ERDQLQVK.js";import"./chunk-KNUR2UEG.js";import"./chunk-QRCDQPJA.js";import"./chunk-C3QOHMR6.js";import"./chunk-ZGUQLVY4.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function k(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function w(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const w=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=k(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,U]=s(0),D=l([]),E=l(C),$=l(!1);c(()=>{$.current?$.current=!1:E.current!==C&&(D.current.push(E.current),D.current.length>50&&D.current.shift()),E.current=C},[C]);const A=i(()=>{const e=D.current.pop();e&&($.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A]);const[M,R]=s(N?.title??"Untitled"),[L,B]=s(()=>g.current?.data.onEmail),Q=i(e=>{const t=k(e.csv,"Sheet 1");t&&(S([t]),U(0),R(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),B(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==w.current&&Q(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&Q(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[X,F]=s(!1),[I,K]=s(null),[O,T]=s(""),V=l(null),[Y,H]=s("1"),[J,G]=s("10"),W=C[j]||C[0],z=W.data,P=W.columns,Z=W.cellStyles??{},[_,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return _?[_]:[]},[ee,_]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:_,ae=oe?Z[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==P.length?se({data:e,columns:y(t)}):se({data:e})},[se,P.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),K(null)},ue=()=>z.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];z.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=z.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
|
|
2
|
-
return u("div",{ref:m,className:"flex flex-col h-full",children:[
|
|
3
|
-
/* @__PURE__ */d(a,{title:`${me=M||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
|
|
4
|
-
/* @__PURE__ */d(t,{app:"spreadsheet"}),
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[X?/* @__PURE__ */d("input",{type:"text",value:M,onChange:e=>R(e.target.value),onBlur:()=>F(!1),onKeyDown:e=>{"Enter"===e.key&&F(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>F(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:M||"Untitled"}),
|
|
6
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
7
|
-
/* @__PURE__ */d("input",{ref:V,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),U(0),R(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),R(r)}V.current&&(V.current.value="")},className:"hidden"}),
|
|
8
|
-
/* @__PURE__ */d("button",{onClick:()=>V.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
|
|
9
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${M||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),L&&/* @__PURE__ */d("button",{onClick:()=>L(ue(),`${M||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
|
|
10
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
11
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
12
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:Y,onChange:e=>H(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
13
|
-
/* @__PURE__ */d("button",{onClick:()=>(e=>{const t=P.length+e;se({columns:y(t),data:z.map(t=>[...t,...Array(e).fill("")])})})(parseInt(Y)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
|
|
14
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
15
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:J,onChange:e=>G(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
16
|
-
/* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(J)||10,void se({data:[...z,...Array.from({length:e},()=>Array(P.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
|
|
17
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
18
|
-
/* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
|
|
19
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
20
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
|
|
21
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
|
|
22
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
|
|
23
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
|
|
24
|
-
/* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
|
|
25
|
-
/* @__PURE__ */d("option",{value:"sm",children:"XS"}),
|
|
26
|
-
/* @__PURE__ */d("option",{value:"base",children:"S"}),
|
|
27
|
-
/* @__PURE__ */d("option",{value:"lg",children:"M"}),
|
|
28
|
-
/* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
|
|
29
|
-
/* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:P,data:z,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:Z,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
|
|
30
|
-
/* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
|
|
31
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>U(t),onDoubleClick:()=>{K(t),T(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&U(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:I===t?/* @__PURE__ */d("input",{type:"text",value:O,onChange:e=>T(e.target.value),onBlur:()=>ie(t,O||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,O||e.name),"Escape"===r.key&&K(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
|
|
32
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),U(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
|
|
33
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
|
|
34
|
-
/* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
|
|
35
|
-
/* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
|
|
36
|
-
/* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
|
|
37
|
-
/* @__PURE__ */u("span",{children:[z.length," × ",P.length]})]})]})]});var me}export{w as default};
|