@machinerd/js-module 0.8.1 → 0.10.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 (101) hide show
  1. package/dist/api-client-B-kwZogn.mjs +1 -0
  2. package/dist/api-client-BH5tW3p8.cjs +1 -0
  3. package/dist/common-BQEGjmFn.cjs +1 -0
  4. package/dist/{common-Df03Ovdm.mjs → common-CCtD91nO.mjs} +1 -1
  5. package/dist/{common-Bn0Ko6B7.cjs → common-D4sUwkFd.cjs} +1 -1
  6. package/dist/common-L3y7_eAy.mjs +1 -0
  7. package/dist/hooks/common/index.cjs +1 -0
  8. package/dist/hooks/common/index.d.cts +71 -0
  9. package/dist/hooks/common/index.d.mts +71 -0
  10. package/dist/hooks/common/index.mjs +1 -0
  11. package/dist/hooks/use-snackbar.cjs +1 -0
  12. package/dist/hooks/use-snackbar.d.cts +10 -0
  13. package/dist/hooks/use-snackbar.d.mts +10 -0
  14. package/dist/hooks/use-snackbar.mjs +1 -0
  15. package/dist/{index-B3fFA21M.d.mts → index-CFOJBfVt.d.mts} +4 -0
  16. package/dist/{index-CeiAF-WU.d.cts → index-ChiDX5zW.d.cts} +4 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +1 -1
  19. package/dist/index.d.mts +1 -1
  20. package/dist/index.mjs +1 -1
  21. package/dist/providers/api-client/index.cjs +1 -0
  22. package/dist/providers/{index.d.cts → api-client/index.d.cts} +3 -3
  23. package/dist/providers/{index.d.mts → api-client/index.d.mts} +1 -1
  24. package/dist/providers/api-client/index.mjs +1 -0
  25. package/dist/providers/noti-stack/index.cjs +1 -0
  26. package/dist/providers/noti-stack/index.d.cts +11 -0
  27. package/dist/providers/noti-stack/index.d.mts +11 -0
  28. package/dist/providers/noti-stack/index.mjs +1 -0
  29. package/dist/{skeleton-DtV9S1QK.cjs → skeleton-BCdxpynL.cjs} +1 -1
  30. package/dist/{skeleton-B6_oBhkl.mjs → skeleton-azZrk5-3.mjs} +1 -1
  31. package/dist/src-6KfzqI9Z.cjs +1 -0
  32. package/dist/src-Ce2i3Lkj.mjs +1 -0
  33. package/dist/styles/index.css +120 -0
  34. package/dist/ui/carousel/index.cjs +1 -1
  35. package/dist/ui/carousel/index.d.cts +9 -9
  36. package/dist/ui/carousel/index.d.mts +9 -9
  37. package/dist/ui/carousel/index.mjs +1 -1
  38. package/dist/ui/dialog/index.cjs +1 -1
  39. package/dist/ui/dialog/index.d.cts +2 -2
  40. package/dist/ui/dialog/index.d.mts +4 -4
  41. package/dist/ui/dialog/index.mjs +1 -1
  42. package/dist/ui/dnd/index.cjs +1 -0
  43. package/dist/ui/dnd/index.d.cts +17 -0
  44. package/dist/ui/dnd/index.d.mts +17 -0
  45. package/dist/ui/dnd/index.mjs +1 -0
  46. package/dist/ui/image/index.cjs +1 -1
  47. package/dist/ui/image/index.d.cts +8 -8
  48. package/dist/ui/image/index.d.mts +6 -6
  49. package/dist/ui/image/index.mjs +1 -1
  50. package/dist/ui/index.cjs +1 -1
  51. package/dist/ui/index.d.cts +19 -19
  52. package/dist/ui/index.d.mts +23 -23
  53. package/dist/ui/index.mjs +1 -1
  54. package/dist/ui/motion-dialog/index.cjs +1 -0
  55. package/dist/ui/motion-dialog/index.d.cts +34 -0
  56. package/dist/ui/motion-dialog/index.d.mts +34 -0
  57. package/dist/ui/motion-dialog/index.mjs +1 -0
  58. package/dist/ui/sheet/index.cjs +1 -1
  59. package/dist/ui/sheet/index.d.cts +2 -2
  60. package/dist/ui/sheet/index.d.mts +2 -2
  61. package/dist/ui/sheet/index.mjs +1 -1
  62. package/dist/ui/switch/index.cjs +1 -0
  63. package/dist/ui/switch/index.d.cts +16 -0
  64. package/dist/ui/switch/index.d.mts +16 -0
  65. package/dist/ui/switch/index.mjs +1 -0
  66. package/dist/ui/tooltip/index.cjs +1 -1
  67. package/dist/ui/tooltip/index.d.cts +2 -2
  68. package/dist/ui/tooltip/index.mjs +1 -1
  69. package/dist/use-dialog-stack-DmBRPhe2.cjs +1 -0
  70. package/dist/use-dialog-stack-STwnhvBB.mjs +1 -0
  71. package/dist/use-subset-image-CTy5mCLo.cjs +1 -0
  72. package/dist/use-subset-image-Ck1Gk5Qk.d.mts +601 -0
  73. package/dist/use-subset-image-LQWsE5P4.mjs +1 -0
  74. package/dist/use-subset-image-oZAiC9VK.d.cts +601 -0
  75. package/dist/util/common.cjs +1 -1
  76. package/dist/util/common.d.cts +8 -1
  77. package/dist/util/common.d.mts +8 -1
  78. package/dist/util/common.mjs +1 -1
  79. package/dist/util/fetcher.cjs +1 -0
  80. package/dist/util/fetcher.d.cts +15 -0
  81. package/dist/util/fetcher.d.mts +15 -0
  82. package/dist/util/fetcher.mjs +1 -0
  83. package/dist/util/file.mjs +1 -1
  84. package/package.json +66 -33
  85. package/dist/hooks/index.cjs +0 -1
  86. package/dist/hooks/index.d.cts +0 -2
  87. package/dist/hooks/index.d.mts +0 -2
  88. package/dist/hooks/index.mjs +0 -1
  89. package/dist/hooks-CUj2xuzU.cjs +0 -1
  90. package/dist/hooks-gbU5dqVF.mjs +0 -1
  91. package/dist/index-BFHrNSKP.d.mts +0 -655
  92. package/dist/index-DiRj3rRA.d.cts +0 -655
  93. package/dist/providers/index.cjs +0 -1
  94. package/dist/providers/index.mjs +0 -1
  95. package/dist/providers-CkXkdYcB.cjs +0 -1
  96. package/dist/providers-zftmvT1z.mjs +0 -1
  97. package/dist/src-CjpmdVyv.cjs +0 -1
  98. package/dist/src-CukOR3K2.mjs +0 -1
  99. package/dist/use-subset-image-D8ssrZhj.mjs +0 -1
  100. package/dist/use-subset-image-DC86cg6O.cjs +0 -1
  101. /package/dist/{file-DShNxIW4.mjs → file-CjW1pMb_.mjs} +0 -0
