react-motion-gallery 2.0.36 → 2.0.38

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 (61) hide show
  1. package/README.md +4 -4
  2. package/dist/FullscreenRuntime-Z3RXJ2HP.mjs +4 -0
  3. package/dist/{GridSkeleton-B5wWBN9L.d.mts → GridSkeleton-Dpsi5tXc.d.mts} +1 -1
  4. package/dist/{MasonrySkeleton-D8aZRUiv.d.mts → MasonrySkeleton-Cs0x-4yL.d.mts} +1 -1
  5. package/dist/chunk-45TZO7MN.mjs +2 -0
  6. package/dist/chunk-4RPAI2F7.mjs +4 -0
  7. package/dist/chunk-4URHXPTV.mjs +4 -0
  8. package/dist/{chunk-7PF7OJT2.mjs → chunk-5HGFS3S2.mjs} +1 -1
  9. package/dist/{chunk-MFTASEWB.mjs → chunk-AHMXEVKY.mjs} +1 -1
  10. package/dist/chunk-AU4O4KU4.mjs +1 -0
  11. package/dist/chunk-EWWWD475.mjs +1 -0
  12. package/dist/{chunk-J3UHEYNG.mjs → chunk-MJAHN7TG.mjs} +1 -1
  13. package/dist/{chunk-63CVVCOL.mjs → chunk-MLE7BKAD.mjs} +1 -1
  14. package/dist/chunk-P6NLW2QN.mjs +1 -0
  15. package/dist/chunk-UEIIMUYB.mjs +1 -0
  16. package/dist/chunk-YNQPSE2N.mjs +3 -0
  17. package/dist/{chunk-3RVITFUD.mjs → chunk-YU2WS3GJ.mjs} +1 -1
  18. package/dist/core.d.mts +1 -1
  19. package/dist/entries.d.mts +8 -7
  20. package/dist/entries.mjs +1 -1
  21. package/dist/fullscreen-captions.d.mts +1 -1
  22. package/dist/fullscreen-controls.d.mts +1 -1
  23. package/dist/fullscreen-crossfade.d.mts +1 -1
  24. package/dist/fullscreen-lazy-load.d.mts +1 -1
  25. package/dist/fullscreen-slider.d.mts +1 -1
  26. package/dist/fullscreen-slider.mjs +1 -1
  27. package/dist/fullscreen-thumbnails.d.mts +1 -1
  28. package/dist/fullscreen-video.d.mts +1 -1
  29. package/dist/fullscreen-zoom-pan.d.mts +1 -1
  30. package/dist/fullscreen.d.mts +4 -3
  31. package/dist/fullscreen.mjs +1 -1
  32. package/dist/grid.d.mts +2 -2
  33. package/dist/grid.mjs +1 -1
  34. package/dist/{index-lEnLoQv4.d.mts → index-QEgABhod.d.mts} +1 -1
  35. package/dist/index.d.mts +4 -3
  36. package/dist/index.mjs +1 -1
  37. package/dist/{layout-DoYnPD0I.d.mts → layout-BOy4geKv.d.mts} +1 -0
  38. package/dist/masonry.mjs +1 -1
  39. package/dist/metafile-esm.json +1 -1
  40. package/dist/{responsive-CrESIWcm.d.mts → responsive-BnHorKhC.d.mts} +25 -1
  41. package/dist/responsive.d.mts +1 -1
  42. package/dist/skeleton-base.d.mts +8 -5
  43. package/dist/skeleton-base.mjs +1 -1
  44. package/dist/skeleton-cache-provider.d.mts +7 -0
  45. package/dist/skeleton-cache-provider.mjs +1 -0
  46. package/dist/skeleton-cache.d.mts +70 -0
  47. package/dist/skeleton-cache.mjs +1 -0
  48. package/dist/skeleton-grid.d.mts +5 -4
  49. package/dist/skeleton-grid.mjs +1 -1
  50. package/dist/skeleton-masonry.d.mts +8 -6
  51. package/dist/skeleton-masonry.mjs +1 -1
  52. package/dist/skeleton-slider.d.mts +2 -1
  53. package/dist/skeleton-slider.mjs +5 -5
  54. package/package.json +9 -1
  55. package/dist/FullscreenRuntime-E7O76RND.mjs +0 -4
  56. package/dist/chunk-4BTS6IIA.mjs +0 -2
  57. package/dist/chunk-4ZOW533S.mjs +0 -1
  58. package/dist/chunk-7YGT5VBX.mjs +0 -1
  59. package/dist/chunk-LSHR3FZM.mjs +0 -4
  60. package/dist/chunk-RGS2QTPJ.mjs +0 -3
  61. package/dist/chunk-X3W6JPNH.mjs +0 -4
