efficient-shell 7.35.0 → 7.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +69 -3
  2. package/dist/{Browser-2RGXJRGC.js → Browser-B2FN5CW3.js} +14 -14
  3. package/dist/Calculator-ABEYFTWE.js +29 -0
  4. package/dist/ConfirmDialog-DHHLXNMV.js +1 -0
  5. package/dist/{CurrencyConverter-PMJC4PJE.js → CurrencyConverter-CZKVL73H.js} +10 -10
  6. package/dist/{Documents-IDOEW4C2.js → Documents-BXSLON5K.js} +13 -13
  7. package/dist/Files-BJGOJJZI.js +87 -0
  8. package/dist/{Notepad-KQOSAH2N.js → Notepad-ULQRZ6ZR.js} +7 -7
  9. package/dist/PdfViewer-KA4YIRIO.js +1 -0
  10. package/dist/{PomodoroTimer-G44MKPIG.js → PomodoroTimer-LJVH3GLO.js} +11 -11
  11. package/dist/{Preview-CBCZPC4F.js → Preview-OH32MRJQ.js} +31 -31
  12. package/dist/Sidebar-U34BBJFZ.js +44 -0
  13. package/dist/{Spreadsheet-KUIL3XXZ.js → Spreadsheet-7B27ZGVM.js} +13 -13
  14. package/dist/{Stock-H6RD4DQL.js → Stock-7BEWCZCA.js} +7 -7
  15. package/dist/{Weather-52XQ47XS.js → Weather-O4XOPB7T.js} +17 -17
  16. package/dist/{WorldClock-5W2IMU5E.js → WorldClock-B3YYXJF7.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/{chunk-WOZ36LPR.js → chunk-3E27HV76.js} +4 -4
  21. package/dist/{chunk-MD3UGBCE.js → chunk-6IMYNQCU.js} +13 -13
  22. package/dist/{chunk-RYBDLJJV.js → chunk-AHN2BTZR.js} +1 -1
  23. package/dist/{chunk-Z756FAL6.js → chunk-CMUDEROF.js} +9 -9
  24. package/dist/{chunk-L7UURACV.js → chunk-CQ4YXW4Y.js} +107 -107
  25. package/dist/chunk-DJ3Z66LK.js +1 -0
  26. package/dist/{chunk-M7U7E4QD.js → chunk-EH46USL7.js} +11 -11
  27. package/dist/{chunk-LU2SMEID.js → chunk-ENOIIZYT.js} +1 -1
  28. package/dist/chunk-G25GLRSP.js +1 -0
  29. package/dist/chunk-G5GERM76.js +2 -0
  30. package/dist/{chunk-DFCTQOIL.js → chunk-GKI4SVYL.js} +1 -1
  31. package/dist/{chunk-CUKZPOKT.js → chunk-I5JYRYAY.js} +2 -2
  32. package/dist/chunk-I7YEIAJ5.js +1 -0
  33. package/dist/{chunk-KNNGYRYW.js → chunk-J7JAYQSK.js} +1 -1
  34. package/dist/{chunk-726ZUTV7.js → chunk-JLAK6FVZ.js} +26 -26
  35. package/dist/{chunk-M5W23H56.js → chunk-K3LAW5NH.js} +16 -16
  36. package/dist/{chunk-DTCIMQP7.js → chunk-K6VLDHTD.js} +1 -1
  37. package/dist/{chunk-UBRW43AM.js → chunk-OGB77LUT.js} +3 -3
  38. package/dist/{chunk-TYZR3BEG.js → chunk-PMUU2VHD.js} +1 -1
  39. package/dist/{chunk-5LJVYLU6.js → chunk-PYNMOS2E.js} +1 -1
  40. package/dist/{chunk-GPPFGCT4.js → chunk-RMEUWIEO.js} +1 -1
  41. package/dist/{chunk-QJYJB6OG.js → chunk-SBVD2F3P.js} +8 -8
  42. package/dist/chunk-UPVVIK3X.js +1038 -0
  43. package/dist/{chunk-UFXQAFZN.js → chunk-WCGEABUZ.js} +4 -4
  44. package/dist/{chunk-2ECESCBH.js → chunk-XUHJRDNO.js} +1 -1
  45. package/dist/{chunk-BDXFODVC.js → chunk-YIEGC2CL.js} +2 -2
  46. package/dist/{chunk-ZB6MIMTH.js → chunk-YVECLMNT.js} +1 -1
  47. package/dist/{chunk-PEYPKCRT.js → chunk-ZLG2NT3S.js} +3 -3
  48. package/dist/file-intake/index.js +1 -1
  49. package/dist/i18n/index.d.ts +1 -1
  50. package/dist/icons/efficient-looks.js +33 -17
  51. package/dist/icons/efficient.d.ts +18 -2
  52. package/dist/icons/efficient.js +288 -270
  53. package/dist/icons/iconoir.js +7 -1
  54. package/dist/icons/index.d.ts +1 -1
  55. package/dist/icons/index.js +1 -1
  56. package/dist/icons/lucide.js +17 -2
  57. package/dist/icons/phosphor.js +13 -9
  58. package/dist/icons/tabler.js +20 -2
  59. package/dist/{index-CWv4SYWk.d.ts → index-DkrMePmf.d.ts} +212 -127
  60. package/dist/index.d.ts +3 -3
  61. package/dist/index.js +49 -49
  62. package/dist/locales/zh-Hans.d.ts +1 -1
  63. package/dist/locales/zh-Hans.js +1 -1
  64. package/dist/map/index.js +2 -2
  65. package/dist/page-tabs/index.js +5 -5
  66. package/dist/pdf/index.js +1 -1
  67. package/dist/{strings-DzmlWMRe.d.ts → strings-Cn5SsfWm.d.ts} +25 -0
  68. package/dist/telemetry/index.js +1 -1
  69. package/dist/ui/index.d.ts +2 -2
  70. package/dist/ui/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/Calculator-3WKCMBTQ.js +0 -29
  73. package/dist/ConfirmDialog-4W3Y7XES.js +0 -1
  74. package/dist/Files-VE4RSBCG.js +0 -87
  75. package/dist/PdfViewer-3WDGKHRE.js +0 -1
  76. package/dist/Sidebar-4EQQQGEY.js +0 -44
  77. package/dist/chunk-2PNYIWIN.js +0 -1
  78. package/dist/chunk-3N7UFUJP.js +0 -1
  79. package/dist/chunk-DCE2WL7J.js +0 -1
  80. package/dist/chunk-J5O7NMNC.js +0 -1032
  81. package/dist/chunk-LU2DSEAL.js +0 -2
@@ -1,9 +1,9 @@
1
- import{solidSurfaceStyle as t}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as e,escapeSurfaceAbove as o,onOverlayOpen as i,Z_LAYERS as r}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{createContext as a,useState as h,useContext as l,useRef as m,useId as d,useEffect as s,isValidElement as c,cloneElement as f}from"react";import{createPortal as u}from"react-dom";import{jsxs as p,jsx as g,Fragment as x}from"react/jsx-runtime";var b=448,w=240,M=8,v=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function N(t){const e=v(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var y=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var W={top:"bottom",bottom:"top",left:"right",right:"left"},H={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function k(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var B=(t,e,o)=>Math.max(e,Math.min(t,o));function C(t,e,o){return E(()=>t()?.getBoundingClientRect(),e,o)}function E(t,e,o){let i=NaN,r=NaN,n=NaN,a=NaN,h=NaN;const l=()=>{const e=t();if(!e)return!1;const l=o?o():NaN,m=e.left!==i||e.top!==r||e.right!==n||e.bottom!==a||l!==h&&!(Number.isNaN(l)&&Number.isNaN(h));return i=e.left,r=e.top,n=e.right,a=e.bottom,h=l,m};l();const m=()=>{l(),e()};let d=requestAnimationFrame(function t(){l()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}}function R({trigger:t,menu:e,bounds:o,align:i,side:r}){const n=k(t,o,4),a="bottom"===r?"top":"bottom",h=e.height>n[r]&&(e.height<=n[a]||n[a]>n[r])?a:r,l=Math.max(Math.min(e.height,96),n[h]),m=Math.min(e.height,l),d=B("bottom"===h?t.bottom+4:t.top-4-m,o.top+8,o.bottom-8-m),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:B("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:d,side:h,maxHeight:l,maxWidth:s}}function j(t,e,o={}){const{matchTriggerWidth:i=!1,preferredMaxWidth:r=b,preferredMaxHeight:a=w,popupRef:l}=o,[m,d]=h(null);return n(()=>{if(!e)return void d(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const n=N(e),h=n.bottom-o.bottom-4-8,m=o.top-n.top-4-8,s=h<Math.min(a,160)&&m>h,c=Math.max(96,Math.min(a,s?m:h)),f=Math.max(0,n.right-n.left-16),u={minWidth:o.width,maxWidth:Math.min(r,f),maxHeight:c};if(i){const t=Math.min(o.width,f);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(n.left+8,o.left),n.right-8-t)}else if(l&&n.right-8-o.left<u.maxWidth&&Math.min(o.right,n.right-8)-n.left-8<u.maxWidth){const t=l.current?.offsetWidth??0,e=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(n.left+8,Math.min(o.left,n.right-8-e))}else if(n.right-8-o.left<u.maxWidth){const t=Math.min(o.right,n.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-n.left-8))}else u.left=Math.max(n.left+8,o.left);s?u.bottom=window.innerHeight-o.top+4:u.top=o.bottom+4,d(u)};return o(),C(()=>t.current,o,l?()=>l.current?.offsetWidth??NaN:void 0)},[e,t,i,r,a,l]),m}function T({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},r=o.right-8-t.x,n=t.x-(o.left+8);return R({trigger:i,menu:e,bounds:o,align:e.width<=r||r>=n?"start":"end",side:"bottom"})}var z=a(!1),F=()=>l(z),L={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function A({content:a,side:l="top",delay:x=200,children:b,className:w="relative inline-flex",describe:M=!0}){const[E,R]=h(!1),j=E&&!(null==a||!1===a||""===a),[T,F]=h(null),A=m(void 0),D=m(null),I=m(null),P=d(),S=m(!1),$=()=>{window.clearTimeout(A.current),S.current||(A.current=window.setTimeout(()=>R(!0),x))},q=()=>{window.clearTimeout(A.current),R(!1)},G=()=>{S.current=!0,q()},J=()=>{S.current=!1,q()};s(()=>()=>window.clearTimeout(A.current),[]),n(()=>{if(!j)return void F(null);const t=()=>{const t=D.current,e=I.current;if(!t||!e)return;const o=N(t),i=Math.max(0,o.right-o.left-16),r=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${i}px`,e.style.maxHeight=`${r}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=v(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let r=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==r;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===r&&"static"===t.position)continue;r=t.position;const o=y.has(t.overflowX),n=y.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(i.left=Math.max(i.left,a.left),i.right=Math.min(i.right,a.right)),n&&(i.top=Math.max(i.top,a.top),i.bottom=Math.min(i.bottom,a.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}(t))return void q();const h=function(t,e,o,i,r){const n=k(t,i,r),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),h=[o,W[o],...H[o]],l=h.find(t=>a(t)>=0)??h.reduce((t,e)=>a(e)>a(t)?e:t),m=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let s,c;switch(l){case"top":s=m-e.width/2,c=t.top-r-e.height;break;case"bottom":s=m-e.width/2,c=t.bottom+r;break;case"left":s=t.left-r-e.width,c=d-e.height/2;break;case"right":s=t.right+r,c=d-e.height/2}return{side:l,left:B(s,i.left+8,i.right-8-e.width),top:B(c,i.top+8,i.bottom-8-e.height)}}(a,n,l,o,12),m=function(t,e,o,i,r){const{side:n,left:a,top:h}=e,l=a+o.width,m=h+o.height;if({top:t.top-m,bottom:h-t.bottom,left:t.left-l,right:a-t.right}[n]<r)return null;const d=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(s,a,o.width),y:m};case"bottom":return{side:n,x:d(s,a,o.width),y:h};case"left":return{side:n,x:l,y:d(c,h,o.height)};case"right":return{side:n,x:a,y:d(c,h,o.height)}}}(a,h,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:h.left-a.left,top:h.top-a.top,maxWidth:i,maxHeight:r,side:h.side,arrow:m&&{left:m.x-a.left,top:m.y-a.top}};F(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),C(()=>D.current,t)},[j,l,a]),s(()=>{if(!j)return;const t=e(t=>"Escape"===t.key&&(q(),!o(D.current))),r=i(q);return()=>{t(),r()}},[j]);const Q=j&&M?P:void 0,X=c(b)?f(b,{"aria-describedby":[b.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):b,Y=j?t():void 0;/* @__PURE__ */
2
- return p("span",{ref:D,className:w,"aria-describedby":c(b)?void 0:Q,onMouseEnter:$,onMouseLeave:J,onFocus:$,onBlur:J,onPointerDown:G,onClick:G,children:[
1
+ import{solidSurfaceStyle as t}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as e,escapeSurfaceAbove as o,onOverlayOpen as i,Z_LAYERS as r}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{createContext as a,useState as h,useContext as l,useRef as m,useId as d,useEffect as s,isValidElement as c,cloneElement as f}from"react";import{createPortal as u}from"react-dom";import{jsxs as p,jsx as g,Fragment as b}from"react/jsx-runtime";var x=448,w=240,M=8,v=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function N(t){const e=v(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var y=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var W={top:"bottom",bottom:"top",left:"right",right:"left"},H={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function k(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var B=(t,e,o)=>Math.max(e,Math.min(t,o));function C(t,e,o){return E(()=>t()?.getBoundingClientRect(),e,o)}function E(t,e,o){let i=NaN,r=NaN,n=NaN,a=NaN,h=NaN;const l=()=>{const e=t();if(!e)return!1;const l=o?o():NaN,m=e.left!==i||e.top!==r||e.right!==n||e.bottom!==a||l!==h&&!(Number.isNaN(l)&&Number.isNaN(h));return i=e.left,r=e.top,n=e.right,a=e.bottom,h=l,m};l();const m=()=>{l(),e()};let d=requestAnimationFrame(function t(){l()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}}function R({trigger:t,menu:e,bounds:o,align:i,side:r}){const n=k(t,o,4),a="bottom"===r?"top":"bottom",h=e.height>n[r]&&(e.height<=n[a]||n[a]>n[r])?a:r,l=Math.max(Math.min(e.height,96),n[h]),m=Math.min(e.height,l),d=B("bottom"===h?t.bottom+4:t.top-4-m,o.top+8,o.bottom-8-m),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:B("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:d,side:h,maxHeight:l,maxWidth:s}}function j(t,e,o={}){const{matchTriggerWidth:i=!1,preferredMaxWidth:r=x,preferredMaxHeight:a=w,popupRef:l}=o,[m,d]=h(null);return n(()=>{if(!e)return void d(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const n=N(e),h=n.bottom-o.bottom-4-8,m=o.top-n.top-4-8,s=h<Math.min(a,160)&&m>h,c=Math.max(96,Math.min(a,s?m:h)),f=Math.max(0,n.right-n.left-16),u={minWidth:o.width,maxWidth:Math.min(r,f),maxHeight:c};if(i){const t=Math.min(o.width,f);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(n.left+8,o.left),n.right-8-t)}else if(l&&n.right-8-o.left<u.maxWidth&&Math.min(o.right,n.right-8)-n.left-8<u.maxWidth){const t=l.current?.offsetWidth??0,e=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(n.left+8,Math.min(o.left,n.right-8-e))}else if(n.right-8-o.left<u.maxWidth){const t=Math.min(o.right,n.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-n.left-8))}else u.left=Math.max(n.left+8,o.left);s?u.bottom=window.innerHeight-o.top+4:u.top=o.bottom+4,d(u)};return o(),C(()=>t.current,o,l?()=>l.current?.offsetWidth??NaN:void 0)},[e,t,i,r,a,l]),m}function T({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},r=o.right-8-t.x,n=t.x-(o.left+8);return R({trigger:i,menu:e,bounds:o,align:e.width<=r||r>=n?"start":"end",side:"bottom"})}var z=a(!1),F=()=>l(z),L={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function A({content:a,side:l="top",delay:b=200,children:x,className:w="relative inline-flex",describe:M=!0}){const[E,R]=h(!1),j=E&&!(null==a||!1===a||""===a),[T,F]=h(null),A=m(void 0),D=m(null),I=m(null),P=d(),S=m(!1),$=()=>{window.clearTimeout(A.current),S.current||(A.current=window.setTimeout(()=>R(!0),b))},q=()=>{window.clearTimeout(A.current),R(!1)},G=()=>{S.current=!0,q()},J=()=>{S.current=!1,q()};s(()=>()=>window.clearTimeout(A.current),[]),n(()=>{if(!j)return void F(null);const t=()=>{const t=D.current,e=I.current;if(!t||!e)return;const o=N(t),i=Math.max(0,o.right-o.left-16),r=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${i}px`,e.style.maxHeight=`${r}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=v(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let r=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==r;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===r&&"static"===t.position)continue;r=t.position;const o=y.has(t.overflowX),n=y.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(i.left=Math.max(i.left,a.left),i.right=Math.min(i.right,a.right)),n&&(i.top=Math.max(i.top,a.top),i.bottom=Math.min(i.bottom,a.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}(t))return void q();const h=function(t,e,o,i,r){const n=k(t,i,r),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),h=[o,W[o],...H[o]],l=h.find(t=>a(t)>=0)??h.reduce((t,e)=>a(e)>a(t)?e:t),m=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let s,c;switch(l){case"top":s=m-e.width/2,c=t.top-r-e.height;break;case"bottom":s=m-e.width/2,c=t.bottom+r;break;case"left":s=t.left-r-e.width,c=d-e.height/2;break;case"right":s=t.right+r,c=d-e.height/2}return{side:l,left:B(s,i.left+8,i.right-8-e.width),top:B(c,i.top+8,i.bottom-8-e.height)}}(a,n,l,o,12),m=function(t,e,o,i,r){const{side:n,left:a,top:h}=e,l=a+o.width,m=h+o.height;if({top:t.top-m,bottom:h-t.bottom,left:t.left-l,right:a-t.right}[n]<r)return null;const d=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(s,a,o.width),y:m};case"bottom":return{side:n,x:d(s,a,o.width),y:h};case"left":return{side:n,x:l,y:d(c,h,o.height)};case"right":return{side:n,x:a,y:d(c,h,o.height)}}}(a,h,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:h.left-a.left,top:h.top-a.top,maxWidth:i,maxHeight:r,side:h.side,arrow:m&&{left:m.x-a.left,top:m.y-a.top}};F(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),C(()=>D.current,t)},[j,l,a]),s(()=>{if(!j)return;const t=e(t=>"Escape"===t.key&&(q(),!o(D.current))),r=i(q);return()=>{t(),r()}},[j]);const Q=j&&M?P:void 0,X=c(x)?f(x,{"aria-describedby":[x.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):x,Y=j?t():void 0;/* @__PURE__ */
2
+ return p("span",{ref:D,className:w,"aria-describedby":c(x)?void 0:Q,onMouseEnter:$,onMouseLeave:J,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&$()},onBlur:J,onPointerDown:G,onClick:G,children:[
3
3
  /* @__PURE__ */g(z.Provider,{value:!0,children:X}),j&&u(
4
4
  /* @__PURE__ */p("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:r.hint,...T?.anchor},children:[
5
5
  /* @__PURE__ */g("span",{ref:I,id:P,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${T?"":L[l]}`,style:{...Y,...T&&{left:T.left,top:T.top,maxWidth:T.maxWidth,maxHeight:T.maxHeight}},children:a}),(!T||T.arrow)&&
6
6
  /* @__PURE__ */g("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":T?.side??l,style:{background:Y?.background,"--rosh-tooltip-edge":Y?.border,...T?.arrow&&{left:T.arrow.left,top:T.arrow.top}}})]}),document.body)]})}var D=t=>!0===t||"true"===t;function I(t){t.preventDefault(),t.stopPropagation()}var P=(t,e)=>[t,e].filter(Boolean).join(" ")||void 0;function S({reason:t,id:e,block:o=!1,children:i}){/* @__PURE__ */
7
- return p(x,{children:[
7
+ return p(b,{children:[
8
8
  /* @__PURE__ */g(A,{content:t,describe:!1,className:o?"relative flex w-full":"relative inline-flex",children:i}),
9
- /* @__PURE__ */g("span",{id:e,className:"sr-only",children:t})]})}export{w as MENU_MAX_HEIGHT,S as OffWithReason,b as POPUP_MAX_WIDTH,A as Tooltip,M as VIEWPORT_MARGIN,P as describedByWith,C as followAnchor,E as followRect,D as isAriaDisabled,T as placeAtPoint,R as placeMenu,N as popupBounds,I as swallowPress,j as useDropdownPosition,F as useInsideTooltip};
9
+ /* @__PURE__ */g("span",{id:e,className:"sr-only",children:t})]})}export{w as MENU_MAX_HEIGHT,S as OffWithReason,x as POPUP_MAX_WIDTH,A as Tooltip,M as VIEWPORT_MARGIN,P as describedByWith,C as followAnchor,E as followRect,D as isAriaDisabled,T as placeAtPoint,R as placeMenu,N as popupBounds,I as swallowPress,j as useDropdownPosition,F as useInsideTooltip};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-5LJVYLU6.js";import{Icon as t}from"./chunk-6OXNDFJE.js";import{useShellStrings as n}from"./chunk-2PNYIWIN.js";import{LoadingSpinner as r}from"./chunk-2J6F4EE7.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
- /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=n().pdf,k=i(null),N=i(null),C=i(null),[E,j]=s(null),[M,z]=s(1),[P,_]=s(0),[D,L]=s(1),[W,S]=s(!0),[$,O]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return O(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),_(e.numPages),O(!1))}).catch(()=>{t||(e.error(T.current),O(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!E||!W||!C.current)return;const e=()=>{const e=C.current;e&&E.getPage(M).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});L(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[E,M,W,d]),l(()=>{if(!E||!k.current)return;let e=!1,t=null,n=null;return E.getPage(M).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:D}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=N.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[E,M,D]),l(()=>{const e=()=>N.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,U="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-PYNMOS2E.js";import{Icon as t}from"./chunk-6OXNDFJE.js";import{useShellStrings as n}from"./chunk-DJ3Z66LK.js";import{LoadingSpinner as r}from"./chunk-2J6F4EE7.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
+ /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=n().pdf,k=i(null),N=i(null),C=i(null),[E,j]=s(null),[M,z]=s(1),[D,P]=s(0),[_,L]=s(1),[S,W]=s(!0),[O,$]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),P(e.numPages),$(!1))}).catch(()=>{t||(e.error(T.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!E||!S||!C.current)return;const e=()=>{const e=C.current;e&&E.getPage(M).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});L(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[E,M,S,d]),l(()=>{if(!E||!k.current)return;let e=!1,t=null,n=null;return E.getPage(M).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:_}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=N.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[E,M,_]),l(()=>{const e=()=>N.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,F="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return m("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */m(f,{children:[
5
5
  /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,P)}),
7
- /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(P,e+1)),disabled:M>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,D)}),
7
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(D,e+1)),disabled:M>=D,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),L(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*D))?Math.round(100*D):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),L(Number(t)/100)):S(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
- /* @__PURE__ */u("option",{value:"fit",children:A}),!W&&!v.includes(Math.round(100*D))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*D),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),L(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":W,className:U+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
9
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{W(!1),L(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */m("select",{value:S?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(W(!1),L(Number(t)/100)):W(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
+ /* @__PURE__ */u("option",{value:"fit",children:A}),!S&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{W(!1),L(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>W(!0),"aria-pressed":S,className:F+(S?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
14
14
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!E)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=P;e++)n.push(E.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:U,children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!E)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=D;e++)n.push(E.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:F,children:[
16
16
  /* @__PURE__ */u(t,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
17
- /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:U,children:[
18
- /* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:U,children:[
17
+ /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:F,children:[
18
+ /* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:F,children:[
19
19
  /* @__PURE__ */u(t,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
20
- /* @__PURE__ */u("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!E)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<P?(e.preventDefault(),z(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!E)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<P&&(e.preventDefault(),z(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(P)))},children:$?/* @__PURE__ */u(r,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */u("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!E)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<D?(e.preventDefault(),z(e=>Math.min(D,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!E)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<D&&(e.preventDefault(),z(e=>Math.min(D,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(D)))},children:O?/* @__PURE__ */u(r,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-WOZ36LPR.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-3E27HV76.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
@@ -1,19 +1,19 @@
1
- import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{TH_ONE_LINE as t}from"./chunk-RYBDLJJV.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-2PNYIWIN.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function g({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
- return h("div",{...n,dangerouslySetInnerHTML:r})}function m({columns:e,data:m,onChange:p,onColumnsChange:f,fixedRows:y=!1,minRows:b=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[$,S]=l({}),N=o(null),[z,A]=l({}),O=o(null),[R,T]=l(null),[K,P]=l(null),[I,F]=l(null),[Y,X]=l(null),[j,H]=l(null),B=o(null);n(()=>{const e=B.current;if(!e||e.row!==j?.row||e.col!==j?.col)return;B.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[j]);const[W,q]=l(null),[J,V]=l(null);c(()=>{D?.(W&&J?{anchor:W,end:J}:null)},[W,J,D]);const _=o(!1),[U,G]=l(null),Q=o(!1),Z=o({a:null,e:null});Z.current={a:W,e:J};const ee=W&&J&&(W.row!==J.row||W.col!==J.col),te=[...m];if(!y)for(;te.length<b;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,p(o)},[te,e.length,p]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,p(r))}}_.current=!0,e.shiftKey&&W||q({row:t,col:n}),V({row:t,col:n})},[te,p,W]),oe=a((e,t)=>{_.current&&V({row:e,col:t})},[]);c(()=>{const e=()=>{_.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!W||!J)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(W.row,J.row),r=Math.max(W.row,J.row),o=Math.min(W.col,J.col),l=Math.max(W.col,J.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W,J,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}p(y?l:w(l,e.length)),q({row:E.row,col:E.col}),V({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,p,y]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}p(y?c:w(c,e.length))},[te,e,p,y]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),W&&J){const t=Math.min(W.row,J.row),n=Math.max(W.row,J.row),r=Math.min(W.col,J.col),o=Math.max(W.col,J.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");p(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),H(null),q({row:o,col:l}),V({row:o,col:l}))}},[e,te,te.length,ne,W,J,p]),ae=a(t=>{if(!y&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));p(t)}},[y,te,e.length,p]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),p(n)},[te,e.length,p]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);p(t)},[te,p]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});p(t)},[te,p]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});p(n)},[te,e.length,p]),ge=a((e,t)=>{e.preventDefault(),y||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[y,ue,he,C]),me=a((t,n)=>{t.preventDefault(),y||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[y,e,de,we,C]),pe=t=>$[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!N.current)return;const t=e.clientX-N.current.startX,n=Math.max(40,N.current.startW+t);S(e=>({...e,[N.current.col]:n}))},n=()=>{if(N.current&&f){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[N.current.col]={...t[N.current.col],width:$[N.current.col]??e[N.current.col].width},f(t)}N.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,f]);const fe=e=>z[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);A(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const ye=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),f){const n=e.map((e,n)=>({...e,width:n===t?l:$[n]??e.width}));f(n)}},[te,e,$,f]),be=a(e=>{A(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,g=te.map(e=>[...e]);for(;g.length<=i;)g.push(Array(e.length).fill(""));for(const e of g)for(;e.length<=h;)e.push("");function m(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=m(Array.from({length:d},(e,n)=>g[o+n]?.[t]??""));if(r){const c=parseFloat(g[l]?.[t]??"0"),a=parseFloat(g[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=g[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=m(Array.from({length:w},(t,n)=>g[e]?.[c+n]??""));if(r){const o=parseFloat(g[e]?.[a]??"0"),l=parseFloat(g[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=g[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=g[o+r]?.[c+l]??""}g[e][t]=n}p(g),q({row:s,col:u}),V({row:i,col:h})},[te,e.length,p]);c(()=>{const e=e=>{if(!Q.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);G({row:r,col:o})},t=()=>{Q.current&&U&&ve(U),Q.current=!1,G(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[U,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),Q.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,$e=Le?Math.max(0,Math.floor(De/28)-20):0,Se=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ne=s(()=>te.slice($e,Se),[te,$e,Se]),ze=28*$e,Ae=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-gray-500 uppercase bg-gray-100 border-b border-r border-gray-200 select-none";/* @__PURE__ */
1
+ import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{TH_ONE_LINE as t}from"./chunk-AHN2BTZR.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-DJ3Z66LK.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function g({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
+ return h("div",{...n,dangerouslySetInnerHTML:r})}function m({columns:e,data:m,onChange:p,onColumnsChange:f,fixedRows:y=!1,minRows:b=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[$,S]=l({}),N=o(null),[z,A]=l({}),T=o(null),[O,R]=l(null),[K,P]=l(null),[F,H]=l(null),[I,X]=l(null),[j,Y]=l(null),B=o(null);n(()=>{const e=B.current;if(!e||e.row!==j?.row||e.col!==j?.col)return;B.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[j]);const[q,W]=l(null),[J,Z]=l(null);c(()=>{D?.(q&&J?{anchor:q,end:J}:null)},[q,J,D]);const _=o(!1),[U,V]=l(null),G=o(!1),Q=o({a:null,e:null});Q.current={a:q,e:J};const ee=q&&J&&(q.row!==J.row||q.col!==J.col),te=[...m];if(!y)for(;te.length<b;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,p(o)},[te,e.length,p]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,p(r))}}_.current=!0,e.shiftKey&&q||W({row:t,col:n}),Z({row:t,col:n})},[te,p,q]),oe=a((e,t)=>{_.current&&Z({row:e,col:t})},[]);c(()=>{const e=()=>{_.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!J)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,J.row),r=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,J,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}p(y?l:w(l,e.length)),W({row:E.row,col:E.col}),Z({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,p,y]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}p(y?c:w(c,e.length))},[te,e,p,y]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&J){const t=Math.min(q.row,J.row),n=Math.max(q.row,J.row),r=Math.min(q.col,J.col),o=Math.max(q.col,J.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");p(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),Y(null),W({row:o,col:l}),Z({row:o,col:l}))}},[e,te,te.length,ne,q,J,p]),ae=a(t=>{if(!y&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));p(t)}},[y,te,e.length,p]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),p(n)},[te,e.length,p]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);p(t)},[te,p]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});p(t)},[te,p]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});p(n)},[te,e.length,p]),ge=a((e,t)=>{e.preventDefault(),y||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[y,ue,he,C]),me=a((t,n)=>{t.preventDefault(),y||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[y,e,de,we,C]),pe=t=>$[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!N.current)return;const t=e.clientX-N.current.startX,n=Math.max(40,N.current.startW+t);S(e=>({...e,[N.current.col]:n}))},n=()=>{if(N.current&&f){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[N.current.col]={...t[N.current.col],width:$[N.current.col]??e[N.current.col].width},f(t)}N.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,f]);const fe=e=>z[e]??28;c(()=>{const e=e=>{if(!T.current)return;const t=e.clientY-T.current.startY,n=Math.max(20,T.current.startH+t);A(e=>({...e,[T.current.row]:n}))},t=()=>{T.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const ye=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),f){const n=e.map((e,n)=>({...e,width:n===t?l:$[n]??e.width}));f(n)}},[te,e,$,f]),be=a(e=>{A(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Q.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,g=te.map(e=>[...e]);for(;g.length<=i;)g.push(Array(e.length).fill(""));for(const e of g)for(;e.length<=h;)e.push("");function m(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=m(Array.from({length:d},(e,n)=>g[o+n]?.[t]??""));if(r){const c=parseFloat(g[l]?.[t]??"0"),a=parseFloat(g[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=g[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=m(Array.from({length:w},(t,n)=>g[e]?.[c+n]??""));if(r){const o=parseFloat(g[e]?.[a]??"0"),l=parseFloat(g[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=g[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=g[o+r]?.[c+l]??""}g[e][t]=n}p(g),W({row:s,col:u}),Z({row:i,col:h})},[te,e.length,p]);c(()=>{const e=e=>{if(!G.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);V({row:r,col:o})},t=()=>{G.current&&U&&ve(U),G.current=!1,V(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[U,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),G.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,$e=Le?Math.max(0,Math.floor(De/28)-20):0,Se=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ne=s(()=>te.slice($e,Se),[te,$e,Se]),ze=28*$e,Ae=28*(te.length-Se),Te="px-2 h-8 text-left text-xs font-medium text-gray-500 uppercase bg-gray-100 border-b border-r border-gray-200 select-none";/* @__PURE__ */
3
3
  return u("div",{ref:Me,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:v,height:v},onScroll:e=>ke(e.target.scrollTop),children:[
4
4
  /* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+pe(e.indexOf(n)),0)},children:[
5
5
  /* @__PURE__ */u("colgroup",{children:[
6
6
  /* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:pe(t)}},e.key))]}),
7
7
  /* @__PURE__ */h("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */u("tr",{children:[
8
- /* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{q({row:0,col:0}),V({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=W&&J&&Math.min(W.col,J.col)<=r&&r<=Math.max(W.col,J.col)&&0===Math.min(W.row,J.row)&&Math.max(W.row,J.row)===te.length-1;/* @__PURE__ */
9
- return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${Y===r?" !bg-blue-100":""}`,style:{width:pe(r)},draggable:!0,onDragStart:()=>(e=>F(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),X(t)})(e,r),onDrop:()=>(t=>{if(null===I||I===t)return F(null),void X(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(I,1);return n.splice(t,0,r),n});if(p(n),f){const n=[...e],[r]=n.splice(I,1);n.splice(t,0,r),f(n)}F(null),X(null)})(r),onDragEnd:()=>{F(null),X(null)},onClick:e=>{e.shiftKey&&W||q({row:0,col:r}),V({row:te.length-1,col:r})},onContextMenu:e=>me(e,r),children:[n.title,
8
+ /* @__PURE__ */h("th",{className:`${t} ${Te} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{W({row:0,col:0}),Z({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&J&&Math.min(q.col,J.col)<=r&&r<=Math.max(q.col,J.col)&&0===Math.min(q.row,J.row)&&Math.max(q.row,J.row)===te.length-1;/* @__PURE__ */
9
+ return u("th",{className:`${t} ${Te} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:pe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),X(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void X(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(p(n),f){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),f(n)}H(null),X(null)})(r),onDragEnd:()=>{H(null),X(null)},onClick:e=>{e.shiftKey&&q||W({row:0,col:r}),Z({row:te.length-1,col:r})},onContextMenu:e=>me(e,r),children:[n.title,
10
10
  /* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),N.current={col:t,startX:e.clientX,startW:pe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]},n.key)})]})}),
11
- /* @__PURE__ */u("tbody",{children:[ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}}),Ne.map((t,n)=>{const r=$e+n,o=W&&J&&Math.min(W.row,J.row)<=r&&r<=Math.max(W.row,J.row)&&0===Math.min(W.col,J.col)&&Math.max(W.col,J.col)===e.length-1;/* @__PURE__ */
11
+ /* @__PURE__ */u("tbody",{children:[ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}}),Ne.map((t,n)=>{const r=$e+n,o=q&&J&&Math.min(q.row,J.row)<=r&&r<=Math.max(q.row,J.row)&&0===Math.min(q.col,J.col)&&Math.max(q.col,J.col)===e.length-1;/* @__PURE__ */
12
12
  return u("tr",{style:{height:fe(r)},children:[
13
- /* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-gray-400 border-b border-r border-gray-200 bg-gray-50 select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${K===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===R||R===e)return T(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(R,1);t.splice(e,0,n),p(t),T(null),P(null)})(r),onDragEnd:()=>{T(null),P(null)},onClick:t=>{t.shiftKey&&W||q({row:r,col:0}),V({row:r,col:e.length-1})},onContextMenu:e=>ge(e,r),children:[r+1,
14
- /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:fe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]}),e.map((e,n)=>{const o=W&&J&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(W,J,r,n),l=j?.row===r&&j?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=W&&J?Math.max(W.row,J.row):-1,i=W&&J?Math.max(W.col,J.col):-1,d=W&&J&&r===s&&n===i,w=Q.current&&U&&W&&J&&(()=>{const e=Math.min(W.row,J.row),t=Math.max(W.row,J.row),o=Math.min(W.col,J.col),l=Math.max(W.col,J.col);let c=e,a=t,s=o,i=l;return U.row>t?a=U.row:U.row<e&&(c=U.row),U.col>l?i=U.col:U.col<o&&(s=U.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",p=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
15
- return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||H({row:r,col:n})},children:[
16
- /* @__PURE__ */h(g,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${p}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||H({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),_.current||(q({row:r,col:n}),V({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),H(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),B.current={row:r,col:n},void H({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ae>0&&/* @__PURE__ */h("tr",{style:{height:Ae}})]})]}),se&&i(
13
+ /* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-gray-400 border-b border-r border-gray-200 bg-gray-50 select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${K===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>R(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===O||O===e)return R(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(O,1);t.splice(e,0,n),p(t),R(null),P(null)})(r),onDragEnd:()=>{R(null),P(null)},onClick:t=>{t.shiftKey&&q||W({row:r,col:0}),Z({row:r,col:e.length-1})},onContextMenu:e=>ge(e,r),children:[r+1,
14
+ /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),T.current={row:t,startY:e.clientY,startH:fe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&J&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,J,r,n),l=j?.row===r&&j?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&J?Math.max(q.row,J.row):-1,i=q&&J?Math.max(q.col,J.col):-1,d=q&&J&&r===s&&n===i,w=G.current&&U&&q&&J&&(()=>{const e=Math.min(q.row,J.row),t=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col);let c=e,a=t,s=o,i=l;return U.row>t?a=U.row:U.row<e&&(c=U.row),U.col>l?i=U.col:U.col<o&&(s=U.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",p=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
15
+ return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||Y({row:r,col:n})},children:[
16
+ /* @__PURE__ */h(g,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${p}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),_.current||(W({row:r,col:n}),Z({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),B.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ae>0&&/* @__PURE__ */h("tr",{style:{height:Ae}})]})]}),se&&i(
17
17
  /* @__PURE__ */u(d,{children:[
18
18
  /* @__PURE__ */h("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ie(null)}),
19
19
  /* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-white rounded-lg shadow-lg border border-gray-200 py-1 min-w-[160px]",style:{left:se.x,top:se.y},children:se.items.map((e,t)=>/* @__PURE__ */h("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-700 hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{m as EditableGrid,w as withSpareRow};