efficient-shell 4.150.0 → 4.155.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +95 -1
  2. package/dist/{Browser-6DPP4K2O.js → Browser-HNSQP7PK.js} +14 -14
  3. package/dist/Calculator-PWWTNCT7.js +29 -0
  4. package/dist/ConfirmDialog-UVIZK7EY.js +1 -0
  5. package/dist/{CurrencyConverter-KWNYRYOZ.js → CurrencyConverter-OH4WAA74.js} +6 -6
  6. package/dist/{Documents-LDCCZRKT.js → Documents-HG6NJCIB.js} +8 -8
  7. package/dist/{Files-QUAXBRVO.js → Files-22E36TVC.js} +22 -22
  8. package/dist/{Notepad-CYFDC4FM.js → Notepad-YHSWKS4C.js} +11 -11
  9. package/dist/PdfViewer-W65LHKXZ.js +1 -0
  10. package/dist/{PomodoroTimer-EOQDA5J7.js → PomodoroTimer-BXJZKA4W.js} +27 -27
  11. package/dist/{Preview-GZP7YTW3.js → Preview-6X5QAHHR.js} +14 -14
  12. package/dist/Sidebar-44I3DD2U.js +44 -0
  13. package/dist/{Spreadsheet-MXNEADWG.js → Spreadsheet-K6QSHFVS.js} +13 -13
  14. package/dist/{Stock-VVM7GK4C.js → Stock-HGSIZXAT.js} +3 -3
  15. package/dist/{Weather-4LJTQLDL.js → Weather-3VS65TQO.js} +17 -17
  16. package/dist/{WorldClock-AHTVTAI7.js → WorldClock-NI5OTEBV.js} +7 -7
  17. package/dist/apps/index.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-UB22J6EF.js → chunk-4DT7B7GZ.js} +1 -1
  20. package/dist/chunk-6UXY7MPY.js +2 -0
  21. package/dist/{chunk-L2ZO76TC.js → chunk-AC54EYVA.js} +1 -1
  22. package/dist/{chunk-IQVJ3C3D.js → chunk-C47EJ4MB.js} +1 -1
  23. package/dist/chunk-DRRIYS3R.js +113 -0
  24. package/dist/chunk-FEWQDVQJ.js +1 -0
  25. package/dist/chunk-J7LKJIZC.js +9 -0
  26. package/dist/{chunk-FHTLC7HH.js → chunk-JGHRZYNV.js} +1 -1
  27. package/dist/chunk-JHXGBYJO.js +18 -0
  28. package/dist/{chunk-4FS742BM.js → chunk-JLSOLX5J.js} +1 -1
  29. package/dist/{chunk-NPJH5MD7.js → chunk-KZPQW6UL.js} +2 -2
  30. package/dist/chunk-MVLIXV7C.js +2 -0
  31. package/dist/{chunk-SLCR26NK.js → chunk-MXLPLKRG.js} +4 -4
  32. package/dist/{chunk-I55UMU3R.js → chunk-NSXQF4YC.js} +1 -1
  33. package/dist/chunk-O35K6ZWH.js +22 -0
  34. package/dist/chunk-OSJ3ADF2.js +1 -0
  35. package/dist/{chunk-MU5H2CDL.js → chunk-RGFEKAPC.js} +2 -2
  36. package/dist/{chunk-L7TEFXIS.js → chunk-TULPGC2I.js} +15 -15
  37. package/dist/chunk-V73HRX73.js +937 -0
  38. package/dist/{chunk-KKOHUQPF.js → chunk-VGTI3BJ4.js} +1 -1
  39. package/dist/chunk-YIXQGB75.js +1 -0
  40. package/dist/{chunk-TFKB2WEB.js → chunk-ZP2V72LB.js} +7 -7
  41. package/dist/{chunk-V453E4KU.js → chunk-ZTXFXS6V.js} +6 -6
  42. package/dist/{chunk-CVTOZCM3.js → chunk-ZVAQKPRB.js} +11 -11
  43. package/dist/chunk-ZYUWLZUG.js +29 -0
  44. package/dist/file-intake/index.js +1 -1
  45. package/dist/{index-DQ52lM8L.d.ts → index-ak9Cps7c.d.ts} +86 -6
  46. package/dist/index.d.ts +75 -7
  47. package/dist/index.js +645 -638
  48. package/dist/map/index.js +1 -1
  49. package/dist/page-tabs/index.d.ts +2 -0
  50. package/dist/page-tabs/index.js +5 -21
  51. package/dist/pdf/index.js +1 -1
  52. package/dist/themes.css +35 -0
  53. package/dist/ui/index.d.ts +1 -1
  54. package/dist/ui/index.js +1 -1
  55. package/dist/ui.css +61 -0
  56. package/package.json +2 -2
  57. package/dist/Calculator-4CLXMBA4.js +0 -29
  58. package/dist/ConfirmDialog-DUYZA2FE.js +0 -1
  59. package/dist/PdfViewer-ZCT3PYXU.js +0 -1
  60. package/dist/Sidebar-CVF7C6BO.js +0 -23
  61. package/dist/chunk-57MIENLJ.js +0 -1
  62. package/dist/chunk-BJVY3LPW.js +0 -1
  63. package/dist/chunk-ET5HXDOR.js +0 -106
  64. package/dist/chunk-LVDRBRYU.js +0 -1
  65. package/dist/chunk-OCSOMMY2.js +0 -1
  66. package/dist/chunk-QOXIUJTN.js +0 -29
  67. package/dist/chunk-SWU7CXZB.js +0 -954
  68. package/dist/chunk-TR6PLN7W.js +0 -1
  69. package/dist/chunk-UB4JIOLD.js +0 -2
  70. package/dist/chunk-ZBIWNVJS.js +0 -9
