import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{$n as n,Cr as r,Fr as i,Nn as a,Xn as o,Xr as s,Zn as c,er as l,li as u,sr as d,ui as f}from"./vendor-primevue-D50rA9nL.js";import{Nn as p,fn as m}from"./vendor-other-BnH5nyVX.js";var h,g,_,v,y,b=t((()=>{a(),m(),h={key:0,class:`relative size-full`},g=[`src`,`alt`],_=[`src`,`alt`],v={key:1,class:`flex size-full items-center justify-center`},y=d({__name:`WidgetImageCompare`,props:{widget:{}},setup(e){let t=e,a=s(null),d=s(50),{elementX:m,elementWidth:y,isOutside:b}=p(a);i([m,y,b],([e,t,n])=>{!n&&t>0&&(d.value=Math.max(0,Math.min(100,e/t*100)))});let x=o(()=>{let e=t.widget.value;return typeof e==`string`?e:e?.before||``}),S=o(()=>{let e=t.widget.value;return typeof e==`string`?``:e?.after||``}),C=o(()=>{let e=t.widget.value;return typeof e==`object`&&e?.beforeAlt?e.beforeAlt:`Before image`}),w=o(()=>{let e=t.widget.value;return typeof e==`object`&&e?.afterAlt?e.afterAlt:`After image`});return(e,t)=>(r(),l(`div`,{ref_key:`containerRef`,ref:a,class:`relative size-full min-h-32 overflow-hidden`},[x.value||S.value?(r(),l(`div`,h,[S.value?(r(),l(`img`,{key:0,src:S.value,alt:w.value,draggable:`false`,class:`size-full object-contain`},null,8,g)):n(``,!0),x.value?(r(),l(`img`,{key:1,src:x.value,alt:C.value,draggable:`false`,class:`absolute inset-0 size-full object-contain`,style:u({clipPath:`inset(0 ${100-d.value}% 0 0)`})},null,12,_)):n(``,!0),c(`div`,{class:`pointer-events-none absolute inset-y-0 z-10 w-0.5 bg-white shadow-md`,style:u({left:`${d.value}%`}),role:`presentation`},null,4)])):(r(),l(`div`,v,f(e.$t(`imageCompare.noImages`)),1))],512))}})})),x;t((()=>{b(),b(),x=y}))();export{x as default};
//# sourceMappingURL=WidgetImageCompare-BfBPpuI5.js.map