@@ -1 +1 @@
1
- "use client";import"../../src-CukOR3K2.mjs";import{n as e}from"../../common-Df03Ovdm.mjs";import"../../file-DShNxIW4.mjs";import{i as t}from"../../hooks-gbU5dqVF.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-D8ssrZhj.mjs";import n from"clsx";import{forwardRef as r,useCallback as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{createPortal as f}from"react-dom";function p({children:e,setOpen:t}){return l(`div`,{"data-komc":!0,className:n(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const m=d(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var h=r(({portal:e,children:t,className:n,placement:r,...i},a)=>l(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:m({portal:e,placement:r,className:n}),...i,children:t}));const g=d(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var _=({placement:e,className:t,offset:n,...r})=>{let i=o(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return l(`div`,{className:g({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${i}`},...r})};const v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:r,open:o,hiddenRef:s,containerRef:d}){let[p,m]=c(!1),[g,y]=c(e),[b,x]=c({top:0,left:0}),[S,C]=c({x:0,y:0});a(()=>{m(!0)},[]);let w=i(()=>{let t=d.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),c=r.top,l=window.innerHeight-r.bottom;o===`bottom`&&l<i.height&&c>=i.height?a=v(a,`top`):o===`top`&&c<i.height&&l>=i.height&&(a=v(a,`bottom`)),y(a);let[u,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(u){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let h=m,g=window.innerWidth;h+i.width>g-4&&(h=g-i.width-4),h<4&&(h=4),x({top:p,left:h}),C({x:m-h,y:0})},[e,d,s]);return a(()=>{if(!p||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;w();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||w(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,l=()=>{if(e||a>=180)return;let t=d.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,w())}s<2&&(a+=1,n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[p,o,w,d]),p?f(u(h,{portal:!0,"data-komc":!0,placement:g,className:n(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[l(`span`,{children:r}),l(_,{placement:g,offset:S})]}),document.body):null}var b=r(({children:e,content:r,defaultOpen:i=!1,className:a,placement:o=`top`})=>{let[d,f]=c(i),m=s(null),g=s(null);return t({ref:m,setOpen:f}),u(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[l(p,{setOpen:f,children:e}),l(y,{placement:o,className:a,open:d,content:r,hiddenRef:g,containerRef:m}),l(h,{ref:g,role:`presentation`,"aria-hidden":`true`,placement:o,className:n(`komc:opacity-0 komc:invisible`,a),children:l(`span`,{children:r})})]})});export{b as Tooltip};
1
+ "use client";import"../../src-Ce2i3Lkj.mjs";import{n as e}from"../../common-CCtD91nO.mjs";import"../../file-CjW1pMb_.mjs";import{a as t}from"../../common-L3y7_eAy.mjs";import"../../use-dialog-stack-STwnhvBB.mjs";import"../../api-client-B-kwZogn.mjs";import"../../use-subset-image-LQWsE5P4.mjs";import n from"clsx";import{forwardRef as r,useCallback as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{createPortal as f}from"react-dom";function p({children:e,setOpen:t}){return l(`div`,{"data-komc":!0,className:n(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const m=d(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var h=r(({portal:e,children:t,className:n,placement:r,...i},a)=>l(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:m({portal:e,placement:r,className:n}),...i,children:t}));const g=d(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var _=({placement:e,className:t,offset:n,...r})=>{let i=o(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return l(`div`,{className:g({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${i}`},...r})};const v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:r,open:o,hiddenRef:s,containerRef:d}){let[p,m]=c(!1),[g,y]=c(e),[b,x]=c({top:0,left:0}),[S,C]=c({x:0,y:0});a(()=>{m(!0)},[]);let w=i(()=>{let t=d.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),c=r.top,l=window.innerHeight-r.bottom;o===`bottom`&&l<i.height&&c>=i.height?a=v(a,`top`):o===`top`&&c<i.height&&l>=i.height&&(a=v(a,`bottom`)),y(a);let[u,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(u){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let h=m,g=window.innerWidth;h+i.width>g-4&&(h=g-i.width-4),h<4&&(h=4),x({top:p,left:h}),C({x:m-h,y:0})},[e,d,s]);return a(()=>{if(!p||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;w();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||w(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,l=()=>{if(e||a>=180)return;let t=d.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,w())}s<2&&(a+=1,n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[p,o,w,d]),p?f(u(h,{portal:!0,"data-komc":!0,placement:g,className:n(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[l(`span`,{children:r}),l(_,{placement:g,offset:S})]}),document.body):null}var b=r(({children:e,content:r,defaultOpen:i=!1,className:a,placement:o=`top`})=>{let[d,f]=c(i),m=s(null),g=s(null);return t({ref:m,setOpen:f}),u(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[l(p,{setOpen:f,children:e}),l(y,{placement:o,className:a,open:d,content:r,hiddenRef:g,containerRef:m}),l(h,{ref:g,role:`presentation`,"aria-hidden":`true`,placement:o,className:n(`komc:opacity-0 komc:invisible`,a),children:l(`span`,{children:r})})]})});export{b as Tooltip};
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`react`);const n=[],r=()=>{document.body.style.overflow=n.some(e=>e.lockScroll)?`hidden`:`unset`},i=e=>{if(e.key!==`Escape`||n.length===0)return;let t=n[n.length-1];e.preventDefault(),e.stopImmediatePropagation(),t.onClose()};let a=!1;const o=()=>{a||=(document.addEventListener(`keydown`,i,!0),!0)},s=()=>{a&&=(document.removeEventListener(`keydown`,i,!0),!1)},c=(e,t,i)=>{n.push({id:e,onClose:t,lockScroll:i}),r(),o()},l=e=>{let t=n.findLastIndex(t=>t.id===e);t!==-1&&n.splice(t,1),r(),n.length===0&&s()};function u(e,n,r=!0){let i=(0,t.useId)(),a=(0,t.useRef)(n);(0,t.useEffect)(()=>{a.current=n},[n]),(0,t.useEffect)(()=>{if(e)return c(i,()=>a.current(),r),()=>{l(i)}},[e,i,r])}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
@@ -0,0 +1 @@
1
+ import{useEffect as e,useId as t,useRef as n}from"react";const r=[],i=()=>{document.body.style.overflow=r.some(e=>e.lockScroll)?`hidden`:`unset`},a=e=>{if(e.key!==`Escape`||r.length===0)return;let t=r[r.length-1];e.preventDefault(),e.stopImmediatePropagation(),t.onClose()};let o=!1;const s=()=>{o||=(document.addEventListener(`keydown`,a,!0),!0)},c=()=>{o&&=(document.removeEventListener(`keydown`,a,!0),!1)},l=(e,t,n)=>{r.push({id:e,onClose:t,lockScroll:n}),i(),s()},u=e=>{let t=r.findLastIndex(t=>t.id===e);t!==-1&&r.splice(t,1),i(),r.length===0&&c()};function d(r,i,a=!0){let o=t(),s=n(i);e(()=>{s.current=i},[i]),e(()=>{if(r)return l(o,()=>s.current(),a),()=>{u(o)}},[r,o,a])}export{d as t};
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./file-5mweNdAM.cjs`),n=require(`./api-client-BH5tW3p8.cjs`);let r=require(`react`);const i=[12,120,240,300,406,512,612,768,960,1024,1280,1440,1560,1920,2560,3840];function a({ref:e,src:a,forceLoad:o=!1,folder:s=`media`,fallbackSrc:c,origin:l,originalWidth:u,loading:d=`lazy`,...f}){let p=n.n(),[m,h]=(0,r.useState)(0),[g,_]=(0,r.useState)(o||!a),[v,y]=(0,r.useState)(!a),b=(0,r.useRef)(null),x=(0,r.useRef)(null),S=(0,r.useCallback)(t=>{b.current=t,typeof e==`function`?e(t):e&&(e.current=t)},[e]),C=(0,r.useCallback)((e,t)=>{let n=e.startsWith(`/`)?e.slice(1):e;return t===`static`?p.cdnStatic(n):p.cdnMedia(n)},[p]),w=(0,r.useMemo)(()=>i.filter(e=>e<=u),[u]),T=(0,r.useMemo)(()=>t.i(a)?a:C(a,s),[C,a,s]),E=(0,r.useMemo)(()=>{if(l||!t.a(a)||w.length===0)return;let{filenameWithoutExtension:e,directory:n}=t.o(a,s);if(f.width){let t=w.find(e=>e>=f.width)??w[w.length-1],r=t*2,i=w.find(e=>e>=r)??w[w.length-1];return`${C(`${n}/subsets/w${t}/${e}.webp`,s)} 1x,${C(`${n}/subsets/w${i}/${e}.webp`,s)} 2x`}let r=``;for(let t of w)r+=`${C(`${n}/subsets/w${t}/${e}.webp`,s)} ${t}w, `;return r.trim()},[w,C,s,l,a,f.width]),D=(0,r.useCallback)((e,n)=>{let{filenameWithoutExtension:r,directory:i}=t.o(e,n);return`${C(`${i}/subsets/origin/${r}.webp`,n)}`},[C]),O=(0,r.useMemo)(()=>{if(a)return`${D(a,s)} 1x`},[a,s,D]),k=(0,r.useCallback)(e=>{h(t=>t>=2?(e&&(x.current=e),3):t+1)},[]),A=()=>{if(m===0)return E;if(m===1)return O},j=m>=3?c:T,M=m===0?f.sizes:void 0,N=m>0?`eager`:d;(0,r.useEffect)(()=>{m<3||y(!0)},[m]),(0,r.useEffect)(()=>{let e=b.current;if(!e||v)return;if(e.complete&&e.naturalWidth===0&&e.getAttribute(`src`)){k();return}if(e.complete&&e.naturalWidth>0){_(!0);return}let t=()=>{e.naturalWidth>0&&_(!0)};return e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[v,m,k]);let{fill:P,...F}=f;return{ref:S,isLoad:g,isError:v,imageProps:{...F,src:j,srcSet:A(),sizes:M,loading:N,onError:v?void 0:k}}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});