package/dist/map/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import{Button_default as e}from"../chunk-PH3PRIFP.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-MAIHBBWT.js";import{useShellStrings as r}from"../chunk-TR6PLN7W.js";import{useRef as o,useState as a,useEffect as l,useCallback as i,useMemo as s,useSyncExternalStore as c}from"react";import{createPortal as u}from"react-dom";import{jsxs as d,jsx as p,Fragment as m}from"react/jsx-runtime";import{useQuery as h}from"@tanstack/react-query";var g="maplibregl-compact-show";function f(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(g)&&(e.classList.remove(g),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var y=20,b=12,x=480,v={center:[0,0],left:[y,0],right:[-20,0],top:[0,y],"top-left":[0,y],"top-right":[0,y],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},w=(e,t=12)=>Math.max(0,Math.floor(e-t-b-y-10-16));function k(e,t,n,r=12){const o=e.y-y-r,a=n.height-e.y-y-b,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<b?(s="-left",c=Math.max(0,b-e.x)):e.x+t.width/2>n.width-b&&(s="-right",c=-Math.max(0,e.x-(n.width-b))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var M="maplibre-gl-worker.mjs",N=e=>`/maplibre-gl/${e}/${M}`,C=null;function L(){return C??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(N(e.getVersion())),e)).catch(e=>{throw C=null,e}),C}var $=24,E=28,S=29;function j(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 A(e){const t=Math.max(E,12+8*e.length);return t+t%2}var z=(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 R=e=>z(e.x,e.y,e.width,e.height);function T(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(R(e[t]),R(e[n])))return[e[t],e[n]];return null}function O(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:E,height:E,under:0}));for(let e=T(o);e;e=T(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=A(j(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(R(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=z(t.x,t.y,$,$),l=o.find(t=>B(R(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(R(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:$,height:$,under:0})}return{groups:[...o,...a],hidden:n}}function W(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 P=t;var q="routes",K=["routes-road","routes-estimate"];function _(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(),H(n)}function H(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 I={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},D={center:[30,20],zoom:1},Z="ring-2 ring-gray-900 ring-offset-2";var V="var(--color-gray-600, #4b5563)",G="http://www.w3.org/2000/svg",U=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function Q(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-")&&!J.test(r.slice(7))})}var X=(...e)=>e.filter(Boolean).join(" ");function Y(e){const t=document.createElementNS(G,"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(G,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function ee(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var te=(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 ne(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-md transition-transform motion-reduce:transition-none",!Q(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-[10px] [&_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 re=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",!Q(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function oe({pins:t,selectedKey:n,focus:s,onSelect:m,ariaLabel:h,className:g="",children:y,routes:b,fitTo:x,attribution:M,marks:N,groupCrowded:C=!1,noun:S,highlightKey:A=null,picking:z=!1,onPick:B,card:R,cardMinMapWidth:T=480,fullScreen:G,initialView:J=D,cooperativeGestures:Q=!1}){const oe=r().map,ie=o(null),se=o(null),ce=o(null),ue=o(null),de=o([]),pe=o(/* @__PURE__ */new Map),me=o(/* @__PURE__ */new Map),he=o(/* @__PURE__ */new Map),ge=o(null),fe=o(/* @__PURE__ */new Map),ye=o(""),[be,xe]=a(!1),[ve,we]=a(!1),ke=c(F,P,()=>!1)?"dark":"light",Me=o({onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:S});l(()=>{Me.current={onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:S}});const Ne=i(()=>{const e=ce.current,{pins:t,selectedKey:n}=Me.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})},[]),Ce=o(!1),Le=i((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(Me.current.selectedKey??"");return void Me.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)=>W(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;Ce.current=!0,n.once("moveend",()=>{if(Ce.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=i(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ie.current||Ce.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Me.current;for(const[e,t]of pe.current){const a=ne(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=[...ie.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=O([...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?j(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-[0.6rem]":"h-6 w-6 text-[0.7rem]",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?E:$),height:t.button.offsetHeight||(null!=t.pin.stop?E:$)}:n?{at:n.mark,width:n.element.offsetWidth||E,height:n.element.offsetHeight||E}: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]);l(()=>{if($e(),!ie.current)return;const e=new ResizeObserver(()=>$e());e.observe(ie.current);for(const t of ie.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),l(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await L();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:I[ke],center:J.center,zoom:J.zoom,attributionControl:M?{compact:!0,customAttribution:M}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===Q?window.matchMedia("(pointer: coarse)").matches:Q}),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=>{Me.current.picking&&Me.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=f(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ne()}),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=o(ke);l(()=>{be&&ce.current&&Ee.current!==ke&&(Ee.current=ke,ce.current.setStyle(I[ke]))},[be,ke]),l(()=>{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=Me.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=te(o,C);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(ee(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(Y(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-[9px] 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(),Me.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 N??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,ee(r,t.data),r.className=re(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,N,C,$e]),l(()=>{be&&$e()},[be,n,A,$e]),l(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ne);return()=>cancelAnimationFrame(e)},[be,n,Ne]),l(()=>{const e=ce.current,n=ue.current,r=x?[...t,...N??[]].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,N,x]),l(()=>{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(),H(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?_(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(q);if(i&&(i.attribution||"")!==n){for(const t of K)e.getLayer(t)&&e.removeLayer(t);e.removeSource(q)}const s=e.getSource(q);s?s.setData(o):e.addSource(q,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:q,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:q,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]),l(()=>{const e=ce.current;if(!be||!e||!s)return;const n=t.find(e=>e.key===s.key);if(!n)return;const r=e.getZoom(),o=C?W(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,a={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,o))};U()?e.jumpTo(a):e.flyTo({...a,duration:600})},[be,s?.n]);const[Se,je]=a(!1);l(()=>{const e=ie.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,Be=Ae?.lng??0,Re=Ae?.lat??0,Te=be&&!Se&&null!=R&&!!Ae,[Oe,We]=a(null);l(()=>{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:v,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Be,Re]).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:V,borderBottomColor:V}),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(),ie.current)+8,u=`${w(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=k(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,Be,Re,$e]);const Fe=G?.active??!1,Pe=o(G?.onChange);l(()=>{Pe.current=G?.onChange}),l(()=>{if(!G)return;const e=document.documentElement;Fe&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!Fe&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Fe]);const qe=!!G;return l(()=>{if(!qe)return;const e=()=>{document.fullscreenElement||Pe.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[qe]),/* @__PURE__ */d("div",{ref:ie,className:X("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",z&&"[&_canvas]:cursor-crosshair",g),children:[
2
+ import{Button_default as e}from"../chunk-PH3PRIFP.js";import{rootIsDark as t,ROOT_THEME_ATTRIBUTES as n}from"../chunk-MAIHBBWT.js";import{useShellStrings as r}from"../chunk-FEWQDVQJ.js";import{useRef as o,useState as a,useEffect as l,useCallback as i,useMemo as s,useSyncExternalStore as c}from"react";import{createPortal as u}from"react-dom";import{jsxs as d,jsx as p,Fragment as m}from"react/jsx-runtime";import{useQuery as h}from"@tanstack/react-query";var g="maplibregl-compact-show";function f(e){if(!e)return()=>{};const t=()=>!!e.classList.contains(g)&&(e.classList.remove(g),!0);if(t())return()=>{};const n=new MutationObserver(()=>{t()&&n.disconnect()});return n.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()}var y=20,b=12,x=480,v={center:[0,0],left:[y,0],right:[-20,0],top:[0,y],"top-left":[0,y],"top-right":[0,y],bottom:[0,-20],"bottom-left":[0,-20],"bottom-right":[0,-20]},w=(e,t=12)=>Math.max(0,Math.floor(e-t-b-y-10-16));function k(e,t,n,r=12){const o=e.y-y-r,a=n.height-e.y-y-b,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<b?(s="-left",c=Math.max(0,b-e.x)):e.x+t.width/2>n.width-b&&(s="-right",c=-Math.max(0,e.x-(n.width-b))),{anchor:`${l?"bottom":"top"}${s}`,move:{x:c,y:i}}}var M="maplibre-gl-worker.mjs",N=e=>`/maplibre-gl/${e}/${M}`,C=null;function L(){return C??=Promise.all([import("maplibre-gl"),import("maplibre-gl/dist/maplibre-gl.css")]).then(([e])=>(e.setWorkerUrl(N(e.getVersion())),e)).catch(e=>{throw C=null,e}),C}var $=24,E=28,S=29;function j(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 A(e){const t=Math.max(E,12+8*e.length);return t+t%2}var z=(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 R=e=>z(e.x,e.y,e.width,e.height);function T(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++)if(B(R(e[t]),R(e[n])))return[e[t],e[n]];return null}function O(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:E,height:E,under:0}));for(let e=T(o);e;e=T(o)){const[t,n]=e;t.keys.push(...n.keys),t.stops.push(...n.stops),t.stops.sort((e,t)=>e-t),t.width=A(j(t.stops)),o=o.filter(e=>e!==n)}o=o.filter(e=>!r(R(e))||(n.push(...e.keys),!1));const a=[];for(const t of e){if(null!==t.stop)continue;const e=z(t.x,t.y,$,$),l=o.find(t=>B(R(t),e));if(l||r(e)){n.push(t.key),l&&l.under++;continue}const i=a.find(t=>B(R(t),e));i?i.keys.push(t.key):a.push({keys:[t.key],stops:[],x:t.x,y:t.y,width:$,height:$,under:0})}return{groups:[...o,...a],hidden:n}}function W(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 K="routes",P=["routes-road","routes-estimate"];function _(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(),H(n)}function H(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 I={light:"https://tiles.openfreemap.org/styles/positron",dark:"https://tiles.openfreemap.org/styles/dark"},D={center:[30,20],zoom:1},V="ring-2 ring-gray-900 ring-offset-2";var Z="var(--color-gray-600, #4b5563)",G="http://www.w3.org/2000/svg",Q=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,U=/^(?:\d+|[xytrblse](?:-\d+)?|solid|dashed|dotted|double|hidden|none)$/;function J(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-")&&!U.test(r.slice(7))})}var X=(...e)=>e.filter(Boolean).join(" ");function Y(e){const t=document.createElementNS(G,"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(G,"path");e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("d",n),t.appendChild(e)}return t}function ee(e,t){for(const[n,r]of Object.entries(t??{}))e.dataset[n]=r}var te=(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 ne(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-md transition-transform motion-reduce:transition-none",!J(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-[10px] [&_svg]:h-3.5 [&_svg]:w-3.5",t&&(o?"ring-2 ring-gray-900 ring-offset-1":V),e.approximate&&"border-dashed opacity-80",e.faded&&!t&&"opacity-40",n&&"scale-125 opacity-100")}var re=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",!J(e.tone??"")&&"border-white",e.tone??"bg-gray-900 text-white");function oe({pins:t,selectedKey:n,focus:s,onSelect:m,ariaLabel:h,className:g="",children:y,routes:b,fitTo:x,attribution:M,marks:N,groupCrowded:C=!1,noun:S,highlightKey:A=null,picking:z=!1,onPick:B,card:R,cardMinMapWidth:T=480,fullScreen:G,initialView:U=D,cooperativeGestures:J=!1}){const oe=r().map,ie=o(null),se=o(null),ce=o(null),ue=o(null),de=o([]),pe=o(/* @__PURE__ */new Map),me=o(/* @__PURE__ */new Map),he=o(/* @__PURE__ */new Map),ge=o(null),fe=o(/* @__PURE__ */new Map),ye=o(""),[be,xe]=a(!1),[ve,we]=a(!1),ke=c(F,q,()=>!1)?"dark":"light",Me=o({onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:S});l(()=>{Me.current={onSelect:m,onPick:B,picking:z,pins:t,selectedKey:n,highlightKey:A,groupCrowded:C,strings:oe,noun:S}});const Ne=i(()=>{const e=ce.current,{pins:t,selectedKey:n}=Me.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:Q()?0:400})},[]),Ce=o(!1),Le=i((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(Me.current.selectedKey??"");return void Me.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)=>W(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;Ce.current=!0,n.once("moveend",()=>{if(Ce.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:Q()?0:600})},[]),$e=i(()=>{const e=ce.current,t=ue.current;if(!e||!t||!ie.current||Ce.current&&e.isMoving())return;const{selectedKey:n,highlightKey:r,groupCrowded:o,strings:a,noun:l}=Me.current;for(const[e,t]of pe.current){const a=ne(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=[...ie.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=O([...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?j(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-[0.6rem]":"h-6 w-6 text-[0.7rem]",null!=n&&r.keys.includes(n)&&V);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?E:$),height:t.button.offsetHeight||(null!=t.pin.stop?E:$)}:n?{at:n.mark,width:n.element.offsetWidth||E,height:n.element.offsetHeight||E}: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]);l(()=>{if($e(),!ie.current)return;const e=new ResizeObserver(()=>$e());e.observe(ie.current);for(const t of ie.current.children)t.contains(se.current)||e.observe(t);return()=>e.disconnect()}),l(()=>{let e=!1,t=null,n=null,r=()=>{};return(async()=>{try{const o=await L();if(e||!se.current)return;ue.current=o,t=new o.Map({container:se.current,style:I[ke],center:U.center,zoom:U.zoom,attributionControl:M?{compact:!0,customAttribution:M}:{compact:!0},dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,maxPitch:0,cooperativeGestures:"coarse"===J?window.matchMedia("(pointer: coarse)").matches:J}),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(U.center).addTo(t),t.on("click",e=>{Me.current.picking&&Me.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=f(se.current.querySelector(".maplibregl-ctrl-attrib"));const l=t;n=new ResizeObserver(()=>{l.resize(),Ne()}),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=o(ke);l(()=>{be&&ce.current&&Ee.current!==ke&&(Ee.current=ke,ce.current.setStyle(I[ke]))},[be,ke]),l(()=>{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=Me.current.strings;for(const o of t){const t=document.createElement("button");t.type="button",t.dataset.pin=o.key,t.className=te(o,C);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(ee(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(Y(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-[9px] 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(),Me.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 N??[]){const r=document.createElement("div");r.dataset.mapMark=t.key,ee(r,t.data),r.className=re(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,N,C,$e]),l(()=>{be&&$e()},[be,n,A,$e]),l(()=>{if(!be||!n)return;const e=requestAnimationFrame(Ne);return()=>cancelAnimationFrame(e)},[be,n,Ne]),l(()=>{const e=ce.current,n=ue.current,r=x?[...t,...N??[]].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,N,x]),l(()=>{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(),H(t)}(),o={type:"FeatureCollection",features:t.map(e=>({type:"Feature",properties:{key:e.key,estimate:e.estimate,faded:!!e.faded,color:e.color?_(e.color):r},geometry:{type:"LineString",coordinates:e.coordinates}}))},a=["case",["get","faded"],.25,.85],l=["get","color"],i=e.getSource(K);if(i&&(i.attribution||"")!==n){for(const t of P)e.getLayer(t)&&e.removeLayer(t);e.removeSource(K)}const s=e.getSource(K);s?s.setData(o):e.addSource(K,{type:"geojson",data:o,...n?{attribution:n}:{}}),e.getLayer("routes-road")||e.addLayer({id:"routes-road",type:"line",source:K,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:K,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]),l(()=>{const e=ce.current;if(!be||!e||!s)return;const n=t.find(e=>e.key===s.key);if(!n)return;const r=e.getZoom(),o=C?W(e.project([n.lng,n.lat]),t.filter(e=>e.key!==n.key).map(t=>e.project([t.lng,t.lat])),r):-1/0,a={center:[n.lng,n.lat],zoom:Math.min(18,Math.max(r,13,o))};Q()?e.jumpTo(a):e.flyTo({...a,duration:600})},[be,s?.n]);const[Se,je]=a(!1);l(()=>{const e=ie.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,Be=Ae?.lng??0,Re=Ae?.lat??0,Te=be&&!Se&&null!=R&&!!Ae,[Oe,We]=a(null);l(()=>{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:v,className:"rosh-map-card",maxWidth:"none",closeButton:!1,closeOnClick:!1,closeOnMove:!1,focusAfterOpen:!1}).setLngLat([Be,Re]).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:Z,borderBottomColor:Z}),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(),ie.current)+8,u=`${w(a,l)}px`;n.style.maxHeight!==u&&(n.style.maxHeight=u);const d=r.getElement(),p=r.getLngLat(),{anchor:m,move:h}=k(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:Q()?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,Be,Re,$e]);const Fe=G?.active??!1,qe=o(G?.onChange);l(()=>{qe.current=G?.onChange}),l(()=>{if(!G)return;const e=document.documentElement;Fe&&!document.fullscreenElement&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{}),!Fe&&document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Fe]);const Ke=!!G;return l(()=>{if(!Ke)return;const e=()=>{document.fullscreenElement||qe.current?.(!1)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[Ke]),/* @__PURE__ */d("div",{ref:ie,className:X("relative min-h-72 overflow-hidden rounded-lg border border-gray-200 bg-gray-100",z&&"[&_canvas]:cursor-crosshair",g),children:[
3
3
  /* @__PURE__ */p("div",{className:"absolute inset-0",children:/* @__PURE__ */p("div",{ref:se,className:"h-full w-full",role:"region","aria-label":h})}),ve&&/* @__PURE__ */p("p",{className:"absolute inset-0 grid place-items-center p-6 text-center text-sm text-gray-500",children:oe.failed}),G&&/* @__PURE__ */p(e,{"data-map-control":"",variant:"secondary",size:"sm",className:"absolute left-3 top-3 z-10",onClick:()=>G.onChange(!G.active),leftIcon:/* @__PURE__ */p(le,{leave:G.active}),children:G.active?oe.leaveFullScreen:oe.fullScreen}),y,null!=R&&!Te&&/* @__PURE__ */p("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:R}),Te&&Oe?u(R,Oe):null,be&&/* @__PURE__ */p(ae,{pins:t,hosts:fe.current})]})}function ae({pins:e,hosts:t}){/* @__PURE__ */
4
4
  return p(m,{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)),u(e.iconNode,n,e.key)})})}function le({leave:e}){/* @__PURE__ */
5
5
  return p("svg",{"aria-hidden":"true",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e?"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25":"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function ie(){const[e,t]=a(null);return{highlightKey:e,pointAt:i(e=>{const n=()=>t(e),r=()=>t(t=>t===e?null:t);return{onMouseEnter:n,onMouseLeave:r,onFocus:n,onBlur:r}},[])}}var se=3e3,ce=e=>!!e?.pending&&3e3,ue=e=>`${e.kind}:${e.id}`,de=e=>("located"===e.placement||"approximate"===e.placement)&&null!=e.lat&&null!=e.lng;function pe(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 me={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"}},he=["importer","dealer","retail","supplier","delivery_location","warehouse"];function ge(e){return"supplier"===e.kind?"supplier":"customer"===e.kind?e.category||"importer":e.kind}var fe=(e,t=me)=>t[e]?.tone??"bg-gray-700 text-white",ye=(e,t=me)=>t[e]?.label??e,be=(e,t)=>fe(ge(e),t);function xe(e,t,n=me){return null!=t?String(t):(n[ge(e)]?.label??"").charAt(0).toUpperCase()}var ve=["delivery_location","warehouse"];function we(e,t=ve){const n=/* @__PURE__ */new Map;let r=0;for(const o of e)t.includes(o.kind)&&n.set(ue(o),++r);return n}function ke(e){const t={onMap:0,approximate:0,pending:0,off:0};for(const n of e)de(n)?(t.onMap+=1,"approximate"===n.placement&&(t.approximate+=1)):"pending"===n.placement?t.pending+=1:t.off+=1;return t}function Me(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 Ne(e){const t=[...new Set(e.filter(de).map(ge))];return[...he.filter(e=>t.includes(e)),...t.filter(e=>!he.includes(e))]}function Ce(e,t){return e.filter(e=>!de(e)&&"pending"!==e.placement).map(e=>{const n=t?.get(ue(e)),r=pe(e.placement)?.replace(/^Not on the map: /,"")??"";return{key:ue(e),text:`${null!=n?`${n}. `:""}${e.label}: ${r}`}})}function Le({categories:e,palette:t=me,floating:n=!0}){return e.length<2?null:/* @__PURE__ */p("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-2.5 py-1.5 text-xs text-gray-600 shadow-sm",children:e.map(e=>/* @__PURE__ */d("span",{className:"inline-flex items-center gap-1.5",children:[
@@ -107,6 +107,8 @@ interface PageTabBarProps {
107
107
  * tabs. */
108
108
  end?: ReactNode;
109
109
  }
110
+ /** The drawing is `TabStrip`'s, shared with the desktop shell's window tabs;
111
+ * this is the half that knows a tab is a page. */
110
112
  declare function PageTabBar({ className, activeClassName, end }: PageTabBarProps): react_jsx_runtime.JSX.Element | null;
111
113
 
112
114
  interface PageTabsApi {
@@ -1,22 +1,6 @@
1
1
  "use client";
2
- import{PopupMenu as e,PopupMenuItem as t,PopupMenuDivider as n}from"../chunk-ZBIWNVJS.js";import{confirm as r}from"../chunk-QOXIUJTN.js";import"../chunk-57MIENLJ.js";import"../chunk-MAIHBBWT.js";import{useShellStrings as i}from"../chunk-TR6PLN7W.js";import{useBrowserLayoutEffect as l}from"../chunk-D65T4H6J.js";import*as a from"react";import{createContext as s,memo as o,useRef as c,useEffect as d,useMemo as u,useId as y,useCallback as f,useReducer as m,useContext as p,useState as h,Fragment as b}from"react";import{useLocation as k,useNavigate as v}from"react-router-dom";import{jsx as g,Fragment as x,jsxs as w}from"react/jsx-runtime";var N=s(null),I=s(null),K=12;var T=(e,t)=>e.filter(e=>e!==t);function F(e,t){return[...t.map(t=>e.find(e=>e.key===t)).filter(e=>Boolean(e)),...e.filter(e=>!t.includes(e.key))]}function $(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:(a=e.mounted,s=t.key,a.includes(s)?a:[...a,s]),clock:r};var a,s;return l.closing&&l.closing!==t.key?l=C(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=C(n,e[0].key)}return n}(l,n)}function A(e){let t={...e,activeKey:null};return t.closing&&(t=C(t,t.closing)),t}function C(e,t){return{...e,tabs:e.tabs.filter(e=>e.key!==t),mounted:T(e.mounted,t),dirty:T(e.dirty,t),activeKey:e.activeKey===t?null:e.activeKey,closing:e.closing===t?null:e.closing}}function L(e,t){switch(t.type){case"visit":return $(e,t.entry,t.maxTabs);case"transient":return A(e);case"close":{let n=e;for(const e of t.keys)n=C(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]:T(e.dirty,t)}}(e,t.key,t.dirty)}}var M=e=>`${e.pathname}${e.search}`;function j(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 D({children:e,resolve:t,pinned:n=[],storageKey:a,maxTabs:s=12,enabled:o=!0,confirmDiscard:p}){const h=k(),b=v(),x=i().pageTabs,w=y(),I=c(t);I.current=t;const K=f(e=>{const t=I.current(e);return t?{key:t.key??e.pathname,path:M(e),title:t.title}:null},[]),[T,C]=m(L,void 0,()=>{const e=function(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{return[]}const r=n;if(!r||1!==r.v||!Array.isArray(r.tabs))return[];const i=[];for(const e of r.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,l=t(r);if(!l||i.some(e=>e.key===l.key))continue;const a="page"===e.titleFrom&&"string"==typeof e.title&&e.title;i.push({key:l.key,path:r,title:a||l.title,titleFrom:a?"page":"route",pinned:!1,lastActive:0})}return i}(function(e){if(!e)return null;try{return localStorage.getItem(e)}catch{return null}}(a),e=>K(j(e)));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:F(r,n)}}({tabs:[],activeKey:null,mounted:[],dirty:[],closing:null,clock:0,tabs:e},n.map(e=>K(j(e))).filter(e=>Boolean(e)));const r=o?K(h):null;return t=r?$(t,r,s):A(t),t}),D=c(T);D.current=T;const O=c(/* @__PURE__ */new Map),z=o?K(h):null,B=z?.key??null;l(()=>{if(!o)return;const e=K(h);e?(O.current.set(e.key,h),C({type:"visit",entry:e,maxTabs:s})):C({type:"transient"})},[h,o,s,K]),d(()=>{const e=new Set(T.tabs.map(e=>e.key));for(const t of O.current.keys())e.has(t)||O.current.delete(t)},[T.tabs]);const E=u(()=>function(e){const t={v:1,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(t)}(T),[T]);d(()=>{if(a)try{localStorage.setItem(a,E)}catch{}},[E,a]);const R=T.dirty.length>0;d(()=>{if(!R)return;const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[R]);const S=c(/* @__PURE__ */new Map),J=f((e,t)=>{let n=S.current.get(e);return void 0===n&&(n=S.current.size,S.current.set(e,n)),`${w}-page-${t}-${n}`},[w]),W=f(e=>p?p(e):r({title:x.discardTitle,message:1===e.length?x.discardOne:x.discardCount?.(e.length)??`${e.length} ${x.discardMany}`,confirmLabel:x.discardConfirm,cancelLabel:x.keepEditing,variant:"warning"}),[p,x]),_=f(()=>{const e=D.current;return e.tabs.find(e=>e.pinned)?.path??"/"},[]),H=f((e,t,n)=>{const r=D.current,i=r.activeKey;if(!i||!e.includes(i))return void C({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))},a=n?r.tabs.find(t=>t.key===n&&!e.includes(t.key)):void 0;l=(a??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??_()}C({type:"close",keys:e.filter(e=>e!==i),closing:i}),b(l)},[b,_]),P=f(async(e,t={})=>{const n=D.current.tabs.find(t=>t.key===e);return!n||n.pinned?(t.to&&b(t.to),!1):!(!t.force&&D.current.dirty.includes(e)&&!await W([n]))&&(!!D.current.tabs.some(t=>t.key===e)&&(H([e],t.to),!0))},[W,H,b]),V=f(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 W(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&&H(n,void 0,"all"===e?null:t)},[W,H]),X=f(e=>{const t=D.current.tabs.find(t=>t.key===e);t&&e!==D.current.activeKey&&b(t.path)},[b]),Q=f((e,t)=>C({type:"title",key:e,title:t}),[]),U=f((e,t)=>C({type:"dirty",key:e,dirty:t}),[]),Y=f(e=>K(e)?.key??null,[K]),Z=f(e=>O.current.get(e),[]),q=u(()=>o?T.tabs.filter(e=>e.key!==T.closing):[],[o,T.tabs,T.closing]),G=u(()=>({enabled:o,state:T,currentKey:B,resolve:t,keyFor:Y,locationFor:Z,idFor:J,activate:X,close:P,closeMany:V,setTitle:Q,setDirty:U,visibleTabs:q}),[o,T,B,t,Y,Z,J,X,P,V,Q,U,q]);/* @__PURE__ */
3
- return g(N.Provider,{value:G,children:e})}var O=a.Activity,z=Boolean(O);function B({active:e,children:t}){return O?/* @__PURE__ */g(O,{mode:e?"visible":"hidden",children:t}):/* @__PURE__ */g(x,{children:t})}var E=o(function({tabKey:e,active:t,location:n,render:r,className:i,panelId:a,tabId:s}){const o=c(null),y=c(t),f=c(/* @__PURE__ */new Map);l(()=>{const e=y.current;if(y.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]),d(()=>{const e=o.current;if(!e)return;const t=e=>{if(!y.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 m=u(()=>({key:e,activeRef:y}),[e]);/* @__PURE__ */
4
- return g("div",{ref:o,role:a?"tabpanel":void 0,id:a,"aria-labelledby":s,hidden:!t,style:t?void 0:{display:"none"},className:i,"data-page-tab":e,children:/* @__PURE__ */g(I.Provider,{value:m,children:/* @__PURE__ */g(B,{active:t,children:r(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)),R="\0transient";function S({children:e,frameClassName:t}){const n=p(N),r=k();if(!n||!n.enabled)/* @__PURE__ */
5
- return g("div",{className:t,children:e(r)},R);const{state:i,currentKey:l,locationFor:a,idFor:s}=n,o=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!o.includes(l)&&o.push(l),/* @__PURE__ */w(x,{children:[o.map(n=>{const i=n===l,o=i?r:a(n);return o?/* @__PURE__ */g(E,{tabKey:n,active:i,location:o,render:e,className:t,panelId:s(n,"panel"),tabId:s(n,"tab")},n):null}),!l&&/* @__PURE__ */g(E,{tabKey:R,active:!0,location:r,render:e,className:t},R)]})}var J="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function W(){/* @__PURE__ */
6
- return g("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */g("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function _({className:r,activeClassName:l,end:a}){const s=p(N),o=i().pageTabs,u=c(null),[y,f]=h(null),m=s?.currentKey??null;if(d(()=>{if(!s||!m)return;const e=document.getElementById(s.idFor(m,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[s,m]),!s||!s.enabled)return null;const{visibleTabs:k,state:v,idFor:x,activate:I,close:K,closeMany:T,resolve:F}=s,$=k.some(e=>e.key===m)?m:k[0]?.key,A=e=>{const t=k[(e+k.length)%k.length];t&&document.getElementById(x(t.key,"tab"))?.focus()},C=y?k.find(e=>e.key===y.key):void 0,L=C?k.indexOf(C):-1,M=e=>e.some(e=>!e.pinned),D=e=>()=>{f(null),e()};/* @__PURE__ */
7
- return w("div",{className:r??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
8
- /* @__PURE__ */g("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
9
- /* @__PURE__ */g("div",{ref:u,role:"tablist","aria-label":o.label,onKeyDown:e=>{const t=k.findIndex(t=>document.getElementById(x(t.key,"tab"))===e.target);if(!(t<0)){if("ArrowRight"===e.key)A(t+1);else if("ArrowLeft"===e.key)A(t-1);else if("Home"===e.key)A(0);else if("End"===e.key)A(k.length-1);else{if("Delete"!==e.key||k[t].pinned)return;K(k[t].key)}e.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:k.map((e,t)=>{const n=e.key===m,r=v.dirty.includes(e.key),i=F(j(e.path))?.icon,a=n?l??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=t>0&&!n&&k[t-1].key!==m,c={type:"button",role:"tab",id:x(e.key,"tab"),"aria-selected":n,"aria-controls":v.mounted.includes(e.key)?x(e.key,"panel"):void 0,tabIndex:e.key===$?0:-1,title:e.title,onClick:()=>I(e.key)},d={onContextMenu:t=>((e,t)=>{e.preventDefault(),f({x:e.clientX,y:e.clientY,key:t.key})})(t,e),onAuxClick:t=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),K(t.key))})(t,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=i&&
10
- /* @__PURE__ */w("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[i,r&&!n&&!e.pinned&&
11
- /* @__PURE__ */g("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]});return e.pinned?/* @__PURE__ */g("div",{role:"presentation",className:`group relative flex h-9 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${i?"w-10":""} ${a}`,...d,children:/* @__PURE__ */w("button",{...c,className:`flex h-full items-center justify-center rounded-t-md ${i?"w-full":"px-3"} ${J}`,children:[u,
12
- /* @__PURE__ */g("span",{className:i?"sr-only":"whitespace-nowrap text-[13px]",children:e.title})]})},e.key):/* @__PURE__ */w(b,{children:[s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"mb-2.5 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
13
- /* @__PURE__ */w("div",{role:"presentation",className:`group @container relative flex h-9 flex-[0_1_15rem] items-center rounded-t-md border border-b-0 text-[13px] transition-colors ${n?"min-w-[4.25rem]":"min-w-[2.75rem]"} ${a}`,...d,children:[
14
- /* @__PURE__ */w("button",{...c,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pl-3 pr-1 text-left ${J} ${n?"@max-[5rem]:pl-2.5":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-1.5"}`,children:[u,
15
- /* @__PURE__ */g("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(i?n?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:e.title})]}),
16
- /* @__PURE__ */w("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(n?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[r&&/* @__PURE__ */g("span",{role:"img","aria-label":o.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
17
- /* @__PURE__ */g("button",{type:"button",tabIndex:-1,"aria-label":o.closeTab?.(e.title)??`${o.close} ${e.title}`,onClick:()=>{K(e.key)},className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(r?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */g(W,{})})]})]})]},e.key)})}),a&&/* @__PURE__ */g("div",{className:"flex shrink-0 items-center gap-2 self-center",children:a}),y&&C&&/* @__PURE__ */w(e,{portal:!0,style:{left:y.x,top:y.y},onClose:()=>f(null),children:[
18
- /* @__PURE__ */g(t,{disabled:C.pinned,onClick:D(()=>K(C.key)),children:o.close}),
19
- /* @__PURE__ */g(n,{}),
20
- /* @__PURE__ */g(t,{disabled:!M(k.filter(e=>e.key!==C.key)),onClick:D(()=>T("others",C.key)),children:o.closeOthers}),
21
- /* @__PURE__ */g(t,{disabled:!M(k.slice(L+1)),onClick:D(()=>T("right",C.key)),children:o.closeRight}),
22
- /* @__PURE__ */g(t,{disabled:!M(k),onClick:D(()=>T("all",null)),children:o.closeAll})]})]})}var H={enabled:!1,tabs:[],activeKey:null,activate:()=>{},close:async()=>!1,closeOthers:async()=>{},closeRight:async()=>{},closeAll:async()=>{}};function P(){const e=p(N);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)}:H}function V(){const e=p(N),t=p(I),n=v();return{key:e?.enabled&&t?t.key:null,close:f(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 X(e){const t=p(N),n=p(I),r=t?.enabled?t.setTitle:void 0,i=n?.key;d(()=>{r&&i&&e&&r(i,e)},[r,i,e])}function Q(e){const t=p(N),n=p(I),r=t?.enabled?t.setDirty:void 0;d(()=>{if(r&&n)return r(n.key,e),()=>{n.activeRef.current&&r(n.key,!1)}},[r,n,e])}export{K as DEFAULT_MAX_TABS,z as PAGE_TABS_PAUSE_HIDDEN,_ as PageTabBar,S as PageTabsOutlet,D as PageTabsProvider,j as parseTabPath,V as usePageTab,Q as usePageTabDirty,X as usePageTabTitle,P as usePageTabs};
2
+ import{TabStrip as e}from"../chunk-JHXGBYJO.js";import{confirm as t}from"../chunk-ZYUWLZUG.js";import"../chunk-J7LKJIZC.js";import"../chunk-OSJ3ADF2.js";import"../chunk-MAIHBBWT.js";import{useBrowserLayoutEffect as n}from"../chunk-D65T4H6J.js";import{useShellStrings as r}from"../chunk-FEWQDVQJ.js";import*as i from"react";import{createContext as l,memo as a,useRef as c,useEffect as s,useMemo as o,useId as u,useCallback as y,useReducer as d,useContext as f}from"react";import{useLocation as p,useNavigate as k}from"react-router-dom";import{jsx as m,Fragment as b,jsxs as v}from"react/jsx-runtime";var h=l(null),g=l(null),K=12;var F=(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 A(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:(a=e.mounted,c=t.key,a.includes(c)?a:[...a,c]),clock:r};var a,c;return l.closing&&l.closing!==t.key?l=N(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=N(n,e[0].key)}return n}(l,n)}function I(e){let t={...e,activeKey:null};return t.closing&&(t=N(t,t.closing)),t}function N(e,t){return{...e,tabs:e.tabs.filter(e=>e.key!==t),mounted:F(e.mounted,t),dirty:F(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 A(e,t.entry,t.maxTabs);case"transient":return I(e);case"close":{let n=e;for(const e of t.keys)n=N(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]:F(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:i,pinned:l=[],storageKey:a,maxTabs:f=12,enabled:b=!0,confirmDiscard:v}){const g=p(),K=k(),F=r().pageTabs,N=u(),L=c(i);L.current=i;const O=y(e=>{const t=L.current(e);return t?{key:t.key??e.pathname,path:M(e),title:t.title}:null},[]),[C,J]=d(w,void 0,()=>{const e=function(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{return[]}const r=n;if(!r||1!==r.v||!Array.isArray(r.tabs))return[];const i=[];for(const e of r.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,l=t(r);if(!l||i.some(e=>e.key===l.key))continue;const a="page"===e.titleFrom&&"string"==typeof e.title&&e.title;i.push({key:l.key,path:r,title:a||l.title,titleFrom:a?"page":"route",pinned:!1,lastActive:0})}return i}(function(e){if(!e)return null;try{return localStorage.getItem(e)}catch{return null}}(a),e=>O(x(e)));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},l.map(e=>O(x(e))).filter(e=>Boolean(e)));const n=b?O(g):null;return t=n?A(t,n,f):I(t),t}),j=c(C);j.current=C;const D=c(/* @__PURE__ */new Map),S=b?O(g):null,$=S?.key??null;n(()=>{if(!b)return;const e=O(g);e?(D.current.set(e.key,g),J({type:"visit",entry:e,maxTabs:f})):J({type:"transient"})},[g,b,f,O]),s(()=>{const e=new Set(C.tabs.map(e=>e.key));for(const t of D.current.keys())e.has(t)||D.current.delete(t)},[C.tabs]);const B=o(()=>function(e){const t={v:1,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(t)}(C),[C]);s(()=>{if(a)try{localStorage.setItem(a,B)}catch{}},[B,a]);const E=C.dirty.length>0;s(()=>{if(!E)return;const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[E]);const W=c(/* @__PURE__ */new Map),R=y((e,t)=>{let n=W.current.get(e);return void 0===n&&(n=W.current.size,W.current.set(e,n)),`${N}-page-${t}-${n}`},[N]),H=y(e=>v?v(e):t({title:F.discardTitle,message:1===e.length?F.discardOne:F.discardCount?.(e.length)??`${e.length} ${F.discardMany}`,confirmLabel:F.discardConfirm,cancelLabel:F.keepEditing,variant:"warning"}),[v,F]),Z=y(()=>{const e=j.current;return e.tabs.find(e=>e.pinned)?.path??"/"},[]),G=y((e,t,n)=>{const r=j.current,i=r.activeKey;if(!i||!e.includes(i))return void J({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))},a=n?r.tabs.find(t=>t.key===n&&!e.includes(t.key)):void 0;l=(a??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??Z()}J({type:"close",keys:e.filter(e=>e!==i),closing:i}),K(l)},[K,Z]),P=y(async(e,t={})=>{const n=j.current.tabs.find(t=>t.key===e);return!n||n.pinned?(t.to&&K(t.to),!1):!(!t.force&&j.current.dirty.includes(e)&&!await H([n]))&&(!!j.current.tabs.some(t=>t.key===e)&&(G([e],t.to),!0))},[H,G,K]),Q=y(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)}(j.current,e,t);const r=j.current.tabs.filter(e=>n.includes(e.key)&&j.current.dirty.includes(e.key));r.length&&!await H(r)&&(n=n.filter(e=>!r.some(t=>t.key===e)));const i=new Set(j.current.tabs.map(e=>e.key));n=n.filter(e=>i.has(e)),n.length&&G(n,void 0,"all"===e?null:t)},[H,G]),U=y(e=>{const t=j.current.tabs.find(t=>t.key===e);t&&e!==j.current.activeKey&&K(t.path)},[K]),V=y((e,t)=>J({type:"title",key:e,title:t}),[]),Y=y((e,t)=>J({type:"dirty",key:e,dirty:t}),[]),z=y(e=>O(e)?.key??null,[O]),X=y(e=>D.current.get(e),[]),q=o(()=>b?C.tabs.filter(e=>e.key!==C.closing):[],[b,C.tabs,C.closing]),_=o(()=>({enabled:b,state:C,currentKey:$,resolve:i,keyFor:z,locationFor:X,idFor:R,activate:U,close:P,closeMany:Q,setTitle:V,setDirty:Y,visibleTabs:q}),[b,C,$,i,z,X,R,U,P,Q,V,Y,q]);/* @__PURE__ */
3
+ return m(h.Provider,{value:_,children:e})}var O=i.Activity,C=Boolean(O);function J({active:e,children:t}){return O?/* @__PURE__ */m(O,{mode:e?"visible":"hidden",children:t}):/* @__PURE__ */m(b,{children:t})}var j=a(function({tabKey:e,active:t,location:r,render:i,className:l,panelId:a,tabId:u}){const y=c(null),d=c(t),f=c(/* @__PURE__ */new Map);n(()=>{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]),s(()=>{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=o(()=>({key:e,activeRef:d}),[e]);/* @__PURE__ */
4
+ return m("div",{ref:y,role:a?"tabpanel":void 0,id:a,"aria-labelledby":u,hidden:!t,style:t?void 0:{display:"none"},className:l,"data-page-tab":e,children:/* @__PURE__ */m(g.Provider,{value:p,children:/* @__PURE__ */m(J,{active:t,children:i(r)})})})},(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 S({children:e,frameClassName:t}){const n=f(h),r=p();if(!n||!n.enabled)/* @__PURE__ */
5
+ return m("div",{className:t,children:e(r)},D);const{state:i,currentKey:l,locationFor:a,idFor:c}=n,s=i.tabs.filter(e=>i.mounted.includes(e.key)).map(e=>e.key);return l&&!s.includes(l)&&s.push(l),/* @__PURE__ */v(b,{children:[s.map(n=>{const i=n===l,s=i?r:a(n);return s?/* @__PURE__ */m(j,{tabKey:n,active:i,location:s,render:e,className:t,panelId:c(n,"panel"),tabId:c(n,"tab")},n):null}),!l&&/* @__PURE__ */m(j,{tabKey:D,active:!0,location:r,render:e,className:t},D)]})}function $({className:t,activeClassName:n,end:i}){const l=f(h),a=r().pageTabs;if(!l||!l.enabled)return null;const{visibleTabs:c,state:s,idFor:o,activate:u,close:y,closeMany:d,resolve:p}=l;/* @__PURE__ */
6
+ return m(e,{tabs:c.map(e=>({key:e.key,title:e.title,pinned:e.pinned,dirty:s.dirty.includes(e.key),icon:p(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:a.label,className:t,activeClassName:n,end:i})}var B={enabled:!1,tabs:[],activeKey:null,activate:()=>{},close:async()=>!1,closeOthers:async()=>{},closeRight:async()=>{},closeAll:async()=>{}};function E(){const e=f(h);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)}:B}function W(){const e=f(h),t=f(g),n=k();return{key:e?.enabled&&t?t.key:null,close:y(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 R(e){const t=f(h),n=f(g),r=t?.enabled?t.setTitle:void 0,i=n?.key;s(()=>{r&&i&&e&&r(i,e)},[r,i,e])}function H(e){const t=f(h),n=f(g),r=t?.enabled?t.setDirty:void 0;s(()=>{if(r&&n)return r(n.key,e),()=>{n.activeRef.current&&r(n.key,!1)}},[r,n,e])}export{K as DEFAULT_MAX_TABS,C as PAGE_TABS_PAUSE_HIDDEN,$ as PageTabBar,S as PageTabsOutlet,L as PageTabsProvider,x as parseTabPath,W as usePageTab,H as usePageTabDirty,R as usePageTabTitle,E as usePageTabs};
package/dist/pdf/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{lazy as r}from"react";var e=r(()=>import("../PdfViewer-ZCT3PYXU.js"));export{e as PdfViewer};
2
+ import{lazy as r}from"react";var e=r(()=>import("../PdfViewer-W65LHKXZ.js"));export{e as PdfViewer};
package/dist/themes.css CHANGED
@@ -26,6 +26,12 @@
26
26
  * otherwise win on <html>. The class remaps themselves stay, for consumer markup
27
27
  * that still writes `focus:ring-blue-500`.
28
28
  *
29
+ * The submit affordance is tokens too (`.btn-submit` / `.kbd-submit` and the
30
+ * four `--submit-*`, see "The submit affordance" in ui.css), so each accent
31
+ * theme moves those four beside the focus ring, `!important` for the same
32
+ * reason. Blue declares none: it tints the surfaces and keeps the default
33
+ * accent, which is what the tokens default to.
34
+ *
29
35
  * Upstreamed 2026-06-13 from the admin portal's index.css so all three
30
36
  * EFFICIENT portals + the demo share one source of truth.
31
37
  */
@@ -74,6 +80,14 @@
74
80
  /* Ring colors */
75
81
  [data-theme="pink"] .ring-blue-300 { --tw-ring-color: #f9a8d4 !important; }
76
82
 
83
+ /* Submit affordance */
84
+ [data-theme="pink"] {
85
+ --submit-bg: #db2777 !important;
86
+ --submit-bg-hover: #be185d !important;
87
+ --submit-kbd-border: rgba(244, 114, 182, 0.5) !important;
88
+ --submit-kbd-bg: rgba(236, 72, 153, 0.3) !important;
89
+ }
90
+
77
91
  /* Pink tint on backgrounds */
78
92
  [data-theme="pink"] .bg-white { background-color: #fff5f9 !important; }
79
93
  [data-theme="pink"] .bg-gray-100 { background-color: #fce7f3 !important; }
@@ -137,6 +151,14 @@
137
151
  /* Ring colors */
138
152
  [data-theme="green"] .ring-blue-300 { --tw-ring-color: #6ee7b7 !important; }
139
153
 
154
+ /* Submit affordance */
155
+ [data-theme="green"] {
156
+ --submit-bg: #059669 !important;
157
+ --submit-bg-hover: #047857 !important;
158
+ --submit-kbd-border: rgba(52, 211, 153, 0.5) !important;
159
+ --submit-kbd-bg: rgba(16, 185, 129, 0.3) !important;
160
+ }
161
+
140
162
  /* Green tint on backgrounds */
141
163
  [data-theme="green"] .bg-white { background-color: #f5fef7 !important; }
142
164
  [data-theme="green"] .bg-gray-100 { background-color: #dcfce7 !important; }
@@ -204,6 +226,14 @@
204
226
  [data-theme="grey"] input[type="range"].accent-blue-600 { accent-color: #374151; }
205
227
  [data-theme="grey"] .ring-blue-300 { --tw-ring-color: #9ca3af !important; }
206
228
 
229
+ /* Submit affordance */
230
+ [data-theme="grey"] {
231
+ --submit-bg: #374151 !important;
232
+ --submit-bg-hover: #1f2937 !important;
233
+ --submit-kbd-border: rgba(107, 114, 128, 0.4) !important;
234
+ --submit-kbd-bg: rgba(75, 85, 99, 0.25) !important;
235
+ }
236
+
207
237
 
208
238
  /* ═══════════════════════════════════════════════════
209
239
  Theme: Blue
@@ -262,3 +292,8 @@
262
292
  [data-custom-accent] input[type="checkbox"].text-blue-600 { accent-color: var(--accent-600); }
263
293
  [data-custom-accent] input[type="range"].accent-blue-600 { accent-color: var(--accent-600); }
264
294
  [data-custom-accent] .ring-blue-300 { --tw-ring-color: var(--accent-300) !important; }
295
+ /* The submit button follows the custom accent. Its chip takes solid steps
296
+ and white ink: the --accent-* scale has no alpha form to tint with. */
297
+ [data-custom-accent] .btn-submit { background-color: var(--accent-600) !important; }
298
+ [data-custom-accent] .btn-submit:hover:not(:disabled) { background-color: var(--accent-700) !important; }
299
+ [data-custom-accent] .kbd-submit { border-color: var(--accent-400) !important; background-color: var(--accent-500) !important; color: #fff; }
@@ -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 AngleScale, k as AppUpdateBanner, l as AppUpdateBannerProps, m as AttachButton, n as AttachButtonProps, o as AttachmentDropZone, p as AttachmentDropZoneProps, q as AttachmentList, r as AttachmentListProps, s as AuthScreen, t as AuthScreenProps, u as Avatar, v as AvatarGroup, w as AvatarGroupProps, x as AvatarProps, y as AvatarSize, z as AvatarStatus, B as BackgroundVariant, D as BandScale, E as Banner, F as BannerEmphasis, G as BannerProps, H as BannerTone, I as BarChart, J as BarChartProps, K as BoxPlotBox, L as BoxPlotChart, M as BoxPlotChartProps, N as BrandAssetEditor, O as BrandAssetEditorProps, Q as BrandAssetPreview, R as BrandMark, T as BrandMarkProps, U as BrandMarkSlot, V as BrandMarkSurface, W as BrandMarkTreatment, X as BreadcrumbItem, Y as Breadcrumbs, Z as BreadcrumbsProps, _ as BudgetBar, $ as BudgetBarProps, a0 as BudgetState, a1 as Button, a2 as ButtonClassesOptions, a3 as ButtonProps, a4 as ButtonSize, a5 as ButtonVariant, a6 as CHART_INK, a7 as CMD_A, a8 as CMD_DOT, a9 as CMD_ENTER, aa as CMD_K, ab as CMD_S, ac as Calendar, ad as CalendarMode, ae as CalendarProps, af as Candle, ag as CandlestickChart, ah as CandlestickChartProps, ai as Card, aj as CardPadding, ak as CardProps, al as CartesianPlot, am as CartesianPlotProps, an as CellStyle, ao as ChartBackgroundVariant, ap as ChartBrush, aq as ChartBrushProps, ar as ChartCurve, as as ChartDefs, at as ChartDefsProps, au as ChartDot, av as ChartDotProps, aw as ChartDotVariant, ax as ChartFillVariant, ay as ChartFrame, az as ChartFrameProps, aA as ChartHighlightProvider, aB as ChartLegendEntry, aC as ChartLegendSwatch, aD as ChartRange, aE as ChartReferenceLine, aF as ChartRevealDirection, aG as ChartSkeleton, aH as ChartSkeletonProps, aI as ChartStatusTone, aJ as ChartStrokeVariant, aK as ChartTooltip, aL as ChartTooltipProps, aM as ChartTooltipRow, aN as ChatTemplate, aO as Checkbox, aP as CheckboxProps, aQ as CheckoutTemplate, aR as ChordChart, aS as ChordChartProps, aT as ColoredBadge, aU as ColoredBadgeProps, aV as ColumnChart, aW as ColumnChartProps, C as ColumnDef, aX as ColumnSeries, aY as ComposerAttachments, aZ as ComposerAttachmentsProps, a_ as ConfirmProvider, a$ as ContainerFillChart, b0 as ContainerFillChartProps, b1 as ContainerFillItem, b2 as CountBadge, b3 as CountBadgeProps, b4 as CountBadgeTone, b5 as Curve, b6 as DAY_MS, b7 as DEFAULT_SHELL_STRINGS, b8 as DashboardTemplate, b9 as DataTable, ba as DataTableColumn, bb as DataTableColumnGroup, bc as DataTableHeader, bd as DataTablePage, be as DataTableProps, bf as DataTableRowLink, bg as DataTableRowProps, bh as DatePicker, bi as DatePickerProps, bj as DateRangePicker, bk as DateRangePickerProps, bl as DateTimePicker, bm as DateTimePickerProps, bn as DescriptionColumns, bo as DescriptionItem, bp as DescriptionList, bq as DescriptionListProps, br as Dialog, bs as DialogProps, bt as DialogSize, bu as Divider, bv as DividerProps, bw as DividerSpacing, bx as DonutChart, by as DonutChartProps, bz as DonutSegment, bA as Drawer, bB as DrawerProps, bC as DrawerSide, bD as DrawerSize, bE as DropdownMenu, bF as DropdownMenuAlign, bG as DropdownMenuCheckboxItem, bH as DropdownMenuDividerItem, bI as DropdownMenuEntry, bJ as DropdownMenuItem, bK as DropdownMenuLabelItem, bL as DropdownMenuLinkItem, bM as DropdownMenuProps, bN as DropdownMenuRadioItem, bO as DropdownMenuSide, bP as DropdownPositionOptions, bQ as ENTER, bR as EditableGrid, bS as EditableGridProps, bT as EmailTemplate, bU as EmptyState, bV as EmptyStateProps, bW as ErrorBoundary, bX as ErrorBoundaryProps, bY as ErrorPage, bZ as ErrorPageProps, b_ as FileIntake, b$ as FilePicker, c0 as FilePickerProps, c1 as FillVariant, c2 as FormError, c3 as FormErrorSummary, c4 as FormErrorSummaryProps, c5 as FormField, c6 as FormFieldProps, c7 as FormLayoutPage, c8 as FormatDateOptions, c9 as FunnelChart, ca as FunnelChartProps, cb as FunnelStage, cc as GLASS_DIVIDER, ce as GROUP_COLORS, cf as GROUP_COLORS_SOLID, cg as GalleryTemplate, ch as Gap, ci as GlobalSearch, cj as GlobalSearchProps, ck as Grid, cl as GridCols, cm as GridColumn, cn as GridProps, co as HeatmapChart, cp as HeatmapChartProps, cq as HelpCenter, cr as HelpCenterDoc, cs as HelpCenterProps, ct as HistogramBin, cu as HistogramChart, cv as HistogramChartProps, cw as INPUT_BASE, cx as INPUT_SIZES, cy as IconButton, cz as IconButtonClassesOptions, cA as IconButtonProps, cB as Inline, cC as InlineProps, cD as Input, cE as InputNumber, cF as InputNumberProps, cG as InputProps, cH as InputSize, cI as Justify, cJ as Kanban, cK as KanbanColumn, cL as KanbanProps, cM as Kbd, cN as KbdProps, cO as KbdSize, cP as Label, cQ as LabelClassesOptions, cR as LabelProps, cS as LadderScale, cT as LineChart, cU as LineChartProps, cV as LineChartSeries, cW as LinearScale, cX as ListFooter, cY as ListLoadError, cZ as ListLoadErrorProps, c_ as LoadingSpinner, c$ as LoadingSpinnerProps, d0 as MAX_FRACTION_DIGITS, d1 as MENU_MAX_HEIGHT, d2 as MOD, d3 as MOTION, d4 as Markdown, d4 as MarkdownLite, d5 as MarkdownLiteProps, d5 as MarkdownProps, d6 as MediaUploadField, d7 as MediaUploadFieldProps, d8 as MediaUploadGrid, d9 as MediaUploadGridItem, da as MediaUploadGridProps, db as MenuPos, dc as Meter, dd as MeterProps, de as MetricBar, df as MetricBarProps, dg as Milestone, dh as MilestoneKind, di as MilestoneTimeline, dj as MilestoneTimelineProps, dk as NEXT_CHUNK_PATH_PREFIX, dl as NativeSelect, dm as NumericKeypad, dn as NumericKeypadProps, dp as OVERLAY_OPEN_EVENT, dq as POPUP_MAX_WIDTH, dr as POST_PRODUCTION_STATUSES, ds as PageHeader, dt as PageHeaderProps, P as PaginatedResponse, du as Pagination, dv as PaginationProps, dw as PaperclipGlyph, dx as Paragraph, dy as ParagraphProps, dz as PieChart, dA as PieChartProps, dB as PieSegment, dC as PlotGeometry, dD as Point, dE as Popover, dF as PopoverAlign, dG as PopoverProps, dH as PopoverRenderProps, dI as PopoverSide, dJ as PopupMenu, dK as PopupMenuDivider, dL as PopupMenuItem, dM as PopupMenuItemProps, dN as PopupMenuLabel, dO as PopupMenuProps, dP as PopupSubmenu, dQ as PopupSubmenuProps, dR as PortalBrandingContextValue, dS as PortalBrandingProvider, dT as PortalBrandingProviderProps, dU as ProductionTimeline, dV as ProductionTimelineProps, dW as ProductionTimelineSnapshot, dX as ProgressItem, dY as PublicPortal, dZ as PublicPortalBranding, d_ as RADAR_SERIES_CAP, d$ as RadarAxis, e0 as RadarChart, e1 as RadarChartProps, e2 as RadarSeries, e3 as RadialBarChart, e4 as RadialBarChartProps, e5 as RadialBarRow, e6 as Radio, e7 as RadioGroup, e8 as RadioGroupOption, e9 as RadioGroupOrientation, ea as RadioGroupProps, eb as RadioProps, ec as Range, ed as RangeChart, ee as RangeChartProps, ef as RangeRow, eg as RankedBars, eh as RankedBarsProps, ei as RankedBarsRow, ej as ResolvedPortalBrandAsset, ek as Result, el as ResultProps, em as ResultStatus, en as RevealDirection, eo as SCATTER_SERIES_CAP, ep as SERIES_SLOT_COUNT, eq as SERIES_VARS, er as SHIFT, es as STAGES, et as STALE_CHUNK_RELOAD_COOLDOWN_MS, eu as STALE_CHUNK_RELOAD_KEY, ev as STATUS_VARS, ew as SankeyChart, ex as SankeyChartProps, ey as SankeyLink, ez as SankeyNode, eA as ScatterChart, eB as ScatterChartProps, eC as ScatterPoint, eD as ScatterSeries, S as SearchConfig, eE as SearchProvider, eF as SearchResult, eG as SearchableOption, eH as SearchableSelect, eI as SearchableSelectProps, eJ as Segmented, eK as SegmentedOption, eL as SegmentedProps, eM as SegmentedSize, eN as Select, eO as SelectOption, eP as SelectProps, eQ as SemanticGroup, eR as SettingRow, eS as SettingRowProps, eT as SeverityTone, eU as ShellPrefsAdapter, eV as ShellPrefsProvider, eW as ShellStrings, eX as ShellStringsOverride, eY as ShellStringsProvider, eZ as SidebarActionButton, e_ as SidebarActionButtonProps, e$ as SidebarGroupLabel, f0 as SidebarLayout, f1 as SidebarLayoutProps, f2 as SidebarNavItem, f3 as SidebarNavItemProps, f4 as Skeleton, f5 as SkeletonProps, f6 as SkeletonVariant, f7 as Snippet, f8 as SnippetProps, f9 as SnippetSize, fa as SnippetVariant, a as SortState, fb as Sparkline, fc as SparklineProps, fd as Stack, fe as StackProps, ff as StaleChunkReloadOptions, fg as StatCard, fh as StatCardProps, fi as StatTile, fj as StatTileProps, fk as Statistic, fl as StatisticProps, fm as StatisticSize, fn as StatisticTone, fo as StatusBadge, fp as StatusBadgeProvider, fq as StatusEmphasis, fr as StepItem, fs as Stepper, ft as StepperProps, fu as StrokeVariant, fv as SunburstChart, fw as SunburstChartProps, fx as SunburstNode, fy as Switch, fz as SwitchProps, fA as SwitchSize, fB as TabItem, fC as Tabs, fD as TabsProps, fE as TagInput, fF as TagInputOption, fG as TagInputProps, fH as Text, fI as TextProps, fJ as TextSize, fK as TextTone, fL as TextWeight, fM as Textarea, fN as TextareaProps, fO as Theme, fP as TileButton, fQ as TileButtonProps, fR as TileSize, fS as TimePicker, fT as TimePickerProps, fU as TimeSeriesChart, fV as TimeSeriesChartProps, fW as TimeSeriesSeries, fX as TimelineMarker, fY as TimelineMarkerKind, fZ as TimelineReport, f_ as TimelineScrubProgress, f$ as TimelineTrack, g0 as TimelineTrackItem, g1 as TimelineTrackKind, g2 as TimelineTrackPending, g3 as TimelineTrackPhase, g4 as TimelineTrackPlayback, g5 as TimelineTrackProps, g6 as TimelineTrackThumb, g7 as Title, g8 as TitleLevel, g9 as TitleProps, ga as ToastOptions, gb as ToastPlacement, gc as Tooltip, gd as TooltipProps, ge as TopNav, gf as TopNavItem, gg as TopNavProps, gh as TreemapChart, gi as TreemapChartProps, gj as TreemapItem, gk as TreemapTile, gl as UseAppUpdateOptions, gm as UseProductionTimelineOpts, gn as VERSION, go as VITE_PRELOAD_ERROR_EVENT, gp as WaterfallChart, gq as WaterfallChartProps, gr as WaterfallStep, gs as ZLayer, gt as Z_LAYERS, gu as angleScale, gv as appendKey, gw as applyThemePrefs, gx as arcPath, gy as areaBetween, gz as areaFrom, gA as autoHighlightIndex, gB as backspace, gC as bandScale, gD as binValues, gE as budgetState, gF as bumpPath, gG as buttonClasses, gH as calcOverall, gI as calcReportOverall, gJ as confirm, gK as confirmDestructive, gL as curvePath, gM as dashFor, gN as dismissPopups, gO as fillFor, gP as fillId, gQ as firstDayOfWeek, gR as fmtSliderDate, gS as formatDate, gT as fromDateKey, gU as glassStyle, gV as glowId, gW as groundId, gX as groupColors, gY as highlightOpacity, gZ as iconButtonClasses, g_ as inputClasses, g$ as installStaleChunkReload, h0 as isMac, h1 as isSeverityTone, h2 as isStaleChunkError, h3 as labelClasses, h4 as ladderScale, h5 as linearPath, h6 as linearScale, h7 as logScale, h8 as maskId, h9 as mediaFileName, ha as monotonePath, hb as niceMax, hc as polygonPoints, hd as popupBounds, he as prompt, hf as radiusScale, hg as resolveBrandMarkTreatment, hh as resolvePortalBrandAsset, hi as resolveSeriesColor, hj as resolveTheme, hk as seriesColor, hl as severityOf, hm as splinePath, hn as squarify, ho as stagger, hp as stepPath, hq as tabButtonId, hr as tabPanelId, hs as toDateKey, ht as toDayMs, hu as toISODate, hv as toast, hw as useAppUpdate, hx as useClickOutside, hy as useConfirm, hz as useDropdownPosition, hA as useFocusTrap, hB as useHighlight, hC as useIsMobile, hD as useLocalStoragePrefs, hE as usePlotWidth, hF as usePortalBranding, hG as useProductionTimeline, hH as useScrollLock, hI as useShellLocale, hJ as useShellPrefs, hK as useShellStrings, hL as useTheme } from '../index-DQ52lM8L.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 AngleScale, k as AppUpdateBanner, l as AppUpdateBannerProps, m as AttachButton, n as AttachButtonProps, o as AttachmentDropZone, p as AttachmentDropZoneProps, q as AttachmentList, r as AttachmentListProps, s as AuthScreen, t as AuthScreenProps, u as Avatar, v as AvatarGroup, w as AvatarGroupProps, x as AvatarProps, y as AvatarSize, z as AvatarStatus, B as BackgroundVariant, D as BandScale, E as Banner, F as BannerEmphasis, G as BannerProps, H as BannerTone, I as BarChart, J as BarChartProps, K as BoxPlotBox, L as BoxPlotChart, M as BoxPlotChartProps, N as BrandAssetEditor, O as BrandAssetEditorProps, Q as BrandAssetPreview, R as BrandMark, T as BrandMarkProps, U as BrandMarkSlot, V as BrandMarkSurface, W as BrandMarkTreatment, X as BreadcrumbItem, Y as Breadcrumbs, Z as BreadcrumbsProps, _ as BudgetBar, $ as BudgetBarProps, a0 as BudgetState, a1 as Button, a2 as ButtonClassesOptions, a3 as ButtonProps, a4 as ButtonSize, a5 as ButtonVariant, a6 as CHART_INK, a7 as CMD_A, a8 as CMD_DOT, a9 as CMD_ENTER, aa as CMD_K, ab as CMD_S, ac as Calendar, ad as CalendarMode, ae as CalendarProps, af as Candle, ag as CandlestickChart, ah as CandlestickChartProps, ai as Card, aj as CardPadding, ak as CardProps, al as CartesianPlot, am as CartesianPlotProps, an as CellStyle, ao as ChartBackgroundVariant, ap as ChartBrush, aq as ChartBrushProps, ar as ChartCurve, as as ChartDefs, at as ChartDefsProps, au as ChartDot, av as ChartDotProps, aw as ChartDotVariant, ax as ChartFillVariant, ay as ChartFrame, az as ChartFrameProps, aA as ChartHighlightProvider, aB as ChartLegendEntry, aC as ChartLegendSwatch, aD as ChartRange, aE as ChartReferenceLine, aF as ChartRevealDirection, aG as ChartSkeleton, aH as ChartSkeletonProps, aI as ChartStatusTone, aJ as ChartStrokeVariant, aK as ChartTooltip, aL as ChartTooltipProps, aM as ChartTooltipRow, aN as ChatTemplate, aO as Checkbox, aP as CheckboxProps, aQ as CheckoutTemplate, aR as ChordChart, aS as ChordChartProps, aT as ColoredBadge, aU as ColoredBadgeProps, aV as ColumnChart, aW as ColumnChartProps, C as ColumnDef, aX as ColumnSeries, aY as ComposerAttachments, aZ as ComposerAttachmentsProps, a_ as ConfirmProvider, a$ as ContainerFillChart, b0 as ContainerFillChartProps, b1 as ContainerFillItem, b2 as CountBadge, b3 as CountBadgeProps, b4 as CountBadgeTone, b5 as Curve, b6 as DAY_MS, b7 as DEFAULT_SHELL_STRINGS, b8 as DashboardTemplate, b9 as DataTable, ba as DataTableColumn, bb as DataTableColumnGroup, bc as DataTableHeader, bd as DataTablePage, be as DataTableProps, bf as DataTableRowLink, bg as DataTableRowProps, bh as DatePicker, bi as DatePickerProps, bj as DateRangePicker, bk as DateRangePickerProps, bl as DateTimePicker, bm as DateTimePickerProps, bn as DescriptionColumns, bo as DescriptionItem, bp as DescriptionList, bq as DescriptionListProps, br as Dialog, bs as DialogProps, bt as DialogSize, bu as Divider, bv as DividerProps, bw as DividerSpacing, bx as DonutChart, by as DonutChartProps, bz as DonutSegment, bA as Drawer, bB as DrawerProps, bC as DrawerSide, bD as DrawerSize, bE as DropdownMenu, bF as DropdownMenuAlign, bG as DropdownMenuCheckboxItem, bH as DropdownMenuDividerItem, bI as DropdownMenuEntry, bJ as DropdownMenuItem, bK as DropdownMenuLabelItem, bL as DropdownMenuLinkItem, bM as DropdownMenuProps, bN as DropdownMenuRadioItem, bO as DropdownMenuSide, bP as DropdownPositionOptions, bQ as ENTER, bR as EditableGrid, bS as EditableGridProps, bT as EmailTemplate, bU as EmptyState, bV as EmptyStateProps, bW as ErrorBoundary, bX as ErrorBoundaryProps, bY as ErrorPage, bZ as ErrorPageProps, b_ as FileIntake, b$ as FilePicker, c0 as FilePickerProps, c1 as FillVariant, c2 as FormError, c3 as FormErrorSummary, c4 as FormErrorSummaryProps, c5 as FormField, c6 as FormFieldProps, c7 as FormLayoutPage, c8 as FormatDateOptions, c9 as FunnelChart, ca as FunnelChartProps, cb as FunnelStage, cc as GLASS_DIVIDER, ce as GROUP_COLORS, cf as GROUP_COLORS_SOLID, cg as GalleryTemplate, ch as Gap, ci as GlobalSearch, cj as GlobalSearchProps, ck as Grid, cl as GridCols, cm as GridColumn, cn as GridProps, co as HeatmapChart, cp as HeatmapChartProps, cq as HelpCenter, cr as HelpCenterDoc, cs as HelpCenterProps, ct as HistogramBin, cu as HistogramChart, cv as HistogramChartProps, cw as INPUT_BASE, cx as INPUT_SIZES, cy as IconButton, cz as IconButtonClassesOptions, cA as IconButtonProps, cB as Inline, cC as InlineProps, cD as Input, cE as InputNumber, cF as InputNumberProps, cG as InputProps, cH as InputSize, cI as Justify, cJ as Kanban, cK as KanbanColumn, cL as KanbanProps, cM as Kbd, cN as KbdProps, cO as KbdSize, cP as Label, cQ as LabelClassesOptions, cR as LabelProps, cS as LadderScale, cT as LineChart, cU as LineChartProps, cV as LineChartSeries, cW as LinearScale, cX as ListFooter, cY as ListLoadError, cZ as ListLoadErrorProps, c_ as LoadingSpinner, c$ as LoadingSpinnerProps, d0 as MAX_FRACTION_DIGITS, d1 as MENU_MAX_HEIGHT, d2 as MOD, d3 as MOTION, d4 as Markdown, d4 as MarkdownLite, d5 as MarkdownLiteProps, d5 as MarkdownProps, d6 as MediaUploadField, d7 as MediaUploadFieldProps, d8 as MediaUploadGrid, d9 as MediaUploadGridItem, da as MediaUploadGridProps, db as MenuPos, dc as Meter, dd as MeterProps, de as MetricBar, df as MetricBarProps, dg as Milestone, dh as MilestoneKind, di as MilestoneTimeline, dj as MilestoneTimelineProps, dk as NEXT_CHUNK_PATH_PREFIX, dl as NativeSelect, dm as NumericKeypad, dn as NumericKeypadProps, dp as OVERLAY_OPEN_EVENT, dq as POPUP_MAX_WIDTH, dr as POST_PRODUCTION_STATUSES, ds as PageHeader, dt as PageHeaderProps, P as PaginatedResponse, du as Pagination, dv as PaginationProps, dw as PaperclipGlyph, dx as Paragraph, dy as ParagraphProps, dz as PieChart, dA as PieChartProps, dB as PieSegment, dC as PlotGeometry, dD as Point, dE as Popover, dF as PopoverAlign, dG as PopoverProps, dH as PopoverRenderProps, dI as PopoverSide, dJ as PopupMenu, dK as PopupMenuDivider, dL as PopupMenuItem, dM as PopupMenuItemProps, dN as PopupMenuLabel, dO as PopupMenuProps, dP as PopupSubmenu, dQ as PopupSubmenuProps, dR as PortalBrandingContextValue, dS as PortalBrandingProvider, dT as PortalBrandingProviderProps, dU as ProductionTimeline, dV as ProductionTimelineProps, dW as ProductionTimelineSnapshot, dX as ProgressItem, dY as PublicPortal, dZ as PublicPortalBranding, d_ as RADAR_SERIES_CAP, d$ as RadarAxis, e0 as RadarChart, e1 as RadarChartProps, e2 as RadarSeries, e3 as RadialBarChart, e4 as RadialBarChartProps, e5 as RadialBarRow, e6 as Radio, e7 as RadioGroup, e8 as RadioGroupOption, e9 as RadioGroupOrientation, ea as RadioGroupProps, eb as RadioProps, ec as Range, ed as RangeChart, ee as RangeChartProps, ef as RangeRow, eg as RankedBars, eh as RankedBarsProps, ei as RankedBarsRow, ej as ResolvedPortalBrandAsset, ek as Result, el as ResultProps, em as ResultStatus, en as RevealDirection, eo as SCATTER_SERIES_CAP, ep as SERIES_SLOT_COUNT, eq as SERIES_VARS, er as SHIFT, es as STAGES, et as STALE_CHUNK_RELOAD_COOLDOWN_MS, eu as STALE_CHUNK_RELOAD_KEY, ev as STATUS_VARS, ew as SankeyChart, ex as SankeyChartProps, ey as SankeyLink, ez as SankeyNode, eA as ScatterChart, eB as ScatterChartProps, eC as ScatterPoint, eD as ScatterSeries, S as SearchConfig, eE as SearchProvider, eF as SearchResult, eG as SearchableOption, eH as SearchableSelect, eI as SearchableSelectProps, eJ as Segmented, eK as SegmentedOption, eL as SegmentedProps, eM as SegmentedSize, eN as Select, eO as SelectOption, eP as SelectProps, eQ as SemanticGroup, eR as SettingRow, eS as SettingRowProps, eT as SeverityTone, eU as ShellPrefsAdapter, eV as ShellPrefsProvider, eW as ShellStrings, eX as ShellStringsOverride, eY as ShellStringsProvider, eZ as SidebarActionButton, e_ as SidebarActionButtonProps, e$ as SidebarGroupLabel, f0 as SidebarLayout, f1 as SidebarLayoutProps, f2 as SidebarNavItem, f3 as SidebarNavItemProps, f4 as Skeleton, f5 as SkeletonProps, f6 as SkeletonVariant, f7 as Snippet, f8 as SnippetProps, f9 as SnippetSize, fa as SnippetVariant, a as SortState, fb as Sparkline, fc as SparklineProps, fd as Stack, fe as StackProps, ff as StaleChunkReloadOptions, fg as StatCard, fh as StatCardProps, fi as StatTile, fj as StatTileProps, fk as Statistic, fl as StatisticProps, fm as StatisticSize, fn as StatisticTone, fo as StatusBadge, fp as StatusBadgeProvider, fq as StatusEmphasis, fr as StepItem, fs as Stepper, ft as StepperProps, fu as StrokeVariant, fv as SunburstChart, fw as SunburstChartProps, fx as SunburstNode, fy as Switch, fz as SwitchProps, fA as SwitchSize, fB as TabItem, fC as Tabs, fD as TabsProps, fE as TagInput, fF as TagInputOption, fG as TagInputProps, fH as Text, fI as TextProps, fJ as TextSize, fK as TextTone, fL as TextWeight, fM as Textarea, fN as TextareaProps, fO as Theme, fP as TileButton, fQ as TileButtonProps, fR as TileSize, fS as TimePicker, fT as TimePickerProps, fU as TimeSeriesChart, fV as TimeSeriesChartProps, fW as TimeSeriesSeries, fX as TimelineMarker, fY as TimelineMarkerKind, fZ as TimelineReport, f_ as TimelineScrubProgress, f$ as TimelineTrack, g0 as TimelineTrackItem, g1 as TimelineTrackKind, g2 as TimelineTrackPending, g3 as TimelineTrackPhase, g4 as TimelineTrackPlayback, g5 as TimelineTrackProps, g6 as TimelineTrackThumb, g7 as Title, g8 as TitleLevel, g9 as TitleProps, ga as ToastOptions, gb as ToastPlacement, gc as Tooltip, gd as TooltipProps, ge as TopNav, gf as TopNavItem, gg as TopNavProps, gh as TransferBadge, gi as TransferBadgeProps, gj as TransferBadgeState, gk as TreemapChart, gl as TreemapChartProps, gm as TreemapItem, gn as TreemapTile, go as UseAppUpdateOptions, gp as UseProductionTimelineOpts, gq as VERSION, gr as VITE_PRELOAD_ERROR_EVENT, gs as WaterfallChart, gt as WaterfallChartProps, gu as WaterfallStep, gv as ZLayer, gw as Z_LAYERS, gx as angleScale, gy as appendKey, gz as applyThemePrefs, gA as arcPath, gB as areaBetween, gC as areaFrom, gD as autoHighlightIndex, gE as backspace, gF as bandScale, gG as binValues, gH as budgetState, gI as bumpPath, gJ as buttonClasses, gK as calcOverall, gL as calcReportOverall, gM as confirm, gN as confirmDestructive, gO as curvePath, gP as dashFor, gQ as dismissPopups, gR as fillFor, gS as fillId, gT as firstDayOfWeek, gU as fmtSliderDate, gV as formatDate, gW as fromDateKey, gX as glassStyle, gY as glowId, gZ as groundId, g_ as groupColors, g$ as highlightOpacity, h0 as iconButtonClasses, h1 as inputClasses, h2 as installStaleChunkReload, h3 as isMac, h4 as isSeverityTone, h5 as isStaleChunkError, h6 as labelClasses, h7 as ladderScale, h8 as linearPath, h9 as linearScale, ha as logScale, hb as maskId, hc as mediaFileName, hd as monotonePath, he as niceMax, hf as openGlobalSearch, hg as polygonPoints, hh as popupBounds, hi as prompt, hj as radiusScale, hk as resolveBrandMarkTreatment, hl as resolvePortalBrandAsset, hm as resolveSeriesColor, hn as resolveTheme, ho as seriesColor, hp as severityOf, hq as splinePath, hr as squarify, hs as stagger, ht as stepPath, hu as tabButtonId, hv as tabPanelId, hw as toDateKey, hx as toDayMs, hy as toISODate, hz as toast, hA as useAppUpdate, hB as useClickOutside, hC as useConfirm, hD as useDropdownPosition, hE as useFocusTrap, hF as useHighlight, hG as useIsMobile, hH as useLocalStoragePrefs, hI as usePlotWidth, hJ as usePortalBranding, hK as useProductionTimeline, hL as useScrollLock, hM as useShellLocale, hN as useShellPrefs, hO as useShellStrings, hP as useTheme } from '../index-ak9Cps7c.js';
2
2
  export { FileIntakeAlert, FileIntakeLimits, FileIntakeOptions, FileRejection, FileRejectionReason, acceptsFile, useFileIntake } from '../file-intake/index.js';
3
3
  import 'react';
4
4
  import 'react/jsx-runtime';
package/dist/ui/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{APP_UPDATE_POLL_MS,Accordion,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,Banner,BarChart,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,Divider,DonutChart,Drawer,DropdownMenu,EmailTemplate,EmptyState,ErrorBoundary,ErrorPage,FilePicker_default as FilePicker,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,GlobalSearch,Grid,HeatmapChart,HelpCenter,HistogramChart,INPUT_BASE,INPUT_SIZES,IconButton_default as IconButton,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LineChart,ListFooter,ListLoadError,MAX_FRACTION_DIGITS,MENU_MAX_HEIGHT,MOTION,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POPUP_MAX_WIDTH,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavItem,Skeleton,Snippet,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,Tabs,TagInput,Text,Textarea_default as Textarea,TileButton_default as TileButton,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,Tooltip,TopNav,TreemapChart,WaterfallChart,angleScale,appendKey,applyThemePrefs,arcPath,areaBetween,areaFrom,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,curvePath,dashFor,fillFor,fillId,firstDayOfWeek,fmtSliderDate,formatDate,fromKey as fromDateKey,glowId,groundId,groupColors,highlightOpacity,inputClasses,isSeverityTone,labelClasses,ladderScale,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceMax,polygonPoints,popupBounds,radiusScale,resolvePortalBrandAsset,resolveSeriesColor,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,useAppUpdate,useClickOutside,useDropdownPosition,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useTheme}from"../chunk-SWU7CXZB.js";export{Breadcrumbs}from"../chunk-I55UMU3R.js";export{SidebarLayout}from"../chunk-SLCR26NK.js";export{BrandMark,resolveBrandMarkTreatment}from"../chunk-OCSOMMY2.js";export{EditableGrid}from"../chunk-TFKB2WEB.js";import"../chunk-BR22X7E5.js";export{toast_default as toast}from"../chunk-KKOHUQPF.js";export{VERSION}from"../chunk-BJVY3LPW.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-V453E4KU.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-UB22J6EF.js";export{Button_default as Button,buttonClasses,iconButtonClasses}from"../chunk-PH3PRIFP.js";export{PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu}from"../chunk-ZBIWNVJS.js";export{ConfirmProvider,Dialog,OVERLAY_OPEN_EVENT,Z_LAYERS,confirm,confirmDestructive,dismissPopups,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-QOXIUJTN.js";export{GLASS_DIVIDER,glassStyle}from"../chunk-57MIENLJ.js";import"../chunk-MAIHBBWT.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-TR6PLN7W.js";import"../chunk-D65T4H6J.js";
2
+ export{APP_UPDATE_POLL_MS,Accordion,AppUpdateBanner,AttachButton,AttachmentDropZone,AttachmentList,AuthScreen,Avatar,AvatarGroup,Banner,BarChart,BoxPlotChart,BrandAssetEditor,BudgetBar,CHART_INK,Calendar,CandlestickChart,Card,CartesianPlot,ChartBrush,ChartDefs,ChartDot,ChartFrame,ChartHighlightProvider,ChartSkeleton,ChartTooltip,ChatTemplate,Checkbox_default as Checkbox,CheckoutTemplate,ChordChart,ColoredBadge,ColumnChart,ComposerAttachments,ContainerFillChart,CountBadge,DAY_MS,DashboardTemplate,DataTable,DataTablePage,DatePicker_default as DatePicker,DateRangePicker,DateTimePicker_default as DateTimePicker,DescriptionList,Divider,DonutChart,Drawer,DropdownMenu,EmailTemplate,EmptyState,ErrorBoundary,ErrorPage,FilePicker_default as FilePicker,FormErrorSummary,FormField,FormLayoutPage,FunnelChart,GROUP_COLORS,GROUP_COLORS_SOLID,GalleryTemplate,Grid,HeatmapChart,HelpCenter,HistogramChart,INPUT_BASE,INPUT_SIZES,IconButton_default as IconButton,Inline,Input_default as Input,InputNumber_default as InputNumber,Kanban,Label,LineChart,ListFooter,ListLoadError,MAX_FRACTION_DIGITS,MENU_MAX_HEIGHT,MOTION,Markdown,Markdown as MarkdownLite,MediaUploadField,MediaUploadGrid,Meter,MetricBar,MilestoneTimeline,NativeSelect,NumericKeypad,POPUP_MAX_WIDTH,POST_PRODUCTION_STATUSES,PageHeader,Pagination,PaperclipGlyph,Paragraph,PieChart,Popover,PortalBrandingProvider,ProductionTimeline,RADAR_SERIES_CAP,RadarChart,RadialBarChart,Radio_default as Radio,RadioGroup,RangeChart,RankedBars,SCATTER_SERIES_CAP,SERIES_SLOT_COUNT,SERIES_VARS,STAGES,STATUS_VARS,SankeyChart,ScatterChart,SearchableSelect,Segmented,Select_default as Select,SettingRow,SidebarActionButton,SidebarGroupLabel,SidebarNavItem,Skeleton,Snippet,Sparkline,Stack,StatCard,StatTile,Statistic,StatusBadge,StatusBadgeProvider,Stepper,SunburstChart,Switch_default as Switch,Tabs,TagInput,Text,Textarea_default as Textarea,TileButton_default as TileButton,TimePicker_default as TimePicker,TimeSeriesChart,TimelineTrack,Title,Tooltip,TopNav,TransferBadge,TreemapChart,WaterfallChart,angleScale,appendKey,applyThemePrefs,arcPath,areaBetween,areaFrom,autoHighlightIndex,backspace,bandScale,binValues,budgetState,bumpPath,calcOverall,calcReportOverall,curvePath,dashFor,fillFor,fillId,firstDayOfWeek,fmtSliderDate,formatDate,fromKey as fromDateKey,glowId,groundId,groupColors,highlightOpacity,inputClasses,isSeverityTone,labelClasses,ladderScale,linearPath,linearScale,logScale,maskId,mediaFileName,monotonePath,niceMax,polygonPoints,popupBounds,radiusScale,resolvePortalBrandAsset,resolveSeriesColor,resolveTheme,seriesColor,severityOf,splinePath,squarify,stagger,stepPath,tabButtonId,tabPanelId,toKey as toDateKey,toDayMs,toISODate,useAppUpdate,useClickOutside,useDropdownPosition,useHighlight,usePlotWidth,usePortalBranding,useProductionTimeline,useTheme}from"../chunk-V73HRX73.js";export{Breadcrumbs}from"../chunk-NSXQF4YC.js";export{SidebarLayout}from"../chunk-MXLPLKRG.js";export{BrandMark,GlobalSearch,openGlobalSearch,resolveBrandMarkTreatment}from"../chunk-O35K6ZWH.js";export{EditableGrid}from"../chunk-ZP2V72LB.js";import"../chunk-BR22X7E5.js";export{toast_default as toast}from"../chunk-VGTI3BJ4.js";export{VERSION}from"../chunk-YIXQGB75.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-ZTXFXS6V.js";export{Button_default as Button,buttonClasses,iconButtonClasses}from"../chunk-PH3PRIFP.js";export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-4DT7B7GZ.js";export{ConfirmProvider,Dialog,confirm,confirmDestructive,prompt,useConfirm,useFocusTrap,useScrollLock}from"../chunk-ZYUWLZUG.js";export{GLASS_DIVIDER,PopupMenu,PopupMenuDivider,PopupMenuItem,PopupMenuLabel,PopupSubmenu,glassStyle}from"../chunk-J7LKJIZC.js";export{OVERLAY_OPEN_EVENT,Z_LAYERS,dismissPopups}from"../chunk-OSJ3ADF2.js";import"../chunk-MAIHBBWT.js";import"../chunk-D65T4H6J.js";export{DEFAULT_SHELL_STRINGS,ShellStringsProvider,useShellLocale,useShellStrings}from"../chunk-FEWQDVQJ.js";
package/dist/ui.css CHANGED
@@ -658,6 +658,67 @@ html.rosh-reduce-transparency *::after {
658
658
  --rosh-glass-solid-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
659
659
  }
660
660
 
661
+ /* ── The submit affordance ──────────────────────────────────────────────────
662
+ * `.btn-submit` is the button that commits a form (Submit, Update, Create, a
663
+ * status transition) and `.kbd-submit` is the shortcut chip it carries. `Modal`
664
+ * has found a window's submit button by `button.btn-submit` since 4.76.0, yet
665
+ * the only DEFINITION of either class was the admin portal's index.css. A
666
+ * second portal had nothing to adopt and wrote its chip as blue utilities at an
667
+ * opacity, and so did the kit, twice. No accent theme reaches those:
668
+ * themes.css remaps `border-blue-400`, and the same class at an opacity is a
669
+ * different class name.
670
+ *
671
+ * Four tokens, so a button and its chip move together:
672
+ *
673
+ * --submit-bg the fill
674
+ * --submit-bg-hover the fill under the pointer
675
+ * --submit-kbd-border the chip's edge, a tint of the accent
676
+ * --submit-kbd-bg the chip's wash
677
+ *
678
+ * Each default is the value the admin portal declared, so a portal that
679
+ * deletes its copy renders what it rendered. They are Tailwind v3's blues
680
+ * written out rather than `--color-blue-600`: in that portal a `.btn-submit`
681
+ * beside a primary `Button` has always been a slightly different blue, and
682
+ * making the two one is a restyle, not a move.
683
+ *
684
+ * The accent themes and the custom accent move them in themes.css, with the
685
+ * rest of the accent. Dark is below: the fill has no dark step (a primary
686
+ * Button's has none either) and the chip sits a little quieter, painted from
687
+ * the dark accent channels like every other blue wash in dark. With the
688
+ * channels at their defaults those are the admin portal's dark literals.
689
+ *
690
+ * IN NO LAYER, as they were in the portal, so they outrank a utility in the
691
+ * same class attribute. That is as far as it goes. The dark and accent remaps
692
+ * of a utility are `!important` and outrank these in turn, so a chip that is
693
+ * to follow the theme wears `kbd-submit` and NO palette utility of its own: a
694
+ * bare `<kbd>`, as the kit's two are, rather than `Kbd`, which brings gray
695
+ * ones. `tests/browser/submitAffordance.check.mjs` reads the computed colours
696
+ * under every theme.
697
+ */
698
+ :root {
699
+ --submit-bg: #2563eb;
700
+ --submit-bg-hover: #1d4ed8;
701
+ --submit-kbd-border: rgba(96, 165, 250, 0.5);
702
+ --submit-kbd-bg: rgba(59, 130, 246, 0.3);
703
+ }
704
+
705
+ :is([data-theme="dark"], .dark) {
706
+ --submit-kbd-border: rgba(var(--rosh-dark-accent-line-rgb), 0.4);
707
+ --submit-kbd-bg: rgba(var(--rosh-dark-accent-rgb), 0.22);
708
+ }
709
+
710
+ .btn-submit {
711
+ background-color: var(--submit-bg);
712
+ color: #fff;
713
+ }
714
+ .btn-submit:hover:not(:disabled) {
715
+ background-color: var(--submit-bg-hover);
716
+ }
717
+ .kbd-submit {
718
+ border-color: var(--submit-kbd-border);
719
+ background-color: var(--submit-kbd-bg);
720
+ }
721
+
661
722
  /* ── Tooltip arrow ──────────────────────────────────────────────────────────
662
723
  * `Tooltip`'s pointer: a 10px square turned 45°, standing out of the bubble's
663
724
  * edge that faces the trigger. `data-side` is the side the BUBBLE is on, so
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-shell",
3
- "version": "4.150.0",
3
+ "version": "4.155.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",
@@ -107,7 +107,7 @@
107
107
  "maplibre-gl": "6.11.2",
108
108
  "online-3d-viewer": "^0.18.0",
109
109
  "pdfjs-dist": "^6.2.108",
110
- "playwright": "^1.48.0",
110
+ "playwright": "^1.63.0",
111
111
  "react": "^18.2.0",
112
112
  "react-dom": "^18.2.0",
113
113
  "react-hook-form": "^7.74.0",
@@ -1,29 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-L2ZO76TC.js";import{useWidgetSettings as n}from"./chunk-ET5HXDOR.js";import"./chunk-V453E4KU.js";import"./chunk-UB4JIOLD.js";import"./chunk-PH3PRIFP.js";import"./chunk-ZBIWNVJS.js";import"./chunk-QOXIUJTN.js";import"./chunk-57MIENLJ.js";import"./chunk-MAIHBBWT.js";import"./chunk-TR6PLN7W.js";import"./chunk-D65T4H6J.js";import{useState as l,useCallback as r,useEffect as i}from"react";import{jsxs as o,Fragment as a,jsx as c}from"react/jsx-runtime";var s="calc_appearance";function u(){const[u,d]=l("0"),[h,m]=l(null),[b,k]=l(null),[g,p]=l(!1),[x,N]=l(""),[v,y]=l([]),[f,C]=l(!1),[$,j]=l(()=>e(s)),[w,E]=l(!1),[L,T]=l($);n(r(()=>{T({...$}),E(!0)},[$]));const B=r(e=>{N(""),d(t=>g||"0"===t?(p(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[g]),S=r(()=>{d("0"),m(null),k(null),p(!1)},[]),I=r((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}},[]),W=r(e=>{const t=parseFloat(u);if(null!==h&&b&&!g){const e=I(h,t,b);d(String(e)),m(e),y(n=>[`${h} ${b} ${t} = ${e}`,...n].slice(0,20))}else m(t);k(e),p(!0)},[u,h,b,g,I]),F=r(()=>{if(null===h||!b)return;const e=parseFloat(u),t=I(h,e,b),n=`${h} ${b} ${e} =`;y(e=>[`${n} ${t}`,...e].slice(0,20)),N(n),d(String(t)),m(null),k(null),p(!0)},[u,h,b,I]),J=r(()=>{d(e=>String(parseFloat(e)/100))},[]),O=r(()=>{d(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);i(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?B(e.key):"."===e.key?B("."):"+"===e.key?W("+"):"-"===e.key?W("-"):"*"===e.key?W("×"):"/"===e.key?(e.preventDefault(),W("÷")):"Enter"===e.key||"="===e.key?F():"Escape"===e.key?S():"Backspace"===e.key?d(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&J())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[B,W,F,S,J]);const A="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",H=`${A} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,M=`${A} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,P=`${A} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,D=`${A} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
- return o(a,{children:[
3
- /* @__PURE__ */o("div",{className:"flex flex-col h-full",style:{opacity:$.activeOpacity/100,backdropFilter:$.activeBlur>0?`blur(${$.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__ */c("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:v.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */c("div",{className:"text-[11px] text-slate-400 text-right font-mono truncate",children:e},t))}),(x||b&&null!==h)&&/* @__PURE__ */c("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${h} ${b} ${g?"":u}`}),
6
- /* @__PURE__ */o("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */c("button",{onClick:()=>{navigator.clipboard.writeText(u),C(!0),setTimeout(()=>C(!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__ */c("svg",f?{className:"h-5 w-5 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}:{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),
8
- /* @__PURE__ */c("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)})(u)})]})]}),
9
- /* @__PURE__ */o("div",{className:"grid grid-cols-4 grid-rows-5 gap-1.5 flex-1 min-h-0 p-2",children:[
10
- /* @__PURE__ */c("button",{onClick:S,className:P,children:"AC"}),
11
- /* @__PURE__ */c("button",{onClick:O,className:P,children:"+/−"}),
12
- /* @__PURE__ */c("button",{onClick:J,className:P,children:"%"}),
13
- /* @__PURE__ */c("button",{onClick:()=>W("÷"),className:`${M} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */c("button",{onClick:()=>B("7"),className:H,children:"7"}),
15
- /* @__PURE__ */c("button",{onClick:()=>B("8"),className:H,children:"8"}),
16
- /* @__PURE__ */c("button",{onClick:()=>B("9"),className:H,children:"9"}),
17
- /* @__PURE__ */c("button",{onClick:()=>W("×"),className:`${M} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */c("button",{onClick:()=>B("4"),className:H,children:"4"}),
19
- /* @__PURE__ */c("button",{onClick:()=>B("5"),className:H,children:"5"}),
20
- /* @__PURE__ */c("button",{onClick:()=>B("6"),className:H,children:"6"}),
21
- /* @__PURE__ */c("button",{onClick:()=>W("-"),className:`${M} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */c("button",{onClick:()=>B("1"),className:H,children:"1"}),
23
- /* @__PURE__ */c("button",{onClick:()=>B("2"),className:H,children:"2"}),
24
- /* @__PURE__ */c("button",{onClick:()=>B("3"),className:H,children:"3"}),
25
- /* @__PURE__ */c("button",{onClick:()=>W("+"),className:`${M} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */c("button",{onClick:()=>B("0"),className:`${H} col-span-2`,children:"0"}),
27
- /* @__PURE__ */c("button",{onClick:()=>B("."),className:H,children:"."}),
28
- /* @__PURE__ */c("button",{onClick:F,className:D,children:"="})]})]}),
29
- /* @__PURE__ */c(t,{open:w,onClose:()=>E(!1),title:"Calculator Settings",appearance:L,onAppearanceChange:T,onSave:()=>{j(L),localStorage.setItem(s,JSON.stringify(L)),E(!1)}})]})}export{u as default};
@@ -1 +0,0 @@
1
- export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-QOXIUJTN.js";import"./chunk-TR6PLN7W.js";
@@ -1 +0,0 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-CVTOZCM3.js";import"./chunk-KKOHUQPF.js";import"./chunk-TR6PLN7W.js";
@@ -1,23 +0,0 @@
1
- import{useAuth as e}from"./chunk-LVDRBRYU.js";import{BrandMark as t}from"./chunk-OCSOMMY2.js";import{startMenuCategories as r,navVisible as n,navSections as a,isSection as o,isReachable as l,navIcons as s,sectionIcons as i,visibleChildren as c}from"./chunk-UB4JIOLD.js";import{glassStyle as d,GLASS_INPUT_BG as h}from"./chunk-57MIENLJ.js";import"./chunk-MAIHBBWT.js";import{useState as m,useRef as u,useMemo as p,useEffect as f,isValidElement as v,cloneElement as x}from"react";import{jsxs as b,jsx as g,Fragment as N}from"react/jsx-runtime";function k({width:k,openPage:w,profile:y,user:L,onLogout:A,onNavigate:C,navSections:j=a,navIcons:S=s,sectionIcons:M=i,categories:I=r,productName:B,productIcon:E,adaptiveLogo:$=!1,logoHasAlpha:_=null,logoIsLight:W=null}){const{hasAnyPerm:O}=e(),P=new Set(I.erp),T=new Set(I.system),U=new Set(I.footer??[]),z=(I.footerItems??[]).filter(e=>n(e,O)),D=I.virtual??[],[H,R]=m(""),[V,J]=m(/* @__PURE__ */new Set),Y=u(null),X=e=>{J(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},q=j.filter(e=>!o(e)).filter(e=>n(e,O)&&l(e,O)),F=j.filter(e=>o(e)&&P.has(e.label)),G=j.filter(e=>o(e)&&T.has(e.label)),K=j.filter(e=>o(e)&&U.has(e.label)),Q=e=>n(e,O)?e.items.filter(e=>n(e,O)).filter(e=>l(e,O)):[],Z=(e,t)=>{if(!n(e,O))return[];if(!l(e,O))return[];const r=[];e.label.toLowerCase().includes(t)&&r.push(e);for(const n of c(e,O))r.push(...Z(n,t));return r},ee=p(()=>{if(H.length<2)return[];const e=H.toLowerCase();return[...j.flatMap(t=>o(t)?Q(t).flatMap(t=>Z(t,e)):Z(t,e)),...z.flatMap(t=>Z(t,e))]},[H,j,z,O]);f(()=>{const e=e=>{"Escape"===e.key?(J(/* @__PURE__ */new Set),R("")):"/"===e.key&&"INPUT"!==document.activeElement?.tagName&&"TEXTAREA"!==document.activeElement?.tagName&&(e.preventDefault(),Y.current?.focus())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);const te=e=>{C(e),ne()},re=e=>{if(e.onSelect)return e.onSelect(),void ne();te(e.to)},ne=()=>{R("")},ae="w-full flex items-center gap-2 rounded-lg px-3 py-2 text-sm",oe=d(),le=e=>{const t=S[e];return t&&v(t)?x(t,{className:"h-4 w-4 shrink-0 text-gray-500"}):/* @__PURE__ */g("span",{className:"h-4 w-4 shrink-0"})},se=e=>{const t=M[e];return t&&v(t)?x(t,{className:"h-4 w-4 shrink-0 text-gray-500"}):/* @__PURE__ */g("span",{className:"h-4 w-4 shrink-0"})},ie=e=>/* @__PURE__ */b("div",{children:[
2
- /* @__PURE__ */b("button",{onClick:()=>re(e),className:`${ae} text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors`,children:[le(e.to),
3
- /* @__PURE__ */g("span",{className:"truncate",children:e.label})]}),e.dividerAfter&&/* @__PURE__ */g("div",{className:"border-t border-white/20 my-1.5 mx-2"})]},e.to),ce=e=>{const t=c(e,O).filter(e=>l(e,O));if(0===t.length)return ie(e);const r=`child:${e.to}`,n=V.has(r);/* @__PURE__ */
4
- return b("div",{children:[
5
- /* @__PURE__ */b("button",{onClick:()=>X(r),"aria-expanded":n,className:`${ae} text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors`,children:[le(e.to),
6
- /* @__PURE__ */g("span",{className:"truncate",children:e.label}),
7
- /* @__PURE__ */g("svg",{className:"h-3.5 w-3.5 ml-auto text-gray-500 transition-transform "+(n?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]}),n&&/* @__PURE__ */g("div",{className:"pl-4 mt-0.5 mb-1 space-y-0.5",children:t.map(e=>ce(e))}),e.dividerAfter&&/* @__PURE__ */g("div",{className:"border-t border-white/20 my-1.5 mx-2"})]},e.to)},de=(e,t,r=!1)=>{const n=r?e.items:Q(e);if(0===n.length)return null;const a=V.has(e.label);/* @__PURE__ */
8
- return b("div",{children:[
9
- /* @__PURE__ */b("button",{onClick:()=>X(e.label),"aria-expanded":a,className:`${ae} text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors`,children:["icon"in e&&e.icon?e.icon:se(e.label),
10
- /* @__PURE__ */g("span",{className:"truncate "+(t?"font-medium":""),children:e.label}),
11
- /* @__PURE__ */g("svg",{className:"h-3.5 w-3.5 ml-auto text-gray-500 transition-transform "+(a?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]}),a&&/* @__PURE__ */g("div",{className:"pl-4 mt-0.5 mb-1 space-y-0.5",children:n.map(e=>ce(e))}),"dividerAfter"in e&&e.dividerAfter&&/* @__PURE__ */g("div",{className:"border-t border-white/20 my-1.5 mx-2"})]},e.label)};/* @__PURE__ */
12
- return b("div",{className:"fixed top-0 left-0 bottom-0 z-[260] flex flex-col rounded-r-2xl overflow-hidden",style:{width:k,...oe},children:[
13
- /* @__PURE__ */b("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-white/15 shrink-0",children:[E&&/* @__PURE__ */g(t,{src:E,alt:"",slot:"compact",surface:"light",adaptive:$,hasAlpha:_,isLight:W,size:20,decorative:!0,className:"opacity-80"}),
14
- /* @__PURE__ */g("span",{className:"text-sm font-semibold text-gray-800 truncate",children:B??"Apps"})]}),
15
- /* @__PURE__ */g("div",{className:"px-3 pt-3 pb-2 shrink-0",children:/* @__PURE__ */b("div",{className:`flex items-center gap-2 ${h} rounded-lg px-2.5 py-1.5`,children:[
16
- /* @__PURE__ */g("svg",{className:"h-3.5 w-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),
17
- /* @__PURE__ */g("input",{ref:Y,value:H,onChange:e=>R(e.target.value),placeholder:"Search...",className:"flex-1 bg-transparent text-xs outline-none placeholder-gray-400"}),H&&/* @__PURE__ */g("button",{onClick:()=>R(""),className:"text-gray-400 hover:text-gray-600 text-xs",children:"×"})]})}),
18
- /* @__PURE__ */g("div",{className:"flex-1 overflow-y-auto px-1 pb-1",children:H.length>=2?
19
- /* @__PURE__ */g("div",{children:0===ee.length?/* @__PURE__ */g("div",{className:"px-3 py-6 text-center text-xs text-gray-400",children:"No matches"}):ee.map(e=>/* @__PURE__ */b("button",{onClick:()=>re(e),className:`${ae} text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors`,children:[le(e.to),
20
- /* @__PURE__ */g("span",{className:"truncate",children:e.label})]},e.to))}):/* @__PURE__ */b(N,{children:[q.map(ie),q.length>0&&(F.length>0||G.length>0||D.length>0)&&/* @__PURE__ */g("div",{className:"border-t border-white/15 my-1.5 mx-2"}),F.map(e=>de(e,!0)),G.map(e=>de(e,!1)),D.map(e=>de(e,!1,!0)),(K.length>0||z.length>0)&&/* @__PURE__ */g("div",{className:"border-t border-white/15 my-1.5 mx-2"}),K.map(e=>de(e,!1)),z.map(ie)]})}),
21
- /* @__PURE__ */g("div",{className:"border-t border-white/15 p-1 shrink-0",children:/* @__PURE__ */b("div",{onClick:()=>te("/profile"),className:"rounded-lg px-2 py-1.5 flex items-center gap-2.5 hover:bg-blue-50 hover:text-blue-700 transition-colors cursor-pointer",children:[y?.avatar_url?/* @__PURE__ */g("img",{src:y.avatar_url,alt:"",className:"h-8 w-8 rounded-full object-cover border border-white/20 shrink-0"}):/* @__PURE__ */g("div",{className:"h-8 w-8 rounded-full bg-blue-100 flex items-center justify-center text-sm font-bold text-blue-700 shrink-0",children:(y?.first_name?.charAt(0)||L?.email?.charAt(0)||"?").toUpperCase()}),
22
- /* @__PURE__ */g("p",{className:"flex-1 min-w-0 text-sm font-medium text-gray-900 truncate",children:y?.first_name?`${y.first_name} ${y.last_name||""}`.trim():L?.email}),
23
- /* @__PURE__ */g("button",{onClick:e=>{e.stopPropagation(),A()},title:"Sign Out",className:"shrink-0 p-1.5 rounded-md text-gray-500 hover:text-red-600 hover:bg-red-50 transition-colors",children:/* @__PURE__ */g("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})})]})})]})}export{k as default};
@@ -1 +0,0 @@
1
- import{rootIsDark as r}from"./chunk-MAIHBBWT.js";function a(){try{const r=getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();if(r)return parseFloat(r)}catch{}return.95}var s=r;function o(){try{return document.documentElement.classList.contains("rosh-reduce-transparency")}catch{return!1}}function t(r,a){return`color-mix(in srgb, ${r} ${+(Math.round(255*Math.min(1,Math.max(0,a)))/255*100).toFixed(4)}%, transparent)`}function e(r){const e=r??a();if(o())return{background:"var(--rosh-glass-surface)",border:"1px solid var(--rosh-glass-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};const n="var(--rosh-glass-surface)",u="var(--rosh-glass-surface-mid)";return s()?{background:`linear-gradient(135deg in srgb, ${t(n,.85*e)} 0%, ${t(u,.75*e)} 50%, ${t(n,.85*e)} 100%)`,backdropFilter:"blur(40px) saturate(1.6)",WebkitBackdropFilter:"blur(40px) saturate(1.6)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}:{background:`linear-gradient(135deg in srgb, ${t(n,.85*e)} 0%, ${t(u,.65*e)} 50%, ${t(n,.75*e)} 100%)`,backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}}function n(r){return o()?"var(--rosh-glass-surface)":t("var(--rosh-glass-surface)",.85*(r??a()))}var u="border-white/20",d="glass-input-bg";export{u as GLASS_DIVIDER,d as GLASS_INPUT_BG,n as glassFill,e as glassStyle};
@@ -1 +0,0 @@
1
- var r="4.150.0",a=r;export{a as APP_VERSION,r as VERSION};