@@ -1,4 +0,0 @@
1
- import {a as a$2,f as f$2,e as e$2}from'./chunk-TIQVSK5S.mjs';import {a as a$9,d as d$4,c as c$3,b as b$3}from'./chunk-PFEGIWQJ.mjs';import {d as d$1,a as a$5}from'./chunk-ADIHG7AT.mjs';import {a as a$1,d as d$2,c as c$2}from'./chunk-XUQO5F2F.mjs';import {b}from'./chunk-P2GQPFSL.mjs';import {a as a$6}from'./chunk-LVMYHM4T.mjs';import {j,i,f,g as g$1,c as c$1,b as b$2,a as a$4,e as e$1}from'./chunk-4NT4UVB5.mjs';import {b as b$1,c,d,f as f$1,e,h,g,a as a$3}from'./chunk-HGY3QLCE.mjs';import {a}from'./chunk-ULUKLQXS.mjs';import {c as c$4}from'./chunk-NHIKOJLU.mjs';import {a as a$7}from'./chunk-UML6FCOQ.mjs';import {d as d$3}from'./chunk-WMG2LTLR.mjs';import'./chunk-L2HRIINV.mjs';import {a as a$8}from'./chunk-B4CC5AGE.mjs';import {f as f$3,g as g$2}from'./chunk-HK2DPKES.mjs';import*as C from'react';import C__default,{forwardRef,useRef,useState,useEffect,useCallback,Children,useImperativeHandle,useLayoutEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {flushSync}from'react-dom';import {createRoot}from'react-dom/client';function ti({size:e=35,className:n}){return jsx("svg",{className:n,width:e,height:e,viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:jsx("path",{fill:"white",stroke:"#4f4f4f",strokeWidth:.5,d:"M12.96 4.46l-1.42-1.42-3.54 3.55-3.54-3.55-1.42 1.42 3.55 3.54-3.55 3.54 1.42 1.42 3.54-3.55 3.54 3.55 1.42-1.42-3.55-3.54 3.55-3.54z"})})}function ni({index:e,count:n}){return jsxs("span",{children:[e+1," / ",n]})}function es(e,n=.4){let t=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,o=Math.min(t.bottom,r)-Math.max(t.top,0);return o<=0?false:o>=t.height*n}async function Ar(e){if(typeof window>"u")return;let n=document.querySelector(`[data-rmg-entry-owner="${e}"]`);if(!n||es(n,.5))return;let t=n.getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop||0,o=window.innerHeight||document.documentElement.clientHeight||t.height,a=t.top+r-(o-t.height)/2;window.scrollTo({top:a,behavior:"instant"});}function Kn(e){let n=document.querySelector(`[data-rmg-entry-owner="${e}"]`);return n?n.getAttribute("data-rmg-entry-mounted")==="1"&&n.getAttribute("data-rmg-entry-ready")==="1":false}async function Dr(e,n=1200){return typeof window>"u"?false:Kn(e)?true:new Promise(t=>{let r=typeof performance<"u"?performance.now():Date.now(),o=()=>{if(Kn(e)){t(true);return}if((typeof performance<"u"?performance.now():Date.now())-r>=n){t(false);return}requestAnimationFrame(o);};requestAnimationFrame(o);})}var ns=80,rs=300;function os(e){return e.introFade||e.isVideoSlide||e.introMethod==="fade"&&e.isLatchedIntroIndex?true:e.hasTransformTarget?false:e.introMethod==="fade"}function is(e){let n=Number.isFinite(e)?Math.max(0,e):0;return Math.min(n,ns)}function ss(e,n){let t=e.getBoundingClientRect();n(e,"width",`${Math.max(1,Math.round(t.width))}px`),n(e,"height",`${Math.max(1,Math.round(t.height))}px`);}var jr=e=>`${Math.round(e)}px`;function as(e){return e?e.parentElement??e:null}function ls(e,n){if(!n?.length)return -1;let t=n.find(r=>r.cells.some(o=>o.index===e));return t?n.indexOf(t):-1}function ri(e,n,t){let r=Array.from(e.querySelectorAll(`:scope > [data-rmg-slide="true"][data-rmg-idx="${t}"]`));if(!r.length)return null;let o=r.sort((a,l)=>{let c=a.getAttribute("data-rmg-clone")==="true"?1:0,u=l.getAttribute("data-rmg-clone")==="true"?1:0;return c-u});return o.find(a=>no(a,n,false))??o.find(a=>no(a,n,true))??o[0]??null}function no(e,n,t=true){let r=n.getBoundingClientRect(),o=e.getBoundingClientRect(),a=o.left>=r.left&&o.right<=r.right&&o.top>=r.top&&o.bottom<=r.bottom,l=o.right>r.left&&o.left<r.right&&o.bottom>r.top&&o.top<r.bottom;return t?l:a}function Er(e){let n=Math.max(1,Math.round(e));return new Promise(t=>{let r=o=>{if(o<=0){t();return}requestAnimationFrame(()=>r(o-1));};r(n);})}function ai(){return Er(4)}function cs(e){let n=Number.parseFloat(e?.trim()??"");return Number.isFinite(n)&&n>0?n:null}function us(e,n,t,r){let o=n+(e.left-n)*r,a=t+(e.top-t)*r;return new DOMRect(o,a,e.width*r,e.height*r)}function ds(e,n){let t=e.offsetWidth>0?n.width/e.offsetWidth:NaN,r=e.offsetHeight>0?n.height/e.offsetHeight:NaN;return Number.isFinite(t)&&t>0?t:Number.isFinite(r)&&r>0?r:null}function Mr(e){if(!e)return null;let n=e.getBoundingClientRect(),t=e.matches('[data-rmg-slide="true"]')?e:e.closest('[data-rmg-slide="true"]');if(!t)return n;let r=cs(getComputedStyle(t).getPropertyValue("--rmg-scale"));if(!r||Math.abs(r-1)<1e-4)return n;let o=t.getBoundingClientRect(),a=ds(t,o);if(!a||a<=0)return n;let l=r/a;if(Math.abs(l-1)<1e-4)return n;let c=o.left+o.width/2,u=o.top+o.height/2;return us(n,c,u,l)}function Nr(e,n,t){let r=e.top,o=e.left,a=n-(e.left+e.width),l=t-(e.top+e.height);return `inset(${r}px ${a}px ${l}px ${o}px)`}function to(e,n){let t=document.createElement("div");return Object.assign(t.style,{position:"fixed",inset:"0",clipPath:e,willChange:"clip-path",transition:"none",pointerEvents:"none",zIndex:String(n)}),t}function oi(e){if(!(e instanceof HTMLElement))return false;let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"||Number.parseFloat(n.opacity||"1")<=0||n.position!=="sticky"&&n.position!=="fixed")return false;let t=e.getBoundingClientRect();return !(t.width<=0||t.height<=0||t.bottom<=0||t.top>=window.innerHeight||t.top>Math.min(window.innerHeight*.25,120))}function ii(e,n){return Math.min(e.right,n.right)>Math.max(e.left,n.left)}function fs(e,n){let t=e?.trim(),o=t?Array.from(document.querySelectorAll(t)):[".rmg-intro-sticky-nav",'[data-rmg-intro-sticky-nav="true"]','header[role="banner"]',"header"].flatMap(c=>Array.from(document.querySelectorAll(c))),a=null,l=-1/0;for(let c of o){if(!oi(c))continue;let u=c.getBoundingClientRect();n&&!ii(u,n)||u.bottom>l&&(l=u.bottom,a=c);}if(a||t)return a;for(let c of Array.from(document.body.querySelectorAll("*"))){if(!oi(c))continue;let u=c.getBoundingClientRect();n&&!ii(u,n)||u.bottom>l&&(l=u.bottom,a=c);}return a}function ms(e,n){let t=Math.max(window.innerHeight||0,document.documentElement?.clientHeight||0),r=Math.min(Math.max(n,0),t),o=e.left,a=e.right,l=Math.max(e.top,r),c=e.bottom;return c<=l||a<=o?null:new DOMRect(o,l,a-o,c-l)}function ps(e){return e?[e.overflow,e.overflowX,e.overflowY].some(n=>{let t=n?.trim().toLowerCase()??"";return t==="hidden"||t==="clip"}):false}function ys(e,n=2){let t=[],r=e?.parentElement??null;for(;r&&r!==document.body&&r!==document.documentElement&&t.length<n;){if(ps(getComputedStyle(r))){let o=Mr(r)??r.getBoundingClientRect();o.width>0&&o.height>0&&t.push(o);}r=r.parentElement;}return t}function gs({DURATION_MS:e,EASING:n}){let t=document.createElement("div");return Object.assign(t.style,{position:"fixed",inset:"0",clipPath:"inset(0px 0px 0px 0px)",willChange:"clip-path",pointerEvents:"none",transition:`clip-path ${e}ms ${n}`,zIndex:"9998",background:"transparent"}),document.body.appendChild(t),t.offsetWidth,t}function si(e){let n=window.innerWidth,t=window.innerHeight,r=e.top,o=e.left,a=n-(e.left+e.width),l=t-(e.top+e.height);return `inset(${jr(r)} ${jr(a)} ${jr(l)} ${jr(o)})`}async function bs(e,n,t,r,o){let a=n.current;if(!a||!t.current?.length)return null;let l=as(a);if(!l)return null;let c=ri(a,l,e);if(!c)return null;no(c,l,false)||ro(e,t,r,o)&&(await ai(),c=ri(a,l,e)??c);let p=Mr(c)??c.getBoundingClientRect(),x=c.querySelector("img"),j=x?getComputedStyle(x):null,h=a$9(j?.objectPosition??null)??{x:.5,y:.5},D=Mr(x)??x?.getBoundingClientRect()??null,A=D?D.width:0,P=D?D.height:0;return {cropRect:p,imgEl:x,objPos:h,renderedW:A,renderedH:P,renderedRect:D}}function ro(e,n,t,r){let o=n.current,a=ls(e,o);return a<0?false:(r(a,"instant"),t?.(),true)}async function hs(e){try{let n=e.videoWidth||Math.round(e.getBoundingClientRect().width)||1,t=e.videoHeight||Math.round(e.getBoundingClientRect().height)||1;if(!n||!t);let r=document.createElement("canvas");r.width=n,r.height=t;let o=r.getContext("2d");if(!o)return null;o.drawImage(e,0,0,n,t);let a=r.toDataURL("image/png"),l=new Image;return l.decoding="async",l.src=a,await l.decode().catch(()=>{}),l}catch{return null}}function vs(e){if(!e)return null;let n=e.querySelector("video");if(n?.poster)return n.poster;let t=e.querySelector(".plyr__poster");if(t){let r=getComputedStyle(t).backgroundImage,o=r&&/url\(["']?(.*?)["']?\)/.exec(r);if(o?.[1])return o[1]}return null}async function Rs(e,n){let t=await hs(e);if(t)return t;let r=vs(n),o=new Image;if(o.decoding="async",r){o.src=r;try{await o.decode();}catch{}}else {let a=e.videoWidth||1,l=e.videoHeight||1,c=document.createElement("canvas");c.width=Math.max(1,a),c.height=Math.max(1,l),o.src=c.toDataURL("image/png");}return o}function Ss(e){if(!e)return {x:.5,y:.5};let n=getComputedStyle(e);return a$9(n?.objectPosition??null)}function Es(e,n){e.decoding="async",e.loading="eager",e.draggable=false,e.style.pointerEvents="none",e.style.objectFit="cover",e.style.objectPosition=`${Math.round(n.x*100)}% ${Math.round(n.y*100)}%`;}function Ms(e){let n=Number.isFinite(e.rectTop)?e.rectTop:0,t=Number.isFinite(e.rectHeight)?Math.max(0,e.rectHeight):0,r=Number.isFinite(e.scrollY)?e.scrollY:0,o=Number.isFinite(e.viewportHeight)&&e.viewportHeight>0?e.viewportHeight:t,a=Number.isFinite(e.viewportOffsetTop)?Math.max(0,e.viewportOffsetTop??0):0,l=Number.isFinite(e.maxScrollY)&&e.maxScrollY!=null?Math.max(0,e.maxScrollY):Number.POSITIVE_INFINITY,c=r+n-a-(o-t)/2;return Math.min(Math.max(0,c),l)}function oo(){return window.scrollY||document.documentElement.scrollTop||0}function ws(){let e=document.scrollingElement??document.documentElement,n=window.innerHeight||document.documentElement.clientHeight||0,t=document.body?.scrollHeight??0,r=Math.max(e.scrollHeight,t);return Math.max(0,r-n)}function xs(e){let n=document.documentElement,t=document.body,r=n.style.scrollBehavior,o=t?.style.scrollBehavior??"";n.style.scrollBehavior="auto",t&&(t.style.scrollBehavior="auto");try{window.scrollTo(window.scrollX||0,e);}finally{n.style.scrollBehavior=r,t&&(t.style.scrollBehavior=o);}}async function Ts(e){let n=oo(),t=0;for(let r=0;r<8;r+=1){await Er(1);let o=oo(),a=Math.abs(o-e)<=1,l=Math.abs(o-n)<=.5;if(a||l){if(t+=1,t>=2)break}else t=0;n=o;}await Er(1);}async function Cs(){await new Promise(e=>{window.setTimeout(e,rs);}),await Er(1);}async function Fs(e){if(!e)return false;let n=e.getBoundingClientRect(),t=oo(),r=window.visualViewport,o=r?.height||window.innerHeight||document.documentElement.clientHeight||n.height,a=r?.offsetTop??0,l=ws(),c=Ms({rectTop:n.top,rectHeight:n.height,scrollY:t,viewportHeight:o,viewportOffsetTop:a,maxScrollY:l});return Math.abs(c-t)>1?(xs(c),await Ts(c),true):(await Er(1),false)}async function Os({fsSliderEl:e,nodeIdx:n,thumbCropRect:t,endClipRect:r,endObjPos:o,captionClone:a,trackStyleMutation:l,trackMutedMutation:c,safeTeardown:u,onCaptionCloneGone:p,DURATION_MS:x,EASING:j}){let h=e.querySelector(`.rmg__player[data-index="${n}"]`)||e.querySelector(".rmg__player")||null,D=h?.querySelector("video"),A=h?.getBoundingClientRect?.()||D?.getBoundingClientRect?.();if(!A){u();return}if(h){ss(h,l),l(h,"visibility","hidden"),l(h,"opacity","0");let $=h.querySelector(".plyr__poster");l($,"opacity","0");let Y=h.querySelector(".plyr__controls");l(Y,"opacity","0");}if(D){try{D.pause();}catch{}c(D,true);}let P=D||h?.querySelector("video");if(!P){u();return}let v=await Rs(P,h);Es(v,o);let w=v.naturalWidth||1,S=v.naturalHeight||1,K=Ss(D),H=b$3(w,S,A,K),W=b$3(w,S,t,o),I=v;Object.assign(I.style,{position:"fixed",left:"0",top:"0",width:`${w}px`,height:`${S}px`,maxWidth:"none",maxHeight:"none",transformOrigin:"50% 50%",willChange:"transform",zIndex:"2147483601",opacity:"1",transition:"none"}),I.style.transform=`translate3d(${H.cx}px, ${H.cy}px, 0) translate3d(${-w/2}px, ${-S/2}px, 0) scale(${H.scale})`;let f=gs({DURATION_MS:x,EASING:j});f.style.clipPath=si(A),f.appendChild(I),I.offsetWidth,f.offsetWidth;let V=()=>{if(a){try{a.remove();}catch{}p?.();}try{document.body.removeChild(f);}catch{}try{I.remove();}catch{}u();},_=$=>{$.propertyName==="transform"&&(I.removeEventListener("transitionend",_),V());};requestAnimationFrame(()=>{f.style.clipPath=si(r??t),I.style.transition=`transform ${x}ms ${j}`,I.style.transform=`translate3d(${W.cx}px, ${W.cy}px, 0) translate3d(${-w/2}px, ${-S/2}px, 0) scale(${W.scale})`,I.addEventListener("transitionend",_,{once:true}),window.setTimeout(()=>{I.removeEventListener("transitionend",_),V();},x+120);});}var li=({children:e,fsSub:n,open:t,onClose:r,isClick:o,isAnimating:a,overlayDivRef:l,closeButtonRef:c,counterRef:u,leftChevronRef:p,rightChevronRef:x,cells:j,setShowFullscreenSlider:h,cellCount:D,setClosingModal:A,slides:P,slider:v,wrappedItems:w,centerSlider:S,setSliderIndex:K,onForceResetZoom:H,layout:W,expandableImageRefs:I,resolveLayoutlessTarget:f,entryMapRef:V,entryMediaLayout:_,introFade:$,introDuration:Y=300,introEasing:re="cubic-bezier(.4,0,.22,1)",requestFsCloseRef:be,cancelFsCloseRef:ce,fs:F,styles:B,syncFullscreenSourceFromIndex:de,baseZ:Q,rootRef:Ve,introMethod:_t,setLatchedIntroMethod:z,latchedIntroIndex:$e})=>{let ue=Y,me=re,he=C__default.useRef(null),Pt=C__default.useRef(0),zt=C__default.useRef(0),ie=Q??9999,Ue=C__default.useCallback(d=>{he.current=d,Ve&&(Ve.current=d);},[Ve]),Ie=C__default.useRef(null),Le=C__default.useRef([]),ve=C__default.useRef(new WeakMap),wt=C__default.useRef(false),ze=C__default.useRef(false),oe=C__default.useCallback(()=>{for(let d=Le.current.length-1;d>=0;d-=1){let b=Le.current[d];if(b.kind==="style"){b.el.style[b.prop]=b.prevValue;continue}b.el.muted=b.prevValue;}Le.current=[],ve.current=new WeakMap;},[]);function yt(){if(Ie.current)return;let d=document.createElement("div");d.setAttribute("data-rmg-fs-shield","true"),Object.assign(d.style,{position:"fixed",inset:"0",zIndex:String(ie+5),background:"transparent",pointerEvents:"auto",touchAction:"none",cursor:"default"});let b=U=>{U.preventDefault?.(),U.stopPropagation?.();};d.addEventListener("pointerdown",b,{capture:true}),d.addEventListener("pointerup",b,{capture:true}),d.addEventListener("pointermove",b,{capture:true}),d.addEventListener("click",b,{capture:true}),d.addEventListener("dblclick",b,{capture:true}),d.addEventListener("contextmenu",b,{capture:true}),d.addEventListener("touchstart",b,{capture:true,passive:false}),d.addEventListener("touchmove",b,{capture:true,passive:false}),d.addEventListener("touchend",b,{capture:true,passive:false}),d.addEventListener("wheel",b,{capture:true,passive:false}),d.addEventListener("keydown",b,{capture:true}),document.body.appendChild(d),Ie.current=d;}function He(){let d=Ie.current;if(d){try{d.remove();}catch{}Ie.current=null;}}function Ne(d){let b=he.current;if(b){if(d){b.setAttribute("data-rmg-fs-closing","true");return}b.removeAttribute("data-rmg-fs-closing");}}useEffect(()=>()=>{ce.current&&(ce.current=null),wt.current=false,ze.current=false,He();},[ce]);function pn(d){let b=he.current;return b?b.querySelector(d):null}function Kt(d,b,U){if(!d)return;let fe=ve.current.get(d);fe||(fe=new Set,ve.current.set(d,fe));let pe=`style:${b}`;fe.has(pe)||(fe.add(pe),Le.current.push({kind:"style",el:d,prop:b,prevValue:d.style[b]??""})),(d.style[b]??"")!==U&&(d.style[b]=U);}function Fe(d,b){if(!d)return;let U=ve.current.get(d);U||(U=new Set,ve.current.set(d,U));let fe="media:muted";U.has(fe)||(U.add(fe),Le.current.push({kind:"muted",el:d,prevValue:d.muted})),d.muted!==b&&(d.muted=b);}let xn=C__default.useCallback(()=>{let d=he.current;d&&(d.style.transition="",d.style.willChange="");let b=d?.querySelector(".fullscreen_slider")??null;b&&(b.style.willChange="");},[]);function Ze(d,b){let U=Math.max(1,b);return (d%U+U)%U}useEffect(()=>{if(!t)return;let d=b=>{b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),kt());};return window.addEventListener("keydown",d,{capture:true}),()=>window.removeEventListener("keydown",d,{capture:true})},[t]),useLayoutEffect(()=>{oe(),t||xn();},[t,oe,xn]);function Tn(d,b){if(b<=1)return 0;let U=Ze(d,b),fe=U+1,pe=pn(".fullscreen_slider");if(!pe)return fe;let te=Array.from(pe.querySelectorAll(`[data-rmg-fs-slide="true"][data-rmg-canonical-idx="${U}"]`));if(!te.length)return fe;let tt=(he.current??pe).getBoundingClientRect(),vt=(tt.left+tt.right)/2,nt=(tt.top+tt.bottom)/2,Jt=null,Ye=Number.POSITIVE_INFINITY;for(let Dt of te){let lt=Dt.getBoundingClientRect(),Me=(lt.left+lt.right)/2,xe=(lt.top+lt.bottom)/2,Xe=Math.abs(Me-vt)+Math.abs(xe-nt);Xe<Ye&&(Jt=Dt,Ye=Xe);}let Ee=Jt?.getAttribute("data-index"),At=Ee!=null?parseInt(Ee,10):NaN;return Number.isFinite(At)?At:fe}function Qn(d,b){if(!d)return null;let U=d.querySelector(`[data-index="${b}"]`)??null,pe=(U?U.closest('[data-rmg-fs-slide="true"]'):null)?.querySelector('[data-rmg-fs-caption="true"]')??null;if(!pe)return null;let te=pe.getBoundingClientRect(),ke=pe.cloneNode(true);return Object.assign(ke.style,{position:"fixed",left:`${Math.round(te.left)}px`,top:`${Math.round(te.top)}px`,width:`${Math.round(te.width)}px`,height:`${Math.round(te.height)}px`,margin:"0",transform:"none",zIndex:"2147483602",pointerEvents:"none"}),document.body.appendChild(ke),Kt(pe,"visibility","hidden"),ke}function gt(){[p.current,x.current,u.current,c.current].forEach(b=>{b&&b.classList.remove(B.open);});}function Wn(d,b,U,fe){if(fe){d.querySelectorAll("[data-index]").forEach(pe=>{pe.dataset.index!==String(b)&&(Kt(pe,"transition","opacity 0.3s cubic-bezier(.4,0,.22,1)"),Kt(pe,"opacity","0"));});return}d.querySelectorAll('[data-rmg-fs-slide="true"]').forEach(pe=>{U&&pe.contains(U)||(Kt(pe,"transition","opacity 0.3s cubic-bezier(.4,0,.22,1)"),Kt(pe,"opacity","0"));});}function Vn(){let d=l.current;if(!d)return;let b=Number.parseFloat(getComputedStyle(d).opacity),U=Number.isFinite(b)?b:1;d.style.transition="none",d.style.opacity=String(U),d.offsetWidth,d.style.transition=`opacity ${ue}ms ${me}`,requestAnimationFrame(()=>{d.style.opacity="0",d.style.pointerEvents="none";});}function $n(d,b,U={}){if(!d)return;let fe=Number.parseFloat(getComputedStyle(d).opacity),pe=Number.isFinite(fe)?fe:1;d.style.transition="none",d.style.opacity=String(pe),d.offsetWidth,d.style.transition=`opacity ${ue}ms ${me}`,d.style.willChange="opacity",requestAnimationFrame(()=>{d.style.opacity=String(b),U.pointerEvents!=null&&(d.style.pointerEvents=U.pointerEvents);});}function on(d){return d?d.kind==="video"||/\.(mp4|webm|ogg)$/i.test(d.src||""):false}function sn(){return wt.current?false:(wt.current=true,ze.current=false,ce.current=()=>{wt.current&&Ae();},yt(),Ne(true),a.current=false,o.current=false,j.current=[],true)}function et(){return ze.current?false:(ze.current=true,A(true),true)}function qt(){et(),gt(),Vn();let d=he.current,b=false,U,fe,pe=()=>{b||(b=true,d?.removeEventListener("transitionend",te),U!==void 0&&window.clearTimeout(U),fe!==void 0&&window.clearTimeout(fe),ce.current===ke&&(ce.current=null),Ae());},te=vt=>{vt.target!==d||vt.propertyName!=="opacity"||pe();},ke=()=>{b||(b=true,d?.removeEventListener("transitionend",te),U!==void 0&&window.clearTimeout(U),fe!==void 0&&window.clearTimeout(fe),ce.current===ke&&(ce.current=null),Ae());};ce.current=ke;let tt=pn(".fullscreen_slider");tt&&$n(tt,0),d&&(d.addEventListener("transitionend",te,{once:true}),$n(d,0,{pointerEvents:"none"})),U=window.setTimeout(()=>{He();},is(ue)),fe=window.setTimeout(()=>{pe();},ue+40);}async function kt(){if(!t||!sn())return;let d=w.slice(1,-1);if(!d.length){Ae();return}let b=n.get(),U=Ze(b,d.length),fe=!W||W==="grid"||W==="masonry"||_==="grid"||_==="masonry",pe=E=>E?E instanceof HTMLImageElement?{host:E.closest("[data-rmg-idx], .rmg__grid-item, .rmg__masonry-item, .rmg__slide")??E.parentElement,image:E}:E instanceof HTMLElement?{host:E,image:E.querySelector("img")??null}:{host:null,image:null}:{host:null,image:null},te=E=>{let q=I.current?.[E]??null,ae=q&&typeof q=="object"&&"current"in q?q.current:q;return pe(ae)},ke=E=>j.current?.find(q=>q.index===E)?.element??null,tt=E=>{let q=te(E),ae=f(E),ye=q.image??ae.image;return ye||(ye=(ke(E)??document.querySelector(`[data-rmg-idx="${E}"]`))?.querySelector("img")??null),ye},vt=E=>{let q=Mr(E)??E.getBoundingClientRect(),ae=getComputedStyle(E),ye=a$9(ae?.objectPosition??null)??{x:.5,y:.5};if((ae?.objectFit??"cover")!=="contain")return {cropRect:q,objPos:ye};let jt=Math.max(1,E.naturalWidth||0),Nt=Math.max(1,E.naturalHeight||0);return {cropRect:d$4(jt,Nt,q,"contain",ye),objPos:ye}},nt=E=>{let q=E.destImg?Mr(E.destImg)??E.destImg.getBoundingClientRect():E.thumbCropRect,ye=fs(F.effects?.introStickyNavSelector,q)?.getBoundingClientRect();return ye?ms(E.thumbCropRect,ye.bottom)??E.thumbCropRect:E.thumbCropRect},Jt=async E=>{let q=pn(".fullscreen_slider");if(!q){Ae();return}let ae=Tn(U,D),ye=E.isVideoSlide?null:q.querySelector(`[data-rmg-fs-slide="true"][data-index="${ae}"]`)??null,cn=E.isVideoSlide?null:ye?.querySelector('[data-rmg-fs-media="true"]')??null,jt=E.isVideoSlide?null:a$5(cn);if(!jt&&!E.isVideoSlide){Ae();return}let Nt=nt({thumbCropRect:E.thumbCropRect,destImg:E.destImg});et(),gt(),Vn(),Wn(q,ae,jt,E.isVideoSlide);let Rt=Qn(q,ae);if(Rt&&(Rt.style.transition=`opacity ${ue}ms ${me}`,Rt.offsetWidth,Rt.style.opacity="0"),E.isVideoSlide){await Os({fsSliderEl:q,nodeIdx:ae,thumbCropRect:E.thumbCropRect,endClipRect:Nt,endObjPos:E.endObjPos??{x:.5,y:.5},captionClone:Rt,trackStyleMutation:Kt,trackMutedMutation:Fe,safeTeardown:Ae,DURATION_MS:ue,EASING:me});return}let X=jt,Fn=X.parentNode||null,ee=X.nextSibling||null,un=getComputedStyle(X),Ct=a$9(un?.objectPosition??null)??{x:.5,y:.5},Ft=un?.objectFit||"contain",rt=X.getBoundingClientRect(),ct=Math.max(1,X.naturalWidth||Math.round(rt.width)||1),Ot=Math.max(1,X.naturalHeight||Math.round(rt.height)||1),Qt=Ft==="contain"?c$3(ct,Ot,rt,Ct):b$3(ct,Ot,rt,Ct),en=b$3(ct,Ot,E.thumbCropRect,E.endObjPos),St=ys(E.destImg??null,2),gn=St[0]??null,It=St[1]??null,Wt=ie+1,Lt=document.documentElement.clientWidth,Vt=window.innerHeight,we=to(Nr(rt,Lt,Vt),Wt),De=gn?to("inset(0px 0px 0px 0px)",Wt):null,it=It?to("inset(0px 0px 0px 0px)",Wt):null,On={position:X.style.position,left:X.style.left,top:X.style.top,width:X.style.width,height:X.style.height,maxWidth:X.style.maxWidth,maxHeight:X.style.maxHeight,transformOrigin:X.style.transformOrigin,transform:X.style.transform,transition:X.style.transition,willChange:X.style.willChange,zIndex:X.style.zIndex,pointerEvents:X.style.pointerEvents};Object.assign(X.style,{position:"fixed",left:"0",top:"0",width:`${ct}px`,height:`${Ot}px`,maxWidth:"none",maxHeight:"none",transformOrigin:"50% 50%",willChange:"transform",transition:"none",zIndex:"1",pointerEvents:"none"}),we.appendChild(X),De?(De.appendChild(we),it&&it.appendChild(De)):it&&it.appendChild(we);let In=it??De??we;document.body.appendChild(In),X.style.transform=`translate3d(${Qt.cx}px, ${Qt.cy}px, 0) translate3d(${-ct/2}px, ${-Ot/2}px, 0) scale(${Qt.scale})`,X.offsetWidth,we.offsetWidth,De?.offsetWidth,it?.offsetWidth,we.style.transition=`clip-path ${ue}ms ${me}`,De&&(De.style.transition=`clip-path ${ue}ms ${me}`),it&&(it.style.transition=`clip-path ${ue}ms ${me}`),X.style.transition=`transform ${ue}ms ${me}`,requestAnimationFrame(()=>{we.style.clipPath=Nr(Nt,Lt,Vt),De&&gn&&(De.style.clipPath=Nr(gn,Lt,Vt)),it&&It&&(it.style.clipPath=Nr(It,Lt,Vt)),X.style.transform=`translate3d(${en.cx}px, ${en.cy}px, 0) translate3d(${-ct/2}px, ${-Ot/2}px, 0) scale(${en.scale})`;});let _n=false,ut=()=>{if(!_n){_n=true,X.removeEventListener("transitionend",tn);try{Fn&&(ee?Fn.insertBefore(X,ee):Fn.appendChild(X));}catch{}Object.assign(X.style,On);try{In.remove();}catch{}Ae();}},tn=zn=>{zn.propertyName==="transform"&&ut();};X.addEventListener("transitionend",tn,{once:true}),window.setTimeout(()=>ut(),ue+80);},Ye=U,Ee=U,At=null;async function Dt(){!v.current||!P.current?.length||ro(Ee,P,S,K)&&v.current.offsetWidth;}let lt=async()=>{if(W!=="entries"||!V?.current)return;let E=V.current[Ye];if(!E)return;Ee=E.mediaIndex,await Ar(E.entryIndex),await Dr(E.entryIndex);let q=document.querySelector(`[data-rmg-entry-owner="${E.entryIndex}"]`);if(q){for(let ae of Array.from(q.children)){let ye=ae;ye.hasAttribute("data-rmg-entry-skeleton")?(ye.style.setProperty("transition","none"),ye.style.setProperty("opacity","0")):(ye.style.setProperty("transition","none"),ye.style.setProperty("opacity","1"));}await new Promise(ae=>requestAnimationFrame(()=>ae()));}de(Ye);},Me=null;if(!fe&&W==="entries"&&V?.current){let E=V.current[Ye];if(E){let q=document.querySelector(`[data-rmg-entry-owner="${E.entryIndex}"]`);if(q?.style.setProperty("--rmg-entry-intro-duration","0ms"),q?.style.setProperty("--rmg-entry-intro-delay","0ms"),q?.style.setProperty("--rmg-entry-skeleton-exit-duration","0ms"),!Kn(E.entryIndex)){let ae=document.createElement("div");ae.className=B.spinner,ae.style.position="fixed",ae.style.zIndex=String(ie+10),ae.style.setProperty("opacity","1","important"),ae.style.setProperty("visibility","visible","important"),document.body.appendChild(ae),Me=ae;}}}if(fe){let E=f(Ye),q=te(Ye),ae=E.host??E.media??q.host??ke(Ye)??document.querySelector(`[data-rmg-idx="${Ye}"]`)??null,ye=await Fs(ae);await lt(),ye&&await Cs(),At=tt(Ye);}else {if(await lt(),Me){Me.style.setProperty("opacity","0","important");let E=Me;setTimeout(()=>{try{E.remove();}catch{}},200),Me=null;}if(!v.current||!P.current?.length){Ae();return}}let xe=d[Ye],Xe=on(xe),ln=Ze($e,d.length)===Ye;if(os({introFade:$,isVideoSlide:Xe,introMethod:_t,isLatchedIntroIndex:ln,hasTransformTarget:!Xe&&(!fe||!!At)})){await Dt(),qt();return}if(!fe){if(!v.current||!P.current?.length){Ae();return}let E=async()=>{let q=await bs(Ee,v,P,S,K);if(!q){Ae();return}let ae=q.cropRect,ye=q.objPos??{x:.5,y:.5};if(q.imgEl){let{cropRect:cn,objPos:jt}=vt(q.imgEl);ae=cn,ye=jt;}await Jt({thumbCropRect:ae,endObjPos:ye,isVideoSlide:false,destImg:q.imgEl});};if(!ro(Ee,P,S,K)){Ae();return}await ai(),await E();return}if(!I?.current){Ae();return}let xt=At??tt(Ye);if(!xt){Ae();return}let{cropRect:Tt,objPos:Ut}=vt(xt);await Jt({thumbCropRect:Tt,endObjPos:Ut,isVideoSlide:false,destImg:xt});}useEffect(()=>(be.current=()=>{kt();},()=>{be.current&&(be.current=null);}),[be,kt]);function Ae(){ce.current&&(ce.current=null),wt.current=false,ze.current=false,He(),Ne(false);let d=pn(".fullscreen_slider");d&&d.style.removeProperty("transition");let b=he.current;b&&b.style.removeProperty("transition"),$||(d&&(d.style.opacity="0"),b&&(b.style.opacity="0",b.style.pointerEvents="none")),l.current?.remove(),l.current=null,H(),r(),h(false),A(false),z(null);}let bt=F?.controls?.close?.enabled!==false,an=()=>{kt();},Bn=typeof F?.controls?.close?.render=="function"?F?.controls?.close.render():null;function er(d,b){return Ze(d,b)}let Cn=Math.max(0,w.length-2),yn=er(n.get(),Math.max(1,Cn)),ht=F?.controls?.counter?.enabled!==false&&D>1,tr=typeof F?.controls?.counter?.render=="function"?F.controls.counter.render({index:yn,count:D}):null;return jsxs("div",{ref:Ue,"data-rmg-fs-root":"true",onPointerDown:d=>{Pt.current=d.clientX,zt.current=d.clientY;},className:"fs_modal",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",opacity:t?1:0,pointerEvents:t?"auto":"none",zIndex:ie,"--rmg-fs-z":ie,display:"block",touchAction:"none",userSelect:"none",WebkitUserSelect:"none",contain:"layout style size",overflow:"hidden"},children:[bt&&jsx("button",{ref:c,type:"button","aria-label":"Close",onClick:()=>an(),className:[B?.closeBtn,F?.controls?.close?.className??"",t?B.open:""].filter(Boolean).join(" "),style:{...F?.controls?.close?.style},children:Bn??jsx(ti,{})}),ht&&jsx("div",{ref:u,className:[B?.counter,F?.controls?.counter?.className??"",t?B.open:""].filter(Boolean).join(" "),style:{...F?.controls?.counter?.style??{}},children:tr??jsx(ni,{index:yn,count:D})}),e]})};function ui({side:e}){return jsx("svg",{viewBox:"0 0 16 16",width:"100%",height:"100%",focusable:"false","aria-hidden":"true",style:{display:"block"},children:jsx("polygon",{points:"4.586,3.414 9.172,8 4.586,12.586 6,14 12,8 6,2",fill:"white",stroke:"#4f4f4f",strokeWidth:"0.5"})})}var Ds=e=>1-Math.pow(1-e,3);function fi(e,n){return a$3({ownerWindow:n,axis:e})}function js(e){let{trigger:n,isZoomed:t}=e;return (e.controls??e.controlsFade??false)&&n!=="drag"&&t}function Ns(e){let{showFullscreenSlider:n,busy:t,trigger:r,mode:o="animated",hasCrossfadeSlides:a,fromIndex:l,toIndex:c}=e,u=e.controls??e.controlsFade??false,p=e.drag??e.dragFade??false,x=e.wheel??false;return !n||t||!a||l===c?false:r==="wheel"?x:r==="requestSet"&&o==="instant"?false:r==="drag"?p:u}function Ws(e){return a$6(e)}var so=forwardRef(({sub:e$3,children:n,cellCount:t,slideIndex:r,isClick:o,isZoomed:a$3,windowSize:l,show:c$2,handleZoomToggle:u,imageRefs:p,cells:x,isPinching:j$1,isTouchPinching:h$1,showFullscreenSlider:D,isZooming:A,plyrRefs:P,closingModal:v,counterRef:w,leftChevronRef:S,rightChevronRef:K,overlayDivRef:H,direction:W,sliderGap:I=0,sliderDuration:f$3,sliderFriction:V,skipSnaps:_,strictSnaps:$,suppressLoopRef:Y,fadeOpening:re,introFade:be,controlsFade:ce=false,dragFade:F=false,slideFadeDuration:B=120,slideFadeEasing:de="cubic-bezier(.4,0,.22,1)",normalizedItems:Q,crossfadeSlides:Ve,introDuration:_t=300,introEasing:z="cubic-bezier(.4,0,.22,1)",resetAllZoomDom:$e,requestFsCloseRef:ue,introMethod:me,fs:he,chromeStyles:Pt},zt)=>{let ie=W==="rtl",Ue=ie?a.rtl:"",Ie=ie?-1:1,Le=useRef(null),ve=useRef(null),wt=useRef(null),ze=useRef(null),oe=useRef(null),yt=useRef(null),He=useRef(null),Ne=useRef(null),mn=useRef(null),Pe=useRef(null),Nn=useRef(false),qe=useRef(false),M=useRef(0),pn=5,Kt=300,Fe=useRef(0),xn=useRef(false),Ze=useRef(0),Tn=useRef(0),Qn=useRef(null),gt=useRef(null),Wn=useRef([]),Vn=useRef(0),$n=useRef(null),on=useRef(null),sn=useRef(null),et=useRef([]),qt=useRef(null),kt=useRef(null),Ae=useRef(false),bt=useRef(false),an=useRef(false),Bn=useRef(false),er=useRef(false),Cn=useRef(0),yn=useRef(0),Zt=useRef(0),ht=useRef(0),tr=useRef(0),d$2=useRef(0),b$3=useRef(0),U=useRef(null),fe=useRef(0),pe=useRef(0),te=useRef(0),ke=useRef(0),tt=useRef(false),vt=useRef(0),nt=useRef(1),Jt=a$1(I),Ye=useRef(e$3.get()),Ee=useRef("none"),At=useRef(null),Dt=useRef(null),lt=useRef(null),Me=useRef(null),[xe,Xe]=useState(null),[Yt,ln]=useState(null),Ge=useRef(null),xt=useRef(0),Tt=useRef(null),Ut=useRef(null),E=useRef(null),q=useRef(D);q.current=D;let ae=useRef(F);ae.current=F;let ye=useRef(Ve);ye.current=Ve;let cn=useRef(false);function jt(...i){return i.filter(Boolean).join(" ")}function Nt(i){return i?.style??void 0}function Rt(i){return i?.className??""}function X(i,s){return i==="left"?s?"next":"prev":s?"prev":"next"}let Fn=he?.controls?.arrows?.enabled!==false&&t>1,ee=he?.controls?.arrows,un=(i,s)=>{let m=i==="prev"?typeof ee?.renderPrev=="function"?ee.renderPrev():null:typeof ee?.renderNext=="function"?ee.renderNext():null;if(m!=null)return m;if(typeof ee?.render=="function"){let g=ee.render({dir:i});if(g!=null)return g}return jsx(ui,{side:s})};function Ct(i){let s=useRef(i);return useEffect(()=>{s.current=i;},[i]),s}let Ft=Ct(a$3);useEffect(()=>{Ge.current=xe;},[xe]);let{wheelLockMs:rt,lockWheelFor:ct,unlockWheelNow:Ot,markWheelSeen:Qt,isWheelLocked:en}=j();function St(i){return (i?.clientWidth||1)+Jt}function gn(i,s){let m=s||1,g=i*m;Ze.current=i,Tn.current=g,Vn.current=g;let L=d(-g,0);Qn.current=L,$n.current=g$1(-g,0);let G=Array.from({length:m},(Oe,ft)=>-i*ft);Wn.current=G;let Z=ze.current,k=oe.current,ne=yt.current,Re=He.current;if(!Z||!k||!ne||!Re){on.current=null,gt.current=null;return}on.current=c$1(true,G,g,L,Re),gt.current=b$2(g,L,Z,[Z,k,ne,Re]);}let It=useCallback(()=>{let i=ve.current;if(!i||!ze.current||!oe.current||!yt.current||!He.current)return;let s=St(i),m=et.current.length||1;gn(s,m);let g=qt.current?.get()??Fe.current??0,L=-s*g;Ht(L),se(L,0),Pe.current?.resetBlend();},[]);useEffect(()=>{let i=ve.current;if(!i)return;let s=()=>{It();};s();let m=new ResizeObserver(s);return m.observe(i),()=>m.disconnect()},[c$2,It]),useEffect(()=>{let i=Children.toArray(n);if(et.current=[],t>1)for(let s=1;s<i.length-1;s++)et.current.push({cells:[x.current[s]]});else for(let s=0;s<i.length;s++)et.current.push({cells:[x.current[s]]});},[n]);function Wt(i){Ye.current!==i&&(Ye.current=i,e$3.setLocalIndex(i));}function Lt(i,s={}){let{publishVisible:m=true,resetZoom:g=true}=s;Fe.current=i,qt.current?.set(i),m&&Wt(i),mr(i),g&&$e();}let Vt="data-rmg-global-drag",we="rmg-global-drag-style";function De(){if(document.getElementById(we))return;let i=document.createElement("style");i.id=we,i.textContent=`
2
- html[${Vt}] * { cursor: grabbing !important; }
3
- html[${Vt}] { cursor: grabbing !important; }
4
- `,document.head.appendChild(i);}function it(i){let s=document.documentElement;s&&(i?s.setAttribute(Vt,""):s.removeAttribute(Vt));}function On(){let i=useRef(null),s=()=>{i.current||(De(),it(true),i.current=g().add(window,"mouseup",m,true).add(window,"pointerup",m,true).add(window,"touchend",m,{passive:true}).add(window,"touchcancel",m,{passive:true}).add(window,"blur",m,true).add(document,"visibilitychange",()=>{document.hidden&&m();}));},m=()=>{i.current?.clear(),i.current=null,it(false);};return useEffect(()=>m,[]),{start:s,stop:m}}let{start:In,stop:_n}=On(),ut=useRef(false),tn=B,zn=de;function nr(){Tt.current!=null&&(cancelAnimationFrame(Tt.current),Tt.current=null),Ut.current!=null&&(cancelAnimationFrame(Ut.current),Ut.current=null),E.current!=null&&(window.clearTimeout(E.current),E.current=null);}function Et(i,s={}){nr(),ut.current=false;let m=()=>{typeof i!="number"&&(Ge.current=null),ln(null),Xe(g=>g?typeof i=="number"&&g.id!==i?(Ge.current=g,g):(Ge.current=null,null):null);};if(s.sync&&Ge.current){flushSync(m);return}m();}function qn(i){let m=-$t()*i;Pe.current?.stop(),Ne.current?.useDuration(0).useFriction(1),Ht(m),se(m,0),Pe.current?.resetBlend();}function rr(){let i=yt.current?.get()??ze.current?.get()??Zt.current;Pe.current?.stop(),Nn.current=false,Ne.current?.useDuration(0).useFriction(1),Ht(i),Mt(),Pe.current?.resetBlend();}function or(i,s){Ge.current&&Et(void 0,{sync:true}),A.current=true,u(i,s);}function Br(){let i=ve.current;if(!i)return null;let s=i.cloneNode(true);return s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.inset="0",s.style.width="100%",s.style.height="100%",s.style.margin="0",s.style.pointerEvents="none",s.removeAttribute("data-rmg-fs-hide-track-captions"),s.querySelectorAll("[id]").forEach(m=>{m.removeAttribute("id");}),s.outerHTML}function ir(i=dt()){return (ye.current?.length??0)>=i}function sr(i,s,m="animated",g){let L=dt(),G=nn(Fe.current,L),Z=nn(i,L),k=ir(L),ne=g?.enabled??ce,Re=g?.durationMs??tn,Oe=g?.easing??zn,ft=s==="arrow"||s==="requestSet"&&m!=="instant";if(ne&&q.current&&k&&ft&&ut.current&&(nr(),ut.current=false),!Ns({controlsFade:ne,dragFade:F,showFullscreenSlider:q.current,busy:ut.current,trigger:s,mode:m,hasCrossfadeSlides:k,fromIndex:G,toIndex:Z}))return false;rr();let le=js({controlsFade:ne,trigger:s,isZoomed:Ft.current})?Br():null,We=!!le;nr();let Be=++xt.current;ut.current=true,kt.current?.set(G);let Ke={id:Be,fromIndex:G,toIndex:Z,progress:0,delta:0,animate:false,durationMs:Re,easing:Oe};return Ge.current=Ke,ln(le),Xe(Ke),Lt(Z,{resetZoom:!We}),Tt.current=requestAnimationFrame(()=>{Tt.current=null,xt.current===Be&&(qn(Z),We&&$e(),Ut.current=requestAnimationFrame(()=>{Ut.current=null,xt.current===Be&&(Xe(dn=>{if(!dn||dn.id!==Be)return dn;let Rn={...dn,progress:1,delta:0,animate:true};return Ge.current=Rn,Rn}),E.current=window.setTimeout(()=>{Et(Be);},Re+48));}));}),true}function ar(){return !!ae.current&&q.current&&dt()>1&&ir()}function Zn(i){let s=dt(),m=ir(s);if(!m)return false;let g=nn(Fe.current,s),L=e$2({currentIndex:g,delta:i,slideCount:s,wrap:s>1});if(L===g)return Et(),false;let G=a$2(Math.abs(i)/Math.max(1,$t()));return Xe(Z=>{let k=Z&&Z.fromIndex===g&&Z.toIndex===L?Z.id:++xt.current;ut.current=true,kt.current?.set(g);let ne={id:k,fromIndex:g,toIndex:L,progress:G,delta:i,animate:false};return Ge.current=ne,ne}),true}function _r(i){let s=Ge.current;if(!s)return Et(),false;let m=f$2({progress:s.progress,force:i,delta:s.delta});if(ut.current=true,!m){let L=s.id;return Xe(G=>G?.id===L?(()=>{let Z={...G,progress:0,animate:true};return Ge.current=Z,Z})():G),E.current=window.setTimeout(()=>{Et(L);},tn+48),false}let g=s.id;return kt.current?.set(s.fromIndex),Lt(s.toIndex),Xe(L=>L?.id===g?(()=>{let G={...L,progress:1,animate:true};return Ge.current=G,G})():L),E.current=window.setTimeout(()=>{xt.current===g&&(qn(s.toIndex),Et(g));},tn+48),true}function $t(){return Ze.current||St(ve.current)}function dt(){return et.current.length||1}function nn(i,s){let m=Math.max(1,s);return (i%m+m)%m}function lr(i,s){let m=Math.round(i)*Ie;mn.current?.to(m,s);}function cr(i){return 1-a$2(Math.abs(i*.36)/Kt)}function ur(i){let s=a$2(i);Math.abs(nt.current-s)<.001||(nt.current=s,H.current&&(H.current.style.opacity=String(s)));}useEffect(()=>{v&&(Pe.current?.stop(),qe.current=false,Et());},[v]),useEffect(()=>{c$2||Et();},[c$2]),useEffect(()=>()=>{Et();},[]),useEffect(()=>{if(!ve.current||xn.current)return;let i=Math.max(1,et.current.length||t||1),s=nn(r,i);Fe.current=s,Wt(s),mr(s),setTimeout(()=>{if(!ve.current)return;let g=-(Ze.current||St(ve.current))*s;if(Zt.current=g,ht.current=0,ze.current&&oe.current&&yt.current&&He.current)ze.current.set(g),oe.current.set(g),yt.current.set(g),He.current.set(g),se(g,0);else {let L=Math.round(g)*Ie;ve.current.style.transform=`translate3d(${L}px, 0, 0)`;}},100),xn.current=true;},[c$2,et.current]);let dr={current:0};function fr(i=300){let s=++dr.current,m=M.current||0,g=performance.now(),L=G=>{if(s!==dr.current||Ae.current)return;let Z=Math.min(1,(G-g)/i),k=Ds(Z);M.current=m+(0-m)*k;let ne=yt.current.get();if(ht.current=M.current,lr(ne,ht.current),ur(cr(ht.current*2)),Z>=1){ht.current=0,M.current=0,vt.current=0,ur(1),Tr();return}Z<1&&requestAnimationFrame(L);};requestAnimationFrame(L);}function zr(){H.current&&(H.current.style.transition="opacity 0s");}function Tr(){H.current&&(H.current.style.transition="");}useEffect(()=>{if(!c$2){nt.current=1;return}!D||v||(nt.current=1,H.current&&(H.current.style.opacity="1"));},[c$2,D,v]);function bn(i,s={}){let{jump:m=false,direction:g}=s,L=qt.current,G=sn.current,Z=Ne.current;if(!G||!Z||!L)return;let k=dt(),ne=((Fe.current||0)%k+k)%k,Re=((i||0)%k+k)%k;if(k>1&&(ne===0&&Re===k-1||ne===k-1&&Re===0)&&Ft.current&&t>1&&Fe.current===0){let We=p,Be=We[1]?.current?.querySelector("img"),Ke=We[t+1]?.current?.querySelector("img");if(Be&&Ke){let dn=mt=>{if(!mt)return 1;let Gn=(mt.style.transform||"").match(/scale\(([^)]+)\)/);if(!Gn)return 1;let Sn=parseFloat(Gn[1]);return Number.isFinite(Sn)?Sn:1},Rn=mt=>{let rn=mt.style.transform;if(!rn){let Gn=window.getComputedStyle(mt);rn=Gn.transform!=="none"?Gn.transform:"";}return rn||""},Ln=dn(Be),gr=dn(Ke);if(Ln>1.01&&gr<=1.01){let mt=Rn(Be);Ke.style.transition="none",Ke.style.transform=mt,Ke.offsetWidth;}if(gr>1.01&&Ln<=1.01){let mt=Rn(Ke);Be.style.transition="none",Be.style.transform=mt,Be.offsetWidth;}}}let ft=L.clone().set(i).get();m?Z.useDuration(0):Z.useBaseDuration().useBaseFriction();let le=typeof g=="number"?g:0;G.index(ft,le);}function hn(){if(bt.current=false,an.current=false,j$1.current=false,h$1.current=false,Y.current=false,Ft.current&&t>1&&Fe.current===0){let Z=p,k=Z[1]?.current?.querySelector("img"),ne=Z[t+1]?.current?.querySelector("img");if(k&&ne){let Re=le=>{if(!le)return 1;let Be=(le.style.transform||"").match(/scale\(([^)]+)\)/);if(!Be)return 1;let Ke=parseFloat(Be[1]);return Number.isFinite(Ke)?Ke:1},Oe=Re(k),ft=Re(ne);if(Oe>1.01&&ft<=1.01){let le=k.style.transform;if(!le){let We=window.getComputedStyle(k);le=We.transform!=="none"?We.transform:"";}ne.style.transition="none",ne.style.transform=le,ne.offsetWidth;}if(ft>1.01&&Oe<=1.01){let le=ne.style.transform;if(!le){let We=window.getComputedStyle(ne);le=We.transform!=="none"?We.transform:"";}k.style.transition="none",k.style.transform=le,k.offsetWidth;}}}let i=dt(),m=(((Fe.current||0)-1)%i+i)%i;if(sr(m,"arrow")){e$3.emitBasePointerDown?.();return}let g=sn.current,L=Ne.current;if(!g||!L)return;let G=$t();L.useBaseDuration().useBaseFriction(),g.distance(G,true),e$3.emitBasePointerDown?.();}function Yn(){if(bt.current=false,an.current=false,j$1.current=false,h$1.current=false,Y.current=false,Ft.current&&t>1&&Fe.current===0){let Z=p,k=Z[1]?.current?.querySelector("img"),ne=Z[t+1]?.current?.querySelector("img");if(k&&ne){let Re=le=>{if(!le)return 1;let Be=(le.style.transform||"").match(/scale\(([^)]+)\)/);if(!Be)return 1;let Ke=parseFloat(Be[1]);return Number.isFinite(Ke)?Ke:1},Oe=Re(k),ft=Re(ne);if(Oe>1.01&&ft<=1.01){let le=k.style.transform;if(!le){let We=window.getComputedStyle(k);le=We.transform!=="none"?We.transform:"";}ne.style.transition="none",ne.style.transform=le,ne.offsetWidth;}if(ft>1.01&&Oe<=1.01){let le=ne.style.transform;if(!le){let We=window.getComputedStyle(ne);le=We.transform!=="none"?We.transform:"";}k.style.transition="none",k.style.transform=le,k.offsetWidth;}}}let i=dt(),m=(((Fe.current||0)+1)%i+i)%i;if(sr(m,"arrow")){e$3.emitBasePointerDown?.();return}let g=sn.current,L=Ne.current;if(!g||!L)return;let G=$t();L.useBaseDuration().useBaseFriction(),g.distance(-G,true),e$3.emitBasePointerDown?.();}function mr(i){let s=et.current.length||1,m=i+1;m=(m%s+s)%s,m===0&&(m=t),w.current&&(w.current.textContent=`${m} / ${t}`);}function Un(i){let s=ve.current;return s?s.querySelector(`[data-rmg-fs-slide="true"][data-rmg-canonical-idx="${i}"][data-rmg-clone="false"]`):null}function Cr(i){let s=Un(i);if(!s)return null;let m=s.getAttribute("data-index"),g=m!=null?parseInt(m,10):NaN;return Number.isFinite(g)?g:null}function vn(i){let s=Cr(i);if(s==null)return false;let g=(P.current[s]||null)?.plyr??null;if(!g)return false;if(typeof g.playing=="boolean"?g.playing:!g.paused)return g.pause(),true;let G=g.play();return G&&typeof G.catch=="function"&&G.catch(()=>{}),true}function Xn(){let i=Me.current;i&&(i.observer?.disconnect(),i.rafId!=null&&cancelAnimationFrame(i.rafId),Me.current=null);}function Fr(i){let s=Me.current;if(!s||s.canonicalIndex!==i)return;s.deadlineTs=performance.now()+1200;let m=()=>{if(Me.current===s){if(vn(i)){Xn();return}if(performance.now()>=s.deadlineTs){Xn();return}s.rafId=requestAnimationFrame(m);}};s.rafId=requestAnimationFrame(m);}function pr(i){Xn(),bn(i);let s=Un(i),m=Le.current;if(!s||!m)return;let g={canonicalIndex:i,observer:null,rafId:null,deadlineTs:0},L=new IntersectionObserver(G=>{if(Me.current===g){for(let k of G)if(!(!k.isIntersecting||(k.intersectionRatio??0)<.1)){g.observer?.disconnect(),g.observer=null,Fr(i);return}}},{root:m,rootMargin:"0px",threshold:[0,.1]});g.observer=L,Me.current=g,L.observe(s);}function qr(i){return !!i?.closest?.([".plyr__controls",".plyr__control--overlaid",".plyr__menu__container",".plyr__tooltip",".plyr__captions"].join(","))}function Or(i){let s=i.changedTouches?.[0]??i.touches?.[0];return s?{x:s.clientX,y:s.clientY}:{x:i.clientX,y:i.clientY}}function Ir(i){let{x:s,y:m}=Or(i),g=document.elementFromPoint(s,m);if(!g)return null;let L=g.closest('[data-rmg-fs-slide="true"]');if(!L)return null;let G=L.querySelector('[data-rmg-video-snapshot="true"]')??L.querySelector('[data-rmg-plyr="true"]');if(!G)return null;let k=(G.querySelector(".plyr__video-wrapper")??G).getBoundingClientRect(),ne=s>=k.left&&s<=k.right&&m>=k.top&&m<=k.bottom;if(g.closest(".plyr__controls")||!ne)return null;let Re=L.getAttribute("data-index"),Oe=L.getAttribute("data-rmg-canonical-idx"),ft=Re!=null?parseInt(Re,10):NaN,le=Oe!=null?parseInt(Oe,10):NaN;return !Number.isFinite(ft)||!Number.isFinite(le)?null:{renderedIndex:ft,canonicalIndex:le,isClone:L.getAttribute("data-rmg-clone")==="true"}}function y(i,s){if(!i)return {clickedImg:null,renderedIndex:null};let m=i.closest('[data-rmg-fs-slide="true"]'),g=d$1(i),L=g?a$5(g):null;if(!L)return {clickedImg:null,renderedIndex:null};let{x:G,y:Z}=Or(s),k=L.getBoundingClientRect();if(!(G>=k.left&&G<=k.right&&Z>=k.top&&Z<=k.bottom))return {clickedImg:null,renderedIndex:null};let Re=m?.getAttribute("data-index")??L?.dataset.index??null,Oe=Re!=null?parseInt(Re,10):NaN;return {clickedImg:L,renderedIndex:Number.isFinite(Oe)?Oe:null}}useEffect(()=>{let i$1=Le.current,s=ve.current;if(!i$1||!s)return;let m=b();wt.current=m;let g$1=Ze.current||St(s),L=et.current.length||1,G=L-1,Z=nn(r,L),k=b$1(0),ne=b$1(0),Re=b$1(0),Oe=b$1(0);ze.current=k,oe.current=ne,yt.current=Re,He.current=Oe,gn(g$1,L);let le=Wn.current[Z]??0;k.set(le),ne.set(le),Re.set(le),Oe.set(le),Zt.current=le,mn.current=i(s),se(le,0);let We=f(G,Z,true),Be=f(G,Z,true);qt.current=We,kt.current=Be,Fe.current=Z,Wt(Z),mr(Z);function Ke(T){let Je=qt.current,_e=kt.current;if(!Je||!_e)return;let ge=T.distance,Te=T.index!==Je.get();if(He.current.add(ge),ge&&(Ne.current.duration()?Pe.current.start():(Ne.current.seek(),Mt())),Te){_e.set(Je.get()),Je.set(T.index);let Qe=Je.get();Lt(Qe,{publishVisible:!Ne.current.duration()});}}let dn={distance(T,Je){let _e=on.current;if(!_e)return;let ge=_e.byDistance(T,Je);Ke(ge);},index(T,Je){let _e=on.current,ge=qt.current;if(!_e||!ge)return;let Te=ge.clone().set(T).get(),Qe=_e.byIndex(Te,Je);Ke(Qe);}};sn.current=dn;let Rn=c(k,Re,ne,Oe,f$3,V);if(Ne.current=Rn,t===1){let T=s.clientWidth,Je=St(s);Ze.current=Je;let _e=et.current.length||1,ge=Je*_e,Te=-Math.max(0,ge-T),Qe=0;At.current=d(isNaN(Te)?0:Te,Qe),Dt.current=f$1(T),lt.current=e(At.current,ze.current,He.current,Ne.current,Dt.current,f$3);}else At.current=null,lt.current=null,Dt.current=null;let Ln=h(document,window,()=>{t===1&&lt.current?.constrain(qe.current),Ne.current?.seek();let T=Rn.direction()||Math.sign(Oe.get()-k.get())||0;!Y.current&&t>1&&Tn.current>0&&gt.current?.loop(T),Zt.current=k.get();},T=>{let Je=k.get(),_e=ne.get(),ge=Je*T+_e*(1-T);Re.set(ge),Zt.current=ge,ht.current=bt.current?M.current:ht.current,Mt();let Te=t===1&&(lt.current?.reached()??false);Ne.current?.settled()&&!Te&&!qe.current&&(Pe.current?.stop(),Nn.current=false),!Ft.current&&!Nn.current&&je(ge);});Pe.current=Ln,Ln.init();let gr=g(),mt=g(),rn=fi(m,window),Sn=fi({scroll:"y",cross:"x",direction(T){return T},measureSize:T=>T.height},window),Xr=false,br=false,Gr=0,Mo=0,wo=pn;function zi(){let T=Xr?document:i$1;mt.add(T,"touchmove",To,{passive:false}).add(T,"touchend",Kr).add(T,"mousemove",To,{passive:false}).add(T,"mouseup",Kr);}function xo(T){let Je=T.target;if(qr(Je))return;let _e=T.target;if(S.current?.contains(_e)||K.current?.contains(_e)||Ft.current||v)return;let ge=a$4(T,window);if(ge&&T.button!==0)return;ge&&T.cancelable&&T.preventDefault(),ut.current&&Et(void 0,{sync:true}),e$3.emitBasePointerDown?.(),Xr=ge,In(),ct(rt),tt.current=false,h$1.current=false,ke.current=ge?0:T.touches?.length??1,qe.current=true,Ae.current=true,an.current=false,j$1.current=false,h$1.current=false,o.current=true,Ee.current="none",M.current=0,Cn.current=0,yn.current=0,fe.current=Fe.current||0,pe.current=He.current?.get()??ze.current?.get()??0,te.current=0,rn.pointerDown(T),Sn.pointerDown(T),Gr=rn.readPoint(T,"x"),Mo=Sn.readPoint(T,"y"),cn.current=false;let Te=ar();Te?(Et(void 0,{sync:true}),qn(Fe.current)):(Ne.current.useFriction(0).useDuration(0),He.current.set(ze.current.get())),zi(),Te||Pe.current?.start();}function To(T){if(Ft.current)return;if(!a$4(T,window)){let st=T;if(ke.current=st.touches?.length??1,ke.current>=2){tt.current=true,h$1.current=true,o.current=false,Ee.current="none",Pe.current?.stop(),st.cancelable&&st.preventDefault();return}}let _e=rn.readPoint(T,"x"),ge=Sn.readPoint(T,"y"),Te=Math.abs(_e-Gr),Qe=Math.abs(ge-Mo);Ee.current==="none"&&(Te>wo||Qe>wo)&&(Ee.current=Te>=Qe?"x":"y",o.current=false,Ee.current==="y"&&(Et(void 0,{sync:true}),bt.current=true,Cn.current=ge,M.current=0)),zr();let Hn=rn.pointerMove(T).dx*Ie;Sn.pointerMove(T),b$3.current=d$2.current,d$2.current=_e*Ie,tr.current=Hn,U.current=new Date;let Bt=(_e-Gr)*Ie;if(te.current=Bt,!br&&!Xr&&Ee.current==="x"&&(!("cancelable"in T)||!T.cancelable||(br=Te>Qe,!br)))return;if(Ee.current==="y"){let st=ge-Cn.current;yn.current=st,M.current=st*.5,ht.current=M.current;let Lr=yt.current.get();lr(Lr,ht.current),ur(cr(st)),T.preventDefault?.();return}if(ar()){an.current=Math.abs(Bt)>.5,Zn(Bt),T.cancelable&&T.preventDefault?.();return}Ne.current.useFriction(.3).useDuration(.75);let fn=wt.current.direction(Hn);He.current.add(fn),Pe.current?.start(),T.cancelable&&T.preventDefault();}function Kr(T){if(!a$4(T,window)&&(h$1.current||tt.current)){let ge=T;if(ke.current=ge.touches?.length??0,ke.current>0)return;_n(),h$1.current=false,tt.current=false,qe.current=false,Ae.current=false,o.current=false,Ee.current="none",bt.current=false,M.current=0,mt.clear(),br=false,Ot(),ct(300);return}if(Ae.current=false,qe.current=false,mt.clear(),br=false,Ot(),ct(300),o.current){let ge=T.target,Te=Ir(T);if(Te!=null){Ee.current="none",Te.isClone?pr(Te.canonicalIndex):bn(Fe.current);return}if(ge.closest("[class*='plyr__']"))return;let Qe=T,{clickedImg:Hn,renderedIndex:Bt}=y(ge,Qe);if(!Hn){Tr(),er.current=true,Pe.current?.stop(),ue.current?.(),Qe.cancelable&&Qe.preventDefault();return}if(Bt==null)return;let fn=p[Bt];if(!fn)return;let st=Fe.current;if(st===t-1&&Bt===t+1){Y.current=true,R(0);return}st!==Bt&&Bt!==st+2&&or(T,fn),st===t-1&&Bt===t+1&&or(T,fn),ve.current&&ve.current.children.length===1&&or(T,fn),Y.current=true,R(st);return}if(Ee.current==="y"){let ge=Sn.pointerUp(T).fy;if(Math.abs(ge)>.15){Ln?.stop(),mn.current?.lockY(M.current),Bn.current=true,ue.current?.(),M.current=0,bt.current=false;return}let Qe=yn.current,Hn=l.height*.3;if(Math.abs(Qe)>Hn){Ln?.stop(),mn.current?.lockY(M.current),Bn.current=true,ue.current?.(),M.current=0,bt.current=false;return}fr(300),Ee.current="none",bt.current=false;}else {let Fo=function(Ki){let Ji=He.current?.get()??ze.current?.get()??pe.current;return Ws({force:Ki,fallbackDirection:te.current||Ji-pe.current,slideCount:et.current.length||1,currentIndex:Fe.current||0,dragStartIndex:fe.current,wrap:t>1,skipSnaps:_,strictSnaps:$,scrollTarget:qi})};let Te=rn.pointerUp(T).fx;if(ie&&(Te=-Te),ar()){an.current=false,_r(Te),Ee.current="none";return}let Qe=a$4(T,window),Bt={mouse:300,touch:400}[Qe?"mouse":"touch"],fn=Te*Bt,st=on.current,Lr=sn.current,Co=Ne.current;if(!st||!Lr||!Co){Ee.current="none";return}let qi=st,Zi=lt.current?.passed(),Oo=fn;Zi&&(Oo*=.6);let Io=Fo(Oo),Yi=V,Ui=e$1(fn,Io),Xi=f$3,Gi=Yi+Ui/50;Co.useDuration(Xi).useFriction(Gi),Lr.distance(Io,true);}Ee.current="none";}return gr.add(i$1,"dragstart",T=>T.preventDefault(),{passive:false}).add(i$1,"selectstart",T=>T.preventDefault(),{passive:false}).add(i$1,"touchstart",xo).add(i$1,"mousedown",xo,{passive:false}).add(i$1,"touchcancel",()=>{h$1.current=false,tt.current=false,qe.current=false,Ae.current=false,Ee.current="none",bt.current=false,M.current=0,mt.clear(),Ot(),ct(rt);}).add(i$1,"contextmenu",Kr),()=>{gr.clear(),mt.clear(),Pe.current?.destroy(),Pe.current=null;}},[c$2,t]);function R(i,s="animated"){bn(i,{jump:s==="instant"});}useEffect(()=>{let i=Le.current;if(!i)return;function s(m){let g=Qt();if(ut.current){m.cancelable&&m.preventDefault?.();return}if(qe.current){ct(rt),m.cancelable&&m.preventDefault?.();return}if(en(g)){ct(40),m.cancelable&&m.preventDefault?.();return}if(e$3.emitBasePointerDown?.(),a$3)return;let L=ve.current;if(!L)return;let G=L.clientWidth,k=(et.current.length||1)*(Ze.current||St(L))>G;if(!(Math.abs(m.deltaX)>Math.abs(m.deltaY))||!k)return;m.preventDefault();let Oe=(yt.current?.get()??0)-m.deltaX*Ie;He.current?.set(Oe),Ne.current?.useDuration(0).useFriction(1),Pe.current?.start(),Zt.current=Oe,Mt(),je(Oe);}return i.addEventListener("wheel",s,{passive:false}),()=>i.removeEventListener("wheel",s)},[a$3]);function N(i){let s=$t(),m=dt(),g=Math.round(Math.abs(i)/s);return g=(g%m+m)%m,g}function je(i){let s=N(i);if(Fe.current!==s){Fe.current=s,qt.current?.set(s);let m=((s+1)%t+t)%t;m===0&&(m=t),w.current&&(w.current.textContent=`${m} / ${t}`);}Wt(s);}function se(i,s){if(!ve.current)return;let m;if(bt.current)m=Math.round(s);else {let g=vt.current,L=g+(0-g)*.2;m=Math.round(L),vt.current=m;}lr(i,m);}function Mt(){se(Zt.current,ht.current);}function Ht(i){ze.current?.set(i),oe.current?.set(i),yt.current?.set(i),He.current?.set(i),Zt.current=i;}useEffect(()=>{let i=0;function s(){cancelAnimationFrame(i),i=requestAnimationFrame(()=>{Pe.current?.stop(),It();});}s();let m=new ResizeObserver(s);return Le.current&&m.observe(Le.current),window.addEventListener("orientationchange",s,{passive:true}),()=>{cancelAnimationFrame(i),window.removeEventListener("orientationchange",s),m.disconnect();}},[l,It]),useEffect(()=>{let i=e$3.onRequest(s=>{switch(s.type){case "requestSet":{let m=s.mode??"animated";if(m==="instant"){let Z=-$t()*s.index;Ht(Z),se(Z,0),Pe.current?.stop();let k=(s.index%dt()+dt())%dt();Lt(k);break}let L=s.meta?.source==="thumbnail"?s.meta?.transition??"scroll":null;if(L==="scroll"){bn(s.index,{jump:false});break}sr(s.index,"requestSet",m,{enabled:L==="crossfade"?true:void 0,durationMs:s.meta?.crossfade?.durationMs,easing:s.meta?.crossfade?.easing})||bn(s.index,{jump:false});break}case "requestPrev":hn();break;case "requestNext":Yn();break;case "center":It();break}});return ()=>{i();}},[e$3]),useEffect(()=>()=>{let i=Me.current;i?.observer?.disconnect(),i?.rafId!=null&&cancelAnimationFrame(i.rafId),Me.current=null;},[]);function yr(){bn(Fe.current,{jump:false});}useImperativeHandle(zt,()=>({centerSlider:yr}),[yr]);function Zr(i){if(!i)return false;let s=i;return !!(s.type==="video"||s.kind==="video"||s.mediaType==="video"||s.videoSrc||s.src&&typeof s.src=="string"&&s.src.match(/\.(mp4|webm|mov)(\?|#|$)/i)||s.plyrSource||s.sources?.video)}let Yr=Q?.length||t||1,Vi=((r??0)%Yr+Yr)%Yr,$i=Zr(Q?.[Vi]),bo=me==="fade"||be||$i,ho=xe!=null?Ve?.[xe.fromIndex]??null:null,vo=xe!=null?Ve?.[xe.toIndex]??null:null,Ro=!!xe&&(!!ho||!!Yt)&&!!vo,So=a$2(xe?.progress??0),Bi=xe?.durationMs??tn,_i=xe?.easing??zn,Eo=xe?.animate?`opacity ${Bi}ms ${_i}`:"none";function Ur(i){let s=Pt?.open;s&&(S.current?.classList.toggle(s,i),K.current?.classList.toggle(s,i));}return useEffect(()=>{let i=0,s=0;if(!c$2||v){Ur(false);return}return Ur(false),i=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{Ur(true);});}),()=>{cancelAnimationFrame(i),cancelAnimationFrame(s);}},[c$2,v,Pt]),jsxs("div",{ref:Le,"data-rmg-fs-viewport":"true",className:`fs_viewport ${Ue}`,dir:ie?"rtl":void 0,style:{position:"absolute",inset:0,overflow:"hidden"},children:[Fn&&jsxs(Fragment,{children:[jsx("button",{ref:S,type:"button","aria-label":X("left",ie)==="prev"?"Previous":"Next",onClick:()=>{X("left",ie)==="prev"?hn():Yn();},className:jt(Pt?.leftChevron,Rt(ee?.arrow),Rt(ee?.prev)),style:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%) rotate(180deg)",...Nt(ee?.arrow)??{},...Nt(ee?.prev)??{}},children:un(X("left",ie),"left")}),jsx("button",{ref:K,type:"button","aria-label":X("right",ie)==="prev"?"Previous":"Next",onClick:()=>{X("right",ie)==="prev"?hn():Yn();},className:jt(Pt?.rightChevron,Rt(ee?.arrow),Rt(ee?.next)),style:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)",...Nt(ee?.arrow)??{},...Nt(ee?.next)??{}},children:un(X("right",ie),"right")})]}),Ro&&jsxs("div",{"data-rmg-fs-crossfade-layer":"true",style:{position:"absolute",inset:0,zIndex:2,pointerEvents:"none"},children:[jsx("div",{"data-rmg-fs-crossfade-slide":"source",style:{position:"absolute",inset:0,overflow:"hidden",opacity:1-So,transition:Eo,willChange:"opacity"},children:Yt?jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0},dangerouslySetInnerHTML:{__html:Yt}}):ho}),jsx("div",{"data-rmg-fs-crossfade-slide":"target",style:{position:"absolute",inset:0,opacity:So,transition:Eo,willChange:"opacity"},children:vo})]},xe.id),jsx("div",{ref:ve,"data-rmg-fs-track":"true","data-rmg-fs-hide-track-captions":Ro?"true":void 0,className:`fullscreen_slider ${Ue}`,style:{position:"absolute",inset:0,overflow:"visible",cursor:"grab",userSelect:"none",WebkitUserSelect:"none",willChange:"opacity, transform",backfaceVisibility:"hidden",transition:bo?`opacity ${_t}ms ${z}`:void 0,opacity:D?bo&&re?0:1:0},children:n})]})});so.displayName="FullscreenSlider";var $s='[data-rmg-overlay-height-active="true"]',mi="data-rmg-overlay-height-frozen",Bs=.5,pi=1e3;function _s(e){return Math.round((e+Number.EPSILON)*pi)/pi}function zs(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function qs(){let[e,n]=C.useState(zs);return C.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>n(t.matches);return r(),typeof t.addEventListener=="function"?(t.addEventListener("change",r),()=>t.removeEventListener("change",r)):(t.addListener(r),()=>t.removeListener(r))},[]),e}function wr({children:e,activeKey:n,activeReady:t,durationMs:r,easing:o}){let a=C.useRef(null),l=C.useRef(null),c=C.useRef(t),[u,p]=C.useState(null),j=!qs()&&r>0;c.current=t;let h=C.useCallback(()=>{let v=a.current;return v?v.querySelector($s)??(v.lastElementChild instanceof HTMLElement?v.lastElementChild:null):null},[]),D=C.useCallback(()=>{let v=a.current,w=h();if(!v||!w)return null;let S=Array.from(v.children).filter(f=>f instanceof HTMLElement),K=S.map(f=>({layer:f,bottom:f.style.bottom,height:f.style.height,inset:f.style.inset,left:f.style.left,maxHeight:f.style.maxHeight,minHeight:f.style.minHeight,position:f.style.position,right:f.style.right,top:f.style.top,transform:f.style.transform,visibility:f.style.visibility,width:f.style.width,zIndex:f.style.zIndex})),H=v.style.height,W=v.style.overflow,I=v.style.transition;v.style.transition="none",v.style.height="auto",v.style.overflow="visible";for(let f of S){if(f===w){f.style.height="auto",f.style.minHeight="0",f.style.maxHeight="none";continue}f.style.position="absolute",f.style.inset="0 0 auto 0",f.style.visibility="hidden";}try{let f=w.getBoundingClientRect();return _s(Math.max(0,f.height,w.scrollHeight))}finally{for(let f of K)f.layer.style.bottom=f.bottom,f.layer.style.height=f.height,f.layer.style.inset=f.inset,f.layer.style.left=f.left,f.layer.style.maxHeight=f.maxHeight,f.layer.style.minHeight=f.minHeight,f.layer.style.position=f.position,f.layer.style.right=f.right,f.layer.style.top=f.top,f.layer.style.transform=f.transform,f.layer.style.visibility=f.visibility,f.layer.style.width=f.width,f.layer.style.zIndex=f.zIndex;v.style.height=H,v.style.overflow=W,v.style.transition=I;}},[h]),A=C.useCallback(()=>{if(!c.current)return;let v=a.current,w=D();if(!v||w==null)return;let S=l.current;S!=null&&Math.abs(S-w)<=Bs||(S!=null&&(v.style.height=`${S}px`,v.offsetHeight),l.current=w,p(w));},[D]);C.useLayoutEffect(()=>{let v=a.current;if(!v)return;let w=Array.from(v.children).filter(S=>S instanceof HTMLElement);for(let S of w)S.getAttribute(mi)==="true"&&(S.removeAttribute(mi),S.style.inset="",S.style.bottom="",S.style.left="",S.style.right="",S.style.top="",S.style.transform="",S.style.width="",S.style.height="");}),C.useLayoutEffect(()=>{t&&A();},[n,t,A]),C.useEffect(()=>{if(!t)return;let v=h();if(!v||typeof ResizeObserver>"u")return;let w=0,S=()=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{w=0,A();});},K=new ResizeObserver(S);return K.observe(v),()=>{w&&cancelAnimationFrame(w),K.disconnect();}},[n,t,h,A]);let P=j&&u!=null?`height ${r}ms ${o}`:void 0;return jsx("div",{ref:a,"data-rmg-overlay-height-stack":"true",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",minWidth:0,position:"relative",height:u??void 0,overflow:"visible",transition:P,willChange:P?"height":void 0},children:e})}var yi="--rmg-entry-overlay-opacity",Ys=300,Us="cubic-bezier(.4,0,.22,1)",Xs="linear";function ao(e,n){return n?(e%n+n)%n:e}function Gs(e){return e==="top"?"linear-gradient(to bottom, rgba(0,0,0,0.75), transparent)":e==="left"?"linear-gradient(to right, rgba(0,0,0,0.75), transparent)":e==="right"?"linear-gradient(to left, rgba(0,0,0,0.75), transparent)":"linear-gradient(to top, rgba(0,0,0,0.75), transparent)"}function Ks(e){let{placement:n,overlay:t,viewportWidth:r,viewportHeight:o}=e,a=f$3(r),l=g$2(o),c=a$8(t?.width,280,a,a),u=t?.height==null?void 0:a$8(t.height,200,a,l);return n==="top"?{top:0,left:0,right:0,...u!=null?{height:u}:{}}:n==="left"?{top:0,bottom:0,left:0,width:c}:n==="right"?{top:0,bottom:0,right:0,width:c}:{bottom:0,left:0,right:0,...u!=null?{height:u}:{}}}function gi(e){let{entriesObject:n,wrapperBaseStyle:t,viewportWidth:r,viewportHeight:o,placement:a,fadeOutMs:l,fadeOutEasing:c,opacity:u}=e;return {position:"fixed",boxSizing:"border-box",zIndex:"calc(var(--rmg-fs-z, 9999) + 1)",pointerEvents:"none",...Ks({placement:a,overlay:n.overlay,viewportWidth:r,viewportHeight:o}),...t??{},opacity:u,transition:l>0?`opacity ${l}ms ${c}`:void 0,willChange:l>0?"opacity":void 0}}function Js(e){let{entriesObject:n,placement:t,overlayZoomMotion:r}=e;return {boxSizing:"border-box",width:"100%",height:"100%",padding:"1.25rem 1.5rem",background:Gs(t),color:"#fff",fontSize:"0.9rem",...n.overlay?.style??{},...r.contentStyle}}function Qs(e){let{opacity:n,fadeOutMs:t,active:a}=e;return {...{gridArea:"1 / 1",minWidth:0,position:"relative",zIndex:a?1:2},opacity:n,transition:t>0?`opacity ${t}ms ${Xs}`:void 0,willChange:t>0?"opacity":void 0,pointerEvents:"none"}}function bi(e){return e?.overlay?.overlayCrossfadeTarget??"overlay"}function ea(e,n=Ys){let t=e?.overlay?.overlayCrossfadeDurationMs;return typeof t=="number"&&Number.isFinite(t)?Math.max(0,t):n}function ta(e){let n=e?.overlay?.overlayCrossfadeEasing;return typeof n=="string"&&n.trim()?n:Us}function na(e){let{prevEntryIndex:n,nextEntryIndex:t,crossfadeTarget:r}=e;return n!==t||r==="content"}function ra(e){let{layers:n,entriesObject:t,entryMap:r,wrapperBaseStyle:o,overlayZoomMotion:a,viewportWidth:l,viewportHeight:c,fadeOutMs:u,fadeOutEasing:p,resolveFsCaptionPlacement:x}=e,j=e.overlayOpacity,h=j==null?`var(${yi}, 1)`:String(j),D=t.render?.overlay,A=t.items;if(typeof D!="function"||!A?.length||!r?.length||!n.length)return null;let P=x(t.overlay?.placement,t.overlay?.breakpoint,l),v=Js({entriesObject:t,placement:P,overlayZoomMotion:a}),w=n.flatMap(V=>{let _=r[V.index];if(!_)return [];let $=A[_.entryIndex];if(!$)return [];let Y=Array.isArray($.media)?$.media[_.mediaIndex]??null:null;return [{layer:V,node:D({entry:$,entryIndex:_.entryIndex,media:Y,mediaIndex:_.mediaIndex,link:_,opacity:V.opacity,fsIndex:V.index,style:v,containerProps:{className:t.overlay?.className,style:v}})}]});if(!w.length)return null;let K=bi(t)==="content",H=w.length-1,W=w[H]?.layer,I=W?.key??"active",f=(W?.opacity??1)>0;return K?jsx("div",{"data-rmg-fs-entry-overlay":"true",className:t.overlay?.className,style:gi({entriesObject:t,wrapperBaseStyle:o,viewportWidth:l,viewportHeight:c,placement:P,fadeOutMs:u,fadeOutEasing:p,opacity:h}),children:jsx("div",{"data-rmg-fs-entry-overlay-surface":"true",style:v,children:jsx(wr,{activeKey:I,activeReady:f,durationMs:u,easing:p,children:w.map(({layer:V,node:_},$)=>jsx("div",{"data-rmg-fs-entry-overlay-content":"true","data-rmg-overlay-height-layer-key":String(V.key),"data-rmg-overlay-height-active":$===H?"true":void 0,style:Qs({opacity:V.opacity,fadeOutMs:u,active:$===H}),"aria-hidden":$===H?void 0:true,children:_},V.key))})})}):jsx(Fragment,{children:w.map(({layer:V,node:_},$)=>jsx("div",{"data-rmg-fs-entry-overlay":"true",className:t.overlay?.className,style:gi({entriesObject:t,wrapperBaseStyle:o,viewportWidth:l,viewportHeight:c,placement:P,fadeOutMs:u,fadeOutEasing:p,opacity:j==null?`calc(var(${yi}, 1) * ${V.opacity})`:String(j*V.opacity)}),"aria-hidden":$===H?void 0:true,children:jsx("div",{"data-rmg-fs-entry-overlay-surface":"true",style:v,children:_})},V.key))})}function hi(e){let{enabled:n,fsSub:t,entriesObject:r,entryMapRef:o,syncFullscreenSourceFromIndex:a,resetAllZoomDom:l,wrapperBaseStyle:c,fadeOutMs:u,closing:p,overlayZoomMotion:x,viewportWidth:j,viewportHeight:h,resolveFsCaptionPlacement:D}=e,A=bi(r),P=ea(r,u),v=ta(r),[w,S]=C.useState(()=>[{key:1,index:ao(t.get(),o.current?.length??0),opacity:1}]),[K,H]=C.useState(0),W=C.useRef(w),I=C.useRef(ao(t.get(),o.current?.length??0)),f=C.useRef(1),V=C.useRef(a),_=C.useRef(l),$=C.useRef({raf1:0,raf2:0,timeout:null}),Y=C.useRef({raf1:0,raf2:0,timeout:null}),re=C.useCallback(()=>{let z=$.current;z.raf1&&cancelAnimationFrame(z.raf1),z.raf2&&cancelAnimationFrame(z.raf2),z.timeout!=null&&window.clearTimeout(z.timeout),$.current={raf1:0,raf2:0,timeout:null};},[]),be=C.useCallback(()=>{let z=Y.current;z.raf1&&cancelAnimationFrame(z.raf1),z.raf2&&cancelAnimationFrame(z.raf2),z.timeout!=null&&window.clearTimeout(z.timeout),Y.current={raf1:0,raf2:0,timeout:null};},[]),ce=C.useCallback(z=>{W.current=z,S(z);},[]),F=C.useCallback(z=>ao(z,o.current?.length??0),[o]);C.useEffect(()=>{V.current=a,_.current=l;},[l,a]);let B=C.useCallback((z,$e=1)=>({key:++f.current,index:z,opacity:$e}),[]),de=C.useCallback(z=>W.current.reduce((me,he)=>!me||he.opacity>me.opacity?he:me,null)??B(z),[B]),Q=C.useCallback(z=>o.current?.[z]?.entryIndex??-1,[o]),Ve=C.useCallback(z=>{let $e=W.current[W.current.length-1];ce([$e?{...$e,index:z,opacity:1}:B(z)]);},[B,ce]),_t=C.useCallback(z=>{if(p)return;re();let $e=de(I.current),ue=B(z,0);if(ce([{...$e,opacity:1},ue]),V.current(z),_.current(),P<=0){ce([{...ue,opacity:1}]);return}$.current.raf1=requestAnimationFrame(()=>{$.current.raf1=0,$.current.raf2=requestAnimationFrame(()=>{$.current.raf2=0,ce([{...$e,opacity:0},{...ue,opacity:1}]),$.current.timeout=window.setTimeout(()=>{ce([{...ue,opacity:1}]),$.current={raf1:0,raf2:0,timeout:null};},P);});});},[B,re,p,ce,P,de]);return C.useEffect(()=>{if(!n){re(),be(),H(0),ce([]);return}if(p){re(),be(),H(0),P<=0?ce([]):Y.current.timeout=window.setTimeout(()=>{ce([]),Y.current={raf1:0,raf2:0,timeout:null};},P);return}be();let z=F(t.get());I.current=z,Ve(z),V.current(z),H(0),Y.current.raf1=requestAnimationFrame(()=>{Y.current.raf1=0,Y.current.raf2=requestAnimationFrame(()=>{Y.current.raf2=0,H(1);});});let $e=t.onEvent(ue=>{if(ue.type!=="internalIndex")return;let me=F(ue.index);if(me===I.current&&W.current.length)return;let he=I.current,Pt=Q(he),zt=Q(me);I.current=me,na({prevEntryIndex:Pt,nextEntryIndex:zt,crossfadeTarget:A})?_t(me):(re(),Ve(me),V.current(me),_.current());});return ()=>{re(),be(),$e();}},[re,be,p,ce,A,n,_t,P,t,Q,F,Ve]),C.useEffect(()=>()=>{re(),be();},[re,be]),w.length?jsx(Fragment,{children:ra({layers:w,entriesObject:r,entryMap:o.current,wrapperBaseStyle:c,overlayZoomMotion:x,viewportWidth:j,viewportHeight:h,fadeOutMs:P,fadeOutEasing:v,overlayOpacity:K,resolveFsCaptionPlacement:D})}):null}function ia(e,n){return e?.type==="video"||e?.kind==="video"||e?.mediaType==="video"||!!e?.videoSrc||!!e?.sources?.video||!!e?.plyrSource||!!n?.dataset?.rmgVideo}function sa(e){e.isConnected||document.body.appendChild(e);}function aa(e){let{requested:n,item:t,fs:r,isVideoSlide:o}=e;return r.effects?.introFade||o||n==="fade"||t?.kind!=="image"&&t?.type!=="image"?"fade":"scale"}function la(e,n,t,r){let o=document.createElement("div");return o.className=e.fullscreenOverlay,n.current=o,o.style.opacity="0",o.style.pointerEvents="none",o.style.transition="none",o.style.transition=`opacity ${t}ms ${r}`,o}function Vr(e,n){return (e??document).querySelector(n)}function Ri(e){let n=Vr(e,".fullscreen_slider");n&&n.style.removeProperty("transition");}function ca(e,n,t){let r=Vr(t,".fullscreen_slider");r&&(r.style.transition="none",r.style.opacity="0",r.offsetWidth,r.style.transition=`opacity ${e}ms ${n}`);}function ua(e){let{vw:n,vh:t,fs:r,viewportOverlay:o,fsThumbContainerRef:a,fullscreenThumbnailPosition:l,resolveFsCaptionPlacement:c}=e,u=f$3(n),p=g$2(t),x=c(r.caption?.placement,r.caption?.breakpoint,u),j=280,h=200,D=a$8(r.caption?.width,j,u,u),A=a$8(r.caption?.height,h,u,p),P=r.caption?.width==null?void 0:a$8(r.caption.width,j,u,u),v=r.caption?.height==null?void 0:a$8(r.caption.height,h,u,p),w=c(o?.placement,o?.breakpoint,u),S=o?.width==null?void 0:a$8(o.width,j,u,u),K=o?.height==null?void 0:a$8(o.height,h,u,p),H=0,W=u,I=0,f=p;r.caption?.layout!=="overlay"?x==="right"?W=Math.max(0,u-D):x==="left"?H=Math.min(u,D):x==="top"?I=Math.min(p,A):x==="bottom"&&(f=Math.max(0,p-A)):(P!=null||v!=null)&&(P!=null&&(x==="right"?W=Math.max(0,u-P):x==="left"&&(H=Math.min(u,P))),v!=null&&(x==="top"?I=Math.min(p,v):x==="bottom"&&(f=Math.max(0,p-v)))),S!=null&&(w==="right"?W=Math.max(0,W-S):w==="left"&&(H=Math.min(W,H+S))),K!=null&&(w==="top"?I=Math.min(f,I+K):w==="bottom"&&(f=Math.max(I,f-K)));let V=l??null;if(a?.current&&V){let $=a.current.offsetHeight,Y=a.current.offsetWidth;V==="top"?I+=$:V==="bottom"?f-=$:V==="left"?H+=Y:V==="right"&&(W-=Y);}return {rect:new DOMRect(H,I,Math.max(1,W-H),Math.max(1,f-I)),effectivePlacement:x,thumbPos:V,sideWidth:D,topBottomHeight:A}}function da(e){let{overlay:n,styles:t,fs:r,overlayCaptionRef:o,overlayCaptionRootRef:a,normalizedItems:l,index:c,introZ:u}=e;if(typeof r.caption?.render=="function"&&r.caption?.layout!=="overlay")try{let p=document.createElement("div");p.className=t.fsOverlayCaption,o.current=p,Object.assign(p.style,{position:"fixed",left:"0",top:"0",width:"0px",height:"0px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"left",padding:"0.75rem 1rem",color:"#fff",fontSize:"0.875rem",boxSizing:"border-box",pointerEvents:"none",opacity:"0",zIndex:String(u+1)}),r.caption?.className&&r.caption.className.split(" ").map(h=>h.trim()).filter(Boolean).forEach(h=>p.classList.add(h)),r.caption?.style&&Object.assign(p.style,r.caption.style),n.appendChild(p);let x=createRoot(p);a.current=x;let j=l[c];x.render(jsx("div",{"data-rmg-fs-caption-content":"true",style:{width:"100%"},children:r.caption.render({item:j,index:c,isZoomed:!1})}));}catch(p){console.error("[RMG] Failed to render overlay caption",p);}}function fa(e){let{overlayCaption:n,captionState:t}=e,{rect:r,computedStyle:o}=t;n.style.left=`${r.left}px`,n.style.top=`${r.top}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`,n.style.opacity="1",n.style.display=o.display,n.style.alignItems=o.alignItems,n.style.justifyContent=o.justifyContent,n.style.padding=o.padding,n.style.textAlign=o.textAlign,n.style.boxSizing=o.boxSizing;}function Ti(e,n){e.current&&(e.current.unmount(),e.current=null),n.current&&(n.current.remove(),n.current=null);}function Ci(e,n){return e==="contain"?"contain":e==="cover"?"cover":n}function Si(e){let{fit:n,natW:t,natH:r,rect:o,objPos:a}=e;return n==="cover"?b$3(t,r,o,a):c$3(t,r,o,a)}function ma(e,n,t){return e<=t.width&&n<=t.height?{cx:t.x+t.width/2,cy:t.y+t.height/2,scale:1}:c$3(e,n,t,{x:.5,y:.5})}var pa=1024;function ya(e){let{sourceNatW:n,sourceNatH:t,startRect:r,contentRect:o,targetImageState:a}=e,l=Math.max(1,a?.natW??n),c=Math.max(1,a?.natH??t),u=Math.max(l,c),p=a?.rect??o,x=Math.max(r.width,r.height,p.width,p.height,1),h=Math.max(1,Math.min(x,pa))/u;return {proxyRasterW:Math.max(1,Math.round(l*h)),proxyRasterH:Math.max(1,Math.round(c*h))}}function ga(e,n){let t=Fi(e,n);if(!t)return null;let r=t.getBoundingClientRect(),o=t.naturalWidth||0,a=t.naturalHeight||0;if(r.width<=0||r.height<=0||o<=0||a<=0)return null;let l=getComputedStyle(t),c=Ci(l?.objectFit,"contain"),u=a$9(l?.objectPosition??null)??{x:.5,y:.5};return {fit:c,objPos:u,natW:o,natH:a,rect:r}}function Fi(e,n){let r=Vr(n,`[data-rmg-fs-slide="true"][data-rmg-canonical-idx="${e}"][data-rmg-clone="false"]`)?.querySelector('[data-rmg-fs-media="true"]')??null;return c$4(r)}function Ei(e,n){let t=Vr(n,`[data-rmg-fs-slide="true"][data-rmg-canonical-idx="${e}"][data-rmg-clone="false"]`);if(!t)return null;let r=t.querySelector('[data-rmg-fs-caption="true"]')??t.querySelector('[data-rmg-fs-caption-content="true"]')?.parentElement??null;if(!r)return null;let o=r.getBoundingClientRect();return o.width<=0||o.height<=0?null:{rect:o,computedStyle:getComputedStyle(r)}}function ba(e,n,t){let r=Ei(e,t);return r?Promise.resolve(r):new Promise(o=>{let a=performance.now(),l=0,c=false,u=x=>{c||(c=true,l&&cancelAnimationFrame(l),o(x));},p=()=>{let x=Ei(e,t);if(x){u(x);return}if(performance.now()-a>=n){u(null);return}l=requestAnimationFrame(p);};l=requestAnimationFrame(p);})}function Oi(){return new Promise(e=>requestAnimationFrame(()=>e()))}async function fo(e){let n=Math.max(1,Math.round(e));for(let t=0;t<n;t+=1)await Oi();}function ha(e){if(!e.complete||e.naturalWidth<=0||e.naturalHeight<=0)return false;let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return false;let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return false;let r=Number.parseFloat(t.opacity||"1");return !Number.isFinite(r)||r>=.98}async function va(e){let{index:n,fullscreenRoot:t,maxWaitMs:r}=e,o=performance.now(),a=null,l=null,c=null;for(;performance.now()-o<r;){let u=Fi(n,t);if(u&&ha(u)){if(typeof u.decode=="function"&&c!==u){a!==u&&(a=u,l=u.decode().then(()=>"resolved",()=>"rejected"));let p=Math.max(0,r-(performance.now()-o));if(p>0&&l){if(await Promise.race([new Promise(j=>window.setTimeout(()=>j("timeout"),p)),l])==="timeout")break;c=u;}}await fo(2);return}await Oi();}await fo(2);}function lo(e,n,t){let r=e.top,o=e.left,a=n-(e.left+e.width),l=t-(e.top+e.height);return `inset(${r}px ${a}px ${l}px ${o}px)`}function Mi(e){if(!(e instanceof HTMLElement))return false;let n=getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden"||Number.parseFloat(n.opacity||"1")<=0||n.position!=="sticky"&&n.position!=="fixed")return false;let t=e.getBoundingClientRect();return !(t.width<=0||t.height<=0||t.bottom<=0||t.top>=window.innerHeight||t.top>Math.min(window.innerHeight*.25,120))}function wi(e,n){return Math.min(e.right,n.right)>Math.max(e.left,n.left)}function Ra(e,n){let t=e?.trim(),o=t?Array.from(document.querySelectorAll(t)):[".rmg-intro-sticky-nav",'[data-rmg-intro-sticky-nav="true"]','header[role="banner"]',"header"].flatMap(c=>Array.from(document.querySelectorAll(c))),a=null,l=-1/0;for(let c of o){if(!Mi(c))continue;let u=c.getBoundingClientRect();n&&!wi(u,n)||u.bottom>l&&(l=u.bottom,a=c);}if(a||t)return a;for(let c of Array.from(document.body.querySelectorAll("*"))){if(!Mi(c))continue;let u=c.getBoundingClientRect();n&&!wi(u,n)||u.bottom>l&&(l=u.bottom,a=c);}return a}function Sa(e,n){let t=Math.max(window.innerHeight||0,document.documentElement?.clientHeight||0),r=Math.min(Math.max(n,0),t),o=e.left,a=e.right,l=Math.max(e.top,r),c=e.bottom;return c<=l||a<=o?null:new DOMRect(o,l,a-o,c-l)}function co(e,n){let t=document.createElement("div");return Object.assign(t.style,{position:"fixed",inset:"0",clipPath:e,willChange:"clip-path",transition:"none",pointerEvents:"none",zIndex:String(n)}),t}function Ea(e){return e?[e.overflow,e.overflowX,e.overflowY].some(n=>{let t=n?.trim().toLowerCase()??"";return t==="hidden"||t==="clip"}):false}function Ma(e,n=2){let t=[],r=e.parentElement;for(;r&&r!==document.body&&r!==document.documentElement&&t.length<n;){if(Ea(getComputedStyle(r))){let o=r.getBoundingClientRect();o.width>0&&o.height>0&&t.push(o);}r=r.parentElement;}return t}function xi(e){let{overlay:n,fullscreenRoot:t,styles:r,overlayCaptionRef:o,overlayCaptionRootRef:a,setShowFullscreenSlider:l,setFsFadeOpening:c,durationMs:u,easing:p}=e;sa(n),n.style.transition="none",n.offsetWidth,n.style.transition=`opacity ${u}ms ${p}`,requestAnimationFrame(()=>{n.style.opacity="1",n.style.pointerEvents="none",o.current?.classList.add(r.open);}),queueMicrotask(()=>{flushSync(()=>{c(true),l(true);}),ca(u,p,t),requestAnimationFrame(()=>{flushSync(()=>c(false));});}),window.setTimeout(()=>{Ti(a,o);},u+30);}function wa(e){let{overlayCaption:n,fs:t,contentRect:r,vw:o,vh:a}=e,l=f$3(o),c=g$2(a),u=a$8(t.caption?.width,280,l,l),p=a$8(t.caption?.height,200,l,c),x=t.caption?.placement==null?"bottom":typeof t.caption.placement=="string"?t.caption.placement:"bottom";x==="right"?(n.style.left=`${r.right}px`,n.style.top=`${r.top}px`,n.style.width=`${u}px`,n.style.height=`${r.height}px`):x==="left"?(n.style.left=`${r.left-u}px`,n.style.top=`${r.top}px`,n.style.width=`${u}px`,n.style.height=`${r.height}px`):x==="top"?(n.style.left=`${r.left}px`,n.style.top=`${r.top-p}px`,n.style.width=`${r.width}px`,n.style.height=`${p}px`):(n.style.left=`${r.left}px`,n.style.top=`${r.bottom}px`,n.style.width=`${r.width}px`,n.style.height=`${p}px`),n.style.opacity="1";}function xa(e){let{originalImage:n,index:t,overlay:r,fullscreenRoot:o,styles:a,fs:l,contentRect:c,vw:u,vh:p,introZ:x,durationMs:j,easing:h,duplicateImgRef:D,overlayCaptionRef:A,overlayCaptionRootRef:P,setShowFullscreenSlider:v}=e;Ri(o);let w=n.getBoundingClientRect(),S=Math.max(1,n.naturalWidth||0),K=Math.max(1,n.naturalHeight||0),H=Ci(getComputedStyle(n).objectFit||"cover","cover"),W=getComputedStyle(n),I=a$9(W?.objectPosition??null),f=H==="contain"?d$4(S,K,w,"contain",I):w,_=Ra(l.effects?.introStickyNavSelector,w)?.getBoundingClientRect(),Y=(_!=null?Sa(f,_.bottom):null)??f,re=co(lo(Y,u,p),x),be=Ma(n,2),ce=be[0]??null,F=be[1]??null,B=ce?co(lo(ce,u,p),x):null,de=F?co(lo(F,u,p),x):null,Q=document.createElement("img");Q.src=n.currentSrc||n.src,Q.decoding="sync",Q.loading="eager",Object.assign(Q.style,{position:"fixed",left:"0",top:"0",width:`${S}px`,height:`${K}px`,maxWidth:"none",maxHeight:"none",transformOrigin:"50% 50%",willChange:"transform",transition:"none",opacity:"0",display:"block",zIndex:String(x),backfaceVisibility:"hidden"}),D.current=Q,re.appendChild(Q),B?(B.appendChild(re),de&&de.appendChild(B)):de&&de.appendChild(re);let Ve=de??B??re,_t=document.createDocumentFragment();_t.append(r,Ve),document.body.appendChild(_t);let z=(ie,Ue,Ie)=>{Q.style.transform=`translate3d(${ie.cx}px, ${ie.cy}px, 0) translate3d(${-Ue/2}px, ${-Ie/2}px, 0) scale(${ie.scale})`;},$e=ie=>{let Ue=H==="contain"?f:w,{proxyRasterW:Ie,proxyRasterH:Le}=ya({sourceNatW:S,sourceNatH:K,startRect:Ue,contentRect:c,targetImageState:ie});Q.style.width=`${Ie}px`,Q.style.height=`${Le}px`;let ve=Si({fit:H,natW:Ie,natH:Le,rect:Ue,objPos:I??{x:.5,y:.5}}),wt=ie?Si({fit:ie.fit,natW:Ie,natH:Le,rect:ie.rect,objPos:ie.objPos}):ma(Ie,Le,c);return {startT:ve,endT:wt,proxyRasterW:Ie,proxyRasterH:Le}};function ue(ie){let{startT:Ue,endT:Ie,proxyRasterW:Le,proxyRasterH:ve}=$e(ie);z(Ue,Le,ve),Q.style.opacity="1",r.style.opacity="0",r.style.pointerEvents="none",Q.offsetWidth,re.offsetWidth,B?.offsetWidth,de?.offsetWidth,r.offsetWidth,requestAnimationFrame(()=>{re.style.transition=`clip-path ${j}ms ${h}`,B&&(B.style.transition=`clip-path ${j}ms ${h}`),de&&(de.style.transition=`clip-path ${j}ms ${h}`),Q.style.transition=`transform ${j}ms ${h}`,r.style.transition=`opacity ${j}ms ${h}`,requestAnimationFrame(()=>{re.style.clipPath="inset(0px 0px 0px 0px)",B&&(B.style.clipPath="inset(0px 0px 0px 0px)"),de&&(de.style.clipPath="inset(0px 0px 0px 0px)"),z(Ie,Le,ve),r.style.opacity="1",r.style.pointerEvents="none";});});}let me=false,he=ie=>{me||(me=true,ue(ie));},Pt=ba(t,120,o);he(ga(t,o)),Pt.then(ie=>{requestAnimationFrame(()=>{let Ue=A.current;Ue&&(ie?fa({overlayCaption:Ue,captionState:ie}):wa({overlayCaption:Ue,fs:l,contentRect:c,vw:u,vh:p}),Ue.classList.add(a.open));});});let zt=async ie=>{ie.propertyName==="transform"&&(Q.removeEventListener("transitionend",zt),await fo(2),Ri(o),flushSync(()=>v(true)),await va({index:t,fullscreenRoot:o,maxWaitMs:Math.max(300,Math.min(1e3,j+500))}),requestAnimationFrame(()=>{Ti(P,A),Ve.remove(),Q.remove(),D.current=null;}));};Q.addEventListener("transitionend",zt,{once:true});}function Ii(e){let{originalImage:n,method:t,index:r,normalizedItems:o,styles:a,fs:l,overlayDivRef:c,duplicateImgRef:u,overlayCaptionRef:p,overlayCaptionRootRef:x,fsThumbContainerRef:j,fullscreenThumbnailPosition:h,setShowFullscreenSlider:D,setFsFadeOpening:A,addShield:P,resolveFsCaptionPlacement:v,viewportOverlay:w,closestSelector:S,baseZ:K,fullscreenRootRef:H}=e,W=o[r],f=(K??9999)-1,V=H?.current??null,_=l.effects?.introDuration??300,$=l.effects?.introEasing??"cubic-bezier(.4,0,.22,1)";P?.(400);let Y=a$7(),re=window.innerHeight,be=false;if(n){let de=n.closest(S??(S===void 0?".rmg__grid-item, .rmg__masonry-item, .rmg__slide":""))||n.parentElement||n;be=ia(W,de);}else be=W?.type==="video"||W?.kind==="video"||W?.mediaType==="video";let ce=aa({requested:t,item:W,fs:l,isVideoSlide:be}),F=la(a,c,_,$),{rect:B}=ua({vw:Y,vh:re,fs:l,viewportOverlay:w,fsThumbContainerRef:j,fullscreenThumbnailPosition:h,resolveFsCaptionPlacement:v});if(da({overlay:F,styles:a,fs:l,overlayCaptionRef:p,overlayCaptionRootRef:x,normalizedItems:o,index:r,introZ:f}),ce==="fade"){xi({overlay:F,fullscreenRoot:V,styles:a,overlayCaptionRef:p,overlayCaptionRootRef:x,setShowFullscreenSlider:D,setFsFadeOpening:A,durationMs:_,easing:$});return}if(!n){xi({overlay:F,fullscreenRoot:V,styles:a,overlayCaptionRef:p,overlayCaptionRootRef:x,setShowFullscreenSlider:D,setFsFadeOpening:A,durationMs:_,easing:$});return}xa({originalImage:n,index:r,overlay:F,fullscreenRoot:V,styles:a,fs:l,contentRect:B,vw:Y,vh:re,introZ:f,durationMs:_,easing:$,duplicateImgRef:u,overlayCaptionRef:p,overlayCaptionRootRef:x,setShowFullscreenSlider:D});}function Li(e,n){return n>1&&e===n+2}function Ca(e,n,t){if(!Li(n,t)){let r=t||n||1;return (e%r+r)%r}return e===0?t-1:e===n-1?0:e-1}function Fa(e,n,t){return Li(n,t)&&(e===0||e===n-1)}function Oa(e){let n=e,t=n.poster??n.thumb??n.thumbSrc??"";return typeof t=="string"?t:""}function Ia(e){let{item:n,index:t,canonicalIndex:r,isClone:o,imageRef:a,cells:l,isZoomed:c,showFullscreenSlider:u,getTransform:p,onPanPointerDown:x,onSuppressNextClickCapture:j,styles:h,renderImage:D,renderMode:A="track",interactive:P=u,registerCell:v=true}=e,w=n.kind==="node",S={maxWidth:"100%",maxHeight:"100%",objectFit:"contain",touchAction:"manipulation",transformOrigin:"0 0",transform:"translate(0, 0) scale(1)",cursor:P?c?"grab":"zoom-in":"default",userSelect:"none",WebkitUserSelect:"none"},K=w?jsx("div",{"data-rmg-fs-node":"true",style:{width:"100%",height:"100%",position:"relative",pointerEvents:P?"auto":"none",userSelect:"none",WebkitUserSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:n.node}):n.kind==="video"?(()=>{let H=Oa(n);return H?jsx("img",{alt:n.alt??`cell-${r}`,"data-index":t,className:h.fullscreenImages,draggable:"false",decoding:"async",loading:"lazy",src:H,style:{...S,display:"block",pointerEvents:"none"}}):jsx("div",{"data-rmg-fs-video-fallback":"true",style:{width:"100%",height:"100%",background:"#000"}})})():D?D({item:n,index:r,isZoomed:c,className:h.fullscreenImages,baseStyle:S}):jsx("img",{alt:n.alt??`cell-${t}`,"data-index":t,className:h.fullscreenImages,draggable:"false",decoding:"async",loading:o?"lazy":"eager",fetchPriority:o?"low":"high",src:n.src??"",srcSet:n.srcSet??void 0,sizes:n.sizes??void 0,style:{...S,display:"block"}});return jsx("div",{"data-rmg-fs-slide":"true","data-index":t,"data-rmg-canonical-idx":r,"data-rmg-clone":o?"true":"false","data-rmg-fs-render-mode":A,ref:H=>{v&&H&&!l.current.some(W=>W.element===H)&&l.current.push({element:H,index:t});},style:{transform:A==="crossfade"?"none":p(t),display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",inset:A==="crossfade"?0:void 0,left:A==="crossfade"?void 0:0,top:A==="crossfade"?void 0:0,width:A==="crossfade"?"100%":void 0,minWidth:"100%",height:"100%",margin:"auto",touchAction:P?"none":"manipulation",userSelect:"none",WebkitUserSelect:"none",pointerEvents:P?"auto":"none"},className:h.imgMargin,children:jsx("div",{ref:a,"data-rmg-zoom-pan-root":"true","data-rmg-fs-media":"true","data-rmg-fs-media-viewport":"true",onPointerDown:w||!P?void 0:H=>x(H,a),onClickCapture:j,style:{overflow:"visible",touchAction:"none",width:"100%",height:"100%",minWidth:0,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",userSelect:"none",WebkitUserSelect:"none",pointerEvents:P?"auto":"none"},children:K})},`${n.src??"slide"}-${t}`)}function mo(e){let{items:n,getTransform:t,imageRefs:r,cells:o,isZoomed:a,showFullscreenSlider:l,onPanPointerDown:c,onSuppressNextClickCapture:u,styles:p,renderImage:x,canonicalLength:j,renderMode:h="track"}=e,D=j??n.length;return n.map((A,P)=>{let v=Ca(P,n.length,D),w=Fa(P,n.length,D);return jsx(Ia,{item:A,index:P,canonicalIndex:v,isClone:w,imageRef:r.current[P],cells:o,isZoomed:a,showFullscreenSlider:l,getTransform:t,onPanPointerDown:c,onSuppressNextClickCapture:u,styles:p,renderImage:x,renderMode:h,interactive:h==="track"&&l,registerCell:h==="track"},`${A.src??"slide"}-${P}`)})}function Hi(e){return mo({...e,renderMode:"crossfade",showFullscreenSlider:true})}function Pi(e){let{normalizedItems:n,wrappedItems:t,setWrappedItems:r,imageRefs:o}=e;C.useEffect(()=>{if(!n.length)return;let a=n[0],l=n[n.length-1];r([l,...n,a]);},[n,r]),C.useEffect(()=>{t.length&&(o.current=t.map(()=>C.createRef()));},[t,o]);}var ki="--rmg-fs-caption-overlay-opacity",La=300,Ha="cubic-bezier(.4,0,.22,1)",Pa="linear";function po(e,n){return n?(e%n+n)%n:e}function ka(e){return e?.overlayCrossfadeTarget??"content"}function Aa(e,n=La){let t=e?.overlayCrossfadeDurationMs;return typeof t=="number"&&Number.isFinite(t)?Math.max(0,t):n}function Da(e){let n=e?.overlayCrossfadeEasing;return typeof n=="string"&&n.trim()?n:Ha}function Ai(e){let{caption:n,viewportWidth:t,viewportHeight:r,placement:o,fadeOutMs:a,fadeOutEasing:l,opacity:c}=e;return {position:"fixed",boxSizing:"border-box",zIndex:"calc(var(--rmg-fs-z, 9999) + 1)",...Ba({placement:o,caption:n,viewportWidth:t,viewportHeight:r}),opacity:c,transition:a>0?`opacity ${a}ms ${l}`:void 0,willChange:a>0?"opacity":void 0,pointerEvents:"none"}}function ja(e){let{caption:n,placement:t,captionZoomMotion:r}=e;return {padding:"1.25rem 1.5rem",background:$a(t),color:"#fff",fontSize:"0.9rem",...n?.style??{},...r.contentStyle,pointerEvents:"none"}}function yo(e){let{opacity:n,fadeOutMs:t,fadeOutEasing:r,stacked:o,active:a}=e;return {...o?{gridArea:"1 / 1",minWidth:0,position:"relative",zIndex:a?1:2}:null,opacity:n,transition:t>0?`opacity ${t}ms ${o?Pa:r}`:void 0,willChange:t>0?"opacity":void 0,pointerEvents:"none"}}function Na(e,n){let t=Object.keys(e).filter(o=>o!=="children"),r=Object.keys(n).filter(o=>o!=="children");if(t.length!==r.length)return false;for(let o of t){if(!r.includes(o))return false;let a=e[o],l=n[o];if(o==="style"&&a&&l&&typeof a=="object"&&typeof l=="object"){let c=a,u=l,p=Object.keys(c),x=Object.keys(u);if(p.length!==x.length)return false;for(let j of p)if(c[j]!==u[j])return false;continue}if(a!==l)return false}return true}function $r(e){return C.isValidElement(e)&&e.type!==C.Fragment}function Wa(e){if(!e.length)return false;let[n]=e;if(!n||!$r(n.node))return false;let t=n.node;return e.every(({node:r})=>$r(r)?r.type===t.type&&Na(t.props,r.props):false)}function Va(e){let{layers:n,items:t,caption:r,isZoomed:o,captionZoomMotion:a,viewportWidth:l,viewportHeight:c,fadeOutMs:u,fadeOutEasing:p,resolveFsCaptionPlacement:x}=e,j=e.overlayOpacity,h=j==null?`var(${ki}, 1)`:String(j),D=r?.render;if(typeof D!="function"||!n.length)return null;let A=n.flatMap(I=>{let f=t[I.index];return f?[{layer:I,node:D({item:f,index:I.index,isZoomed:o})}]:[]});if(!A.length)return null;let P=x(r?.placement,r?.breakpoint,l),w=ka(r)==="content",S=A.length-1,K=r?.className,H=ja({caption:r,placement:P,captionZoomMotion:a}),W=Wa(A);if(w){let I=W?A[S]?.node??null:null,f=A[S]?.layer,V=f?.key??"active",_=(f?.opacity??1)>0;return jsx("div",{"data-rmg-fs-caption":"true","data-rmg-fs-caption-overlay":"true",className:K,style:Ai({caption:r,viewportWidth:l,viewportHeight:c,placement:P,fadeOutMs:u,fadeOutEasing:p,opacity:h}),"aria-hidden":a.interactive?void 0:true,children:jsx("div",{"data-rmg-fs-caption-surface":"true",style:H,children:I&&$r(I)?C.cloneElement(I,I.props,jsx(wr,{activeKey:V,activeReady:_,durationMs:u,easing:p,children:A.map(({layer:$,node:Y},re)=>{let be=$r(Y)?Y.props.children:Y;return jsx("div",{"data-rmg-fs-caption-content":"true","data-rmg-overlay-height-layer-key":String($.key),"data-rmg-overlay-height-active":re===S?"true":void 0,style:yo({opacity:$.opacity,fadeOutMs:u,fadeOutEasing:p,stacked:true,active:re===S}),"aria-hidden":re===S&&a.interactive?void 0:true,children:be},$.key)})})):jsx(wr,{activeKey:V,activeReady:_,durationMs:u,easing:p,children:A.map(({layer:$,node:Y},re)=>jsx("div",{"data-rmg-fs-caption-content":"true","data-rmg-overlay-height-layer-key":String($.key),"data-rmg-overlay-height-active":re===S?"true":void 0,style:yo({opacity:$.opacity,fadeOutMs:u,fadeOutEasing:p,stacked:true,active:re===S}),"aria-hidden":re===S&&a.interactive?void 0:true,children:Y},$.key))})})})}return jsx(Fragment,{children:A.map(({layer:I,node:f},V)=>jsx("div",{"data-rmg-fs-caption":"true","data-rmg-fs-caption-overlay":"true",className:K,style:Ai({caption:r,viewportWidth:l,viewportHeight:c,placement:P,fadeOutMs:u,fadeOutEasing:p,opacity:j==null?`calc(var(${ki}, 1) * ${I.opacity})`:String(j*I.opacity)}),"aria-hidden":V===S&&a.interactive?void 0:true,children:jsx("div",{"data-rmg-fs-caption-surface":"true",style:H,children:jsx("div",{"data-rmg-fs-caption-content":"true",style:yo({opacity:1,fadeOutMs:0,fadeOutEasing:p,stacked:false,active:true}),children:f})})},I.key))})}function Di(e){let{enabled:n,fsSub:t,items:r,caption:o,isZoomed:a,captionZoomMotion:l,viewportWidth:c,viewportHeight:u,closing:p,fadeOutMs:x,resolveFsCaptionPlacement:j}=e,h=Aa(o,x),D=Da(o),[A,P]=C.useState(()=>[{key:1,index:po(t.get(),r.length),opacity:1}]),[v,w]=C.useState(0),S=C.useRef(A),K=C.useRef(po(t.get(),r.length)),H=C.useRef(1),W=C.useRef({raf1:0,raf2:0,timeout:null}),I=C.useRef({raf1:0,raf2:0,timeout:null}),f=C.useCallback(()=>{let F=W.current;F.raf1&&cancelAnimationFrame(F.raf1),F.raf2&&cancelAnimationFrame(F.raf2),F.timeout!=null&&window.clearTimeout(F.timeout),W.current={raf1:0,raf2:0,timeout:null};},[]),V=C.useCallback(()=>{let F=I.current;F.raf1&&cancelAnimationFrame(F.raf1),F.raf2&&cancelAnimationFrame(F.raf2),F.timeout!=null&&window.clearTimeout(F.timeout),I.current={raf1:0,raf2:0,timeout:null};},[]),_=C.useCallback(F=>{S.current=F,P(F);},[]),$=C.useCallback(F=>po(F,r.length),[r.length]),Y=C.useCallback((F,B=1)=>({key:++H.current,index:F,opacity:B}),[]),re=C.useCallback(F=>S.current.reduce((Q,Ve)=>!Q||Ve.opacity>Q.opacity?Ve:Q,null)??Y(F),[Y]),be=C.useCallback(F=>{let B=S.current[S.current.length-1];_([B?{...B,index:F,opacity:1}:Y(F)]);},[Y,_]),ce=C.useCallback(F=>{if(p)return;f();let B=re(K.current),de=Y(F,0);if(_([{...B,opacity:1},de]),h<=0){_([{...de,opacity:1}]);return}W.current.raf1=requestAnimationFrame(()=>{W.current.raf1=0,W.current.raf2=requestAnimationFrame(()=>{W.current.raf2=0,_([{...B,opacity:0},{...de,opacity:1}]),W.current.timeout=window.setTimeout(()=>{_([{...de,opacity:1}]),W.current={raf1:0,raf2:0,timeout:null};},h);});});},[Y,f,p,_,h,re]);return C.useEffect(()=>{if(!n){f(),V(),w(0),_([]);return}if(p){f(),V(),w(0),h<=0?_([]):I.current.timeout=window.setTimeout(()=>{_([]),I.current={raf1:0,raf2:0,timeout:null};},h);return}V();let F=$(t.get());K.current=F,be(F),w(0),I.current.raf1=requestAnimationFrame(()=>{I.current.raf1=0,I.current.raf2=requestAnimationFrame(()=>{I.current.raf2=0,w(1);});});let B=t.onEvent(de=>{if(de.type!=="internalIndex")return;let Q=$(de.index);Q!==K.current&&(K.current=Q,ce(Q));});return ()=>{f(),V(),B();}},[f,V,p,ce,n,h,t,$,be]),C.useEffect(()=>()=>{f(),V();},[f,V]),A.length?jsx(Fragment,{children:Va({layers:A,items:r,caption:o,isZoomed:a,captionZoomMotion:l,viewportWidth:c,viewportHeight:u,fadeOutMs:h,fadeOutEasing:D,overlayOpacity:v,resolveFsCaptionPlacement:j})}):null}function $a(e){return e==="top"?"linear-gradient(to bottom, rgba(0,0,0,0.75), transparent)":e==="left"?"linear-gradient(to right, rgba(0,0,0,0.75), transparent)":e==="right"?"linear-gradient(to left, rgba(0,0,0,0.75), transparent)":"linear-gradient(to top, rgba(0,0,0,0.75), transparent)"}function Ba(e){let{placement:n,caption:t,viewportWidth:r,viewportHeight:o}=e,a=f$3(r),l=g$2(o),c=a$8(t?.width,280,a,a),u=t?.height==null?void 0:a$8(t.height,200,a,l);return n==="top"?{top:0,left:0,right:0,...u!=null?{height:u}:{}}:n==="left"?{top:0,bottom:0,left:0,width:c}:n==="right"?{top:0,bottom:0,right:0,width:c}:{bottom:0,left:0,right:0,...u!=null?{height:u}:{}}}var _a=[],za={};function qa(e){return C.useMemo(()=>[],[])}function Za(){let e=C.useRef(false),n=C.useRef(false),t=C.useCallback(()=>{},[]);return C.useMemo(()=>({isPinching:e,isTouchPinching:n,entryOverlayZoomMotion:void 0,captionZoomMotion:void 0,handlePanPointerStart:t,handleZoomToggle:t,resetAllZoomDom:t,resetForSlideNavigation:t,forceResetZoom:t}),[e,n,t])}function Ya(e){return e.reduce((n,t)=>t.runtime?{...n,...t.runtime}:n,{})}function wn(e,n){return (e%n+n)%n}function Ua(e){return e.map(n=>{let t=n;return `${n.kind}|${t.src??""}|${t.srcSet??""}|${t.sizes??""}|${t.poster??""}`}).join("||")}function Ni(e){if(!e)return;try{e?.pause?.();}catch{}let n=e?.plyr??null;try{n?.pause?.();}catch{}try{n?.media?.pause?.();}catch{}}function Xa(e){let{canonicalIndex:n,canonicalLength:t}=e;if(!Number.isFinite(n)||!Number.isFinite(t)||t<=0)return null;let r=wn(n,t);return t>1?r+1:r}function Ga(e){return !!e.enabled&&e.showFullscreenModal&&e.showFullscreenSlider&&!e.closingModal&&e.item?.kind==="video"}function Ka(e){let n=e?.plyr??null;if(!n||typeof n.play!="function")return false;try{let t=n.play();return t&&typeof t.catch=="function"&&t.catch(()=>{}),!0}catch{return false}}function Ja(e){if(!e)return;let{width:n,height:t,minWidth:r,minHeight:o,maxWidth:a,maxHeight:l,flex:c,flexBasis:u,flexGrow:p,flexShrink:x,alignSelf:j,margin:h,marginTop:D,marginRight:A,marginBottom:P,marginLeft:v,marginBlock:w,marginBlockStart:S,marginBlockEnd:K,marginInline:H,marginInlineStart:W,marginInlineEnd:I}=e;return {width:n,height:t,minWidth:r,minHeight:o,maxWidth:a,maxHeight:l,flex:c,flexBasis:u,flexGrow:p,flexShrink:x,alignSelf:j,margin:h,marginTop:D,marginRight:A,marginBottom:P,marginLeft:v,marginBlock:w,marginBlockStart:S,marginBlockEnd:K,marginInline:H,marginInlineStart:W,marginInlineEnd:I}}function Qa(e){let{fsEnabled:n,fsSub:t,showFullscreenModal:r,setShowFullscreenModal:o,isClick:a,isAnimatingRef:l,overlayDivRef:c,cells:u,setShowFullscreenSlider:p,slidesForFullscreen:x,sliderForFullscreen:j,isWrappingForFullscreen:h,setClosingModal:D,closeButtonRef:A,counterRef:P,leftChevronRef:v,rightChevronRef:w,centerSliderForFullscreen:S,setSliderIndexForFullscreen:K,layout:H,expandableImageRefs:W,resolveLayoutlessTarget:I,entryMapRef:f,entryMediaLayout:V,introFade:_,introDuration:$,introEasing:Y,fullscreenSliderApi:re,slideIndex:be,isZoomClick:ce,isZoomed:F,windowSize:B,imageRefs:de,wrappedItems:Q,setWrappedItems:Ve,scale:_t,showFullscreenSlider:z,isZooming:$e,singleModePlyrRefs:ue,wrappedModePlyrRefs:me,closingModal:he,duplicateImgRef:Pt,direction:zt,sliderGap:ie,sliderDuration:Ue,sliderFriction:Ie,sliderSkipSnaps:Le,sliderStrictSnaps:ve,suppressLoopRef:wt,fsFadeOpening:ze,normalizedItems:oe,fsThumbContainerRef:yt,fullscreenThumbnailSlot:He,setFullscreenThumbnailMountEl:Ne,showFsEntryOverlayMount:mn,fsIntroReq:Pe,clearFsIntroReq:Nn,styles:qe,fs:M,overlayCaptionRef:pn,overlayCaptionRootRef:Kt,setFsFadeOpening:Fe,addShield:xn,resolveFsCaptionPlacement:Ze,requestFsCloseRef:Tn,cancelFsCloseRef:Qn,suppressNextClickRef:gt,currentImage:Wn,scaleRef:Vn,pointerDownRef:$n,interactionModeRef:on,boundsX:sn,boundsY:et,bodyX:qt,bodyY:kt,locX:Ae,locY:bt,prevX:an,prevY:Bn,offX:er,offY:Cn,tgtX:yn,tgtY:Zt,axisRef:ht,animRef:tr,setScale:d,previousZoom:b,panRef:U,changingSlides:fe,fsIndexRef:pe,entriesObject:te,syncFullscreenSourceFromIndex:ke,setFullscreenOpen:tt,runtimePlugins:vt=_a}=e,nt=C.useMemo(()=>Ya(vt),[vt]),Jt=nt.renderSlides??mo,Ye=nt.renderCrossfadeSlides??Hi,Ee=nt.usePlyrProps??qa,At=nt.useZoomPanRuntime??Za,Dt=nt.defaultPlayerStyle??za,lt=!!nt.usePlyrProps,Me=!!M.lazyLoad?.images?.enabled,xe=lt&&!!M.lazyLoad?.videos?.enabled,Xe=C.useRef(new Set),Yt=C.useRef(new Set),ln=C.useRef(new Set),Ge=C.useRef(new Set),xt=C.useRef(0),Tt=C.useRef(new Set),Ut=C.useRef(new Set),E=C.useRef(new Map),q=C.useRef(new Set),ae=C.useRef(new Set),ye=C.useRef(new Set),[cn,jt]=C.useState(0),[Nt,Rt]=C.useState(null),[X,Fn]=C.useState(0),ee=oe.length||0,un=C.useRef(0),Ct=C.useMemo(()=>Ua(oe),[oe]),Ft=C.useRef(null);!Ft.current&&nt.createVideoSnapshotStore&&(Ft.current=nt.createVideoSnapshotStore());let rt=Ft.current;function ct(){ln.current.forEach(y=>y());}function Ot(){Ge.current.forEach(y=>y());}let Qt=C.useCallback(y=>{if(!ee)return;let R=wn(y,ee);if(xe){let N=ye.current;Yt.current=new Set([R,...N]),Ot();}Me&&(Xe.current=new Set([R]),ct());},[ee,Me,xe]),en=C.useCallback(()=>{ye.current.clear(),Yt.current=new Set,Xe.current=new Set;},[]),St=C.useCallback(()=>{let y=t.get?.(),R=typeof y=="number"&&Number.isFinite(y)?y:xt.current;typeof R!="number"||!Number.isFinite(R)||(xt.current=R,Qt(R));},[t,Qt]);C.useEffect(()=>{if(!Me&&!xe||!t)return;let y=R=>{typeof R=="number"&&(xt.current=R,Qt(R));};if(r){let R=t.get?.();typeof R=="number"&&y(R);}if(typeof t.subscribe=="function"){let R=t.subscribe(N=>y(N));return ()=>R?.()}if(typeof t.onEvent=="function"){let R=t.onEvent(N=>{if(typeof N=="number")y(N);else if(typeof N?.index=="number")y(N.index);else {let J=t.get?.();typeof J=="number"&&y(J);}});return ()=>R?.()}},[Me,xe,t,r,Qt]),C.useEffect(()=>{if(!t)return;let y=R=>{typeof R!="number"||!Number.isFinite(R)||jt(R);};if(r){let R=t.get?.();typeof R=="number"&&y(R);}if(typeof t.subscribe=="function"){let R=t.subscribe(N=>y(N));return ()=>R?.()}if(typeof t.onEvent=="function"){let R=t.onEvent(N=>{if(typeof N=="number")y(N);else if(typeof N?.index=="number")y(N.index);else {let J=t.get?.();typeof J=="number"&&y(J);}});return ()=>R?.()}},[t,r]);function gn(){let y=window;return y.__rmgZ||(y.__rmgZ=9999),y.__rmgZ+=1,y.__rmgZ}let It=C.useRef(9999),Wt=C.useRef(null);C.useEffect(()=>{r&&(It.current=gn());},[r]);let Lt=C.useRef(r);C.useEffect(()=>{let y=Lt.current;Lt.current=r,!(!r||y)&&(en(),St());},[r,en,St]);let Vt=C.useRef(Ct);C.useEffect(()=>{Vt.current!==Ct&&(Vt.current=Ct,q.current.clear(),ae.current.clear(),en(),rt?.reset?.(),r&&St());},[Ct,en,r,St,rt]);let we=H==="entries"&&typeof te.render?.overlay=="function";C.useEffect(()=>{if(!Pe)return;let{originalImage:y,index:R,closestSelector:N,method:J}=Pe;Rt(J??null),Fn(R);let je=He?.position??null;Ii({originalImage:y,method:J,index:R,normalizedItems:oe,styles:qe,fs:M,overlayDivRef:c,duplicateImgRef:Pt,overlayCaptionRef:pn,overlayCaptionRootRef:Kt,fsThumbContainerRef:yt,fullscreenThumbnailPosition:je,setShowFullscreenSlider:p,setFsFadeOpening:Fe,addShield:xn,resolveFsCaptionPlacement:Ze,viewportOverlay:we?{placement:te.overlay?.placement,width:te.overlay?.width,height:te.overlay?.height,breakpoint:te.overlay?.breakpoint}:void 0,closestSelector:N,baseZ:It.current,fullscreenRootRef:Wt}),Nn();},[te.overlay,Pe,He,we]),Pi({normalizedItems:oe,wrappedItems:Q,setWrappedItems:Ve,imageRefs:de}),C.useEffect(()=>{u.current=[];},[u,Ct,Q.length]);let De=At({fs:M,entriesObject:te,hasEntriesViewportOverlay:we,layout:H,resolveFsCaptionPlacement:Ze,windowSize:B,currentImage:Wn,scaleRef:Vn,setScale:d,previousZoom:b,suppressLoopRef:wt,locX:Ae,prevX:an,offX:er,tgtX:yn,locY:bt,prevY:Bn,offY:Cn,tgtY:Zt,bodyX:qt,bodyY:kt,boundsX:sn,boundsY:et,animRef:tr,panRef:U,imageRefs:de,changingSlides:fe,fullscreenSliderApi:re,isZoomed:F,pointerDownRef:$n,interactionModeRef:on,axisRef:ht,suppressNextClickRef:gt,closingModal:he});C.useEffect(()=>{if(!r)return;let y=t.get();pe.current=y,ke(y);},[r,t]),C.useEffect(()=>{if(!r||H!=="entries"||he||!t||!ee||!f.current?.length)return;let y=false,R=async J=>{if(typeof J!="number")return;let je=wn(J,ee),se=f.current?.[je];if(!se)return;let Mt=++un.current;Kn(se.entryIndex)||await Ar(se.entryIndex),await Dr(se.entryIndex),!y&&Mt===un.current&&ke(je);},N=t.get?.();return typeof N=="number"&&R(N),()=>{y=true,un.current+=1;}},[r,H,he,t,ee,f,ke]);let it=!!r&&M.caption?.layout==="overlay"&&typeof M.caption?.render=="function",On=oe.length>1?ie??0:0,In=Ee({items:oe,source:M.video?.source,options:M.video?.options}),_n=Ee({items:Q,source:M.video?.source,options:M.video?.options}),ut=C.useMemo(()=>d$2(),[]),tn=zt==="rtl"?-1:1,zn=C.useMemo(()=>c$2({length:Q.length,sign:tn,gap:On}),[On,Q.length,tn]),nr=C.useMemo(()=>oe.map(()=>C.createRef()),[Ct]),Et=C.useRef([]),qn=C.useRef([]),rr=De.handlePanPointerStart,go=De.handleZoomToggle,or=De.resetForSlideNavigation,Br=De.resetAllZoomDom,ir=De.forceResetZoom??De.resetAllZoomDom,sr=De.isPinching,ar=De.isTouchPinching,Zn=De.captionZoomMotion,_r=De.entryOverlayZoomMotion;function $t(y){let R=y;return `${y.kind}|${R.src??""}|${R.srcSet??""}|${R.sizes??""}|${R.poster??""}`}C.useEffect(()=>()=>{rt?.destroy?.();},[rt]);let dt=r&&!z,nn=ee?wn(X,ee):null,lr=(()=>{let y=t.get?.();return typeof y=="number"&&Number.isFinite(y)?y:cn})(),cr=ee?wn(lr,ee):null,ur=nn!=null?oe[nn]?.kind??null:null,dr=xe&&!!dt&&ur!=="video",fr=C.useRef(null);C.useEffect(()=>{r||(fr.current=null);},[r]),C.useEffect(()=>{if(!ee)return;let y=wn(X,ee),R=oe[y]??null;if(!Ga({enabled:M.video?.playOnOpen,showFullscreenModal:r,showFullscreenSlider:z,closingModal:he,item:R}))return;let N=Xa({canonicalIndex:y,canonicalLength:ee});if(N==null)return;let J=ee>1?me:ue,je=`${Ct}|${y}|${X}`;if(fr.current===je)return;fr.current=je;let se=false,Mt=null,Ht=performance.now()+1600,yr=()=>{if(se)return;let Zr=J.current[N]??null;Ka(Zr)||performance.now()>=Ht||(Mt=window.requestAnimationFrame(yr));};return Mt=window.requestAnimationFrame(yr),()=>{se=true,Mt!=null&&window.cancelAnimationFrame(Mt);}},[ee,he,M.video?.playOnOpen,X,Ct,oe,r,z,ue,me]);let zr=Jt({items:oe,plyrList:In,getTransform:ut,imageRefs:de,playerRefs:ue,cells:u,isZoomed:F,showFullscreenSlider:z,defaultPlayerStyle:Dt,fsVideoStyle:M.video?.style,fsVideoClassName:M.video?.className,onPanPointerDown:(y,R)=>rr(y,R),onSuppressNextClickCapture:y=>{gt.current&&(gt.current=false,y.preventDefault(),y.stopPropagation());},renderCaption:M.caption?.render,captionClassName:M.caption?.className,captionStyle:M.caption?.style,captionZoomMotion:Zn,fsCaptionPlacement:M.caption?.placement,fsCaptionWidth:M.caption?.width,fsCaptionHeight:M.caption?.height,fsCaptionBreakpoint:M.caption?.breakpoint,fsCaptionLayout:M.caption?.layout,fsViewportOverlayPlacement:we?te.overlay?.placement:void 0,fsViewportOverlayWidth:we?te.overlay?.width:void 0,fsViewportOverlayHeight:we?te.overlay?.height:void 0,fsViewportOverlayBreakpoint:we?te.overlay?.breakpoint:void 0,viewportWidth:B.width,viewportHeight:B.height,resolveFsCaptionPlacement:Ze,styles:{imgMargin:qe.imgMargin,fullscreenImages:qe.fullscreenImages},renderImage:M.renderImage,fsLazy:M.lazyLoad,fsLazyAllowedImagesRef:Xe,fsLazyListenersImagesRef:ln,fsLazyAllowedVideosRef:Yt,fsLazyListenersVideosRef:Ge,fsDecodedImagesRef:Tt,fsCustomDecodedImagesRef:Ut,fsCustomResolvedSrcByKeyRef:E,fsPreparedVideosRef:q,videoSnapshotStore:rt,canonicalLength:ee,activeCanonicalIndex:cr,openingCanonicalIndex:nn,openingInProgress:dt,deferLiveVideoUntilVisible:dr,getMediaKey:$t}),Tr=Jt({items:Q,plyrList:_n,getTransform:zn,imageRefs:de,playerRefs:me,cells:u,isZoomed:F,showFullscreenSlider:z,defaultPlayerStyle:Dt,fsVideoStyle:M.video?.style,fsVideoClassName:M.video?.className,onPanPointerDown:(y,R)=>rr(y,R),onSuppressNextClickCapture:y=>{gt.current&&(gt.current=false,y.preventDefault(),y.stopPropagation());},renderCaption:M.caption?.render,captionClassName:M.caption?.className,captionStyle:M.caption?.style,captionZoomMotion:Zn,fsCaptionPlacement:M.caption?.placement,fsCaptionWidth:M.caption?.width,fsCaptionHeight:M.caption?.height,fsCaptionBreakpoint:M.caption?.breakpoint,fsCaptionLayout:M.caption?.layout,fsViewportOverlayPlacement:we?te.overlay?.placement:void 0,fsViewportOverlayWidth:we?te.overlay?.width:void 0,fsViewportOverlayHeight:we?te.overlay?.height:void 0,fsViewportOverlayBreakpoint:we?te.overlay?.breakpoint:void 0,viewportWidth:B.width,viewportHeight:B.height,resolveFsCaptionPlacement:Ze,styles:{imgMargin:qe.imgMargin,fullscreenImages:qe.fullscreenImages},renderImage:M.renderImage,fsLazy:M.lazyLoad,fsLazyAllowedImagesRef:Xe,fsLazyListenersImagesRef:ln,fsLazyAllowedVideosRef:Yt,fsLazyListenersVideosRef:Ge,fsDecodedImagesRef:Tt,fsCustomDecodedImagesRef:Ut,fsCustomResolvedSrcByKeyRef:E,fsPreparedVideosRef:q,videoSnapshotStore:rt,canonicalLength:ee,activeCanonicalIndex:cr,openingCanonicalIndex:nn,openingInProgress:dt,deferLiveVideoUntilVisible:dr,getMediaKey:$t}),bn=Ye({items:oe,plyrList:In,getTransform:ut,imageRefs:{current:nr},playerRefs:Et,cells:qn,isZoomed:F,showFullscreenSlider:true,defaultPlayerStyle:Dt,fsVideoStyle:M.video?.style,fsVideoClassName:M.video?.className,onPanPointerDown:(y,R)=>rr(y,R),onSuppressNextClickCapture:y=>{gt.current&&(gt.current=false,y.preventDefault(),y.stopPropagation());},renderCaption:M.caption?.render,captionClassName:M.caption?.className,captionStyle:M.caption?.style,captionZoomMotion:Zn,fsCaptionPlacement:M.caption?.placement,fsCaptionWidth:M.caption?.width,fsCaptionHeight:M.caption?.height,fsCaptionBreakpoint:M.caption?.breakpoint,fsCaptionLayout:M.caption?.layout,fsViewportOverlayPlacement:we?te.overlay?.placement:void 0,fsViewportOverlayWidth:we?te.overlay?.width:void 0,fsViewportOverlayHeight:we?te.overlay?.height:void 0,fsViewportOverlayBreakpoint:we?te.overlay?.breakpoint:void 0,viewportWidth:B.width,viewportHeight:B.height,resolveFsCaptionPlacement:Ze,styles:{imgMargin:qe.imgMargin,fullscreenImages:qe.fullscreenImages},renderImage:M.renderImage,fsLazy:M.lazyLoad,fsLazyAllowedImagesRef:Xe,fsLazyListenersImagesRef:ln,fsLazyAllowedVideosRef:Yt,fsLazyListenersVideosRef:Ge,fsDecodedImagesRef:Tt,fsCustomDecodedImagesRef:Ut,fsCustomResolvedSrcByKeyRef:E,fsPreparedVideosRef:q,videoSnapshotStore:rt,canonicalLength:oe.length,openingCanonicalIndex:null,openingInProgress:false,deferLiveVideoUntilVisible:false,getMediaKey:$t}),hn=C.useCallback(()=>{let y=new Set;for(let N of ue.current)!N||y.has(N)||(y.add(N),Ni(N));for(let N of me.current)!N||y.has(N)||(y.add(N),Ni(N));if(typeof document>"u")return;document.querySelectorAll('[data-rmg-fs-slide="true"] video, [data-rmg-fs-slide="true"] audio').forEach(N=>{try{N.pause();}catch{}});},[ue,me]);C.useEffect(()=>{he&&hn();},[he,hn]),C.useEffect(()=>{r||hn();},[r,hn]);let Yn=C.useRef(new Set);function mr(y,R=3){let N=y.filter(se=>se.kind==="image"),J=0,je=async()=>{for(;J<N.length;){let se=N[J++],Mt=`${se.src??""}|${se.srcSet??""}|${se.sizes??""}`;if(Yn.current.has(Mt))continue;Yn.current.add(Mt);let Ht=new Image;Ht.decoding="async",Ht.fetchPriority="low",Ht.src=se.src,Ht.srcset=se.srcSet??"",Ht.sizes=se.sizes??"";try{await Ht.decode();}catch{}}};return Promise.all(Array.from({length:R},()=>je()))}let Un=C.useMemo(()=>oe.map(y=>y.kind==="image"?y.src??"":"").join("|"),[oe]),Cr=C.useRef(null);C.useEffect(()=>{if(Me||r||Cr.current===Un)return;Cr.current=Un;let y=()=>{mr(oe,3);};"requestIdleCallback"in window?window.requestIdleCallback(y,{timeout:2e3}):setTimeout(y,250);},[Me,r,Un,oe]);let vn=d$3();C.useEffect(()=>{if(!vn||!r||!t||!ee)return;let y=N=>{if(typeof N!="number")return;let J=wn(N,ee);vn.notifyFsVisibleIndex(J);},R=t.get?.();if(typeof R=="number"&&y(R),typeof t.subscribe=="function"){let N=t.subscribe(J=>y(J));return ()=>N?.()}if(typeof t.onEvent=="function"){let N=t.onEvent(J=>{if(typeof J=="number")y(J);else if(typeof J?.index=="number")y(J.index);else {let je=t.get?.();typeof je=="number"&&y(je);}});return ()=>N?.()}},[vn,r,t,ee]);let Xn=C.useCallback(async y=>{let R=oe[y];if(!R||R.kind!=="image")return;let N=$t(R);if(Tt.current.has(N))return;let J=new Image;J.decoding="async",J.fetchPriority="high",J.src=R.src,J.srcset=R.srcSet??"",J.sizes=R.sizes??"";try{await J.decode(),Tt.current.add(N);}catch{}},[oe]),Fr=C.useCallback(async y=>{let R=oe[y];if(!R||R.kind!=="video")return;let N=$t(R);if(ae.current.has(N))return;ae.current.add(N);let J=R.poster??R.thumbSrc??null;if(J)try{let se=new Image;se.decoding="async",se.fetchPriority="high",se.src=J,await se.decode().catch(()=>{});}catch{}let je=R.src||R.videoSrc||R.sources?.[0]?.src||null;if(typeof je=="string"&&je)try{let se=document.createElement("video");se.preload="auto",se.muted=!0,se.playsInline=!0,J&&(se.poster=J),se.src=je,se.load(),setTimeout(()=>{try{se.removeAttribute("src"),se.load();}catch{}},1500);}catch{}ye.current.add(y),Yt.current.add(y),Ot();},[oe]);C.useEffect(()=>{if(!vn||!(Me||xe))return;let R=vn.baseVisibleSub.subscribe(N=>{let J=N?.index;if(typeof J!="number"||!ee)return;let je=wn(J,ee);Me&&Xn(je),xe&&Fr(je);});return ()=>R?.()},[vn,Me,xe,Xn,Fr]);let pr=He?.position??null,qr=pr==="left"?"row-reverse":pr==="right"?"row":pr==="top"?"column-reverse":"column",Or=Ja(He?.style),Ir=oe.length;return jsx(Fragment,{children:n&&jsxs(li,{fsSub:t,open:r,onClose:()=>o(false),isClick:a,isAnimating:l,overlayDivRef:c,cells:u,setShowFullscreenSlider:p,cellCount:Ir,slides:x,slider:j,wrappedItems:Q,setClosingModal:D,closeButtonRef:A,counterRef:P,leftChevronRef:v,rightChevronRef:w,centerSlider:S,setSliderIndex:K,onForceResetZoom:()=>ir(),layout:H,expandableImageRefs:W,resolveLayoutlessTarget:I,entryMapRef:f,entryMediaLayout:V,introFade:_,introDuration:$,introEasing:Y,requestFsCloseRef:Tn,cancelFsCloseRef:Qn,fs:M,styles:qe,syncFullscreenSourceFromIndex:ke,baseZ:It.current,rootRef:Wt,introMethod:Nt,setLatchedIntroMethod:Rt,latchedIntroIndex:X,children:[jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:qr},children:[jsx("div",{style:{flex:"1 1 auto",position:"relative",minHeight:0},children:jsx(so,{sub:t,ref:re,cellCount:Ir,slideIndex:be,isClick:ce,isZoomed:F,windowSize:B,show:r,handleZoomToggle:go,imageRefs:de.current,cells:u,isPinching:sr,scale:_t,isTouchPinching:ar,showFullscreenSlider:z,isZooming:$e,plyrRefs:oe.length>1?me:ue,plyrRef:oe.length>1?me:ue,closingModal:he,counterRef:P,leftChevronRef:v,rightChevronRef:w,overlayDivRef:c,direction:zt,isWrapping:h,sliderGap:On,sliderDuration:Ue,sliderFriction:Ie,skipSnaps:Le,strictSnaps:ve,suppressLoopRef:wt,fadeOpening:ze,introFade:_,controlsFade:!!M.effects?.crossfade?.controls,dragFade:!!M.effects?.crossfade?.drag,slideFadeDuration:M.effects?.crossfade?.durationMs,slideFadeEasing:M.effects?.crossfade?.easing,normalizedItems:oe,crossfadeSlides:bn,introDuration:$,introEasing:Y,resetAllZoomDom:()=>or(),requestFsCloseRef:Tn,introMethod:Nt,fs:M,chromeStyles:qe,children:oe.length>1?Tr:zr})}),He&&jsx("div",{ref:Ne,style:{flex:"0 0 auto",position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible",backgroundColor:"transparent",...Or||{}}})]}),it?jsx(Di,{enabled:it,fsSub:t,items:oe,caption:M.caption,isZoomed:F,captionZoomMotion:Zn,viewportWidth:B.width,viewportHeight:B.height,interactive:!!z,closing:!!he,resolveFsCaptionPlacement:Ze}):null,mn?jsx(hi,{enabled:mn,fsSub:t,entriesObject:te,entryMapRef:f,syncFullscreenSourceFromIndex:ke,resetAllZoomDom:Br,closing:!!he,overlayZoomMotion:_r,viewportWidth:B.width,viewportHeight:B.height,resolveFsCaptionPlacement:Ze}):null]})})}var zc=Qa;export{Qa as FullscreenRuntime,zc as default,Xa as getFullscreenVideoOpenRefIndex,Ga as shouldPlayFullscreenVideoOnOpen};
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-HK2DPKES.mjs';import {jsx}from'react/jsx-runtime';var h={skelRect:"ge",skelSquare:"ce",skelCircle:"pe",skelGroup:"he",skelRow:"fe",skelCol:"be",skelStack:"ve",skelText:"B",skelTextLine:"ue",skelTile:"ye",skelCardShimmer:"p",rmgSharedSkeletonShimmer:"h",skelShimmer:"C"};var R="68%",W="__NODE_SEL__",se="(font: -apple-system-body) and (-webkit-hyphens: none)";function ae(e){let n=Math.max(1,Math.trunc(e.lines??1)),t=Math.max(0,e.barHeight*e.lineHeight),o=Math.min(Math.max(0,e.barHeight),t),r=Math.max(t-o,0);return {lines:n,lineBoxHeight:t,barHeight:o,leading:r,paddingBlock:r/2,rowGap:r,totalHeight:t*n}}function L(e){let n=Math.max(e.barHeight,Math.floor(e.lineBoxHeight)),t=Math.max(n-e.barHeight,0);return {...e,lineBoxHeight:n,leading:t,paddingBlock:t/2,rowGap:t,totalHeight:n*e.lines}}function v(e,n=a$1){return !e||typeof e!="object"||Array.isArray(e)?false:Object.keys(e).some(t=>S(t,n)!=null)}function k(e,n){let t=Number.isFinite(e)?Math.trunc(e):n;return Math.max(1,t)}function C(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function w(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function S(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function c(e){return typeof e=="number"?`${e}px`:e}function b(e){return Array.isArray(e)?e.map(c):c(e)}function le(e){let{barWidths:n,lineCount:t,finalBarWidthFallback:o}=e;return t<=0?[o]:n.length>=t?n.slice(0,t):Array.from({length:t},(r,i)=>i<n.length?n[i]:i===t-1?o:"100%")}function z(e){let n=ce(e.lines,1,e.minWidth,e.breakpointMap),t=ge(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,e.minWidth,e.breakpointMap),o=Se(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,e.minWidth,e.breakpointMap),r=ke(e.lastBarWidth,R,e.minWidth,e.breakpointMap),i=xe(e.barWidth,"100%",e.minWidth,e.breakpointMap),s=e.barWidth==null?Array.from({length:n},(l,u)=>u===n-1?r:"100%"):Array.isArray(i)?i:Array.from({length:n},()=>i);return {lineCount:n,barWidths:le({barWidths:s,lineCount:n,finalBarWidthFallback:e.barWidth==null?r:"100%"}),metrics:ae({barHeight:t,lineHeight:o,lines:n})}}function ue(e,n){return e.lineCount===n.lineCount&&e.metrics.totalHeight===n.metrics.totalHeight&&e.metrics.barHeight===n.metrics.barHeight&&e.metrics.paddingBlock===n.metrics.paddingBlock&&e.metrics.rowGap===n.metrics.rowGap&&e.barWidths.length===n.barWidths.length&&e.barWidths.every((t,o)=>t===n.barWidths[o])}function de(e,n=a$1){return v(e,n)}function pe(e,n=a$1){return v(e,n)}function he(e,n=a$1){return v(e,n)}function me(e,n=a$1){return v(e,n)}function fe(e,n=a$1){return v(e,n)}function A(e,n=1,t=a$1){if(!de(e,t))return [{minWidth:0,lines:k(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lines:k(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lines=i.lines:r.push(i),r},[]);return o.length===0?[{minWidth:0,lines:k(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lines:k(void 0,n)}),o)}function E(e,n=0,t=a$1){if(!pe(e,t))return [{minWidth:0,barHeight:C(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,barHeight:C(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barHeight=i.barHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,barHeight:C(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barHeight:o[0].barHeight}),o)}function G(e,n=1,t=a$1){if(!he(e,t))return [{minWidth:0,lineHeight:w(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lineHeight:w(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lineHeight=i.lineHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,lineHeight:w(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lineHeight:o[0].lineHeight}),o)}function ce(e,n=1,t=0,o=a$1){let r=A(e,n,o),i=r[0]?.lines??k(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lines);return i}function ge(e,n=0,t=0,o=a$1){let r=E(e,n,o),i=r[0]?.barHeight??C(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.barHeight);return i}function Se(e,n=1,t=0,o=a$1){let r=G(e,n,o),i=r[0]?.lineHeight??w(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lineHeight);return i}function xe(e,n="100%",t=0,o=a$1){let r=O(e,n,o),i=r[0]?.barWidth??b(n);for(let s of r)t>=s.minWidth&&(i=s.barWidth);return i}function O(e,n="100%",t=a$1){if(!me(e,t))return [{minWidth:0,barWidth:b(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,barWidth:b(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barWidth=i.barWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,barWidth:b(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barWidth:b(n)}),o)}function D(e,n=R,t=a$1){if(!fe(e,t))return [{minWidth:0,lastBarWidth:c(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,lastBarWidth:c(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lastBarWidth=i.lastBarWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,lastBarWidth:c(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lastBarWidth:c(n)}),o)}function ke(e,n=R,t=0,o=a$1){let r=D(e,n,o),i=r[0]?.lastBarWidth??c(n);for(let s of r)t>=s.minWidth&&(i=s.lastBarWidth);return i}function be(e){let n=new Set,t=e.breakpointMap??a$1;for(let r of E(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,t))n.add(r.minWidth);for(let r of A(e.lines,1,t))n.add(r.minWidth);for(let r of G(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,t))n.add(r.minWidth);let o=e.barWidth!=null?O(e.barWidth,"100%",t):D(e.lastBarWidth,R,t);for(let r of o)n.add(r.minWidth);return Array.from(n).sort((r,i)=>r-i)}function H(e){let n=e.breakpointMap??a$1,t=e.responsiveBy??"viewport",r=be({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}).reduce((l,u)=>{let p=z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:u,breakpointMap:n}),m=l[l.length-1];return m&&ue(m.state,p)||l.push({minWidth:u,state:p}),l},[]),i=r[0]?.state??z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:0,breakpointMap:n}),s=r.reduce((l,u)=>Math.max(l,u.state.lineCount),i.lineCount);return {baseState:i,states:r.length?r:[{minWidth:0,state:i}],maxLines:s,usesResponsiveBarCss:r.length>1,baseLines:i.lineCount,baseLastBarWidth:i.barWidths[i.lineCount-1]??R,metrics:i.metrics,responsiveBy:t}}function F(e){let n="renderState"in e?e.renderState:H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:e.breakpointMap});if(!n.usesResponsiveBarCss)return [];let t=e.selectorPlaceholder??W,o=e.fitContent===true;return n.states.map(({minWidth:r,state:i})=>{let s=`${t} [data-rmg-skel-text-line="true"]`,l=`${s}:nth-child(-n+${i.lineCount})`,u=i.lineCount<n.maxLines?`${s}:nth-child(n+${i.lineCount+1})`:null,p=i.barWidths.map((g,y)=>o?`${s}:nth-child(${y+1}){width:${g} !important;max-width:${g} !important;}`:`${s}:nth-child(${y+1}){max-width:${g} !important;}`),m=o?`${l}{display:block !important;max-width:100% !important;}`:`${l}{display:block !important;width:100% !important;max-width:100% !important;}`,x=L(i.metrics);return {minWidth:r,query:n.responsiveBy,css:[`${t}{height:${i.metrics.totalHeight}px !important;padding-block:${i.metrics.paddingBlock}px !important;row-gap:${i.metrics.rowGap}px !important;}`,`@supports ${se}{${t}{height:${x.totalHeight}px !important;padding-block:${x.paddingBlock}px !important;row-gap:${x.rowGap}px !important;}}`,`${s}{display:none !important;height:${i.metrics.barHeight}px !important;}`,m,...u?[`${u}{display:none !important;}`]:[],...p].join("")}})}function V(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function Re(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function B(e,n=a$1){if(!V(e))return {baseStyle:e,rules:[]};let t={},o=new Map;for(let[r,i]of Object.entries(e)){let s=Re(r,n);if(s!=null&&V(i)){o.set(s,{...o.get(s)??{},...i});continue}t[r]=i;}return {baseStyle:Object.keys(t).length?t:void 0,rules:Array.from(o.entries()).sort((r,i)=>r[0]-i[0]).map(([r,i])=>({minWidth:r,style:i}))}}function P(e,n,t=a$1){let{baseStyle:o,rules:r}=B(e,t),i={...o??{}};for(let s of r){if(s.minWidth>n)break;Object.assign(i,s.style);}return Object.keys(i).length?i:void 0}function J(e,n=a$1){let{baseStyle:t,rules:o}=B(e,n);if(!t)return;if(!o.length)return t;let r=new Set;for(let s of o)for(let l of Object.keys(s.style))r.add(l);let i={};for(let[s,l]of Object.entries(t))r.has(s)||(i[s]=l);return Object.keys(i).length?i:void 0}function Y(e,n,t=a$1){let{rules:o}=B(e,t);for(let r of o)r.minWidth>0&&n.add(r.minWidth);}function ee(e){let n=e.breakpointMap??a$1,t=e.selector??W,o=[],{rules:r}=B(e.value,n);if(!r.length)return [];let i=new Set([0]);for(let s of r)i.add(s.minWidth);for(let s of Array.from(i).sort((l,u)=>l-u)){let l=P(e.value,s,n),u=l?e.serialize(l):"";u&&o.push({minWidth:s,css:`${t}{${u}}`,raw:true});}return o}function a(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function ne(e){if(!e)return {};let n=a(e.margin),t=a(e.marginTop),o=a(e.marginRight),r=a(e.marginBottom),i=a(e.marginLeft),s={};return n!=null&&(s.margin=n),t!=null&&(s.marginTop=t),o!=null&&(s.marginRight=o),r!=null&&(s.marginBottom=r),i!=null&&(s.marginLeft=i),s}function _(e,n){n&&(n.flex!=null&&(e.flex=n.flex),n.flexGrow!=null&&(e.flexGrow=n.flexGrow),n.flexShrink!=null&&(e.flexShrink=n.flexShrink),n.flexBasis!=null&&(e.flexBasis=a(n.flexBasis)),n.order!=null&&(e.order=n.order),n.alignSelf&&(e.alignSelf=n.alignSelf),n.boxSizing!=null&&(e.boxSizing=n.boxSizing));}function j(e,n){n&&(n.flex!=null&&e.push(`flex:${n.flex};`),n.flexGrow!=null&&e.push(`flex-grow:${n.flexGrow};`),n.flexShrink!=null&&e.push(`flex-shrink:${n.flexShrink};`),n.flexBasis!=null&&e.push(`flex-basis:${a(n.flexBasis)};`),n.order!=null&&e.push(`order:${n.order};`),n.alignSelf&&e.push(`align-self:${n.alignSelf};`),n.boxSizing!=null&&e.push(`box-sizing:${n.boxSizing};`));}function te(e,n){let t={};e?.aspectRatio!=null&&(t.aspectRatio=e.aspectRatio);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth),s=a(e?.height),l=a(e?.minHeight),u=a(e?.maxHeight);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),s!=null&&(t.height=s),l!=null&&(t.minHeight=l),u!=null&&(t.maxHeight=u),e?.aspectRatio!=null&&e?.height==null&&(t.height="auto"),e?.aspectRatio!=null&&e?.width==null&&e?.height==null&&(t.inlineSize="100%",t.width="100%",t.height="auto"),e?.backgroundColor&&(t["--rmg-skel-bg"]=e.backgroundColor),e?.borderRadius!=null&&(t["--rmg-skel-radius"]=a(e.borderRadius)),e?.overflow!=null&&(t.overflow=e.overflow),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),Object.assign(t,Te(n)),t}function I(e,n){let t=a(n?.margin),o=a(n?.marginTop),r=a(n?.marginRight),i=a(n?.marginBottom),s=a(n?.marginLeft);t!=null&&e.push(`margin:${t};`),o!=null&&e.push(`margin-top:${o};`),r!=null&&e.push(`margin-right:${r};`),i!=null&&e.push(`margin-bottom:${i};`),s!=null&&e.push(`margin-left:${s};`);}function We(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth),i=a(e.height),s=a(e.minHeight),l=a(e.maxHeight);return e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),i!=null&&n.push(`height:${i};`),s!=null&&n.push(`min-height:${s};`),l!=null&&n.push(`max-height:${l};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.aspectRatio!=null&&e.width==null&&e.height==null&&(n.push("inline-size:100%;"),n.push("width:100%;"),n.push("height:auto;")),e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),e.overflow!=null&&n.push(`overflow:${e.overflow};`),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function ve(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth);return t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function Be(e){if(!e)return "";let n=[];return e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),n.join("")}function Te(e,n){let t={},o=n?.enabledVarName??"--rmg-skel-shimmer-enabled";return e?.enabled===false&&(t[o]="0"),e?.durationMs!=null&&(t["--rmg-skel-shimmer-duration"]=`${e.durationMs}ms`),e?.angleDeg!=null&&(t["--rmg-skel-shimmer-angle"]=`${e.angleDeg}deg`),e?.opacity!=null&&(t["--rmg-skel-shimmer-opacity"]=String(e.opacity)),e?.blurPx!=null&&(t["--rmg-skel-shimmer-blur"]=`${e.blurPx}px`,t["--rmg-skel-shimmer-filter"]=e.blurPx>0?`blur(${e.blurPx}px)`:"none"),e?.timing&&(t["--rmg-skel-shimmer-timing"]=e.timing),e?.c1&&(t["--rmg-skel-shimmer-c1"]=e.c1),e?.c2&&(t["--rmg-skel-shimmer-c2"]=e.c2),e?.c3&&(t["--rmg-skel-shimmer-c3"]=e.c3),t}function q(e,n){let t={};n!=null&&(t.height=`${n}px`);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),t}function N(e){return typeof e=="string"&&e.trim()==="max-content"}function Ce(e){return !e||typeof e!="object"?false:N(e.width)?true:Object.values(e).some(t=>!!t&&typeof t=="object"&&N(t.width))}function Ae(e){let n=te(e,void 0);return delete n["--rmg-skel-bg"],e?.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e?.padding!=null&&(n.padding=a(e.padding)),e?.border!=null&&(n.border=e.border),e?.boxShadow!=null&&(n.boxShadow=e.boxShadow),e?.borderRadius!=null?(n.borderRadius=a(e.borderRadius),n.overflow=e?.overflow??"hidden"):e?.overflow!=null&&(n.overflow=e.overflow),n.boxSizing="border-box",n}function K(e){let n={};return e&&(e.position!=null&&(n.position=e.position),e.inset!=null&&(n.inset=a(e.inset)),e.insetBlock!=null&&(n.insetBlock=a(e.insetBlock)),e.insetInline!=null&&(n.insetInline=a(e.insetInline)),e.top!=null&&(n.top=a(e.top)),e.right!=null&&(n.right=a(e.right)),e.bottom!=null&&(n.bottom=a(e.bottom)),e.left!=null&&(n.left=a(e.left)),e.zIndex!=null&&(n.zIndex=e.zIndex),e.display!=null&&(n.display=e.display),e.flexDirection!=null&&(n.flexDirection=e.flexDirection),e.gap!=null&&(n.gap=a(e.gap)),e.rowGap!=null&&(n.rowGap=a(e.rowGap)),e.columnGap!=null&&(n.columnGap=a(e.columnGap)),e.padding!=null&&(n.padding=a(e.padding)),(e.align??e.alignItems)&&(n.alignItems=e.alignItems??e.align),e.alignContent!=null&&(n.alignContent=e.alignContent),(e.justify??e.justifyContent)&&(n.justifyContent=e.justifyContent??e.justify),e.aspectRatio!=null&&(n.aspectRatio=e.aspectRatio),e.flexWrap!=null?n.flexWrap=e.flexWrap:e.wrap&&(n.flexWrap="wrap"),e.width!=null&&(n.width=a(e.width)),e.minWidth!=null&&(n.minWidth=a(e.minWidth)),e.maxWidth!=null&&(n.maxWidth=a(e.maxWidth)),e.height!=null&&(n.height=a(e.height)),e.minHeight!=null&&(n.minHeight=a(e.minHeight)),e.maxHeight!=null&&(n.maxHeight=a(e.maxHeight)),e.aspectRatio!=null&&e.height==null&&(n.height="auto"),e.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e.borderRadius!=null&&(n.borderRadius=a(e.borderRadius)),e.border!=null&&(n.border=e.border),e.boxShadow!=null&&(n.boxShadow=e.boxShadow),e.margin!=null&&(n.margin=a(e.margin)),e.marginTop!=null&&(n.marginTop=a(e.marginTop)),e.marginRight!=null&&(n.marginRight=a(e.marginRight)),e.marginBottom!=null&&(n.marginBottom=a(e.marginBottom)),e.marginLeft!=null&&(n.marginLeft=a(e.marginLeft)),_(n,e),e.overflow!=null&&(n.overflow=e.overflow),e.transform!=null&&(n.transform=e.transform),e.pointerEvents!=null&&(n.pointerEvents=e.pointerEvents),e.opacity!=null&&(n.opacity=e.opacity)),n}function we(e,n=a$1){return B(e,n).rules.length>0}function He(e,n=0,t=a$1){return P(e,n,t)}function Ee(e,n=0,t=a$1){return P(e,n,t)}function ie(e,n=a$1){return J(e,n)}function X(e,n=a$1){return J(e,n)}function Ge(e,n,t=a$1){Y(e,n,t);}function U(e){return e.replace(/"/g,'\\"')}function ye(e){let n=[];return e.position!=null&&n.push(`position:${e.position};`),e.inset!=null&&n.push(`inset:${a(e.inset)};`),e.insetBlock!=null&&n.push(`inset-block:${a(e.insetBlock)};`),e.insetInline!=null&&n.push(`inset-inline:${a(e.insetInline)};`),e.top!=null&&n.push(`top:${a(e.top)};`),e.right!=null&&n.push(`right:${a(e.right)};`),e.bottom!=null&&n.push(`bottom:${a(e.bottom)};`),e.left!=null&&n.push(`left:${a(e.left)};`),e.zIndex!=null&&n.push(`z-index:${e.zIndex};`),e.display!=null&&n.push(`display:${e.display};`),e.flexDirection!=null&&n.push(`flex-direction:${e.flexDirection};`),e.gap!=null&&n.push(`gap:${a(e.gap)};`),e.rowGap!=null&&n.push(`row-gap:${a(e.rowGap)};`),e.columnGap!=null&&n.push(`column-gap:${a(e.columnGap)};`),e.padding!=null&&n.push(`padding:${a(e.padding)};`),(e.align??e.alignItems)&&n.push(`align-items:${e.alignItems??e.align};`),e.alignContent!=null&&n.push(`align-content:${e.alignContent};`),(e.justify??e.justifyContent)&&n.push(`justify-content:${e.justifyContent??e.justify};`),e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),e.flexWrap!=null?n.push(`flex-wrap:${e.flexWrap};`):e.wrap&&n.push("flex-wrap:wrap;"),e.width!=null&&n.push(`width:${a(e.width)};`),e.minWidth!=null&&n.push(`min-width:${a(e.minWidth)};`),e.maxWidth!=null&&n.push(`max-width:${a(e.maxWidth)};`),e.height!=null&&n.push(`height:${a(e.height)};`),e.minHeight!=null&&n.push(`min-height:${a(e.minHeight)};`),e.maxHeight!=null&&n.push(`max-height:${a(e.maxHeight)};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.backgroundColor!=null&&n.push(`background-color:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`border-radius:${a(e.borderRadius)};`),e.border!=null&&n.push(`border:${e.border};`),e.boxShadow!=null&&n.push(`box-shadow:${e.boxShadow};`),I(n,e),j(n,e),e.overflow!=null&&n.push(`overflow:${e.overflow};`),e.transform!=null&&n.push(`transform:${e.transform};`),e.pointerEvents!=null&&n.push(`pointer-events:${e.pointerEvents};`),e.opacity!=null&&n.push(`opacity:${e.opacity};`),n.join("")}function $(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:ye})}function Q(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:We})}function Le(e){let n=e.breakpointMap??a$1;if(!we(e.style,n))return [];let t=e.selector??W,o=[],r=new Set([0]);Y(e.style,r,n);for(let i of Array.from(r).sort((s,l)=>s-l)){let s=He(e.style,i,n),l=ve(s),u=Be(s),p=[l?`${t}{${l}}`:"",u?`${t} [data-rmg-skel-text-line="true"]{${u}}`:""].filter(Boolean).join("");p&&o.push({minWidth:i,css:p,raw:true});}return o}function M(e,n,t,o,r=a$1){if(e.kind===o){let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=M(i.item,n,t,o,r),p=Array.isArray(i.slots)?i.slots.map(m=>({...m,item:m?.item?M(m.item,n,t,o,r):m?.item})):void 0;return {...i,...l?{__rmgNodeId:l}:null,item:u,...p?{slots:p}:null}}switch(e.kind){case "rect":case "square":case "circle":{let i=e,s=Q({style:i.style,breakpointMap:r});if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...i,__rmgNodeId:l}}case "text":{let i=e,s=i.__rmgTextRenderState??H({barHeight:i.barHeight,barWidth:i.barWidth,lineHeight:i.lineHeight,lines:i.lines,lastBarWidth:i.lastBarWidth,responsiveBy:i.responsiveBy,breakpointMap:r}),l=[...F({renderState:s,fitContent:Ce(i.style)}).map(p=>({...p,raw:true})),...Le({style:i.style,breakpointMap:r})];if(!l.length&&!i.__rmgTextRenderState)return e;let u=l.length?n():void 0;return u&&l.length&&t.push({nodeId:u,rules:l}),{...i,...u?{__rmgNodeId:u}:null,__rmgTextRenderState:s}}case "media":{let i=e,s=[...$({style:i.style,breakpointMap:r}),...Q({style:i.tile?.style,breakpointMap:r,selector:`${W} [data-rmg-skel-media-tile="true"]`})];if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...e,__rmgNodeId:l}}case "stack":case "row":case "col":{let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=i.children.map(p=>M(p,n,t,o,r));return {...i,...l?{__rmgNodeId:l}:null,children:u}}default:return e}}function Oe(e){if(!e.rules.length)return "";let n=`[${e.scopeAttr}="${U(e.scopeId)}"]`,t=[];for(let o of e.rules){let r=`${n} [data-rmg-skel-node="${U(o.nodeId)}"]`;for(let i of o.rules){let s=i.raw?i.css.split("__NODE_SEL__").join(r):`${r}{${i.css}}`;i.minWidth<=0?t.push(s):i.query==="container"?t.push(`@container (min-width:${i.minWidth}px){${s}}`):t.push(`@media (min-width:${i.minWidth}px){${s}}`);}}return t.join(`
2
- `)}function re(e,n,t){return te(e,t?void 0:n)}function Z(e){let{kind:n,style:t,shimmer:o,disableShimmer:r,breakpointMap:i,mediaTile:s}=e,l=n==="circle"?h.skelCircle:n==="square"?h.skelSquare:h.skelRect,u=ie(t,i),p=e.__rmgNodeId;return jsx("div",{"data-rmg-skel-node":p,"data-rmg-skel-media-tile":s?"true":void 0,className:[h.skelTile,l,r?null:h.skelShimmer].filter(Boolean).join(" "),style:{...re(u,o,r),...ne(u)}})}function $e({node:e,disableShimmer:n,breakpointMap:t}){let o=e.__rmgTextRenderState??H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:t}),r=ie(e.style,t),i=e.__rmgNodeId,s=o.responsiveBy==="container"&&o.usesResponsiveBarCss,l=L(o.baseState.metrics),u=q(s?void 0:r,o.baseState.metrics.totalHeight),p=ne(r),m={height:o.baseState.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},x=N(r?.width),g=jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-text":"true",className:h.skelText,style:{...u,...s?null:p,paddingBlock:`${o.baseState.metrics.paddingBlock}px`,rowGap:`${o.baseState.metrics.rowGap}px`,"--rmg-skel-text-safari-height":`${l.totalHeight}px`,"--rmg-skel-text-safari-padding-block":`${l.paddingBlock}px`,"--rmg-skel-text-safari-row-gap":`${l.rowGap}px`},children:Array.from({length:o.maxLines}).map((y,T)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[h.skelTile,n?null:h.skelShimmer,h.skelTextLine].filter(Boolean).join(" "),style:{...re(m,e.shimmer,n),display:T>=o.baseState.lineCount?"none":void 0,width:x?o.baseState.barWidths[T]??"100%":"100%",maxWidth:o.baseState.barWidths[T]??"100%"}},T))});return s?jsx("div",{"data-rmg-skel-text-container":"true",style:{...q(r),...p,containerType:"inline-size"},children:g}):g}function Me({node:e,disableShimmer:n,breakpointMap:t}){let o=t??a$1;switch(e.kind){case "rect":case "square":case "circle":return jsx(Z,{...e,disableShimmer:n,breakpointMap:o});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",s=e.tile?.shape??"rect",l=e.__rmgNodeId,u=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":l,className:[h.skelGroup,i==="row"?h.skelRow:h.skelCol].join(" "),style:u,children:Array.from({length:r}).map((p,m)=>jsx(Z,{kind:s,style:e.tile?.style,shimmer:e.tile?.shimmer,disableShimmer:n,breakpointMap:o,mediaTile:true},m))})}case "stack":case "row":case "col":{let r=e.kind==="row"?h.skelRow:e.kind==="col"?h.skelCol:h.skelStack,i=e.__rmgNodeId,s=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":i,className:[h.skelGroup,r].join(" "),style:s,children:e.children.map((l,u)=>jsx(Me,{node:l,disableShimmer:n,breakpointMap:o},u))})}case "text":return jsx($e,{node:e,disableShimmer:n,breakpointMap:o});default:return null}}export{Oe as A,Me as B,h as a,W as b,se as c,ae as d,L as e,ce as f,ge as g,Se as h,be as i,H as j,F as k,a as l,ne as m,Te as n,Ae as o,K as p,He as q,Ee as r,ie as s,X as t,Ge as u,U as v,$ as w,Q as x,Le as y,M as z};
@@ -1 +0,0 @@
1
- import {A,z,n,l,B}from'./chunk-4BTS6IIA.mjs';import {a as a$1,d as d$1,e,b,c}from'./chunk-Z34PSRMG.mjs';import {a as a$3}from'./chunk-UUAWLGWO.mjs';import {a}from'./chunk-LVYED5ZM.mjs';import {a as a$2}from'./chunk-HK2DPKES.mjs';import*as d from'react';import {jsx,Fragment,jsxs}from'react/jsx-runtime';var o={shell:"Ue",contentLayer:"y",loadingLayer:"x",contentLayerVisible:"Ve",contentLayerBlocked:"We",loadingLayerOverlay:"er",loadingLayerCompare:"rr",loadingLayerExit:"ir"};function O(...e){return e.filter(Boolean).join(" ")}function Q({skeletonNode:e$1,children:S,ready:v,enabled:c$1=true,force:u,timing:R,shellClassName:M,shellStyle:N,loadingShellStyle:b$1,contentClassName:p,contentStyle:y,contentOwnsWrapperLayout:a$2,loadingLayerFirst:s,contentWrapper:i,shellDataAttributes:w}){let f=S!==void 0,x=a(),m=v===true,r=a$1(u),n=f&&c$1&&(r.enabled||!m),l=d.useMemo(()=>d$1({prefersReducedMotion:x,timing:R}),[x,R]),{showLoadingLayer:C,loadingExiting:k}=e({loadingActive:n,exitMs:l.exitMs,minVisibleMs:l.minVisibleMs}),t=d.useMemo(()=>b({loadingActive:n,loadingForced:u,contentReady:m}),[m,u,n]),P=d.useMemo(()=>c({exitMs:l.exitMs,compareMode:t.compareMode,loadingLayerOpacity:t.loadingLayerOpacity,opacityVarName:"--rmg-standalone-skeleton-opacity"}),[l.exitMs,t.compareMode,t.loadingLayerOpacity]);if(!f)return jsx(Fragment,{children:e$1});let L=c$1&&C,h=!c$1||t.compareMode||k||!L,T=c$1&&t.contentBlocked&&!k&&!a$2,G=i?i(S):S,B=L?jsx("div",{className:O(o.loadingLayer,a$2&&o.loadingLayerOverlay,t.compareMode&&o.loadingLayerCompare,k&&o.loadingLayerExit),style:P,"data-rmg-skeleton-loading-layer":"true",children:e$1}):null;return jsxs("div",{className:O(o.shell,M),style:{...L?b$1:null,...N},"aria-busy":n?true:void 0,"data-rmg-skeleton-wrapper":"true","data-rmg-skeleton-ready":m?"true":"false","data-rmg-skeleton-compare":t.compareMode?"true":"false","data-rmg-skeleton-layout-owner":a$2?"content":"skeleton",...w,children:[s?B:null,jsx("div",{className:O(o.contentLayer,h&&o.contentLayerVisible,T&&o.contentLayerBlocked,p),style:{"--rmg-loading-fade-duration":`${l.exitMs}ms`,...y},"aria-hidden":h?void 0:true,"data-rmg-skeleton-content-layer":"true",children:G}),s?null:B]})}function ie({layout:e,children:S,breakpoints:v,className:c,style:u,shellClassName:R,shellStyle:M,contentClassName:N,contentStyle:b,backgroundColor:p,radius:y,shimmer:a,disableShimmer:s,ariaLabel:i,ready:w,enabled:f,force:x,timing:m}){let r=d.useMemo(()=>({...a$2,...v??{}}),[v]),n$1=d.useMemo(()=>a$3("skel_",{layout:e,breakpoints:r,backgroundColor:p,radius:y,shimmer:a,disableShimmer:s}),[e,r,p,y,a,s]),{layout:l$1,responsiveCss:C}=d.useMemo(()=>{let P=0,L=()=>`n${++P}`,h=[];return {layout:z(e,L,h,"__standalone__",r),responsiveCss:A({scopeAttr:"data-rmg-skeleton-scope",scopeId:n$1,rules:h})}},[e,n$1,r]),k={...u,...p?{"--rmg-skel-bg":p}:null,...y!=null?{"--rmg-skel-radius":l(y)}:null,...s?null:n(a)};return jsx(Q,{skeletonNode:jsxs("div",{"data-rmg-skeleton-scope":n$1,className:c,style:k,"aria-hidden":i?void 0:true,"aria-label":i,role:i?"status":void 0,"aria-live":i?"polite":void 0,children:[C?jsx("style",{dangerouslySetInnerHTML:{__html:C}}):null,jsx(B,{node:l$1,disableShimmer:s,breakpointMap:r})]}),ready:w,enabled:f,force:x,timing:m,shellClassName:R,shellStyle:M,contentClassName:N,contentStyle:b,children:S})}export{Q as a,ie as b};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-JJMFOLJZ.mjs';import {b}from'./chunk-XUQO5F2F.mjs';import {a as a$2}from'./chunk-ULUKLQXS.mjs';import {a as a$3}from'./chunk-UML6FCOQ.mjs';import {d}from'./chunk-WMG2LTLR.mjs';import {c}from'./chunk-B4CC5AGE.mjs';import {a as a$1}from'./chunk-HK2DPKES.mjs';import*as X from'react';import {useCallback,useRef,useMemo,useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var Un=300,Vn="cubic-bezier(.4,0,.22,1)",M={enabled:false,controls:{close:{enabled:true,style:{},className:"",render:void 0},arrows:{enabled:true,arrow:{},prev:{},next:{},render:void 0,renderPrev:void 0,renderNext:void 0},counter:{enabled:true,style:{},className:"",render:void 0}},effects:{introDuration:300,introEasing:"cubic-bezier(.4,0,.22,1)",introFade:false,crossfade:{controls:false,drag:false,durationMs:120,easing:"cubic-bezier(.4,0,.22,1)"}},slider:{gap:0,duration:25,friction:.68,direction:"ltr",skipSnaps:false,strictSnaps:false},zoom:{...a},caption:{overlayCrossfadeTarget:"content",overlayCrossfadeDurationMs:300,overlayCrossfadeEasing:"cubic-bezier(.4,0,.22,1)",zoomFade:true,zoomFadeDurationMs:Un,zoomFadeEasing:Vn,zoomInTransform:"",zoomOutTransform:""}};function Ae(n=0){let l=n,s=new Set,c=new Set,u=new Set,S={get:()=>l,requestSet(o,F="animated",b){s.forEach(L=>L({type:"requestSet",index:o,mode:F,meta:b?.meta}));},requestPrev(){s.forEach(o=>o({type:"requestPrev"}));},requestNext(){s.forEach(o=>o({type:"requestNext"}));},requestCenter(){s.forEach(o=>o({type:"center"}));},onEvent(o){return c.add(o),()=>c.delete(o)},onRequest(o){return s.add(o),()=>s.delete(o)},setLocalIndex(o){l=o,c.forEach(F=>F({type:"internalIndex",index:o}));},onBasePointerDown(o){return u.add(o),()=>u.delete(o)},emitBasePointerDown(){u.forEach(o=>o());},destroy(){s.clear(),c.clear(),u.clear();}};return queueMicrotask(()=>{c.forEach(o=>o({type:"mounted"}));}),S}function He(n=1e4){let l=null;function s(c=400){l?.();let u=document.createElement("div");Object.assign(u.style,{position:"fixed",inset:"0",zIndex:String(n),background:"transparent",touchAction:"none",pointerEvents:"auto"}),document.body.appendChild(u);let S=()=>{u.parentNode&&u.remove();},o=window.setTimeout(()=>{S(),l=null;},c),F=()=>{window.clearTimeout(o),S(),l=null;};return l=F,F}return {add:s}}function _e(){return {width:a$3(),height:typeof window<"u"&&window.innerHeight>0?window.innerHeight:0}}function Ne(){let[n,l]=X.useState(()=>typeof window>"u"?{width:1024,height:768}:_e());return X.useEffect(()=>{if(typeof window>"u")return;let s=()=>{let c=_e();l(u=>u.width===c.width&&u.height===c.height?u:c);};return window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)},[]),n}function ke(n,l,s){return s||(l??"scale")==="fade"||!n||n.kind!=="image"?"fade":"scale"}function Wn(n){return n?n instanceof HTMLImageElement?n:n instanceof HTMLElement?n.querySelector("img"):null:null}function Yn(n,l){if(n===l)return true;if(!n||!l)return !n&&!l;let s=Object.keys(n),c=Object.keys(l);if(s.length!==c.length)return false;for(let u of s)if(n[u]!==l[u])return false;return true}function Zn(n,l){return n?n.position===l.position&&n.className===l.className&&n.fadeDurationMs===l.fadeDurationMs&&n.fadeEasing===l.fadeEasing&&Yn(n.style,l.style):false}var Gn=[];function jn(n,l){if(!l)return n;let s={...n,...l};return (n.slider||l.slider)&&(s.slider={...n.slider??{},...l.slider??{}}),(n.zoom||l.zoom)&&(s.zoom={...n.zoom??{},...l.zoom??{}}),(n.controls||l.controls)&&(s.controls={...n.controls??{},...l.controls??{}}),(n.caption||l.caption)&&(s.caption={...n.caption??{},...l.caption??{}}),(n.video||l.video)&&(s.video={...n.video??{},...l.video??{}}),(n.lazyLoad||l.lazyLoad)&&(s.lazyLoad={...n.lazyLoad??{},...l.lazyLoad??{},images:n.lazyLoad?.images||l.lazyLoad?.images?{...n.lazyLoad?.images??{},...l.lazyLoad?.images??{}}:void 0,videos:n.lazyLoad?.videos||l.lazyLoad?.videos?{...n.lazyLoad?.videos??{},...l.lazyLoad?.videos??{}}:void 0}),(n.effects||l.effects)&&(s.effects={...n.effects??{},...l.effects??{},crossfade:n.effects?.crossfade||l.effects?.crossfade?{...n.effects?.crossfade??{},...l.effects?.crossfade??{}}:void 0}),s}function Kn(n,l){return l.reduce((s,c)=>jn(s,c.options),n??{})}function Rt(n){let{fullscreen:l,plugins:s=Gn}=n,c$1=d();if(!c$1)throw new Error("useFullscreenController() must be used inside <GalleryCore />");let{layout:u,resolveLayoutlessTarget:S,normalizedItems:o,fsOpenSub:F,setFullscreenOpen:b$1,sliderApiRef:L,getFullscreenAdapter:te,effectiveBreakpoints:re}=c$1,I=useCallback(t=>te(t),[te]),le=useCallback((t,r)=>{I(t)?.syncBeforeOpen?.(r);},[I]),se=useCallback(t=>I(t)?.closestSelector??(t==="slider"?".rmg__slide":t==="masonry"?".rmg__masonry-item":t==="api"?'[data-rmg-idx], [data-rmg-layoutless-item], article, figure, section, button, [role="button"], a[href], .rmg__grid-item, .rmg__masonry-item, .rmg__slide':".rmg__grid-item"),[I]),m=I("entries")?.getEntryContext?.()??{},Be=useRef(null),oe=useMemo(()=>m.entriesObject??{render:{},mediaLayout:"slider"},[m.entriesObject]),C=m.entryMapRef??Be,O=m.entryMediaLayout??oe.mediaLayout??"slider",Xe=u==="entries"&&!!m.entriesObject&&!!m.entryMapRef,ie=useCallback(t=>{if(u==="entries"&&O==="slider"){let d=C.current?.[t]??null,a=m.entrySliderRefs?.current??null;return (d&&a?a[d.entryIndex]:null)??null}return L.current??null},[u,O,C,m.entrySliderRefs,L]),R=useMemo(()=>Ae(0),[]),[Ue,U]=useState(0),V=useRef(false),Ve=useRef(false),We=useRef([]),[ue,ce]=useState(false),Ye=useRef(null),Ze=useRef(false),P=c$1.expandableImageRefs,de=useRef(null),ae=useRef(null),fe=useRef(null),me=useRef(null),pe=useRef(null),ye=useRef(null),[g,W]=useState(false),Y=Ne(),Z=useRef(1),Ge=useRef({x:0,y:0}),je=useRef({x:0,y:0}),q=useRef(null),A=useRef([]),G=useRef(1),j=useRef(0),K=useRef(0),J=useRef(0),H=useRef(false),_=useRef(R.get()),[Fe,ge]=useState(false),[h,Ke]=useState(false),Je=useRef(false),[Qe,$e]=useState(false),Se=useRef(false),en=useRef(null),nn=useRef(null),tn=useRef(false),rn=useRef("idle"),ln=useRef(null),sn=useRef(null),on=useRef(null),un=useRef(null),cn=useRef(null),dn=useRef(null),an=useRef(null),fn=useRef(null),mn=useRef(null),pn=useRef(null),Q=useRef(null),[yn,Re]=useState(null),[he,Fn]=useState(null),gn=useRef(false),be=useRef(null),ve=useRef(null),Sn=useRef(null),Rn=useRef(null),hn=useRef(null),bn=useRef(null),vn=useRef(false),Mn=useRef(null),[En,Tn]=useState([]),Ln=useRef([]),xn=useRef([]),wn=useRef(false),Me=useRef([]),[In,Ee]=useState(null),Cn=useRef(null),Te=useRef(null),N=useRef(null),$=useMemo(()=>s.find(t=>t?.RuntimeHost),[s]),ee=$?.RuntimeHost,k=!!ee,v=useMemo(()=>Kn(l,s),[l,s]),i=useMemo(()=>{let t={...v??{}};delete t.thumbnails;let r={...v?.effects??{}};return delete r.thumbnailsFadeDuration,delete r.thumbnailsFadeEasing,{...M,...t,slider:{...M.slider,...v?.slider??{}},zoom:{...M.zoom,...v?.zoom??{}},effects:{...M.effects,...r,crossfade:{...M.effects.crossfade,...r.crossfade??{}}},controls:{...v?.controls??{}},caption:{...M.caption,...v?.caption??{}}}},[v]),On=useCallback(t=>{Z.current=t;let r=Se.current,d=t>1.01;d!==r&&(Se.current=d,$e(d));},[]);function zn(t,r,d,a=a$1){return t==null?null:typeof t=="object"||Array.isArray(t)?c(t,"bottom",d,a):r==null||d>=r?t:"bottom"}useEffect(()=>{typeof window>"u"||(ve.current=He(1e4));},[]),useEffect(()=>{i.enabled&&$?.preload?.();},[i.enabled,$]);let Dn=useCallback(t=>{be.current?.();let r=ve.current?.add(t);be.current=r??null;},[]),Pn=useCallback(t=>{Q.current=t,Fn(t);},[]),Le=useCallback(t=>{Re(r=>Zn(r,t)?r:t);},[]),xe=useCallback(()=>{Re(null);},[]),ne=i.slider.direction??"ltr",qn=useMemo(()=>o.length>1?b(i.slider.gap,Y.width,re):0,[i.slider.gap,Y.width,re,o.length]),An=useMemo(()=>({mountEl:he,fsSub:R,visible:g,invisible:h,direction:ne,registerLayout:Le,clearLayout:xe}),[he,R,g,h,ne,Le,xe]),z=useCallback(t=>{if(_.current=t,u==="entries"&&O==="slider"){let a=C.current?.[t]??null,B=m.entrySliderRefs?.current??null,p=(a&&B?B[a.entryIndex]:null)?.getInternals?.();if(p){q.current=p.slider.current,A.current=p.slides.current,G.current=p.visibleImages.current,j.current=p.selectedIndex.current,K.current=p.sliderX.current,J.current=p.sliderVelocity.current,H.current=p.isWrapping.current;return}}let r=L.current?.getInternals?.();r&&(q.current=r.slider.current,A.current=r.slides.current,G.current=r.visibleImages.current,j.current=r.selectedIndex.current,K.current=r.sliderX.current,J.current=r.sliderVelocity.current,H.current=r.isWrapping.current);},[u,O,C,m.entrySliderRefs,L]),x=useCallback((t,r,d,a)=>{if(!i.enabled||!k)return;if(Te.current||h){N.current={source:t,index:r,originEl:d??null,requestedMethod:a};return}if(le(t,r),!o.length)return;let w=r;(u==="grid"||u==="masonry")&&(w=r);let p=o[w],D=null;d&&(d instanceof HTMLImageElement?D=d:D=d.querySelector("img")),D||(D=Wn(P.current[r]??null)??S(r).image);let we=ke(p,a,!!i.effects?.introFade),kn=we==="scale"?D:null,Bn=se(t),Xn={originalImage:kn,index:w,method:we,closestSelector:Bn};V.current=true,b$1(true),R.setLocalIndex(w),W(true),Ee(Xn),U(w);},[i.enabled,o,le,u,h,b$1,R,P,S,se,k]);useEffect(()=>{if(!i.enabled)return;let t=R.onEvent(r=>{r.type==="internalIndex"&&Number.isFinite(r.index)&&(z(r.index),U(r.index));});return ()=>t()},[i.enabled,R,z]),useEffect(()=>{if(!i.enabled){N.current=null;return}if(g||h)return;let t=N.current;if(!t)return;N.current=null;let r=window.requestAnimationFrame(()=>{x(t.source,t.index,t.originEl,t.requestedMethod);});return ()=>window.cancelAnimationFrame(r)},[i.enabled,g,h,x]);let Hn=()=>{ie(_.current)?.centerSlider?.();},_n=(t,r)=>{ie(_.current)?.setIndex?.(t,r);};useEffect(()=>{if(!i.enabled)return;let t=F.subscribe(r=>{z(r.index);let d=r.requestedMethod,a=r.method;a?x(r.source,r.index,r.image??null,a):x(r.source,r.index,r.image??null,d);});return ()=>t?.()},[i.enabled,F,x,z]),useEffect(()=>{g||b$1(false);},[g,b$1]),useEffect(()=>{c$1.setFsEnabled(i.enabled&&k);},[c$1,i.enabled,k]);let Nn=i.enabled&&ee?jsx(ee,{fsEnabled:i.enabled,fsSub:R,showFullscreenModal:g,setShowFullscreenModal:W,setShowFullscreenSlider:ce,showFullscreenSlider:ue,isClick:V,isAnimatingRef:vn,overlayDivRef:de,duplicateImgRef:ae,cells:Me,slidesForFullscreen:A,sliderForFullscreen:q,isWrappingForFullscreen:H,setClosingModal:Ke,closingModal:h,closeButtonRef:fe,counterRef:me,leftChevronRef:pe,rightChevronRef:ye,centerSliderForFullscreen:Hn,setSliderIndexForFullscreen:_n,layout:u,expandableImageRefs:P,resolveLayoutlessTarget:S,entryMapRef:C,entryMediaLayout:O,introFade:i.effects.introFade,introDuration:i.effects.introDuration,introEasing:i.effects.introEasing,fullscreenSliderApi:Ye,slideIndex:Ue,isZoomClick:Ve,isZoomed:Qe,windowSize:Y,imageRefs:We,wrappedItems:En,setWrappedItems:Tn,scale:Z.current,isZooming:Ze,singleModePlyrRefs:Ln,wrappedModePlyrRefs:xn,direction:ne,sliderGap:qn,sliderDuration:i.slider.duration,sliderFriction:i.slider.friction,sliderSkipSnaps:i.slider.skipSnaps,sliderStrictSnaps:i.slider.strictSnaps,suppressLoopRef:gn,fsFadeOpening:Fe,normalizedItems:o,fsThumbContainerRef:Q,fullscreenThumbnailSlot:yn,setFullscreenThumbnailMountEl:Pn,showFsEntryOverlayMount:g&&Xe,fsIntroReq:In,clearFsIntroReq:()=>Ee(null),styles:a$2,fs:i,overlayCaptionRef:mn,overlayCaptionRootRef:pn,setFsFadeOpening:ge,addShield:Dn,resolveFsCaptionPlacement:zn,requestFsCloseRef:Cn,cancelFsCloseRef:Te,suppressNextClickRef:wn,currentImage:en,scaleRef:Z,pointerDownRef:tn,interactionModeRef:rn,boundsX:hn,boundsY:bn,bodyX:Sn,bodyY:Rn,locX:ln,locY:sn,prevX:on,prevY:un,offX:cn,offY:dn,tgtX:an,tgtY:fn,axisRef:nn,animRef:Mn,setScale:On,previousZoom:je,panRef:Ge,changingSlides:Je,fsIndexRef:_,entriesObject:oe,syncFullscreenSourceFromIndex:z,setFullscreenOpen:b$1,runtimePlugins:s}):null;return {fs:i,fullscreenNode:Nn,fullscreenThumbnailBridge:An,openFullscreenAt:x,isClick:V,expandableImageRefs:P,overlayDivRef:de,duplicateImgRef:ae,closeButtonRef:fe,counterRef:me,leftChevronRef:pe,rightChevronRef:ye,sliderForFullscreen:q,slidesForFullscreen:A,visibleImagesForFullscreen:G,selectedIndexForFullscreen:j,sliderXForFullscreen:K,sliderVelocityForFullscreen:J,isWrappingForFullscreen:H,fsThumbContainerRef:Q,cells:Me,setSlideIndex:U,setShowFullscreenModal:W,setShowFullscreenSlider:ce,setFsFadeOpening:ge,showFullscreenModal:g,showFullscreenSlider:ue,fsFadeOpening:Fe,closingModal:h}}export{Rt as a};
@@ -1,4 +0,0 @@
1
- import {p,t,v as v$1,c as c$1,u,i,z,A,q as q$1,r,j as j$1,e as e$1,f,g,d,h}from'./chunk-4BTS6IIA.mjs';import {a,c,e}from'./chunk-HK2DPKES.mjs';import*as F from'react';import {jsx}from'react/jsx-runtime';var ln=Object.assign(function({children:e}){return F.createElement(F.Fragment,null,e)},{__rmgMasonryItem:true,displayName:"Masonry.Item"});function $e(t,e){let n=e[t];if(typeof n=="number"&&Number.isFinite(n))return n;let r=parseFloat(t);return Number.isNaN(r)?0:r}function Zt(t){if(t==="full")return t;if(!(typeof t!="number"||!Number.isFinite(t)))return Math.max(1,t|0)}function Fe(t){let e=F.Children.toArray(t);return e.length===0?null:e.length===1?e[0]??null:F.createElement(F.Fragment,null,t)}function He(t){return F.isValidElement(t)&&!!t.type?.__rmgMasonryItem}function un(t){if(!He(t))return {node:t};let e={span:t.props.span,className:t.props.className,style:t.props.style};return {node:Fe(t.props.children),layoutMeta:e}}function Be(t){return !!t&&typeof t=="object"&&!Array.isArray(t)}function gt(t,e){if(!Be(t)){let r=Zt(t);return r==null?[]:[{minWidth:0,span:r}]}let n=Object.entries(t).map(([r,i])=>({minWidth:$e(r,e),span:Zt(i)})).filter(r=>r.span!=null).sort((r,i)=>r.minWidth-i.minWidth);return n.length===0?[]:(n[0].minWidth>0?n.unshift({minWidth:0,span:n[0].span}):n[0].minWidth<0&&(n[0]={...n[0],minWidth:0}),n)}function Te(t,e){let n=Math.max(1,e|0);return t==="full"?n:typeof t!="number"||!Number.isFinite(t)?1:Math.max(1,Math.min(n,t|0))}function Gt(t){let{span:e,columnCount:n,width:r,breakpointMap:i}=t,s=gt(e,i);if(!s.length)return 1;let a=s[0].span;for(let o of s)if(r>=o.minWidth)a=o.span;else break;return Te(a,n)}var tt=240,ue=[55,90,130,75];function pe(t){return t!=null&&Number.isFinite(t)?[{minWidth:0,value:t}]:[]}function Ie(t){return t!=null&&Number.isFinite(t)?t:void 0}function Ae(){return {ratios:[...ue],radius:12}}function B(t){return `${Math.max(0,t)}px`}function I(t){return `calc(${t})`}function Yt(t){let e=t.trim();for(;e.startsWith("(")&&e.endsWith(")");){let n=0,r=true;for(let i=0;i<e.length;i++){let s=e[i];if(s==="("&&(n+=1),s===")"&&(n-=1),n===0&&i<e.length-1){r=false;break}if(n<0){r=false;break}}if(!r||n!==0)break;e=e.slice(1,-1).trim();}return e}function ce(t){let e=Yt(t);return e.startsWith("calc(")&&e.endsWith(")")?Yt(e.slice(5,-1).trim()):e}function j(t){return `(${ce(t)})`}function Y(t){let e=ce(t);if(!e)return null;let n=e.match(/^(-?\d*\.?\d+)([a-zA-Z%]+)?$/);if(!n)return null;let r=Number(n[1]);return Number.isFinite(r)?{value:r,unit:n[2]??null}:null}function Ve(t){let e=Y(t);return e!=null&&e.value===0}function mt(t,e,n){return Number.isFinite(t)?t===0&&n?.preferPxForZero?"0px":e?`${t}${e}`:`${t}`:e?`0${e}`:"0"}function b(t){let e=t.filter(Boolean);if(!e.length)return "0px";let n=[],r=0;for(let i of e){let s=Y(i);if(!s){n.push(i);continue}if(s.unit==="px"||s.unit==null&&s.value===0){r+=s.value;continue}n.push(i);}return (r!==0||!n.length&&r===0)&&n.push(mt(r,"px",{preferPxForZero:true})),n.length===1?n[0]:I(n.map(j).join(" + "))}function Nt(t,e){if(Ve(e))return t;let n=Y(t),r=Y(e);return n&&r&&(n.unit===r.unit&&n.unit!=null||n.unit==="px"&&r.unit==null&&r.value===0||r.unit==="px"&&n.unit==null&&n.value===0||n.unit==null&&r.unit==null)?mt(n.value-r.value,n.unit??r.unit,{preferPxForZero:(n.unit??r.unit)==="px"}):I(`${j(t)} - ${j(e)}`)}function v(t,e){if(!Number.isFinite(e))return I(`${j(t)} * ${e}`);if(e===0)return "0px";if(e===1)return t;let n=Y(t);return n?mt(n.value*e,n.unit,{preferPxForZero:n.unit==="px"}):I(`${j(t)} * ${e}`)}function Ut(t,e){if(!Number.isFinite(e)||e===0)return I(`${j(t)} / ${e}`);if(e===1)return t;let n=Y(t);return n?mt(n.value/e,n.unit,{preferPxForZero:n.unit==="px"}):I(`${j(t)} / ${e}`)}function de(t){let e=t.filter(Boolean);return e.length?e.length===1?e[0]:`max(${e.join(", ")})`:"0px"}function Xt(t,e){if(!t)return [];if(typeof t=="number")return [];if(typeof t=="string")return [];if(typeof t!="object")return [];let n=[];for(let[i,s]of Object.entries(t)){let a=Number(s);if(!Number.isFinite(a))continue;if(String(+i)===i){let l=+i;Number.isFinite(l)&&l>=0&&n.push({minWidth:l,value:a});continue}let o=e?.[i];typeof o=="number"&&Number.isFinite(o)&&n.push({minWidth:o,value:a});}n.sort((i,s)=>i.minWidth-s.minWidth);let r=[];for(let i of n){let s=r[r.length-1];s&&s.minWidth===i.minWidth?s.value=i.value:r.push(i);}return r}function Jt(t,e,n){if(t==null)return n;if(typeof t=="number")return t;if(typeof t=="string"){let r=Number(t);return Number.isFinite(r)?r:n}return e.length?e[0].value:n}function Qt(t,e,n){let r=n;for(let i of t)if(i.minWidth<=e)r=i.value;else break;return r}function Oe(t,e){if(!(!t&&!e))return {...t||{},...e||{}}}function L(t,e){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let n=t.trim();if(!n)return null;if(n.endsWith("%")){let i=Number(n.slice(0,-1));return !Number.isFinite(i)||e==null?null:e*i/100}let r=parseFloat(n);return Number.isFinite(r)?r:null}function T(t,e){if(t==null)return null;if(typeof t=="number")return B(t);let n=t.trim();if(!n)return null;if(n.endsWith("%")){let r=Number(n.slice(0,-1));return !Number.isFinite(r)||!e?null:v(e,r/100)}return n}function me(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)&&t>0?t:null;let e=t.replace(/\s+/g,"");if(!e)return null;if(e.includes("/")){let[r,i]=e.split("/"),s=Number(r),a=Number(i);return Number.isFinite(s)&&Number.isFinite(a)&&s>0&&a>0?s/a:null}let n=parseFloat(e);return Number.isFinite(n)&&n>0?n:null}function et(t,e,n){if(t==null)return 0;let r=t.toString().trim().split(/\s+/).map(i=>L(i,n)).filter(i=>Number.isFinite(i));return r.length?r.length===1?r[0]*2:r.length===2?e==="block"?r[0]*2:r[1]*2:r.length===3?e==="block"?r[0]+r[2]:r[1]*2:e==="block"?r[0]+r[2]:r[1]+r[3]:0}function nt(t,e,n){if(t==null)return null;let r=t.toString().trim().split(/\s+/).map(i=>T(i,n)).filter(Boolean);return r.length?r.length===1?v(r[0],2):r.length===2?v(e==="block"?r[0]:r[1],2):r.length===3?e==="block"?b([r[0],r[2]]):v(r[1],2):b(e==="block"?[r[0],r[2]]:[r[1],r[3]]):null}function he(t){if(typeof t!="string")return 0;let e=t.trim().split(/\s+/)[0],n=L(e);return n!=null?n*2:0}function fe(t){return he(t)}function xe(t){if(typeof t!="string")return null;let e=t.trim().split(/\s+/)[0],n=T(e);return n?v(n,2):null}function _e(t){return xe(t)}function q(t,e){return (L(t?.marginTop,e)??0)+(L(t?.marginBottom,e)??0)}function Z(t,e){let n=T(t?.marginTop,e),r=T(t?.marginBottom,e);return !n&&!r?null:b([n??"0px",r??"0px"])}function te(t,e){return t?q(t,e)+et(t.padding,"block",e)+he(t.border):0}function ee(t,e){return t?b([Z(t,e)??"0px",nt(t.padding,"block",e)??"0px",xe(t.border)??"0px"]):null}function ye(t,e){return t==null?null:Math.max(0,t-et(e?.padding,"inline",t)-fe(e?.border))}function je(t,e){if(!t)return null;let n=nt(e?.padding,"inline",t),r=_e(e?.border);return !n&&!r?t:Nt(t,b([n??"0px",r??"0px"]))}function wt(t,e){return {slope:t.slope*e,intercept:t.intercept*e}}function be(t,e){return {slope:t.slope,intercept:t.intercept-e}}function ge(t,e){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?{slope:0,intercept:t}:null;let n=t.trim();if(!n)return null;if(n.endsWith("%")){let i=Number(n.slice(0,-1));return Number.isFinite(i)?wt(e,i/100):null}let r=parseFloat(n);return Number.isFinite(r)?{slope:0,intercept:r}:null}function Me(t,e,n){if(t==null)return {slope:0,intercept:0};let r=t.toString().trim().split(/\s+/).map(a=>ge(a,n));if(!r.length||r.some(a=>a==null))return null;let i=(a,o)=>({slope:a.slope+o.slope,intercept:a.intercept+o.intercept}),s=(a,o)=>wt(a,o);return r.length===1?s(r[0],2):r.length===2?s(r[1],2):r.length===3?s(r[1],2):i(r[1],r[3])}function De(t,e){let n=ge(t?.width,e)??e;return t?.maxWidth==null?n:null}function ze(t,e){let n=Me(e?.padding,"inline",t);return n?be({slope:t.slope-n.slope,intercept:t.intercept-n.intercept},fe(e?.border)):null}function ne(t,e){let n=Me(e?.padding,"inline",t);return n?{slope:t.slope-n.slope,intercept:t.intercept-n.intercept}:null}function pt(t,e){return t==null?null:Math.max(0,t-et(e?.padding,"inline",t))}function re(t,e){if(!t)return null;let n=nt(e?.padding,"inline",t);return n?Nt(t,n):t}function ct(t,e){let n=L(t?.width,e)??e,r=L(t?.maxWidth,e);return r==null?Math.max(0,n):Math.max(0,Math.min(n,r))}function Wt(t,e){let n=T(t?.width,e)??e,r=T(t?.maxWidth,e);return r?de([`min(${n}, ${r})`]):n}function Ce(t){let e=t.node.responsiveBy==="container"&&t.availableWidthPx!=null&&Number.isFinite(t.availableWidthPx)&&t.availableWidthPx>0?t.availableWidthPx:t.responsiveMinWidth,n=q$1(t.node.style,t.responsiveMinWidth,t.breakpointMap);if(t.conservativeContainerText&&t.node.responsiveBy==="container"){let a=t.node.__rmgTextRenderState??j$1({barHeight:t.node.barHeight,barWidth:t.node.barWidth,lineHeight:t.node.lineHeight,lines:t.node.lines,lastBarWidth:t.node.lastBarWidth,responsiveBy:t.node.responsiveBy,breakpointMap:t.breakpointMap}),o=a.states.reduce((l,c)=>c.state.metrics.totalHeight>l.metrics.totalHeight?c.state:l,a.baseState);return {style:n,metrics:t.textMetricsMode==="safari"?e$1(o.metrics):o.metrics}}let r=f(t.node.lines,1,e,t.breakpointMap),i=g(t.node.barHeight,typeof t.node.barHeight=="number"?t.node.barHeight:0,e,t.breakpointMap),s=d({barHeight:i,lineHeight:h(t.node.lineHeight,typeof t.node.lineHeight=="number"?t.node.lineHeight:1,e,t.breakpointMap),lines:r});return {style:n,metrics:t.textMetricsMode==="safari"?e$1(s):s}}function U(t,e,n=a){return r(t,e,n)}function Pt(t,e){let n=e?.responsiveMinWidth??0,r=e?.availableWidthPx??null,i=e?.breakpointMap??a,s=e?.conservativeContainerText===true,a$1=e?.textMetricsMode??"default";if(t.kind==="rect"||t.kind==="square"||t.kind==="circle"){let o=q$1(t.style,n,i),l=L(o?.height,r??void 0);if(l!=null)return l+q(o,r??void 0);let c=ct(o,r??tt);if(t.kind==="square"&&c!=null)return c+q(o,r??void 0);let u=me(o?.aspectRatio);if(u!=null&&c!=null&&c>0)return c/u+q(o,r??void 0);let p=q(o,r??void 0);return p>0?p:null}if(t.kind==="text"){let{style:o,metrics:l}=Ce({node:t,responsiveMinWidth:n,availableWidthPx:r,breakpointMap:i,conservativeContainerText:s,textMetricsMode:a$1});return l.totalHeight+q(o,r??void 0)}if(t.kind==="media"){let o=U(t.style,n,i),l=pt(r,o),c=L(o?.gap,l??void 0)??0,u=et(o?.padding,"block",r??void 0),p=Math.max(0,t.count|0),h={kind:t.tile?.shape??"rect",style:t.tile?.style,shimmer:t.tile?.shimmer},y=(t.direction??"row")==="row"&&p>1&&l!=null?Math.max(0,(l-c*Math.max(0,p-1))/p):l,m=Pt(h,{responsiveMinWidth:n,availableWidthPx:y,breakpointMap:i,conservativeContainerText:s,textMetricsMode:a$1});return m==null?u||null:(t.direction??"row")==="row"||p<=1?m+u:m*p+c*Math.max(0,p-1)+u}if(t.kind==="row"||t.kind==="col"||t.kind==="stack"){let o=U(t.style,n,i),l=pt(r,o),c=L(o?.gap,l??void 0)??0,u=et(o?.padding,"block",r??void 0),p=t.children.map(h=>Pt(h,{responsiveMinWidth:n,availableWidthPx:l,breakpointMap:i,conservativeContainerText:s,textMetricsMode:a$1})).filter(h=>h!=null);return p.length?t.kind==="row"?Math.max(...p)+u:p.reduce((h,y)=>h+y,0)+c*Math.max(0,p.length-1)+u:u||null}return null}function kt(t,e){let n=e?.responsiveMinWidth??0,r=e?.availableWidthExpr??null,i=e?.availableWidthPx??null,s=e?.breakpointMap??a,a$1=e?.conservativeContainerText===true,o=e?.textMetricsMode??"default";if(t.kind==="rect"||t.kind==="square"||t.kind==="circle"){let l=q$1(t.style,n,s),c=T(l?.height,r??void 0);if(c!=null)return b([c,Z(l,r??void 0)??"0px"]);let u=Wt(l,r??B(tt));if(t.kind==="square")return b([u,Z(l,r??void 0)??"0px"]);let p=me(l?.aspectRatio);return p!=null?b([Ut(u,p),Z(l,r??void 0)??"0px"]):Z(l,r??void 0)??null}if(t.kind==="text"){let{style:l,metrics:c}=Ce({node:t,responsiveMinWidth:n,availableWidthPx:i,breakpointMap:s,conservativeContainerText:a$1,textMetricsMode:o});return b([B(c.totalHeight),Z(l,r??void 0)??"0px"])}if(t.kind==="media"){let l=U(t.style,n,s),c=re(r,l),u=pt(i,l),p=T(l?.gap,c??void 0)??"0px",h=L(l?.gap,u??void 0)??0,y=nt(l?.padding,"block",r??void 0)??"0px",m=Math.max(0,t.count|0),f={kind:t.tile?.shape??"rect",style:t.tile?.style,shimmer:t.tile?.shimmer},S=(t.direction??"row")==="row"&&m>1&&c!=null?Ut(Nt(c,v(p,Math.max(0,m-1))),m):c,W=(t.direction??"row")==="row"&&m>1&&u!=null?Math.max(0,(u-h*Math.max(0,m-1))/m):u,M=kt(f,{responsiveMinWidth:n,availableWidthExpr:S,availableWidthPx:W,breakpointMap:s,conservativeContainerText:a$1,textMetricsMode:o});return M==null?y||null:(t.direction??"row")==="row"||m<=1?b([M,y]):b([v(M,m),v(p,Math.max(0,m-1)),y])}if(t.kind==="row"||t.kind==="col"||t.kind==="stack"){let l=U(t.style,n,s),c=re(r,l),u=pt(i,l),p=T(l?.gap,c??void 0)??"0px",h=nt(l?.padding,"block",r??void 0)??"0px",y=t.children.map(m=>kt(m,{responsiveMinWidth:n,availableWidthExpr:c,availableWidthPx:u,breakpointMap:s,conservativeContainerText:a$1,textMetricsMode:o})).filter(m=>!!m);return y.length?t.kind==="row"?b([de(y),h]):b([...y.flatMap((m,f)=>f>0?[p,m]:[m]),h]):h||null}return null}function Ke(t){if(t==null)return null;let e=Number(t);return Number.isFinite(e)?Math.max(25,Math.min(260,e)):null}function qe(t){if(t==null)return null;let e=Number(t);return Number.isFinite(e)&&e>0?e:null}function Rt(t,e){let n=t.slots?.[e];return {item:n?.item??t.item,itemWrapStyle:Oe(t.itemWrapStyle,n?.itemWrapStyle),ratio:Ke(n?.ratio),heightPx:qe(n?.heightPx),span:n?.span}}function Se(t,e,n){let r=gt(t,n);for(let i of r)e.add(i.minWidth);}function Et(t){return Gt({span:t.span,columnCount:t.columnCount,width:t.minWidth,breakpointMap:t.breakpointMap})}function xn(t,e){return We(t,e)?.key??null}function We(t,e){if(!t.length)return null;let n=t[0];for(let r of t)if(e>=r.minWidth)n=r;else break;return n}function Ze(t){let{columnsRules:e,gapRules:n,baseColumns:r,baseGapPx:i,extraMinWidths:s}=t,a=new Set([0]),o=new Set;for(let p of e)a.add(p.minWidth);for(let p of n)a.add(p.minWidth);if(s)for(let p of s){let h=Math.max(0,p|0);a.add(h),o.add(h);}let l=Array.from(a).sort((p,h)=>p-h),c$1=[],u="";for(let p of l){let h=Qt(e,p,r),y=Qt(n,p,i),m=Math.max(1,h|0),f=Math.max(0,c(y,i)),S=`c${m}_g${f}`;S===u&&!o.has(p)||(c$1.push({minWidth:p,columns:m,gapPx:f,key:S===u?`${S}_m${p}`:S}),u=S);}return c$1.length?c$1:[{minWidth:0,columns:r,gapPx:i,key:`c${r}_g${i}`}]}function Ge(t){let e$1=pe(t.layoutWidthPx).filter(r=>r.value>0);if(!e$1.length)return;if(t.viewportWidth!=null){let r=We(t.states,t.viewportWidth),i=Ie(t.layoutWidthPx);return !r||i==null||i<=0?void 0:new Map([[r.key,i]])}let n=new Map;for(let r of t.states){let i=e(e$1,r.minWidth);i!=null&&i>0&&n.set(r.key,i);}return n.size?n:void 0}function Ye(t,e){return e!=null&&Number.isFinite(e)&&e>0?Math.max(e,tt):Math.max(t.minWidth||tt,tt)}function ie(t,e){let n=Ye(t,e);return t.columns>0?(n-t.gapPx*(t.columns-1))/t.columns:n}function ut(t,e,n){if(t){if(t.kind==="masonry"){u(t.style,e,n),ut(t.item,e,n);for(let r of t.slots??[])Se(r.span,e,n),ut(r.item,e,n);return}switch(t.kind){case "rect":case "square":case "circle":u(t.style,e,n);return;case "text":u(t.style,e,n);for(let r of i({barHeight:t.barHeight,barWidth:t.barWidth,lineHeight:t.lineHeight,lines:t.lines,lastBarWidth:t.lastBarWidth,breakpointMap:n}))e.add(r);return;case "media":u(t.style,e,n),u(t.tile?.style,e,n);return;case "stack":case "row":case "col":u(t.style,e,n);for(let r of t.children)ut(r,e,n);return}}}function Ue(t){return Number.isFinite(t)?Math.max(0,Math.round(t*1e3)/1e3):null}function Xe(t,e,n){if(t<=0){n.add(0);return}if(e.slope<=0)return;let r=Ue((t-e.intercept)/e.slope);r!=null&&n.add(r);}function vt(t){let{node:e,availableWidth:n,responsiveMinWidth:r,breakpointMap:i$1,out:s}=t;if(!(!e||!n))switch(e.kind){case "rect":case "square":case "circle":return;case "text":if(e.responsiveBy!=="container")return;for(let a of i({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:i$1}))Xe(a,n,s);return;case "media":{let a=U(e.style,r,i$1),o=ne(n,a);if(!o)return;let l=L(a?.gap,0)??0,c=Math.max(0,e.count|0),u=(e.direction??"row")==="row"&&c>1?wt(be(o,l*Math.max(0,c-1)),1/c):o,p={kind:e.tile?.shape??"rect",style:e.tile?.style,shimmer:e.tile?.shimmer};vt({node:p,availableWidth:u,responsiveMinWidth:r,breakpointMap:i$1,out:s});return}case "stack":case "row":case "col":{let a=U(e.style,r,i$1),o=ne(n,a);if(!o)return;for(let l of e.children)vt({node:l,availableWidth:o,responsiveMinWidth:r,breakpointMap:i$1,out:s});return}}}function Je(t){let{state:e,span:n}=t,r=Math.max(1,e.columns|0),i={slope:1/r,intercept:-(e.gapPx*Math.max(0,r-1))/r};return {slope:i.slope*n,intercept:i.intercept*n+e.gapPx*Math.max(0,n-1)}}function Qe(t){let e=new Set([0]),{state:n,itemCount:r,structuredLayout:i,spans:s,breakpointMap:a}=t;if(!i)return [];for(let o=0;o<r;o++){let l=Rt(i,o),c=Et({span:l?.span??s?.[o],columnCount:n.columns,minWidth:n.minWidth,breakpointMap:a}),u=Je({state:n,span:c}),p=De(l.itemWrapStyle,u),h=p?ze(p,l.itemWrapStyle):null;vt({node:l.item,availableWidth:h,responsiveMinWidth:n.minWidth,breakpointMap:a,out:e});}return Array.from(e).sort((o,l)=>o-l)}function tn(t){if(!t.layout)return {structuredLayout:null,responsiveCss:""};let e=t.breakpointMap??a,n=0,r=()=>`n${++n}`,i=[],s=z(t.layout,r,i,"masonry",e),a$1=t.scopeId?A({scopeAttr:"data-rmg-mskel-scope",scopeId:t.scopeId,rules:i}):"";return {structuredLayout:s,responsiveCss:a$1}}function en(t){let e=t?.colsCssVar??"--rmg-cols",n=t?.gapCssVar??"--rmg-gap",r=t?.containerWidthCss??"100cqw";return I(`(${r} - ((var(${e}) - 1) * var(${n}))) / var(${e})`)}function se(t){let{span:e,columnWidthCssExpr:n,gapCssExpr:r="var(--rmg-gap)"}=t;return e<=1?n:b([v(n,e),v(r,Math.max(0,e-1))])}function oe(t){let{columnStart:e,columnWidthCssExpr:n,gapCssExpr:r="var(--rmg-gap)"}=t;return e<=0?"0px":b([v(n,e),v(r,e)])}function ae(t){let{index:e,slot:n,state:r,safeRatios:i,safeHeights:s,itemWidthCssExpr:a,itemWidthPx:o,breakpointMap:l,conservativeContainerText:c,textMetricsMode:u="default"}=t;if(n){let y=Wt(n.itemWrapStyle,a),m=ct(n.itemWrapStyle,o),f=je(y,n.itemWrapStyle),S=ye(m,n.itemWrapStyle),W=kt(n.item,{responsiveMinWidth:r.minWidth,availableWidthExpr:f,availableWidthPx:S,breakpointMap:l,conservativeContainerText:c,textMetricsMode:u});if(W)return b([W,ee(n.itemWrapStyle,y)??"0px"])}let p=Wt(n?.itemWrapStyle,a),h=ee(n?.itemWrapStyle,p)??"0px";return n?.heightPx!=null?b([B(n.heightPx),h]):n?.ratio!=null?b([I(`${p} * ${n.ratio/100}`),h]):s?.length?b([B(s[e%s.length]),h]):i.length?b([I(`${p} * ${i[e%i.length]/100}`),h]):b([p,h])}function le(t){let{index:e,slot:n,state:r,safeRatios:i,safeHeights:s,itemWidthPx:a,breakpointMap:o,conservativeContainerText:l,textMetricsMode:c="default"}=t;if(n){let y=ct(n.itemWrapStyle,a),m=ye(y,n.itemWrapStyle),f=Pt(n.item,{responsiveMinWidth:r.minWidth,availableWidthPx:m,breakpointMap:o,conservativeContainerText:l,textMetricsMode:c});if(f!=null)return Math.ceil(f+te(n.itemWrapStyle,y))}let u=ct(n?.itemWrapStyle,a),p=te(n?.itemWrapStyle,u),h=n?.heightPx!=null?n.heightPx:n?.ratio!=null?Math.round(n.ratio/100*u):s?.length?s[e%s.length]:i.length?Math.round(i[e%i.length]/100*u):u;return Math.ceil(h+p)}function Mt(t,e,n){let r=0;for(let i=e;i<e+n;i++)r=Math.max(r,t[i]??0);return r}function nn(t,e,n){let r=0;for(let i=e;i<e+n;i++)r+=t[i]??0;return r}function rn(t){let e=Math.max(1,t.columnCount-t.span+1);return t.cursor%e}function Ct(t){let{itemCount:e,columnCount:n,placement:r,heights:i,gapPx:s,spans:a}=t,o=Math.max(1,n|0),l=new Array(o).fill(0),c=new Array(o).fill(0),u=[],p=0,h=0,y=0;for(let m=0;m<e;m++){let f=Math.max(1,Math.min(o,Math.round(a?.[m]??1)||1)),S=i[m]??0,W=Math.max(0,o-f),M=0,C=0;if(r==="roundRobin")M=rn({cursor:h,columnCount:o,span:f}),C=Mt(l,M,f),h+=1;else if(r==="horizontalOrder")M=y%o,M+f>o&&(M=0),C=Mt(l,M,f),y=M+f;else {let R=0,N=Number.POSITIVE_INFINITY,X=Number.POSITIVE_INFINITY;for(let d=0;d<=W;d++){let w=Mt(l,d,f),D=nn(c,d,f);(w<N||w===N&&D<X||w===N&&D===X&&d<R)&&(R=d,N=w,X=D);}M=R,C=Number.isFinite(N)?N:0;}let H=C+S+s;for(let R=M;R<M+f;R++)l[R]=H,c[R]=(c[R]??0)+1;p=Math.max(p,C+S),u.push({index:m,span:f,columnStart:M,top:C,height:S});}return {items:u,height:p}}function St(t){if(t.items.length===0)return {itemTopCssExprs:[],itemHeightCssExprs:[],shellHeightCssExpr:"0px",cssVars:{}};let e=Math.max(1,t.columnCount|0),n=new Array(e).fill(0),r=new Array(e).fill(null),i=[],s=[],a={};for(let[u,p]of t.items.entries()){let h=`--rmg-mskel-height-${p.index}`,y=`var(${h})`;a[h]=p.heightCssExpr,s.push(y);let m=0,f=null;for(let C=p.columnStart;C<p.columnStart+p.span;C++){let H=n[C]??0,R=r[C]??null;(H>m||f==null)&&(m=H,f=R);}let S=m<=0||!f?"0px":t.gapPx>0?b([f,B(t.gapPx)]):f,W=b([S,y]);i.push(S);let M=(m>0?m+t.gapPx:0)+p.heightPx;for(let C=p.columnStart;C<p.columnStart+p.span;C++)n[C]=M,r[C]=W;}let l=0,c="0px";for(let u=0;u<e;u++){let p=n[u]??0,h=r[u]??"0px";p>=l&&(l=p,c=h);}return {itemTopCssExprs:i,itemHeightCssExprs:s,shellHeightCssExpr:c,cssVars:a}}function yn(t$1){let e=t$1.spec??Ae(),n={...a,...t$1.breakpoints??{}},r=pe(t$1.layoutWidthPx).filter(d=>d.value>0),i=e.ratios??ue,s=(Array.isArray(t$1.ratios)&&t$1.ratios.length?t$1.ratios:Array.isArray(e.ratios)&&e.ratios.length?e.ratios:i).map(d=>Number(d)).filter(d=>Number.isFinite(d)).map(d=>Math.max(25,Math.min(220,d))),a$1=(Array.isArray(t$1.heightsPx)&&t$1.heightsPx.length?t$1.heightsPx:Array.isArray(e.heightsPx)&&e.heightsPx.length?e.heightsPx:null)?.map(d=>Number(d)).filter(d=>Number.isFinite(d)&&d>0)??null,o=Xt(t$1.columns,n),l=Xt(t$1.gap,n),c$1=Jt(t$1.columns,o,4),u=Jt(t$1.gap,l,8),p$1=Math.max(1,c$1|0),h=Math.max(0,c(u,8)),y=Ze({columnsRules:o,gapRules:l,baseColumns:p$1,baseGapPx:h,extraMinWidths:(()=>{let d=new Set;ut(e.layout,d,n);for(let w of t$1.spans??[])Se(w,d,n);for(let w of r)d.add(w.minWidth);return d})()}),m=Ge({states:y,layoutWidthPx:t$1.layoutWidthPx,viewportWidth:t$1.viewportWidth}),{structuredLayout:f,responsiveCss:S}=tn({layout:e.layout,scopeId:t$1.scopeId,breakpointMap:n}),W=t$1.respectLayoutCount===false?Math.max(0,t$1.count|0):f?.count!=null?Math.max(0,f.count|0):Math.max(0,t$1.count|0),M=t$1.placement??"balanced",C="--rmg-mskel-colw",H=`var(${C})`,R=en(),N="var(--rmg-gap)",X=y.map(d=>{let w=m?.has(d.key)===true,D=!w,Lt=ie(d,m?.get(d.key)),$t=x=>Array.from({length:W},(g,P)=>{let $=f?Rt(f,P):null,A=Et({span:$?.span??t$1.spans?.[P],columnCount:d.columns,minWidth:d.minWidth,breakpointMap:n}),V=Lt*A+d.gapPx*Math.max(0,A-1),k=`--rmg-mskel-width-${P}`,E=se({span:A,columnWidthCssExpr:H,gapCssExpr:N}),O=`var(${k})`,Q=le({index:P,slot:$,state:d,safeRatios:s,safeHeights:a$1,itemWidthPx:V,breakpointMap:n,conservativeContainerText:D,textMetricsMode:x}),ot=ae({index:P,slot:$,state:d,safeRatios:s,safeHeights:a$1,itemWidthCssExpr:O,itemWidthPx:V,breakpointMap:n,conservativeContainerText:D,textMetricsMode:x});return {slot:$,span:A,height:Q,heightCssExpr:ot,itemWidthPx:V,itemWidthVarName:k,itemWidthCssValue:E,itemWidthCssExpr:O}}),J=$t("default"),z=$t("safari"),Ft=Ct({itemCount:W,columnCount:d.columns,placement:M,heights:J.map(x=>x.height),gapPx:d.gapPx,spans:J.map(x=>x.span)}),rt=St({columnCount:d.columns,gapPx:d.gapPx,items:Ft.items.map((x,g)=>({index:g,columnStart:x.columnStart,span:x.span,heightPx:x.height,heightCssExpr:J[g]?.heightCssExpr??B(x.height)}))}),Ht=Ct({itemCount:W,columnCount:d.columns,placement:M,heights:z.map(x=>x.height),gapPx:d.gapPx,spans:z.map(x=>x.span)}),it=St({columnCount:d.columns,gapPx:d.gapPx,items:Ht.items.map((x,g)=>({index:g,columnStart:x.columnStart,span:x.span,heightPx:x.height,heightCssExpr:z[g]?.heightCssExpr??B(x.height)}))}),st={[C]:R};for(let x of J)st[x.itemWidthVarName]=x.itemWidthCssValue;Object.assign(st,rt.cssVars);let Re={...st,...it.cssVars},Bt=x=>!w&&f?Qe({state:d,itemCount:W,structuredLayout:f,spans:t$1.spans,breakpointMap:n}).map(g=>{let P=ie(d,g),$=Array.from({length:W},(k,E)=>{let O=Rt(f,E),Q=Et({span:O?.span??t$1.spans?.[E],columnCount:d.columns,minWidth:d.minWidth,breakpointMap:n}),ot=P*Q+d.gapPx*Math.max(0,Q-1),Ne=`var(${`--rmg-mskel-width-${E}`})`,we=le({index:E,slot:O,state:d,safeRatios:s,safeHeights:a$1,itemWidthPx:ot,breakpointMap:n,conservativeContainerText:false,textMetricsMode:x}),Le=ae({index:E,slot:O,state:d,safeRatios:s,safeHeights:a$1,itemWidthCssExpr:Ne,itemWidthPx:ot,breakpointMap:n,conservativeContainerText:false,textMetricsMode:x});return {slot:O,span:Q,height:we,heightCssExpr:Le}}),A=Ct({itemCount:W,columnCount:d.columns,placement:M,heights:$.map(k=>k.height),gapPx:d.gapPx,spans:$.map(k=>k.span)}),V=St({columnCount:d.columns,gapPx:d.gapPx,items:A.items.map((k,E)=>({index:E,columnStart:k.columnStart,span:k.span,heightPx:k.height,heightCssExpr:$[E]?.heightCssExpr??B(k.height)}))});return {minWidth:g,rootDecls:{height:V.shellHeightCssExpr,...V.cssVars},items:A.items.map((k,E)=>({index:E,topCssExpr:V.itemTopCssExprs[E],leftCssExpr:oe({columnStart:k.columnStart,columnWidthCssExpr:H,gapCssExpr:N}),widthCssExpr:se({span:k.span,columnWidthCssExpr:H,gapCssExpr:N})}))}}):void 0,Ee=Bt("default"),ve=Bt("safari");return {state:d,shellHeightCssExpr:rt.shellHeightCssExpr,positionedCssVars:st,containerCssRules:Ee,safariShellHeightCssExpr:it.shellHeightCssExpr,safariPositionedCssVars:Re,safariContainerCssRules:ve,items:J.map((x,g)=>{let P=Ft.items[g]??{span:x.span,columnStart:0,top:0,height:x.height},$=Ht.items[g]??{span:x.span,columnStart:P.columnStart,top:P.top,height:z[g]?.height??x.height};return {index:g,height:x.height,columnIndex:P.columnStart,columnStart:P.columnStart,span:P.span,top:P.top,topCssExpr:rt.itemTopCssExprs[g],leftPx:P.columnStart*(Lt+d.gapPx),leftCssExpr:oe({columnStart:P.columnStart,columnWidthCssExpr:H,gapCssExpr:N}),widthPx:x.itemWidthPx,widthCssExpr:x.itemWidthCssExpr,slot:x.slot,heightCssExpr:rt.itemHeightCssExprs[g]??x.heightCssExpr,safariHeight:z[g]?.height??x.height,safariTop:$.top,safariTopCssExpr:it.itemTopCssExprs[g],safariHeightCssExpr:it.itemHeightCssExprs[g]??z[g]?.heightCssExpr??x.heightCssExpr}})}});return {itemCount:W,states:y,variants:X,structuredLayout:f,structuredNodeId:f?.__rmgNodeId,plainStructuredStyle:f?p(t(f.style,n)):void 0,responsiveCss:S}}function bn(t,e){if(!t.length)return null;let n=t[0];for(let r of t)if(e>=r.state.minWidth)n=r;else break;return n}function sn(t){return t.items.length?Math.max(0,...t.items.map(e=>e.top+e.height)):0}function G(t,e){return `${t}:${e} !important;`}function dt(t,e="default"){let n=e==="safari"?t.safariShellHeightCssExpr??t.shellHeightCssExpr:t.shellHeightCssExpr,r=e==="safari"?t.safariPositionedCssVars??t.positionedCssVars:t.positionedCssVars,i=[["height",n??`${sn(t)}px`],["--rmg-cols",t.state.columns],["--rmg-gap",`${t.state.gapPx}px`]];for(let[s,a]of Object.entries(r??{}))i.push([s,a]);return i}function Pe(t){return t.map(([e,n])=>e==="height"?["min-height",n]:[e,n])}function gn(t){if(!t.scopeId||!t.prediction.variants.length)return "";let e=`[data-rmg-masonry-layout-seed="${v$1(t.scopeId)}"]`,n=(i,s)=>{let a=`${e}{`+i.map(([l,c])=>G(l,c)).join("")+"}",o=s.map(l=>`${`${e}>[data-rmg-idx="${l.index}"]`}{`+[G("top",l.topCssExpr??"0px"),G("left",l.leftCssExpr),G("width",l.widthCssExpr)].join("")+"}").join("");return `${a}${o}`},r=i=>{let s=dt(i),a=n(s,i.items.map(u=>({index:u.index,topCssExpr:u.topCssExpr??`${u.top}px`,leftCssExpr:u.leftCssExpr,widthCssExpr:u.widthCssExpr}))),o=(i.containerCssRules??[]).map(u=>`@container (min-width:${u.minWidth}px){${n(Object.entries(u.rootDecls),u.items)}}`).join(""),l=n(dt(i,"safari"),i.items.map(u=>({index:u.index,topCssExpr:u.safariTopCssExpr??u.topCssExpr??`${u.safariTop}px`,leftCssExpr:u.leftCssExpr,widthCssExpr:u.widthCssExpr}))),c=(i.safariContainerCssRules??[]).map(u=>`@container (min-width:${u.minWidth}px){${n(Object.entries(u.rootDecls),u.items)}}`).join("");return `${a}${o}@supports ${c$1}{${l}${c}}`};return t.prediction.variants.map(i=>{let s=r(i);return i.state.minWidth<=0?s:`@media (min-width:${i.state.minWidth}px){${s}}`}).join(`
2
- `)}function Mn(t){if(!t.scopeId||!t.prediction.variants.length)return "";let e=`[data-rmg-masonry-skeleton-shell="${v$1(t.scopeId)}"]`,n=i=>`${e}{`+Pe(i).map(([s,a])=>G(s,a)).join("")+"}",r=i=>{let s=n(dt(i)),a=(i.containerCssRules??[]).map(o=>`@container (min-width:${o.minWidth}px){${n(Object.entries(o.rootDecls))}}`).join("");return `${s}${a}`};return t.prediction.variants.map(i=>{let s=r(i);return i.state.minWidth<=0?s:`@media (min-width:${i.state.minWidth}px){${s}}`}).join(`
3
- `)}function Cn(t){if(!t.scopeId||!t.prediction.variants.length)return "";let e=`[data-rmg-masonry-skeleton-shell="${v$1(t.scopeId)}"]`,n=i=>`${e}{`+Pe(i).map(([s,a])=>G(s,a)).join("")+"}",r=i=>{let s=n(dt(i,"safari")),a=(i.safariContainerCssRules??[]).map(o=>`@container (min-width:${o.minWidth}px){${n(Object.entries(o.rootDecls))}}`).join("");return `@supports ${c$1}{${s}${a}}`};return t.prediction.variants.map(i=>{let s=r(i);return i.state.minWidth<=0?s:`@media (min-width:${i.state.minWidth}px){${s}}`}).join(`
4
- `)}var ke=F.createContext(null);function Wn(t){return jsx(ke.Provider,{value:t.value,children:t.children})}function Pn(){return F.useContext(ke)}export{ln as a,un as b,Gt as c,xn as d,en as e,se as f,oe as g,Ct as h,yn as i,bn as j,gn as k,Mn as l,Cn as m,Wn as n,Pn as o};
@@ -1,3 +0,0 @@
1
- import {i,j,m,l,k,n as n$1,d}from'./chunk-LSHR3FZM.mjs';import {a as a$2}from'./chunk-4ZOW533S.mjs';import {n,l as l$1,a as a$3,m as m$1,B,v,c,o}from'./chunk-4BTS6IIA.mjs';import {a as a$1}from'./chunk-UUAWLGWO.mjs';import {a,b}from'./chunk-HK2DPKES.mjs';import*as I from'react';import {jsx,jsxs}from'react/jsx-runtime';var O={masonrySkeletonRoot:"or",masonrySkeletonCol:"sr",masonrySkeletonItem:"lr",masonrySkeletonLayoutItem:"z",masonrySkeletonLayoutItemInner:"dr"};function fe(e,a){let l=`[data-rmg-mskel-scope="${v(e)}"]`,m=[];m.push(`${l} [data-rmg-mskel-variant]{display:none !important;}`);let i=a[0];i&&m.push(`${l} [data-rmg-mskel-variant="${i.key}"]{display:block !important;}`);for(let c of a)c.minWidth<=0||m.push(`@media (min-width:${c.minWidth}px){${l} [data-rmg-mskel-variant]{display:none !important;}${l} [data-rmg-mskel-variant="${c.key}"]{display:block !important;}}`);return m.join(`
2
- `)}function P(e,a){return `${e}:${a} !important;`}function xe(e,a){let l=`[data-rmg-mskel-scope="${v(e)}"]`,m=[];for(let i of a){let c=i.items.some(f=>f.span>1),g=`${l} [data-rmg-mskel-variant="${v(i.state.key)}"]`;for(let f of i.containerCssRules??[]){let p=`${g}{`+Object.entries(f.rootDecls).map(([u,b])=>P(u,b)).join("")+"}",x=c?f.items.map(u=>`${`${g} > [data-rmg-mskel-index="${u.index}"]`}{`+[P("top",u.topCssExpr??"0px"),P("left",u.leftCssExpr),P("width",u.widthCssExpr)].join("")+"}").join(""):"";m.push(`@container (min-width:${f.minWidth}px){${p}${x}}`);}}return m.join(`
3
- `)}function be(e,a){let l=`[data-rmg-mskel-scope="${v(e)}"]`,m=[];for(let i of a){let c=i.items.some(s=>s.span>1),g=`${l} [data-rmg-mskel-variant="${v(i.state.key)}"]`,f=i.items.length?Math.max(0,...i.items.map(s=>s.safariTop+s.safariHeight)):0,p=[["height",i.safariShellHeightCssExpr??i.shellHeightCssExpr??`${f}px`],["--rmg-cols",i.state.columns],["--rmg-gap",`${i.state.gapPx}px`],...Object.entries(i.safariPositionedCssVars??{})],x=c?p:p.filter(([s])=>s!=="height"),u=`${g}{`+x.map(([s,S])=>P(s,S)).join("")+"}",b=i.items.map(s=>{let S=`${g} [data-rmg-mskel-index="${s.index}"]`,h=c?[P("height",s.safariHeightCssExpr),P("top",s.safariTopCssExpr??`${s.safariTop}px`)]:[P("height",s.safariHeightCssExpr)];return `${S}{`+h.join("")+"}"}).join(""),N=(i.safariContainerCssRules??[]).map(s=>{let S=Object.entries(s.rootDecls).filter(([r])=>c||r!=="height"),h=`${g}{`+S.map(([r,d])=>P(r,d)).join("")+"}",D=c?s.items.map(r=>`${`${g} [data-rmg-mskel-index="${r.index}"]`}{`+[P("top",r.topCssExpr??"0px"),P("left",r.leftCssExpr),P("width",r.widthCssExpr)].join("")+"}").join(""):"";return `@container (min-width:${s.minWidth}px){${h}${D}}`}).join("");m.push(`${u}${b}${N}`);}return m.length?`@supports ${c}{${m.join("")}}`:""}function ue(e){if(!e)return {outerStyle:void 0,innerStyle:void 0};let a=o(e),l={};return a.boxShadow!=null&&(l["--rmg-masonry-skel-wrap-shadow"]=a.boxShadow,delete a.boxShadow),a.borderRadius!=null&&(l["--rmg-masonry-skel-wrap-shadow-radius"]=a.borderRadius),{outerStyle:Object.keys(l).length?l:void 0,innerStyle:a}}function Se(e){let{count:a$2,columns:l,gap:m,breakpoints:i$1,classNames:c,ratios:g,placement:f,spec:p,viewportWidth:x,layoutWidthPx:u,disableShimmer:b}=e,N=I.useRef(u),s=N.current!==void 0?N.current:u,S=I.useMemo(()=>({...a,...i$1??{}}),[i$1]),h=I.useMemo(()=>a$1("mskel_",{count:a$2,columns:l,gap:m,breakpoints:S,ratios:g,heightsPx:e.heightsPx,spans:e.spans,placement:f,spec:p}),[a$2,l,m,S,g,e.heightsPx,e.spans,f,p]),D={...p?.backgroundColor?{"--rmg-skel-bg":p.backgroundColor}:null,...p?.radius!=null?{"--rmg-skel-radius":l$1(p.radius)}:null,...b?null:n(p?.shimmer,{enabledVarName:"--rmg-skel-card-shimmer-enabled"}),...!b&&(p?.shimmer?.c2??p?.highlightColor)!=null?{"--rmg-skel-shimmer-c2":p?.shimmer?.c2??p?.highlightColor}:null},r=I.useMemo(()=>i({count:a$2,columns:l,gap:m,breakpoints:S,ratios:g,heightsPx:e.heightsPx,spans:e.spans,placement:f,spec:p,scopeId:h,viewportWidth:x,layoutWidthPx:s}),[a$2,l,m,S,g,e.heightsPx,f,p,h,x,s]),d$1=x!==void 0,$=d$1?d(r.states,x):null,B$1=I.useMemo(()=>d$1?null:fe(h,r.states),[d$1,h,r.variants]),R=I.useMemo(()=>xe(h,r.variants),[h,r.variants]),z=I.useMemo(()=>be(h,r.variants),[h,r.variants]),k=r.structuredLayout,X=c?.root??O.masonrySkeletonRoot,A=c?.column??O.masonrySkeletonCol,_=c?.item??(k?O.masonrySkeletonLayoutItem:O.masonrySkeletonItem),E=d$1&&s!==void 0&&Number.isFinite(Number(s))&&Number(s)>0,Z=I.useMemo(()=>{let o=b?null:a$3.skelCardShimmer;return r.variants.map(t=>{let ee=t.items.some(n=>n.span>1),K=Math.max(0,...t.items.map(n=>n.top+n.height));if(!ee){let n=Array.from({length:t.state.columns},()=>[]);for(let L of t.items)n[L.columnIndex].push(L);return jsx("div",{"data-rmg-mskel-variant":t.state.key,style:{width:"100%","--rmg-cols":t.state.columns,"--rmg-gap":`${t.state.gapPx}px`,...t.positionedCssVars??{},display:d$1?t.state.key===$?"block":"none":t.state.key===r.states[0]?.key?"block":"none"},children:jsx("div",{style:{width:"100%",display:"flex",alignItems:"flex-start",columnGap:`${t.state.gapPx}px`},children:n.map((L,T)=>jsx("div",{className:A,style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:L.map((M,v)=>{let W=v===L.length-1?"0px":`${t.state.gapPx}px`;if(!k)return jsx("div",{"data-rmg-mskel-index":M.index,className:[_,o].filter(Boolean).join(" "),style:{height:`${M.height}px`,marginBottom:W}},`rmg-mskel-${t.state.key}-${M.index}`);let{outerStyle:j,innerStyle:w}=ue(M.slot?.itemWrapStyle);return jsx("div",{"data-rmg-mskel-index":M.index,className:_,style:{...M.slot?.itemWrapStyle?m$1(M.slot.itemWrapStyle):null,...j??null,width:"100%",height:M.heightCssExpr,marginBottom:W},children:jsx("div",{className:[O.masonrySkeletonLayoutItemInner,o].filter(Boolean).join(" "),style:w,children:jsx("div",{style:{width:"100%"},children:jsx(B,{node:M.slot?.item??k.item,disableShimmer:true,breakpointMap:S})})})},`rmg-mskel-${t.state.key}-${M.index}`)})},T))})},t.state.key)}return jsx("div",{"data-rmg-mskel-variant":t.state.key,style:{position:"relative",width:"100%",height:k&&!E?t.shellHeightCssExpr??`${K}px`:`${K}px`,display:d$1?t.state.key===$?"block":"none":t.state.key===r.states[0]?.key?"block":"none","--rmg-cols":t.state.columns,"--rmg-gap":`${t.state.gapPx}px`,...t.positionedCssVars??{}},children:t.items.map(n=>{if(!k)return jsx("div",{"data-rmg-mskel-index":n.index,className:[_,o].filter(Boolean).join(" "),style:{position:"absolute",top:`${n.top}px`,left:n.leftCssExpr,width:n.widthCssExpr,height:`${n.height}px`}},`rmg-mskel-${t.state.key}-${n.index}`);let{outerStyle:L,innerStyle:T}=ue(n.slot?.itemWrapStyle);return jsx("div",{"data-rmg-mskel-index":n.index,className:_,style:{...n.slot?.itemWrapStyle?m$1(n.slot.itemWrapStyle):null,...L??null,position:"absolute",top:E?`${n.top}px`:n.topCssExpr??`${n.top}px`,left:E?`${n.leftPx}px`:n.leftCssExpr,width:E?`${n.widthPx}px`:n.widthCssExpr,height:E?`${n.height}px`:n.heightCssExpr,minWidth:0},children:jsx("div",{className:[O.masonrySkeletonLayoutItemInner,o].filter(Boolean).join(" "),style:T,children:jsx("div",{style:{width:"100%"},children:jsx(B,{node:n.slot?.item??k.item,disableShimmer:true,breakpointMap:S})})})},`rmg-mskel-${t.state.key}-${n.index}`)})},t.state.key)})},[_,A,r.variants,r.states,k,S,d$1,E,$,b]);return jsxs("div",{"data-rmg-mskel-scope":h,"data-rmg-skel-node":r.structuredNodeId,className:[X,p?.className].filter(Boolean).join(" "),style:{...D,...r.plainStructuredStyle||{},containerType:"inline-size",width:"100%"},children:[B$1?jsx("style",{dangerouslySetInnerHTML:{__html:B$1}}):null,r.responsiveCss?jsx("style",{dangerouslySetInnerHTML:{__html:r.responsiveCss}}):null,R?jsx("style",{dangerouslySetInnerHTML:{__html:R}}):null,Z,z?jsx("style",{dangerouslySetInnerHTML:{__html:z}}):null]})}function ke(e){return !!e&&typeof e=="object"&&!("kind"in e)&&"layout"in e&&e.layout?.kind==="masonry"}function he(e){return !!e&&typeof e=="object"&&"kind"in e&&e.kind==="masonry"}function Me(e){if(ke(e))return e;let{className:a,backgroundColor:l,radius:m,shimmer:i,columns:c,gap:g,ratios:f,heightsPx:p,spans:x,placement:u,viewportWidth:b,layoutWidthPx:N,...s}=e;return {className:a,backgroundColor:l,radius:m,shimmer:i,layout:s}}function Fe({layout:e,children:a$3,breakpoints:l$2,className:m$1,style:i$1,shellClassName:c,shellStyle:g,contentClassName:f,contentStyle:p,backgroundColor:x,radius:u,shimmer:b$1,disableShimmer:N,ariaLabel:s,ready:S,enabled:h,force:D,timing:r,masonry:d}){let $=I.useMemo(()=>({...a,...l$2??{}}),[l$2]),B=I.useMemo(()=>a$1("skel_",{layout:e,breakpoints:$,backgroundColor:x,radius:u,shimmer:b$1,disableShimmer:N,masonry:d}),[e,$,x,u,b$1,N,d]),R=I.useMemo(()=>he(e)||ke(e)?Me(e):null,[e]),z=R?.layout?.kind==="masonry"?R.layout:null,k$1=he(e)?e:null,X=I.useRef(null),A=d?.layoutWidthPx??k$1?.layoutWidthPx,[_,E]=I.useState(void 0),Z=A??_;I.useLayoutEffect(()=>{if(A!==void 0){E(w=>w===void 0?w:void 0);return}let v=X.current;if(!v)return;let W=w=>{let H=Number(w);!Number.isFinite(H)||H<=0||E(U=>U!=null&&Math.abs(U-H)<.5?U:H);},j=()=>{W(v.getBoundingClientRect().width);};if(j(),typeof ResizeObserver<"u"){let w=new ResizeObserver(H=>{let U=H[0];W(U?.contentRect.width);});return w.observe(v),()=>w.disconnect()}return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[A]);let o=R?{count:d?.count??(typeof z?.count=="number"?Math.max(0,z.count|0):1),columns:d?.columns??k$1?.columns,gap:d?.gap??k$1?.gap,ratios:d?.ratios??k$1?.ratios,heightsPx:d?.heightsPx??k$1?.heightsPx,spans:d?.spans??k$1?.spans,placement:d?.placement??k$1?.placement,viewportWidth:d?.viewportWidth??k$1?.viewportWidth,layoutWidthPx:Z,disableShimmer:N}:null,t=I.useMemo(()=>{if(!R||!o)return null;let v=a$1("mseed_",{scopeId:B,breakpoints:$,masonry:o,spec:R}),W=i({count:o.count,columns:o.columns,gap:o.gap,breakpoints:$,ratios:o.ratios,heightsPx:o.heightsPx,spans:o.spans,placement:o.placement,spec:R,scopeId:v,respectLayoutCount:false,viewportWidth:o.viewportWidth,layoutWidthPx:o.layoutWidthPx}),j$1=j(W.variants,o.viewportWidth??b);return {scopeId:v,initialHeights:j$1?.items.map(w=>w.height),responsiveCss:k({scopeId:v,prediction:W}),shellReserveCss:l({scopeId:v,prediction:W}),shellReserveSafariCss:m({scopeId:v,prediction:W})}},[$,o?.columns,o?.count,o?.disableShimmer,o?.gap,o?.heightsPx,o?.layoutWidthPx,o?.placement,o?.ratios,o?.spans,o?.viewportWidth,R,B]),ee={...i$1,...x?{"--rmg-skel-bg":x}:null,...u!=null?{"--rmg-skel-radius":l$1(u)}:null,...N?null:n(b$1)},K=R&&o?jsx("div",{"data-rmg-skeleton-scope":B,ref:X,className:m$1,style:ee,"aria-hidden":s?void 0:true,"aria-label":s,role:s?"status":void 0,"aria-live":s?"polite":void 0,children:jsx(Se,{...o,spec:R,breakpoints:$})}):null,n$2=I.useCallback(v=>t?jsx(n$1,{value:t,children:v}):v,[t]);if(!K)return null;let L=a$3!==void 0&&!!t?.scopeId,T=L&&h!==false&&S!==true&&!!t?.shellReserveCss,M=jsx(a$2,{skeletonNode:K,ready:S,enabled:h,force:D,timing:r,shellClassName:c,shellStyle:g,contentClassName:f,contentStyle:p,contentOwnsWrapperLayout:a$3!==void 0,loadingLayerFirst:a$3!==void 0,contentWrapper:n$2,shellDataAttributes:T?{"data-rmg-masonry-skeleton-shell":t.scopeId}:void 0,children:a$3});return L?jsxs("div",{style:{containerType:"inline-size",width:"100%"},children:[T?jsx("style",{dangerouslySetInnerHTML:{__html:t.shellReserveCss}}):null,M,T&&t.shellReserveSafariCss?jsx("style",{dangerouslySetInnerHTML:{__html:t.shellReserveSafariCss}}):null]}):M}export{Fe as a};
@@ -1,4 +0,0 @@
1
- import {a as a$2}from'./chunk-4ZOW533S.mjs';import {n,l,z,A,p,t,m,a as a$3,B as B$1,v,o}from'./chunk-4BTS6IIA.mjs';import {f,c,d,e}from'./chunk-Y7NUGXTR.mjs';import {a as a$1}from'./chunk-UUAWLGWO.mjs';import {a,i}from'./chunk-HK2DPKES.mjs';import*as $ from'react';import {jsx,jsxs}from'react/jsx-runtime';var R={gridSkeletonOverlay:"Re",gridSkeletonGrid:"Se",gridSkeletonItem:"K",gridSkeletonItemInner:"Te"};function B(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function re(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function ue(e,t){let o=t[e];if(typeof o=="number"&&Number.isFinite(o))return o;let r=parseFloat(e);return Number.isNaN(r)?0:r}function Se(e){let{templateColumns:t,breakpointMap:o}=e;if(!re(t))return [];let r=Object.entries(t).map(([s,i])=>({minWidth:ue(s,o),template:typeof i=="string"?i.trim():""})).filter(s=>s.template.length>0).sort((s,i)=>s.minWidth-i.minWidth);return r.length===0?[]:(r[0].minWidth>0?r.unshift({minWidth:0,template:r[0].template}):r[0].minWidth<0&&(r[0]={...r[0],minWidth:0}),r)}function ce(e){let{scopeId:t,columns:o,templateColumns:r,gap:s,breakpointMap:i$1,fallbackGap:c}=e,u=`${`[data-rmg-grid-skel-scope="${v(t)}"]`} .${R.gridSkeletonGrid}`,p=[],d=(n,l)=>{if(!l.length)return;let y=`${u}{${l.join("")}}`;if(n<=0){p.push(y);return}p.push(`@media (min-width:${n}px){${y}}`);},a=Se({templateColumns:r,breakpointMap:i$1});if(a.length>0)for(let n of a)d(n.minWidth,[`grid-template-columns:${n.template};`]);else if(B(o)){let n=i(o,1,i$1);for(let l of n)d(l.minWidth,[`grid-template-columns:repeat(${Math.max(1,l.count|0)}, minmax(0, 1fr));`]);}if(B(s)){let n=i(s,c,i$1);for(let l of n)d(l.minWidth,[`--rmg-grid-gap:${Math.max(0,l.count|0)}px;`]);}return p.join(`
2
- `)}function ye(e$1){let{scopeId:t,items:o,breakpointMap:r,allowSpan:s}=e$1;if(!s)return "";let i=[],c$1=`[data-rmg-grid-skel-scope="${v(t)}"]`;for(let m of o){let u=m.span;if(!c(u))continue;let p=`${c$1} [data-rmg-grid-item-key="${v(m.id)}"]`,d$1=d(u,r);for(let a of d$1){let n=e(a.span);if(!n)continue;let l=`${p}{grid-column:${n};}`;if(a.minWidth<=0){i.push(l);continue}i.push(`@media (min-width:${a.minWidth}px){${l}}`);}}return i.join(`
3
- `)}function ke(e){let t={...e.gridStyle||{}};return e.minColumnWidth!=null&&t["--rmg-grid-min"]==null&&(t["--rmg-grid-min"]=typeof e.minColumnWidth=="number"?`${e.minColumnWidth}px`:e.minColumnWidth),!B(e.gap)&&e.gap!=null&&t["--rmg-grid-gap"]==null&&(t["--rmg-grid-gap"]=typeof e.gap=="number"?`${Math.max(0,e.gap|0)}px`:String(e.gap)),!re(e.templateColumns)&&typeof e.templateColumns=="string"&&e.templateColumns.trim().length>0&&t.gridTemplateColumns==null?t.gridTemplateColumns=e.templateColumns.trim():e.templateColumns==null&&!B(e.columns)&&typeof e.columns=="number"&&Number.isFinite(e.columns)&&t.gridTemplateColumns==null&&(t.gridTemplateColumns=`repeat(${Math.max(1,e.columns|0)}, minmax(0, 1fr))`),t}function oe(){return {layout:{kind:"grid",item:{kind:"rect",style:{width:"100%",aspectRatio:1,borderRadius:12}},itemWrapStyle:void 0},radius:12}}function ge(e,t){if(!(!e&&!t))return {...e||{},...t||{}}}function fe(e,t){let o=e.slots?.[t];return {item:o?.item??e.item,itemWrapStyle:ge(e.itemWrapStyle,o?.itemWrapStyle)}}function he(e){if(!e)return {outerStyle:void 0,innerStyle:void 0};let t=o(e),o$1={};return t.boxShadow!=null&&(o$1["--rmg-grid-skel-wrap-shadow"]=t.boxShadow,delete t.boxShadow),t.borderRadius!=null&&(o$1["--rmg-grid-skel-wrap-shadow-radius"]=t.borderRadius),{outerStyle:Object.keys(o$1).length?o$1:void 0,innerStyle:t}}function ie({count:e,gridStyle:t$1,spec:o,breakpoints:r,columns:s,templateColumns:i,minColumnWidth:c,gap:m$1,items:u,allowItemSpans:p$1,disableShimmer:d}){let a$2=o??oe(),n$1=$.useMemo(()=>({...a,...r??{}}),[r]),l$1=a$2.layout??oe().layout,y=$.useMemo(()=>a$1("gskel_",{count:e,breakpoints:n$1,gridStyle:t$1,spec:o,columns:s,templateColumns:i,minColumnWidth:c,gap:m$1,items:u,allowItemSpans:p$1,disableShimmer:d}),[e,n$1,t$1,o,s,i,c,m$1,u,p$1,d]),C={...ke({gridStyle:t$1,columns:s,templateColumns:i,minColumnWidth:c,gap:m$1}),...d?null:n(a$2.shimmer,{enabledVarName:"--rmg-skel-card-shimmer-enabled"})};a$2.backgroundColor&&(C["--rmg-skel-bg"]=a$2.backgroundColor),a$2.radius!=null&&(C["--rmg-skel-radius"]=l(a$2.radius));let{layout:A$1,responsiveCss:x,itemLayouts:S}=$.useMemo(()=>{let k=0,f=()=>`n${++k}`,G=[],b=z(l$1,f,G,"grid",n$1),v=A({scopeAttr:"data-rmg-grid-skel-scope",scopeId:y,rules:G}),N=l$1,j=Array.from({length:Math.max(0,typeof N.count=="number"?N.count|0:e|0)},(Re,E)=>({id:`slot-${E}`,span:N.slots?.[E]?.span})),z$1=u??j,ae=ce({scopeId:y,columns:s,templateColumns:i,gap:m$1,breakpointMap:n$1,fallbackGap:typeof m$1=="number"&&Number.isFinite(m$1)?m$1:8}),pe=ye({scopeId:y,items:z$1,breakpointMap:n$1,allowSpan:!!p$1}),de=[v,ae,pe].filter(Boolean).join(`
4
- `);return {layout:b,responsiveCss:de,itemLayouts:z$1}},[l$1,y,n$1,s,i,m$1,u,p$1]),g=A$1,O=g.__rmgNodeId,h=p(t(g.style,n$1)),M=g.count!=null?Math.max(0,g.count|0):Math.max(0,e|0);return jsxs("div",{"data-rmg-grid-skel-scope":y,className:[R.gridSkeletonOverlay,a$2.className].filter(Boolean).join(" "),children:[x?jsx("style",{dangerouslySetInnerHTML:{__html:x}}):null,jsx("div",{"data-rmg-skel-node":O,className:R.gridSkeletonGrid,style:{...C,...h||{},display:"grid"},children:Array.from({length:M}).map((k,f$1)=>{let G=S[f$1],{item:b,itemWrapStyle:v}=fe(g,f$1),{outerStyle:N,innerStyle:j}=he(v);return jsx("div",{"data-rmg-grid-item-key":G?.id,className:R.gridSkeletonItem,style:{...f({span:G?.span,allowSpan:!!p$1})||{},...v?m(v):null,...N||null},children:jsx("div",{className:[R.gridSkeletonItemInner,d?null:a$3.skelCardShimmer].filter(Boolean).join(" "),style:j,children:jsx(B$1,{node:b,disableShimmer:true,breakpointMap:n$1})})},`rmg-grid-skel-${f$1}`)})})]})}function le(e){return !!e&&typeof e=="object"&&!("kind"in e)&&"layout"in e&&e.layout?.kind==="grid"}function se(e){return !!e&&typeof e=="object"&&"kind"in e&&e.kind==="grid"}function be(e){if(le(e))return e;let{className:t,backgroundColor:o,radius:r,shimmer:s,gridStyle:i,columns:c,templateColumns:m,minColumnWidth:u,gap:p,items:d,allowItemSpans:a,...n}=e;return {className:t,backgroundColor:o,radius:r,shimmer:s,layout:n}}function Ae({layout:e,children:t,breakpoints:o,className:r,style:s,shellClassName:i,shellStyle:c,contentClassName:m,contentStyle:u,backgroundColor:p,radius:d,shimmer:a$3,disableShimmer:n$1,ariaLabel:l$1,ready:y,enabled:C,force:A,timing:x,grid:S}){let g=$.useMemo(()=>({...a,...o??{}}),[o]),O=$.useMemo(()=>a$1("skel_",{layout:e,breakpoints:g,backgroundColor:p,radius:d,shimmer:a$3,disableShimmer:n$1,grid:S}),[e,g,p,d,a$3,n$1,S]),h=$.useMemo(()=>se(e)||le(e)?be(e):null,[e]),M=h?.layout?.kind==="grid"?h.layout:null,k=se(e)?e:null,f=h?{count:S?.count??(typeof M?.count=="number"?Math.max(0,M.count|0):1),gridStyle:S?.style??k?.gridStyle,columns:S?.columns??k?.columns,templateColumns:S?.templateColumns??k?.templateColumns,minColumnWidth:S?.minColumnWidth??k?.minColumnWidth,gap:S?.gap??k?.gap,items:S?.items??k?.items,allowItemSpans:S?.allowItemSpans??k?.allowItemSpans,disableShimmer:n$1}:null,G={...s,...p?{"--rmg-skel-bg":p}:null,...d!=null?{"--rmg-skel-radius":l(d)}:null,...n$1?null:n(a$3)},b=h&&f?jsx("div",{"data-rmg-skeleton-scope":O,className:r,style:G,"aria-hidden":l$1?void 0:true,"aria-label":l$1,role:l$1?"status":void 0,"aria-live":l$1?"polite":void 0,children:jsx(ie,{...f,spec:h,breakpoints:g})}):null;return b?jsx(a$2,{skeletonNode:b,ready:y,enabled:C,force:A,timing:x,shellClassName:i,shellStyle:c,contentClassName:m,contentStyle:u,contentOwnsWrapperLayout:t!==void 0,children:t}):null}export{Ae as a};